public void OnTriggerEnter(Collider collider) { if (firstHit == null && collider.gameObject.tag == "Ball") { firstHit = collider.gameObject.GetComponent <StdBall>(); } }
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); } }
public void Colpisci(Vector3 direction, float force) { firstHit = null; rb.velocity = direction * force * multiplier; }