Пример #1
0
 public void ApplyDmg(float dmg)
 {
     health -= dmg;
     if (!(isDead))
     {
         GameManagement.AddPoints(ptValue);
         if (health <= 0)
         {
             Death();
         }
     }
 }
Пример #2
0
    public void TakeDamage(int amount)
    {
        currentHealth -= amount;
        if (currentHealth <= 0)
        {
            currentHealth = 0;
            GameManagement.AddPoints(points);
            spawnPoint         = spawner.GetComponent <SpawnManager>().Spawn();
            transform.position = spawnPoint;
            currentHealth      = maxHealth;

            // Destroy(gameObject);
        }
    }