Esempio n. 1
0
        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();
            }
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
 public void init(GameObject uiRoot)
 {
     this.uiRoot       = uiRoot;
     this.currentBoard = null;
 }