private void openUI(string uiName, Action callBack) { string url = UrlString.uiUrl + uiName; GameObject prefab = Resources.Load <GameObject> (url); GameObject uiNode = GameObject.Instantiate(prefab); uiNode.transform.SetParent(this.uiRoot.transform); uiNode.transform.localPosition = Vector3.zero; BaseUI targetUI = uiNode.GetComponent <BaseUI> (); this.uiDic.Add(uiName, targetUI); if (callBack != null) { callBack(); } }
public void showBoard(string uiName, params object[] args) { BaseUI targerUI = this.getUI(uiName); if (currentBoard != null && this.currentBoard == targerUI) { return; } this.showUI( uiName, () => { if (this.currentBoard != null) { this.hideUI(uiName); } this.currentBoard = this.getUI(uiName); }, args); }
public void init(GameObject uiRoot) { this.uiRoot = uiRoot; this.currentBoard = null; }