Exemple #1
0
 public void OnTriggerEnter(Collider collider)
 {
     if (firstHit == null && collider.gameObject.tag == "Ball")
     {
         firstHit = collider.gameObject.GetComponent <StdBall>();
     }
 }
Exemple #2
0
 public bool pallaInBuca(StdBall ball)
 {
     Debug.Log("player " + currentPlayer.n + " ha inbucato la palla n:" + ball.ballNumber);
     balls.Remove(ball);
     if (currentPlayer.balls.Contains(ball.ballNumber))
     {
         currentPlayer.remove(ball.ballNumber);
         inBuca = true;
         return(true);
     }
     else if (p1 != currentPlayer)
     {
         p1.remove(ball.ballNumber);
         return(false);
     }
     else
     {
         p2.remove(ball.ballNumber);
         return(false);
     }
 }
Exemple #3
0
 public void Colpisci(Vector3 direction, float force)
 {
     firstHit    = null;
     rb.velocity = direction * force * multiplier;
 }