Ejemplo n.º 1
0
 private void Die()
 {
     renderer.flipY   = true;
     rb2D.constraints = RigidbodyConstraints2D.None;
     playerBrain      = FindObjectOfType <UnityStandardAssets._2D.PlatformerCharacter2D>();
     playerBrain.IncreaseScore(scoreValue);
 }
Ejemplo n.º 2
0
 private void dealDamage(GameObject player)
 {
     Player2 = player.GetComponent<UnityStandardAssets._2D.PlatformerCharacter2D>();
     //Check for a match with the specified tag on any GameObject that collides with your GameObject
     //if (player.tag == "Player")
     //{
         if (Player2 != null)
         {
             //If the GameObject's tag matches the one you suggest, deal damage
             Player2.LoseHealth(damage);
         }
     //}
 }