Beispiel #1
0
 private void Recover()
 {
     life--;
     LifeUpdate.Invoke(life);
     if (0 < life)
     {
         Instantiate(player, new Vector3(0, -4, 0), Quaternion.identity);
     }
     else
     {
         isDefeat = true;
     }
 }
Beispiel #2
0
    private void OnTriggerEnter2D(Collider2D other)
    {
        if (_isStop)
        {
            return;
        }
        Enemy enemy = other.GetComponent <Enemy>();

        if (enemy != null)
        {
            Life--;
            LifeUpdate?.Invoke(Life);
        }
    }