Пример #1
0
 protected void dead()
 {
     if (health <= 0)
     {
         KillEnemyCount.Kill_count(Enemy_ID);
         GameObject.Instantiate(Effect_explode, gameObject.transform.position, Quaternion.identity);
         Destroy(gameObject);
     }
 }
Пример #2
0
    void isDead()
    {
        if (health <= 0)
        {
            explosion();
            gameObject.transform.Translate(Vector3.down * 1f * Time.deltaTime);

            if (gameObject.transform.position.y < 0)
            {
                for (int i = 0; i < 500; i++)
                {
                    explosion();
                }
                KillEnemyCount.Kill_count(Enemy_ID);
                Destroy(gameObject);
            }
        }
    }