Exemplo n.º 1
0
 public void BackPage()
 {
     if ((this._pageContextStack.Count != 0) && ((this._pageContextStack.Count != 1) || !(this._pageContextStack.Peek() is MainPageContext)))
     {
         BasePageContext context = this._pageContextStack.Pop();
         this.spaceShipVisibleOnPreviesPage = context.spaceShipVisible();
         context.Destroy();
         if (this._pageContextStack.Count > 0)
         {
             BasePageContext context2 = this._pageContextStack.Peek();
             if (context2.view != null)
             {
                 context2.SetActive(true);
                 context2.OnLandedFromBackPage();
             }
             else
             {
                 context2.StartUp(this.SceneCanvas.transform, null);
             }
             if (context2.spaceShipVisible())
             {
                 UIUtil.SpaceshipCheckWeather();
             }
         }
         else
         {
             this._emtryPageContext.SetActive(true);
         }
     }
 }
Exemplo n.º 2
0
 public bool BackPageTo(string contextName)
 {
     if (this._pageContextStack.Count <= 0)
     {
         SuperDebug.VeryImportantError("The page stack is empty!!!");
         return(false);
     }
     if (contextName != "MainPageContext")
     {
         bool flag = false;
         foreach (BasePageContext context in this._pageContextStack)
         {
             if (context.config.contextName == contextName)
             {
                 flag = true;
                 break;
             }
         }
         if (!flag)
         {
             SuperDebug.VeryImportantError("Can't find page in stack: " + contextName);
             return(false);
         }
     }
     this.spaceShipVisibleOnPreviesPage = this._pageContextStack.Peek().spaceShipVisible();
     while ((this._pageContextStack.Count > 0) && (this._pageContextStack.Peek().config.contextName != contextName))
     {
         this._pageContextStack.Pop().Destroy();
     }
     if (this._pageContextStack.Count > 0)
     {
         BasePageContext context4 = this._pageContextStack.Peek();
         if (context4.view != null)
         {
             context4.SetActive(true);
             context4.OnLandedFromBackPage();
         }
         else
         {
             context4.StartUp(this.SceneCanvas.transform, null);
         }
     }
     else
     {
         this._pageContextStackStash.Clear();
         this._emtryPageContext.Destroy();
         this.ShowPage(new MainPageContext(), UIType.Page);
     }
     return(true);
 }