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()); }
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()); }