using System.Collections.Generic; using UnityEngine; using static Extensions; /// /// can be inherited by MonoBehaviours in order to be added to the level manager /// public abstract class LevelObject : MonoBehaviour, ILevelObject { [LevelSerialize] public Vector3 Position => transform.position; [LevelSerialize] public string Name => name; void Awake() { if (LevelManager.Instance.Has(obj => obj.Equals(this))) return; LevelManager.Instance.Add(this); } public abstract void LevelStart(); public abstract void LevelDestroy(); public abstract void LevelUpdate(); public abstract bool Equals(ILevelObject other); public abstract Dictionary ToDictionary(); }