Esempio n. 1
0
 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();
     }
 }
Esempio n. 2
0
 public override void Initial(Transform parent, HotUIPage page, object dat = null)
 {
     base.Initial(parent, page, dat);
     view = LoadUI <View>("baseUI", "LandlordLobby");
     InitialEvent();
     LoadData();
 }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
 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);
         }
     }
 }
Esempio n. 5
0
    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;
    }
Esempio n. 6
0
 public static void Start(Transform uiRoot, string Cmd, object dat)
 {
     HotUIPage.Root = uiRoot;
     HotUIPage.LoadPage <LoginPage>();
 }
Esempio n. 7
0
 public static void Update(float time)
 {
     HotUIPage.Refresh(time);
 }
Esempio n. 8
0
 static void ExitRoom()
 {
     HotUIPage.LoadPage <LobbyPage>();
 }
Esempio n. 9
0
 static void JoinRoom(DataBuffer data)
 {
     HotUIPage.LoadPage <GamePage>();
 }