Пример #1
0
        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);
            }
        }
Пример #2
0
        private IEnumerator <int> PoolDelayer()
        {
            deathingIndex = AgentController.DeathingAgents.Add(this);


            yield return(_deathTime);

            AgentController.DeathingAgents.RemoveAt(deathingIndex);

            AgentController.CompleteLife(this);
        }
Пример #3
0
        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();
        }