public void StopLoad() { if (mActorCreateRequest != null) { if (mActorCreateRequest.ActorGo != null) { ActorCreater.DestoryActor(mActorCreateRequest.Hero.ID); UtilTool.SafeDestroy(mActorCreateRequest.ActorGo); } mActorCreateRequest.Stop(); } }
public void OnValueChanged() { if (this.SelectedToggle.isOn && this.Parent.SelectedPlayerItem != this) { StopLoad(); Account.Instance.ActiveActor = this.mNetActor; this.Parent.SelectedPlayerItem = this; ActorProfessional rProfessional = GameConfig.Instance.GetActorProfessional(this.mNetActor.ProfessionalID); mActorCreateRequest = ActorCreater.CreateActor(this.mNetActor.ActorID, rProfessional.HeroID, ActorLoadCompleted); } else if (!this.SelectedToggle.isOn) { ActorCreater.DestoryActor(mActorCreateRequest.Hero.ID); UtilTool.SafeDestroy(mActorCreateRequest.ActorGo); mActorCreateRequest.Stop(); } }