internal void Deactivate(bool Immediate = false) { if (IsActive == false) { Debug.Log("NOASER"); } if (onDeactivate != null) { this.onDeactivate(this); } _Deactivate(); if (Immediate == false) { if (Animator.IsNotNull()) { Animator.Play(AnimState.Dying); } poolCoroutine = CoroutineManager.StartCoroutine(PoolDelayer()); } else { AgentController.CompleteLife(this); } }
private IEnumerator <int> PoolDelayer() { deathingIndex = AgentController.DeathingAgents.Add(this); yield return(_deathTime); AgentController.DeathingAgents.RemoveAt(deathingIndex); AgentController.CompleteLife(this); }
public static void Deactivate() { for (int i = 0; i < PeakGlobalID; i++) { if (GlobalAgentActive [i]) { DestroyAgent(GlobalAgents [i], true); } } CheckDestroyAgent(); for (int i = 0; i < DeathingAgents.PeakCount; i++) { if (DeathingAgents.arrayAllocation [i]) { LSAgent agent = DeathingAgents [i]; AgentController.CompleteLife(agent); } } DeathingAgents.FastClear(); }