//--------------------------------------------------- // Initialize //--------------------------------------------------- protected void Initialize(Define.ActorType actorType, ActorModel model, ActorView actorView) { int actorId = ApplicationManager.Instance.ActorManager.AddActor(this, actorType); _actorModel = model; _actorModel.AddListerner(this); _actorModel.ActorId = actorId; if (actorView != null) { _actorView = actorView; _actorModel.AddListerner(_actorView); } }
//--------------------------------------------------- // Release //--------------------------------------------------- override protected void Release() { if (_actorView != null) { _actorModel.RemoveListerner(_actorView); _actorView = null; } if (_actorModel != null) { ApplicationManager.Instance.ActorManager.RemoveActor(_actorModel.ActorId); _actorModel.RemoveListerner(this); _actorModel.Release(); _actorModel = null; } }