Exemplo n.º 1
0
    private void CloseScreen(ScreenController screen, IUIAnimation animation = null)
    {
        _navigationStack.Remove(screen);

        if (animation == null)
        {
            GameObject.Destroy(screen.gameObject);
            return;
        }

        animation.AnimateOn(screen.GetComponent <RectTransform>())
        .Then(() => GameObject.Destroy(screen.gameObject));
    }
Exemplo n.º 2
0
    public ScreenController OpenScreen <T>(IUIAnimation animation = null) where T : ScreenController
    {
        var screen = _screenFactory.Create <T>();

        _navigationStack.Add(screen);

        if (animation != null)
        {
            animation.AnimateOn(screen.GetComponent <RectTransform>());
        }

        return(screen);
    }
Exemplo n.º 3
0
    private void CloseAll(IUIAnimation animation = null)
    {
        foreach (var screen in _navigationStack)
        {
            if (animation == null)
            {
                GameObject.Destroy(screen.gameObject);
                continue;
            }

            animation.AnimateOn(screen.GetComponent <RectTransform>())
            .Then(() => GameObject.Destroy(screen.gameObject));
        }

        _navigationStack.Clear();
    }
Exemplo n.º 4
0
 public ScreenController GotoScreen <T>(IUIAnimation openingScreenAnimation = null, IUIAnimation closingScreenAnimation = null) where T : ScreenController
 {
     CloseAll(closingScreenAnimation);
     return(OpenScreen <T>(openingScreenAnimation));
 }
 /// <summary>
 /// 动画结束
 /// </summary>
 /// <param name="uiAnim"></param>
 public override void OnAnimationComplete(IUIAnimation uiAnim)
 {
     base.OnAnimationComplete(uiAnim);
     GameMode.XLua.CallLua <UGUIViewCallXLua>().LuaOnAnimationComplete(_uiContext, uiAnim);
 }