public void ChangeScene(ScenePage page, object dat)
 {
     if (CurrentPage != null)
     {
         CurrentPage.Dispose();
     }
     page.Scene = this;
     page.Initial(Root, dat);
     CurrentPage = page;
 }
 public void Dispose()
 {
     if (CurrentPage != null)
     {
         CurrentPage.Dispose();
     }
     CurrentPage = null;
     if (Instance != null)
     {
         GameObject.Destroy(Instance);
     }
     Instance = null;
 }
Пример #3
0
        public void ChangeScene <T>(object dat) where T : ScenePage, new()
        {
            if (CurrentPage is T)
            {
                CurrentPage.Show(dat);
                return;
            }
            if (CurrentPage != null)
            {
                CurrentPage.Dispose();
            }
            var t = new T();

            t.Scene = this;
            t.Initial(Root, dat);
            CurrentPage = t;
        }