Esempio n. 1
0
        public void ShowSelect()
        {
            var add = new UISwitchAvatarPanel(Game);

            Add(add);

            SetSubpanel(null);
            foreach (var fade in GetFadeables())
            {
                GameFacade.Screens.Tween.To(fade, 0.3f, new Dictionary <string, float>()
                {
                    { "Opacity", 0f }
                });
            }
            if (Switcher.CategoryExpand > 0)
            {
                Switcher.Close();
            }
            ShowingSelect = true;
            SwitchAvatar  = add;

            add.OnEnd += () =>
            {
                Open();
                Switcher_OnCategorySelect(Switcher.ActiveCategory);
                SwitchAvatar  = null;
                ShowingSelect = false;
                OnEndSelect?.Invoke();
            };
        }
Esempio n. 2
0
        public void Close()
        {
            GameFacade.Screens.Tween.To(this, 0.5f, new Dictionary <string, float>()
            {
                { "CurWidth", 0 }
            }, TweenQuad.EaseOut);
            SetSubpanel(null);
            foreach (var fade in GetFadeables())
            {
                GameFacade.Screens.Tween.To(fade, 0.3f, new Dictionary <string, float>()
                {
                    { "Opacity", 0f }
                });
            }
            if (Switcher.CategoryExpand > 0)
            {
                Switcher.Close();
            }

            SwitchAvatar?.Kill();
            SwitchAvatar = null;
            PanelActive  = false;
        }