Beispiel #1
0
 private void OnCollisionEnter(Collision col)
 {
     if (col.gameObject.name == "Player") // IF THE ENEMY COLLIDES WITH A GAMEOBJECT WITH THE NAME PLAYER
     {
         plM.takeDamage(10);              // CALLS THE TAKEDAMAGE METHOD IN THE PLAYER MANAGER AND SETS THE DAMAGE VAL TO 10
         gm.updateHud();                  // CALLS THE GAMEMANAGER'S UPDATEHUD METHOD
         gm.resetGame();                  // CALLS THE GAMEMANAGER'S RESETGAME METHOD
     }
 }