private void Update() { if (!ClickChange.End) { cubeHave = ClickChange.GetAmount(); score.text = "Cubes: " + cubeHave.ToString(); timeLeft -= .01f; time.text = "Time remain: " + timeLeft.ToString(); need.text = "Goal: " + cubeNeed.ToString(); if (cubeHave >= cubeNeed) { game.text = "You Win!"; ClickChange.End = true; } if (timeLeft <= 0) { Time.timeScale = 0; ClickChange.End = true; game.text = "You Lose!"; } } }
private void Update() { if (!ClickChange.End) { if (!readyToStart) { for (int i = 0; i < size; i++) { for (int j = 0; j < size; j++) { CheckColor(i, j); } } readyToStart = true; } ClickChange.DeleteCube(); if ((Time.time - ClickChange.TimeClick) > 5) { ClickChange.HintCube = ClickChange.Hint(); } ClickChange.Refresh(); } }