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); } }
void OnTriggerExit(Collider collider) { if (collider.CompareTag("PlayerBullet") || GameManager.sharedInstance.currentGameState == GameState.inTheGame) { // Debug.Log("Enemy shooted ghost"); enemyAnimatorPositions.EnemyIsDeath(); // The enemy animation change to killed if (disableTheShootedSound) { enemySound.EnemyKilled(); } disableTheShootedSound = false; notShooted = false; // Bonus time if (GameManager.sharedInstance.currentGameState != GameState.gameOver) { UICountDown.TimerBonus = enemyTypeDamage.EnemyValueCalculator(EnemyTypesEnum.GHOST); } // Destroy the enemy after n time Invoke("destroyEnemy", 1.5f); } }