Example #1
0
 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////  what happens when hit
 void onHit()
 {
     if (playerScript.playerHealth == 5)
     {
         Destroy(gameObject);
     }
     else
     {
         playerScript.playerHealth++;
         healthKeeper.AddOneHealth();
         playerScript.ChangeColor();
         Destroy(gameObject);
     }
 }