Files
HauntedBloodlines/Assets/Scripts/SaveLoad/SaveableObject.cs
2025-05-29 22:31:40 +03:00

28 lines
609 B
C#

using UnityEngine;
[ExecuteInEditMode]
public class SaveableObject : MonoBehaviour
{
public string GameObjectID;
public bool IsSetActiveTrueAfterLoad;
public void SetGameObjectAsSetActiveTrue()
{
IsSetActiveTrueAfterLoad = true;
}
public void SetGameObjectAsSetActiveFalse()
{
IsSetActiveTrueAfterLoad = false;
}
private void OnValidate()
{
// Automatically set GameObjectID based on the GameObject's name in the Editor
if (string.IsNullOrEmpty(GameObjectID))
{
GameObjectID = gameObject.name;
}
}
}