protected virtual void Kill()
        {
            if (isDead)
            {
                return;
            }

            isDead = true;
            DevdogLogger.Log("You killed it!");
            if (_onKilled != null)
            {
                _onKilled.OnKilled();
            }

            if (_agent.isOnNavMesh)
            {
#if UNITY_2017_1_OR_NEWER
                _agent.isStopped = true;
#else
                _agent.Stop();
#endif
            }

            StartCoroutine(SinkIntoGround());
        }
Example #2
0
        protected virtual void Kill()
        {
            if (isDead)
            {
                return;
            }

            isDead = true;
            DevdogLogger.Log("You killed it!");
            if (_onKilled != null)
            {
                _onKilled.OnKilled();
            }

            if (_agent.isOnNavMesh)
            {
                _agent.Stop();
            }

            StartCoroutine(SinkIntoGround());
        }