Beispiel #1
0
    public static void BackTo <T>() where T : Page
    {
        if (AdmissionManager.busing)
        {
            return;
        }
        var name       = typeof(T).Name;
        var targetPage = PageStack.Find(name);

        if (targetPage == null)
        {
            // page not in stack, can't pop to
            return;
        }
        var popedList = PageStack.PopUtil(targetPage);

        // var top = Top;
        // while(typeof(T) != top.GetType())
        // {
        //     UIEngine.Back();
        //     top = Top;
        //     if(top == null)
        //     {
        //         break;
        //     }
        // }
        foreach (var p in popedList)
        {
            pagePool.Put(p.name, p);
        }
    }
Beispiel #2
0
    public static void Back(object result = null, Admission admision = null)
    {
        if (AdmissionManager.busing)
        {
            return;
        }
        var page = PageStack.Pop();

        if (page != null)
        {
            pagePool.Put(page.name, page);
        }
        if (PageStack.Count > 0)
        {
            var top = PageStack.Peek();
            Debug.Log("Back to: " + top.name);
            top.OnResult(result);
        }
        else
        {
            Debug.Log("All pages poped!");
        }
        if (admision != null)
        {
            AdmissionManager.Play(admision, page, PageStack.Peek());
        }
        RepositionMask();
    }
Beispiel #3
0
 public static Page PopToPool(string name, PagePool pagePool)
 {
     while (stack.Count > 0 && !stack.Peek().name.Equals(name))
     {
         var page = stack.Pop();
         page.Active = false;
         page.OnNavigatedFrom();
         page.OnPop();
         pagePool.Put(page.name, page);
     }
     if (stack.Count > 0)
     {
         RecaculateActive();
         var tarPage = stack.Peek();
         tarPage.OnNavigatedTo();
         return(tarPage);
     }
     return(null);
 }