/// <summary> /// hides ui /// </summary> /// <returns>true on success, false on failure</returns> bool hideUI() { FBUIManager uiMgr = FBUIManager.instance; if (cmdData.Length < 2) { // ui name not specified => hide all uiMgr.hideUI(); return(true); } FBBaseUI ui = uiMgr.getUIByName(cmdData[1].stringValue); if (ui) { if (!ui.isVisible) { nextCmd = true; } else if (!ui.isAnimating) { uiMgr.hideUI(ui); } return(true); } onError("ui not found: " + cmdData[1].stringValue); return(false); }
void Awake() { instance = this; // keep ui for other scenes GameObject.DontDestroyOnLoad(canvas.gameObject); // add all ui to list FBBaseUI[] childUIs = canvas.GetComponentsInChildren <FBBaseUI>(); for (int i = 0; i < childUIs.Length; i++) { this.uiList[childUIs[i].gameObject.name] = childUIs[i]; } }
/// <summary> /// replaces current ui with new ui /// </summary> /// <returns>true on success, false on failure</returns> bool replaceUI() { FBUIManager uiMgr = FBUIManager.instance; FBBaseUI ui = uiMgr.getUIByName(cmdData[1].stringValue); if (ui) { if (!ui.isVisible) { uiMgr.replaceUI(ui); } else if (!ui.isAnimating) { nextCmd = true; } return(true); } onError("ui not found: " + cmdData[1].stringValue); return(false); }