Esempio n. 1
0
 void Update()
 {
     if (transform.position.y < -15)
     {
         GameLogic.CheckForGameEnd(true);
     }
 }
    void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.layer == LayerMask.NameToLayer("Enemy"))
        {
            TakeHealth(1);

            // Kill enemy
            EnemyUnitBaseScript enemyunit = other.GetComponent <EnemyUnitBaseScript>();
            if (enemyunit)
            {
                enemyunit.Die_DamageGate();
                Destroy(other.gameObject);
            }

            // Check for game lose conditions
            if (Health <= 0)
            {
                GameLogic.CheckForGameEnd(true);
            }
        }
    }
 override protected void HandleDeath()
 {
     GameLogic.CheckForGameEnd(true);
 }