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

        if (ballDropped)
        {
            updateScore(ballDropped);
        }

        if (!ballDropped.IsWhite())
        {
            Destroy(ballGameObj);
        }
    }