Esempio n. 1
0
 public UIFlowCommand(WidgetBase prev, WidgetBase current, float activeTime, IUIDataParams data)
 {
     m_prevWidget    = prev;
     m_data          = data;
     m_activeTime    = activeTime;
     m_currentWidget = current;
 }
Esempio n. 2
0
        protected override void ShowWidget(IUIDataParams data)
        {
            MessageBoxDataParam messageData = data as MessageBoxDataParam;

            {
                MessageBoxType = messageData.MessageBoxType;

                // ok button
                UIModuleButton okButton = GetButton(0);
                if (okButton != null)
                {
                    okButton.SetActive(true);
                    okButton.Set(OnOkButtonClick);
                }

                // cancel button
                UIModuleButton cancelButton = GetButton(1);
                if (cancelButton != null)
                {
                    cancelButton.SetActive(MessageBoxType == eMessageBoxType.OKAndCancel ? true : false);
                    cancelButton.Set(OnCancelButtonClick);
                }

                // close button
                SetButton(2, OnCancelButtonClick);
            }

            SetText(Title, messageData.TitleText);
            SetText(Message, messageData.MessageText);

            m_completed = messageData.CompletedAction;
        }
Esempio n. 3
0
        public void Show(float activeTime = 0.0f, IUIDataParams data = null, bool flowCommand = false)
        {
            if (FadeCoroutine != null)
            {
                StopCoroutine(FadeCoroutine);
                FadeCoroutine = null;
            }

            m_isActive = true;

            if (CanvasGroup != null)
            {
                CanvasGroup.blocksRaycasts = IsActive;
                CanvasGroup.interactable   = IsActive;
            }

            gameObject.SetActive(IsActive);
            ShowWidget(data);

            if (IsFlow && IsPopupType == false && flowCommand == false)
            {
                Global.WidgetMgr.AddFlow(this, activeTime, data);
            }

            if (activeTime != 0.0f)
            {
                if (CanvasGroup != null)
                {
                    CanvasGroup.alpha = 0.0f;
                }

                if (IsGameOjectActive == true)
                {
                    FadeCoroutine = StartCoroutine(CanvasFadeCoroutine(activeTime, false, () =>
                    {
                        if (CanvasGroup != null)
                        {
                            CanvasGroup.alpha = 1.0f;
                        }
                        FadeCoroutine = null;
                    }));
                }
                else
                {
                    if (CanvasGroup != null)
                    {
                        CanvasGroup.alpha = 1.0f;
                    }
                    FadeCoroutine = null;
                }
            }
            else
            {
                if (CanvasGroup != null)
                {
                    CanvasGroup.alpha = 1.0f;
                }
            }
        }
Esempio n. 4
0
        public WidgetBase ShowWidget(string widgetName, IUIDataParams data = null, float activeTime = 0.0f)
        {
            WidgetBase widget = FindWidget(widgetName);

            if (widget == null)
            {
                widget = CreateWidget <WidgetBase>(widgetName);
            }

            widget.Show(activeTime, data);
            return(widget);
        }
Esempio n. 5
0
        public void AddFlow(WidgetBase currentWidget, float activeTime, IUIDataParams data)
        {
            if (currentWidget.IsFlow == false)
            {
                return;
            }

            WidgetBase prevWidget = null;

            if (string.IsNullOrEmpty(m_currentUIName) == false)
            {
                prevWidget = FindWidget(m_currentUIName);
            }

            if (prevWidget != null)
            {
                m_commandManager.CurrentCommand = new UIFlowCommand(prevWidget, currentWidget, activeTime, data);
                m_commandManager.Execute();
            }
            m_currentUIName = currentWidget.WidgetName;
        }
Esempio n. 6
0
 protected override void ShowWidget(IUIDataParams data)
 {
 }
Esempio n. 7
0
 protected override void ShowWidget(IUIDataParams data)
 {
     _userProfile.SetActive(true);
     _bossProfile.SetActive(false);
 }
Esempio n. 8
0
 protected abstract void ShowWidget(IUIDataParams data);
Esempio n. 9
0
 protected override void ShowWidget(IUIDataParams data)
 {
     m_loadingText.text = "Loading";
 }