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; } } }