/// ================================================================== /// DISPLAY /// ================================================================== private void DisplayCurrentMenu() { isBackSelected = false; for (int i = 0; i < MenuPanels.Length; ++i) { if (i == (int)currentMenu) MenuPanels[i].SetActive(true); else MenuPanels[i].SetActive(false); } if (currentMenu == ConnexionState.TwoPlayers) { isSetHostListDone = false; currentHomeState = HomeChoice.CREATE; SetCurrentStateToggleOn(); } if (currentMenu == ConnexionState.WaitingRoom || currentMenu == ConnexionState.RoomList) { UnityEngine.UI.Toggle toggle = MenuPanels[(int)currentMenu].GetComponentInChildren<Toggle>(); toggle.isOn = false; } }
public void UpdateSelectedState(int value) { int newMode = (int)currentHomeState; newMode += (value); if (newMode >= (int)HomeChoice.NUMBER_OF_CHOICE) newMode = 0; else if (newMode < 0) newMode = (int)HomeChoice.NUMBER_OF_CHOICE - 1; currentHomeState = (HomeChoice)newMode; }