Esempio n. 1
0
 void OnCollisionEnter2D(Collision2D collision)
 {
     if (collision.gameObject.CompareTag("PlayerOne") && punching)
     {
         playerOneControl         = player.GetComponentInChildren <PlayerOneControl>();
         playerOneControl.health -= (int)Random.Range(5.0f, 40.0f);
     }
 }
Esempio n. 2
0
 void Update()
 {
     playerOneControl = player.GetComponentInChildren <PlayerOneControl>();
     health.text      = "HP - " + playerOneControl.health.ToString();
 }