Esempio n. 1
0
 private ColorProblem MixBucketColor(BucketColor color1, BucketColor color2)
 {
     if (color1 == BucketColor.Red && color2 == BucketColor.Yellow)
     {
         return(ColorProblem.Orange);
     }
     if (color1 == BucketColor.Yellow && color2 == BucketColor.Red)
     {
         return(ColorProblem.Orange);
     }
     if (color1 == BucketColor.Blue && color2 == BucketColor.Yellow)
     {
         return(ColorProblem.Green);
     }
     if (color1 == BucketColor.Yellow && color2 == BucketColor.Blue)
     {
         return(ColorProblem.Green);
     }
     if (color1 == BucketColor.Blue && color2 == BucketColor.Red)
     {
         return(ColorProblem.Purple);
     }
     if (color1 == BucketColor.Red && color2 == BucketColor.Blue)
     {
         return(ColorProblem.Purple);
     }
     throw new Exception();
 }
Esempio n. 2
0
    public void CheckColor(BucketColor color1, BucketColor color2)
    {
        ColorProblem mixedColor = MixBucketColor(color1, color2);

        if (mixedColor == currentProblem)
        {
            if (wrongOnce == false)
            {
                score++;
            }

            correctAnimation.Play();

            round = round + 1;
            if (round == 5)
            {
                EndGame();
            }
            else
            {
                StartCoroutine(WaitAndCreateProblemRoutine());
            }
        }
        else
        {
            wrongAnimation.Play();
            wrongOnce = true;
        }
    }