Example #1
0
 public void gotHit()
 {
     enemyHealth--;
     currecnyController.IncreaseMoney(10);
     if (enemyHealth <= 0)
     {
         Destroy(gameObject);
         currecnyController.IncreaseMoney(50);
         enemyGenerator.BaloonGone();
     }
 }
 void OnCollisionEnter2D(Collision2D coll)
 {
     switch (coll.gameObject.tag)
     {
     case "target":
         for (int i = 0; i < damage; i++)
         {
             life.lostLife();
         }
         Destroy(gameObject);
         enemyGenerator.BaloonGone();
         break;
     }
 }