public override void OnShow() { if (m_params == null || m_params.Length == 0 || !(m_params[0] is TutorialPanelParams)) { m_content.text = ""; return; } m_data = m_params[0] as TutorialPanelParams; m_content.text = m_data.message; m_tranLeft.gameObject.SetActive(m_data.showDouble); m_tranRight.gameObject.SetActive(m_data.showDouble); m_tranCancel.gameObject.SetActive(m_data.showCancel); m_tranCenter.gameObject.SetActive(m_data.showCenter); m_nebula.gameObject.SetActive(m_data.showNebula); m_content2.gameObject.SetActive(m_data.showNebula); m_content.gameObject.SetActive(!m_data.showNebula); m_content2.text = m_data.message; line.SetActive(m_data.showDouble); bgGround.SetUILocation(bgGround.parent, m_tran.localPosition.x, m_data.yPos); m_txtLeft.text = m_data.LeftLabel ?? m_strDefaultLeft; m_txtRight.text = m_data.RightLabel ?? m_strDefaultRight; m_txtCenter.text = m_data.CenterLabel ?? m_strDefaultCenter; isMaskActive = m_data.isMaskActive; //PlayActionManager.Instance.PlayAction(m_go); }
/// <summary> /// 使用默认的信息提示窗 /// </summary> /// <param name="message">消息内容</param> /// <param name="onOk">按钮回调</param> /// <param name="onCancel">按钮回调</param> /// <param name="showCloseBtn">是否显示关闭按钮</param> /// <param name="showCancel">是否显示取消按钮</param> /// <param name="okLabel">确定按钮的文字</param> /// <param name="cancelLabel">取消按钮的文字</param> //public static void ShowTipMulTextPanel(string message, Action onOk = null, Action onCancel = null, bool showCloseBtn = true, bool showCancel = false, string okLabel = null, string cancelLabel = null) //{ // var panelName = typeof(PanelTipMulText).Name; // if (!m_panelDic.ContainsKey(panelName)) // { // m_panelDic.Add(panelName, new PanelTipMulText()); // m_panelLoopList.Add(m_panelDic[panelName]); // } // if (m_tipPanel != null) // m_tipPanel.HidePanel(); // var param = new TipMulTextPanelParams(); // param.message = message; // param.onOk = onOk; // param.onCancel = onCancel; // param.showCancel = showCancel; // param.showCloseBtn = showCloseBtn; // param.okLabel = okLabel; // param.cancelLabel = cancelLabel; // m_tipPanel = m_panelDic[panelName]; // m_tipPanel.SetParams(new object[] { param }); // m_tipPanel.ShowPanel(m_tipLayer, true); //} /// <summary> /// 使用阶段性引导专用提示窗 /// </summary> /// <param name="message">消息内容</param> /// <param name="onOk">按钮回调</param> /// <param name="onCancel">按钮回调</param> /// <param name="showCloseBtn">是否显示关闭按钮</param> /// <param name="showCancel">是否显示取消按钮</param> /// <param name="okLabel">确定按钮的文字</param> /// <param name="cancelLabel">取消按钮的文字</param> public static void ShowTutorialPanel(string message, Action onLeft = null, Action onCancel = null, Action onRight = null, Action onCenter = null, bool showCancel = false, bool showDouble = false, bool showCenter = true, string leftLabel = null, string rightLabel = null, string centerLabel = null, bool isMaskActive = false, float yPos = 0, bool showNebula = false) { if (string.IsNullOrEmpty(message)) { return; } var panelName = typeof(PanelTutorial).Name; if (!m_panelDic.ContainsKey(panelName)) { m_panelDic.Add(panelName, new PanelTutorial()); m_panelLoopList.Add(m_panelDic[panelName]); } if (m_tutorialPanel != null) { m_tutorialPanel.HidePanel(); } var param = new TutorialPanelParams(); param.message = message; param.onLeft = onLeft; param.onCancel = onCancel; param.onRight = onRight; param.onCenter = onCenter; param.showCancel = showCancel; param.showDouble = showDouble; param.showCenter = showCenter; param.LeftLabel = leftLabel; param.RightLabel = rightLabel; param.CenterLabel = centerLabel; param.yPos = yPos; param.isMaskActive = isMaskActive; param.showNebula = showNebula; m_tutorialPanel = m_panelDic[panelName]; m_tutorialPanel.SetParams(new object[] { param }); m_tutorialPanel.ShowPanel(CanvasOverlay, true); }
public override void OnHide() { m_params = null; m_data = null; }