Exemplo n.º 1
0
        public void Die()
        {
            _dieAudio.Play();
            Destroy(_rigidBody);
            Destroy(_agent);

            _collider.enabled = false;
            _animator.ResetTrigger(_hurtHash);
            _animator.ResetTrigger(_atkDistanceHash);
            _animator.ResetTrigger(_chaseHash);
            _animator.ResetTrigger(_defendHash);

            _animator.SetTrigger(_dieHash);

            _playerStatsController.AddKillSurvivalRound(); // TODO Change this to an enum of game modes
            _playerController.ObtainMoney(_enemy.MoneyToGive);
            _playerController.ObtainExperience();

            Destroy(gameObject, 5f);
        }