public void Enter() { // Spawn or open UI bool isSpawned = false; dialogObj = UISystem.GetObject(uiName); // Check if exist (a valid page) if (dialogObj) { UIBase page = dialogObj.GetComponent <UIBase>(); if (page && page.IsActive()) { dialogObj = null; } } // Spawn one if there is no exist UI if (!dialogObj) { dialogObj = UISystem.Spawn(uiName); isSpawned = true; } // Setup page (QuickPanel) if (dialogObj) { dialogObj.SetActive(true); UIBase page = dialogObj.GetComponent <UIBase>(); if (page) { page.destroyWhenClose = isSpawned; page.Open(); } } else { // Empty UI // will destruct when update } SetText(); Pause(true); DoCommand(); eventOnLoad.Broadcast(dialogObj); }
void Awake() { eventInitial.Broadcast(this); }
public void DoEvent() { eventArray.Broadcast(this); }