Exemplo n.º 1
0
        public static void CloseDialog(BaseUI Dialog)
        {
            if (Dialog == null)
            {
                return;
            }

            var Root = UIHelper.FindChild(Dialog.UITransform, "Dialog");

            if (Root == null)
            {
                UIManager.CloseUI(Dialog);
                CurrentUI_ = null;
                CheckDialogQueueList();
                return;
            }

            var CloseAct = MotionHelper.Sequence()
                           .Callback(MaskLayerHelper.CreateMaskLayer)
                           .Scale(0.05f, new Vector3(1.1f, 1.1f), false)
                           .Scale(0.2f, new Vector3(0.0f, 0.0f), false)
                           .Callback(() =>
            {
                UIManager.CloseUI(Dialog);
                MaskLayerHelper.DeleteMaskLayer();
                CurrentUI_ = null;
                CheckDialogQueueList();
            })
                           .Flush();

            Root.ExecuteMotion(CloseAct);
        }
Exemplo n.º 2
0
        private static void OpenDialog(DialogUI Dialog)
        {
            CurrentUI_ = Dialog;
            var Root = UIHelper.FindChild(Dialog.UITransform, "Dialog");

            if (Root == null)
            {
                Dialog.OnDialogPopup();
                return;
            }

            var PopupAct = MotionHelper.Sequence()
                           .Callback(MaskLayerHelper.CreateMaskLayer)
                           .Scale(0.2f, new Vector3(1.1f, 1.1f), false)
                           .Scale(0.05f, new Vector3(1.0f, 1.0f), false)
                           .Callback(() =>
            {
                Dialog.OnDialogPopup();
                MaskLayerHelper.DeleteMaskLayer();
            })
                           .Flush();

            Root.localScale = Vector3.zero;
            Root.ExecuteMotion(PopupAct);
        }