// roll button event public void OnRollButtonClick() { switch (stage) // check stage of round { case 0: // dices has not been rolled yet > reroll selected dices stage = 1; // set stage phase to 1 enemyRolled = false; // enemy did not rolled yet enemyDices.RollSet(); // roll enemy dices playerDices.RollSet(); // roll player dices rollButtonText.text = "REROLL"; // change roll text to reroll on roll button break; case 1: // all dices were rolled once > lock roll button if (!enemyRolled) // if enemy did not rolled yet { enemyDices.AIreroll(playerDices.GetOutcome()); // reroll enemy dices enemyRolled = true; // enemy rolled } stage = 2; // set stage phase to 2 playerDices.RerollSet(); // reroll player dices (selected only) rollButtonText.text = "DECIDE"; // change roll button text to decide break; default: break; } }