Example #1
0
        /// <summary>
        /// 弹窗
        /// </summary>
        /// <param name="type">类型</param>
        /// <param name="callBack">需要回调的对象</param>
        public void AlertWindow(AlertWindowType type, IWindowListener callBack = null)
        {
            if (callBack != null)
            {
                RegisterSender(callBack);
            }
            GameObject tempGo = default(GameObject);

            switch (type)
            {
            case AlertWindowType.SelectWindow:
                tempGo = TSingleTon <PrefabLoad> .Singleton().LoadFromResource("Common", SelectLevelWindow.PrefabName);

                break;
            }
            if (tempGo != null)
            {
                currentWindow = GameObject.Instantiate(tempGo, windowRoot);
                currentWindow.transform.localPosition = Vector3.zero;
                currentAlert = currentWindow.GetComponent <SelectLevelWindow>();
            }
        }
Example #2
0
 /// <summary>
 /// 销毁弹窗
 /// </summary>
 public void CloseWindow()
 {
     GameObject.DestroyImmediate(currentWindow);
     currentWindow = null;
     currentAlert  = null;
 }