/// <summary> /// Destroys the state and all of its transitions. /// </summary> public void Destroy() { foreach (var transition in _transitions) { ObjectUtil.Destroy(transition); } ObjectUtil.Destroy(this); }
//退出 public void exitCombat() {//先关相机并且删掉 再打开主相机 否则相机冲突 ObjectUtil.Destroy(combat.gameObject); ObjectUtil.Destroy(combatScene); ViewController.Instance.removeCameraDictionary("combatcam"); //返回主视角 ViewController.instance.showMainCam(); //切主相机 initController(); }
protected override void OnRemove() { if (container) { ObjectUtil.Destroy(container); container = null; } base.OnRemove(); }
bool RemoveTransition(Predicate <StateTransitionAsset> predicate) { var toRemove = new List <StateTransitionAsset>(); foreach (var transition in _transitions) { if (predicate(transition)) { toRemove.Add(transition); } } foreach (var transition in toRemove) { _transitions.Remove(transition); ObjectUtil.Destroy(transition); } return(toRemove.Count > 0); }
void OnDestroy() { ObjectUtil.Destroy(_mesh); _mesh = null; }