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(); } }
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(); }
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(); }); }
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(); }
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"); }); }
public static T GetPanel <T>() where T : ILUIPanel, new() { return(UIKit.GetPanel(typeof(T).Name) .GetILComponent <T>()); }
private void BindUI() { form = (UIMain)UIKit.GetPanel("UIMain"); holder = form.GetComponentInChildren <OrderHolder>(); }