public UIFlowCommand(WidgetBase prev, WidgetBase current, float activeTime, IUIDataParams data) { m_prevWidget = prev; m_data = data; m_activeTime = activeTime; m_currentWidget = current; }
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; }
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; } } }
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); }
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; }
protected override void ShowWidget(IUIDataParams data) { }
protected override void ShowWidget(IUIDataParams data) { _userProfile.SetActive(true); _bossProfile.SetActive(false); }
protected abstract void ShowWidget(IUIDataParams data);
protected override void ShowWidget(IUIDataParams data) { m_loadingText.text = "Loading"; }