Ejemplo n.º 1
0
    void OnTriggerExit(Collider collider)
    {
        if (collider.CompareTag("PlayerBullet") || GameManager.sharedInstance.currentGameState == GameState.inTheGame)
        {
            // Debug.Log("Enemy shooted stone");
            enemyAnimator.EnemyIsDeath();

            if (disableTheShootedSound)
            {
                // audioSource.PlayOneShot(deadSE);
                enemySound.EnemyKilled();
            }

            disableTheShootedSound = false;
            notShooted             = false;

            // Bonus time
            if (GameManager.sharedInstance.currentGameState != GameState.gameOver)
            {
                UICountDown.TimerBonus = enemyTypeDamage.EnemyValueCalculator(EnemyTypesEnum.STONE);
            }

            // Destroy the enemy after n time
            Invoke("destroyEnemy", 1.5f);
        }
    }