Exemplo n.º 1
0
 public void Dying()
 {
     Destroy(GetComponent <Rigidbody>());
     StopCoroutine(colorChanger);
     StopCoroutine(stabCycle);
     if (alive)
     {
         if (!invulnerable)
         {
             healthBarHandler.Translate();
         }
         if (gotWeapon)
         {
             playerInterface.Translate();
         }
         GameSettings.ChangeHurtIndicator(hurtIndicator, colors[11], colors[8]);
     }
     else
     {
         GameSettings.ChangeHurtIndicator(hurtIndicator, colors[8]);
         GameChallenges.HandleEvent(GameChallenges.EventTypes.enemyKilled);
         Destroy(enemy.gameObject);
     }
     // dying animation
     Destroy(this);
 }
Exemplo n.º 2
0
 private void GameOver()
 {
     enemy.Lost();
     if (!invulnerable)
     {
         healthBarHandler.Translate();
     }
     if (gotWeapon)
     {
         playerInterface.Translate();
     }
     GameSettings.ChangeHurtIndicator(hurtIndicator, colors[8]);
     //launch win animation
     Destroy(enemy.gameObject);
     Destroy(this);
 }
Exemplo n.º 3
0
    private IEnumerator MonsterDying()
    {
        enemy.Dying();
        alive = false;
        if (!invulnerable)
        {
            healthBarHandler.Translate();
        }
        if (gotWeapon)
        {
            playerInterface.Translate();
        }
        GameSettings.ChangeHurtIndicator(hurtIndicator, colors[8]);
        yield return(new WaitForSeconds(2f));

        //launch win animation
        GameChallenges.HandleEvent(GameChallenges.EventTypes.enemyKilled);
        Destroy(enemy.gameObject);
        Destroy(this);
    }