public static void LoadPage(Type type, object dat = null) { if (typeof(HotUIPage).IsAssignableFrom(type)) { if (CurrentPage != null) { if (CurrentPage.GetType() == type) { CurrentPage.Show(dat); return; } } if (HCanvas.MainCanvas != null)//释放当前页面所有事件 { HCanvas.MainCanvas.ClearAllAction(); } TextInput.Clear(); if (CurrentPage != null) { CurrentPage.Dispose(); } var t = Activator.CreateInstance(type) as HotUIPage; CurrentPage = t; t.Initial(Root, dat); t.ReSize(); t.Recovery(); } }
public override void Initial(Transform parent, HotUIPage page, object dat = null) { base.Initial(parent, page, dat); view = LoadUI <View>("baseUI", "LandlordLobby"); InitialEvent(); LoadData(); }
static void Login(DataBuffer data) { var args = data.fakeStruct.GetData <string>(Req.Args); var info = JSONParser.FromJson <UserInfo>(args); UserData.userInfo = info; HotUIPage.LoadPage <LobbyPage>(info); }
public virtual void Initial(Transform parent, HotUIPage page, object obj = null) { base.Initial(parent, page, obj); mainPage = page; if (model != null) { if (page != null) { Main.transform.SetParent(parent); } } }
public static void LoadPage <T>(object dat = null) where T : HotUIPage, new() { if (CurrentPage is T) { CurrentPage.Show(dat); return; } if (HCanvas.MainCanvas != null)//释放当前页面所有事件 { HCanvas.MainCanvas.ClearAllAction(); } TextInput.Clear(); if (CurrentPage != null) { CurrentPage.Save(); CurrentPage.Dispose(); } var t = new T(); t.Initial(Root, dat); t.ReSize(); CurrentPage = t; }
public static void Start(Transform uiRoot, string Cmd, object dat) { HotUIPage.Root = uiRoot; HotUIPage.LoadPage <LoginPage>(); }
public static void Update(float time) { HotUIPage.Refresh(time); }
static void ExitRoom() { HotUIPage.LoadPage <LobbyPage>(); }
static void JoinRoom(DataBuffer data) { HotUIPage.LoadPage <GamePage>(); }