public void SetNavigationMode(NAV_STATE _ns) { ClearDisplayedButtons(); switch(_ns) { case NAV_STATE.Home: AddNavigationOption(NAV_STATE.CharacterCreator); AddNavigationOption(NAV_STATE.Settings); break; case NAV_STATE.CharacterCreator: break; case NAV_STATE.CharacterViewer: AddNavigationOption(NAV_STATE.Equip); AddNavigationOption(NAV_STATE.Spells); break; case NAV_STATE.Equip: AddNavigationOption(NAV_STATE.CharacterViewer); AddNavigationOption(NAV_STATE.Spells); break; case NAV_STATE.Spells: AddNavigationOption(NAV_STATE.CharacterViewer); AddNavigationOption(NAV_STATE.Equip); break; } }
public void SetNavigationMode(NAV_STATE _ns) { CloseAllUI(); ApplicationState = _ns; switch(ApplicationState) { case NAV_STATE.Home: SetToHomeMode(); break; case NAV_STATE.CharacterCreator: SetToCharacterCreationMode(); break; case NAV_STATE.CharacterViewer: SetToCharacterViewMode(); break; case NAV_STATE.Equip: SetToEquipMode(); break; case NAV_STATE.Settings: SetToSettingsMode(); break; case NAV_STATE.Spells: SetToEquipMode(); break; case NAV_STATE.Invitations: SetToHomeMode(); break; default: SetToHomeMode(); break; } }
void AddNavigationOption(NAV_STATE _ns) { AddButtonToDisplayedList(this.GetButton(_ns)); }
private GameObject GetButton(NAV_STATE _ns) { if(!Contains(_ns)) BuildButtons(); foreach(GameObject go in AllButtons) { NavButtonController temp = go.GetComponentInChildren<NavButtonController>(); // Debug.Log("go: " +temp.state.GetDesc() + " comp: " + _ns.GetDesc()); if(temp.state == _ns) return go; } return null; }
private bool Contains(NAV_STATE _ns) { foreach(GameObject go in AllButtons) { NavButtonController temp = go.GetComponentInChildren<NavButtonController>(); if(temp.state==_ns) return true; } return false; }