private void updateScore(BallBehavior ballDropped) { if (!ballDropped.IsWhite()) { //points++; points += COLOURED_BALL_PTS; } else { //points--; points += WHITE_BALL_PTS; ballDropped.Reset(); } }
private void OnTriggerExit(Collider other) { GameObject ballGameObj = other.gameObject; BallBehavior ballDropped = ballGameObj.GetComponent <BallBehavior>(); if (ballDropped) { updateScore(ballDropped); } if (!ballDropped.IsWhite()) { Destroy(ballGameObj); } }