using Entitas; using UnityEngine; namespace CoreGame.Render { public abstract class ProxyBase : IComponent, IReset { internal GameObject go; internal bool hasInit; public CombatEntity ent; protected abstract void Initialize(GameObject go, CombatEntity ent); public virtual void Init(GameObject go, CombatEntity ent) { if (hasInit) return; hasInit = true; this.go = go; this.ent = ent; Initialize(go, ent); } public void Reset() { hasInit = false; go = null; OnReset(); } protected virtual void OnReset() { } } }