コード例 #1
0
 public void Update()
 {
     if (Input.GetKeyDown(KeyCode.Escape))
     {
         Kurisu.Service.UIManager.UIWindow ui = UIAPI.ShowUIWindow(UIDef.UIGameExitWindow);
         ui.transform.SetAsLastSibling();
     }
 }
コード例 #2
0
        /// <summary>
        /// 打开一个MsgBox
        /// </summary>
        /// <param name="title">MsgBox的标题</param>
        /// <param name="content">MsgBox的内容</param>
        /// <param name="btnText">MagBox的按钮内容,格式为 "确定|取消"</param>
        /// <param name="onCloseEvent">当按钮关闭时调用的事件</param>
        /// <returns></returns>
        public static Kurisu.Service.UIManager.UIWindow ShowMsgBox(string title, string content, string btnText, Kurisu.Service.UIManager.UIWindow.CloseEvent onCloseEvent = null)
        {
            UIMsgBox.UIMsgBoxArg arg = new UIMsgBox.UIMsgBoxArg();
            arg.content = content;
            arg.title   = title;
            arg.btnText = btnText;

            Kurisu.Service.UIManager.UIWindow wnd = UIManager.Instance.OpenWindow(UIDef.UIMsgBox, arg);

            if (wnd != null && onCloseEvent != null)
            {
                wnd.OnCloseEvent += closeArg =>
                {
                    onCloseEvent(closeArg);
                };
            }

            return(wnd);
        }