コード例 #1
0
ファイル: ILUIKit.cs プロジェクト: JiYangJi/QFramework
        public static void ClosePanel <T>() where T : ILUIPanel
        {
            var panelName = typeof(T).Name;
            var panel     = UIKit.GetPanel(panelName);

            if (panel)
            {
                UIKit.ClosePanel(panelName);
                var ilPanel = panel.GetILComponent <ILUIPanelInterface>();
                ilPanel.Close();
            }
        }
コード例 #2
0
        public void UIKit_PushPopTest()
        {
            ResKit.Init();

            var uiKitTestPanel = UIKit.OpenPanel <UIKitTestPanel>();

            UIKit.Stack.Push <UIKitTestPanel>();

            Assert.AreEqual(uiKitTestPanel.State, PanelState.Closed);

            UIKit.Stack.Pop();

            uiKitTestPanel = UIKit.GetPanel <UIKitTestPanel>();

            Assert.AreEqual(uiKitTestPanel.State, PanelState.Opening);

            UIKit.CloseAllPanel();
        }
コード例 #3
0
        protected override void OnOpen(IUIData uiData = null)
        {
            var data = UIKit.GetPanel <UIMain>().GetmData();

            OrderNum.text = data.order_count.ToString();
            RunCount.text = data.run_count.ToString();
            RunTime.text  = (Time.time - data.start_run_time).ToString();
            CodeTime.text = (Time.time - data.start_time).ToString();

            ButtonBack.onClick.AddListener(() => {
                CloseSelf();
                UIKit.GetPanel <UIMain>().SetRunCount(0);
                GameMode1Manager.Instance.Excuter.ResetExcuter();
            });
            ButtonNext.onClick.AddListener(() => {
                CloseSelf();
                GameMode1Manager.Instance.NextStage();
            });
        }
コード例 #4
0
        public void UIKit_GetPanelTest()
        {
            var uiKitTestPanel = UIKit.GetPanel <UIKitTestPanel>();

            Assert.IsFalse(uiKitTestPanel);

            ResKit.Init();

            UIKit.OpenPanel("UIKitTestPanel");

            uiKitTestPanel = UIKit.GetPanel <UIKitTestPanel>();

            Assert.IsTrue(uiKitTestPanel);
            Assert.AreEqual(uiKitTestPanel.State, PanelState.Opening);

            UIKit.ClosePanel("UIKitTestPanel");

            UIKit.CloseAllPanel();
        }
コード例 #5
0
ファイル: UIMenuPanel.cs プロジェクト: WangYuHang-97/UnityAPI
        protected override void OnInit(IUIData uiData = null)
        {
            ImageBg.color = "#FFFFFFFF".HtmlStringToColor();

            this.Delay(0.1f, () => { UIKit.GetPanel <UIMenuPanel>().LogInfo(); });

            // 注册事件
            RegisterEvent(UIEventID.MenuPanel.ChangeMenuColor);

            BtnPlay.onClick.AddListener(() =>
            {
                UIKit.OpenPanel <UISectionPanel>(UILevel.Common, prefabName: "resources://UISectionPanel");
                // this.DoTransition<UISectionPanel>(new FadeInOut(), UILevel.Common,
                // prefabName: "Resources/UISectionPanel");
            });

            BtnSetting.onClick.AddListener(() =>
            {
                UIKit.OpenPanel <UISettingPanel>(UILevel.PopUI,
                                                 prefabName: "Resources/UISettingPanel");
            });
        }
コード例 #6
0
ファイル: ILUIKit.cs プロジェクト: JiYangJi/QFramework
 public static T GetPanel <T>() where T : ILUIPanel, new()
 {
     return(UIKit.GetPanel(typeof(T).Name)
            .GetILComponent <T>());
 }
コード例 #7
0
 private void BindUI()
 {
     form   = (UIMain)UIKit.GetPanel("UIMain");
     holder = form.GetComponentInChildren <OrderHolder>();
 }