// other name candidates ToggleOn, Show, SwitchTo public static void Show <T>() where T : UiBehaviour { CheckAndInit(); UiBehaviour newUi = Get <T>(); TabGroup group = tabGroups[newUi.TabGroup]; group.SwitchTo(newUi); }
private void ShowNextUi(UiBehaviour nextUi) { prevUi = currUi; currUi = nextUi; if (nextUi != null) { nextUi.RequestShow(EndOfSwitching); } else { EndOfSwitching(); } }
public void SwitchTo(UiBehaviour nextUi) { if (state != State.Switch) { state = State.Switch; if (currUi != null) { currUi.RequestHide(() => { ShowNextUi(nextUi); }); } else { ShowNextUi(nextUi); } } else { Debug.LogError($"You try switch to ui '{nextUi.GetType().ToString()}' but group '{id.ToString()}' is alredy in switching state."); } }