Exemplo n.º 1
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.gameObject.GetComponent <BallController>() != null && collision.IsTouching(addScoreTrigger))
     {
         if (ballController.isBallThrown)
         {
             playerScore += 1;
             UpdateScore();
             entryData.entryScore = playerScore;
             scoreController.AddEntry(entryData);
         }
     }
     if (collision.gameObject.GetComponent <BallController>() != null && collision.IsTouching(resetScoreTrigger))
     {
         if (ballController.isBallThrown)
         {
             playerScore = 0;
             UpdateScore();
         }
     }
 }