void NextRandomButton() { SetEmissionForGem(currentButton, 0f); SurroundingImage.transform.localScale = Vector3.one * (failSurroundingScale + maxSurroundingScale); startTime = Time.time; endTime = startTime + timeToInput; selectedButton = (InputManager.Buttons)UnityEngine.Random.Range(1, 4); ButtonX.SetActive(selectedButton == InputManager.Buttons.X); ButtonY.SetActive(selectedButton == InputManager.Buttons.Y); ButtonB.SetActive(selectedButton == InputManager.Buttons.B); currentButton = GetButtonFromEnum(selectedButton); SetEmissionForGem(currentButton, 0f); }
GameObject GetButtonFromEnum(InputManager.Buttons button) { switch (button) { case InputManager.Buttons.X: return(ButtonX); case InputManager.Buttons.Y: return(ButtonY); case InputManager.Buttons.B: return(ButtonB); } return(null); }