protected void ToggleModal(UGuideMsgData _gData) { if (_gData.bModal) { m_wndView.ShowModal(); } else { m_wndView.HideModal(); } }
protected override int onExecute(TBTWorkingData wData) { GuideWorkingData gData = wData as GuideWorkingData; UGuideMsgData data = new UGuideMsgData(m_strShowMessage, gData.GuideCurrentNode); UISystem.Instance.SendTargetWndMessage(WndID.WND_ID_GAMEGUIDE, WndMsgID.WND_MSG_GAMEGUIDE_ALWAYMESSAGE, data); return(base.onExecute(wData)); }
internal void Show(UGuideMsgData _gData) { if (DefaultComponent == null) { return; } //必须先执行 SetUserDataDefaultComponent,因为里面会设置DefaultComponent 用哪个类型 SetUserDataDefaultComponent(_gData.UserData); SetUserData(_gData.UserData, ref DefaultComponent); DefaultComponent.GuideTextField.text = string.Empty; DefaultComponent.GuideTextField.DOText(_gData.strMsgText, 1.0f).SetAutoKill(true); DefaultComponent.gameObject.SetActive(true); if (!m_listUsingComponent.Contains(DefaultComponent)) { m_listUsingComponent.Add(DefaultComponent); } m_bNeedUpdateSibling = true; }
internal void ShowReward(UGuideMsgData _gData) { if (RewardComponent == null) { return; } RewardComponent.GuideTextField.text = string.Empty; RewardComponent.GuideTextField.DOText(_gData.strMsgText, 1.0f).SetAutoKill(true); RewardComponent.gameObject.SetActive(true); if (!m_listUsingRewardComponent.Contains(RewardComponent)) { m_listUsingRewardComponent.Add(RewardComponent); } m_bNeedUpdateSibling = true; UEffectParamBase param = new UEffectPrefabParam(_eType: UEffectPrefabType.UEPT_GuideWidget_Reward_heroUnlock, _tfAttachParent: RewardComponent.transform, _bAutoDestroy: true); UEffectManager.Instance.CreateEffect(UEffectType.UET_EffectPrefab, ref param); m_RewardEffect = param; }
public override void OnMessage(WndMsgID msgID, UIMsgData data) { switch (msgID) { case WndMsgID.WND_MSG_COMMOM_STATICGAMESTATE_ENTER: this.SetVisible(false); LoadView(); break; case WndMsgID.WND_MSG_GAMEGUIDE_ADDNODEMESSAGE: { //this.SetVisible(true); UGuideMsgData gData = data as UGuideMsgData; if (m_wndView == null || gData == null || string.IsNullOrEmpty(gData.strMsgText)) { break; } if (gData != null) { #region 旧版处理 //m_messageQueue.Add(gData); //if(m_messageQueue.Count >=1 && m_bAnimPlaying && !m_bRunningTimerID_0) //{ // m_bRunningTimerID_0 = true; // TimerManager.SetTimer(this, m_nPlayTimerID_0, m_nDelayPlayAnimDuration, 1); //} //PlayAnim(); #endregion UBB.toHtml(ref gData.strMsgText); SetVisible(true); m_wndView.Show(gData); ToggleModal(gData); } } break; case WndMsgID.WND_MSG_GAMEGUIDE_REMOVENODEMESSAGE: { if (m_wndView == null) { break; } UGuideMsgRemoveData gData = data as UGuideMsgRemoveData; if (gData != null) //&& gData.nGuideNodeID == m_eAddMessageGuideNodeID) { #region 旧版处理 //if (gData.nGuideNodeID == m_eAddMessageGuideNodeID && !m_bRunningTimerID_0) // m_wndView.RemoveNode(); //else //{ // int removeIndex = m_messageQueue.FindIndex((queueData) => { if (queueData.nGuideNodeID == gData.nGuideNodeID) return true; else return false; }); // if(removeIndex != -1) // m_messageQueue.RemoveAt(removeIndex); //} #endregion if (gData.IsRemoveMessage) { m_wndView.Hide(); } if (gData.IsRemoveModal) { m_wndView.HideModal(); } if (gData.IsHideView) { SetVisible(false); } } } break; case WndMsgID.WND_MSG_COMMON_LOGINSTATE_ENTER: { if (m_wndView != null) { #region 旧版处理 //m_wndView.ClearNode(); //TimerManager.KillTimer(this, m_nPlayTimerID_0); #endregion m_wndView.Clear(); m_wndView.HideModal(); SetVisible(false); } } break; case WndMsgID.WND_MSG_COMMON_LOGINMOBA: case WndMsgID.WND_MSG_COMMON_WAREND: case WndMsgID.WND_MSG_COMMON_BATTLESTATE_LEAVE: case WndMsgID.WND_MSG_GAMEGUIDE_REMOVEALLMESSAGE: { if (m_wndView == null) { break; } #region 旧版处理 //m_messageQueue.Clear(); //m_wndView.RemoveNode(); //TimerManager.KillTimer(this, m_nPlayTimerID_0); #endregion //WND_MSG_COMMON_WAREND 关闭引导提示 //WND_MSG_COMMON_BATTLESTATE_LEAVE 启用引导提示 m_bEnableGuideUI = msgID == WndMsgID.WND_MSG_COMMON_WAREND ? false : msgID == WndMsgID.WND_MSG_COMMON_BATTLESTATE_LEAVE ? true : true; m_wndView.Clear(); m_wndView.HideModal(); SetVisible(false); } break; case WndMsgID.WND_MSG_GAMEGUIDE_ADDAUTOMESSAGE: { if (m_wndView == null || !m_bEnableGuideUI) { break; } UGuideMsgData gData = data as UGuideMsgData; if (gData != null) { UBB.toHtml(ref gData.strMsgText); m_wndView.ShowAutoMessage(gData.strMsgText, gData.nGuideSignSpriteID); SetVisible(true); } } break; case WndMsgID.WND_MSG_GAMEGUIDE_ALWAYMESSAGE: { if (m_wndView == null) { break; } UGuideMsgData gData = data as UGuideMsgData; if (gData != null) { UBB.toHtml(ref gData.strMsgText); m_wndView.ShowAlwaysDisplayMessage(gData.strMsgText); SetVisible(true); } } break; case WndMsgID.WND_MSG_GAMEGUIDE_ADDGUIDEEFFECT: { if (m_wndView == null) { break; } UGuideWidgetMsgData gData = data as UGuideWidgetMsgData; if (gData != null) { m_wndView.AddGuideEffect(gData.nGuideEffectID); } } break; case WndMsgID.WND_MSG_GAMEGUIDE_REMOVEGUIDEEFFECT: { if (m_wndView == null) { break; } UGuideWidgetMsgData gData = data as UGuideWidgetMsgData; if (gData != null) { m_wndView.RemoveGuideEffect(gData.nGuideEffectID); } } break; case WndMsgID.WND_MSG_GAMEGUIDE_ADDNODEREWARDMESSAGE: { UGuideMsgData gData = data as UGuideMsgData; if (m_wndView == null || gData == null || string.IsNullOrEmpty(gData.strMsgText)) { break; } if (gData != null) { UBB.toHtml(ref gData.strMsgText); SetVisible(true); m_wndView.ShowReward(gData); ToggleModal(gData); } } break; case WndMsgID.WND_MSG_GAMEGUIDE_REMOVENODEREWARDMESSAGE: { if (m_wndView == null) { break; } UGuideMsgRemoveData gData = data as UGuideMsgRemoveData; if (gData != null) { if (gData.IsRemoveMessage) { m_wndView.HideReward(); } if (gData.IsRemoveModal) { m_wndView.HideModal(); } if (gData.IsHideView) { SetVisible(false); } } } break; } }