public void CloseOpenMenu(int panelIndex) { if (isTransitioning) { return; } isTransitioning = true; anim.SetBool("Close Menu", true); allowRuntimeUnpack = false; bool showMainMenu = false; if (panelIndex == 0 || panelIndex == 1) { if (gm.gameState == GameState.Menu) { panelIndex = selectPhase; //For Closing and Opening back to Song/Beatmap Select showMainMenu = true; } else { panelIndex = 5; //Show Pause Screen Instead if Game State is not Menu } } OnTransitionEnd += () => ReopenPanel(panelIndex, showMainMenu); }
void CallOnTransitionEnd() { if (OnTransitionEnd != null) { OnTransitionEnd(); } OnTransitionEnd = null; //Clear all Functions Suscribed to Delegate isTransitioning = false; }
void CallOnTransitionStart() { //print("Transition Start Called on " + Time.time); if (OnTransitionStart != null) { OnTransitionStart(); } OnTransitionStart = null; //Clear all Functions Suscribed to Delegate anim.StopPlayback(); isTransitioning = true; }
public void SuscribeToOnTransitionEvents(bool isStart, UITransitionDel function) { if (isStart) { OnTransitionStart += function; } else { OnTransitionEnd += function; } }
// Start is called before the first frame update void Start() { gm = GameManager.inst; anim = GetComponent <Animator>(); songObjs = new List <BeatmapUIObj>(); beatmaps = new List <BeatmapUIObj>(); print(songObjs.Count); PopulateSongSelect(); OnTransitionEnd += () => { OnTransitionStart += () => { allPanelGroups[7].buttonGroup.SetActive(true); }; }; sliders[0].value = PlayerPrefs.GetFloat("Master Volume", 1); sliders[1].value = PlayerPrefs.GetFloat("Music Volume", 1); sliders[2].value = PlayerPrefs.GetFloat("Sound Volume", 1); buttonSfxPlayer.ignoreListenerPause = true; }