void GoThroughRack() { switch (rackChoice) { case RackOptions.ShowUIOptions: rerackInProgress = true; StartCoroutine(CorutineUI()); rerack3bool = false; nextRack = false; rackEnabled = false; rackChoice = RackOptions.NoSelection; break; case RackOptions.Rack2: Rerack2(); rerack2bool = false; nextRack = false; rackEnabled = false; rackChoice = RackOptions.NoSelection; break; case RackOptions.Winner: RedWin(); newGame = false; rackEnabled = false; nextRack = false; rackChoice = RackOptions.NoSelection; break; } }
// Update is called once per frame void Update() { cups = GameObject.FindGameObjectsWithTag(cupColor + "Cup"); killBox = GameObject.FindGameObjectsWithTag(cupColor + "Goal"); if (rackEnabled) { GoThroughRack(); } if (cups.Length == 3 && rerack3bool && StartMenu.player) { nextRack = true; rackChoice = RackOptions.ShowUIOptions; } if (cups.Length == 2 && rerack2bool) { nextRack = true; rackChoice = RackOptions.Rack2; } if (cups.Length == 0 && newGame) { GoThroughRack(); rackChoice = RackOptions.Winner; } }