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; } }
private void CreateProblem() { mixingBucket.Reset(); wrongOnce = false; currentProblem = (ColorProblem)UnityEngine.Random.Range(0, 3); GameObject h1 = hint[0]; GameObject h2 = hint[1]; GameObject h3 = hint[2]; if (currentProblem == ColorProblem.Green) { h1.SetActive(true); h2.SetActive(false); h3.SetActive(false); } else if (currentProblem == ColorProblem.Orange) { h1.SetActive(false); h2.SetActive(true); h3.SetActive(false); } else if (currentProblem == ColorProblem.Purple) { h1.SetActive(false); h2.SetActive(false); h3.SetActive(true); } }