示例#1
0
        //Start animation that replace the current menu with the next.
        private void ToNextMenu(GameMenu nextGameMenu)
        {
            GameMenu     oldGameMenu = _menuesStack.Peek();
            ReplaceMenus animate     = new ReplaceMenus(oldGameMenu, nextGameMenu)
            {
                TimeToReach      = PANEL_TIME_TO_LEAVE,
                WindowSize       = SizeVector,
                AnimateDirection = Direction.Up
            };

            animate.ActionInEnd += () =>
            {
                _menuesStack.Push(nextGameMenu);
                Animations.Remove(animate);
            };

            Animations.Add(animate);
            animate.StartAnimate();
        }
示例#2
0
        //Start animation that replace the current menu with the old one.
        private void ToOldMenu(Action doInEnd = null)
        {
            GameMenu     currentGameMenu = _menuesStack.Pop();
            GameMenu     oldGameMenu     = _menuesStack.Peek();
            ReplaceMenus animate         = new ReplaceMenus(currentGameMenu, oldGameMenu)
            {
                TimeToReach      = PANEL_TIME_TO_LEAVE,
                WindowSize       = SizeVector,
                AnimateDirection = Direction.Down
            };

            animate.ActionInEnd += () =>
            {
                Animations.Remove(animate);
                doInEnd?.Invoke();
            };

            Animations.Add(animate);
            animate.StartAnimate();
        }