public void OnCreditsClick() { activateSFX(); // instantiate credits prefab (under canvas) var panelGo = Instantiate(creditsPrefab, UxUtil.GetCanvas().gameObject.transform); var uxPanel = panelGo.GetComponent <UxPanel>(); uxPanel.onDoneEvent.AddListener(OnSubPanelDone); Hide(); }
IEnumerator StateWaitScores() { activateSFX(); // instantiate scores prefab (under canvas) var panelGo = Instantiate(scoresPrefab, UxUtil.GetCanvas().gameObject.transform); yield return(null); // wait a frame for panel initialization // create listener for back event var scoreDone = false; var listener = panelGo.AddComponent <GameEventListener>(); listener.SetEvent(onScoreBack); listener.Response.AddListener(() => { scoreDone = true; }); // wait for gameModeSelected event yield return(new WaitUntil(() => scoreDone)); // clean up Destroy(panelGo); }
public void OnHelpClick() { // instantiate scores prefab (under canvas) Instantiate(helpPanelPrefab, UxUtil.GetCanvas().gameObject.transform); }