/// <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 ShowTipPanel3(string message, Action onLeft = null, Action onCancel = null, Action onCenter = null, Action onRight = null, Action hideCallBack = null, bool showCancel = false, bool showDoubleBtn = false, bool showCenter = true, string leftLabel = null, string rightLabel = null, string centerLabel = null, ETipPanelStyle imgStyle = ETipPanelStyle.NONE, bool isMaskActive = false) { if (string.IsNullOrEmpty(message)) { return; } var panelName = typeof(PanelTip).Name; if (!m_panelDic.ContainsKey(panelName)) { m_panelDic.Add(panelName, new PanelTip()); m_panelLoopList.Add(m_panelDic[panelName]); } if (m_tipPanel != null) { m_tipPanel.HidePanel(); } var param = new TipPanelParams(); param.message = message; param.onLeft = onLeft; param.onCancel = onCancel; param.onRight = onRight; param.hideCallBack = hideCallBack; param.showCancel = showCancel; param.showCenter = showCenter; param.onCenter = onCenter; param.leftLabel = leftLabel; param.rightLabel = rightLabel; param.showDoubleBtn = showDoubleBtn; param.centerLabel = centerLabel; param.style = imgStyle; param.isMaskActive = isMaskActive; m_tipPanel = m_panelDic[panelName]; m_tipPanel.SetParams(new object[] { param }); m_tipPanel.ShowPanel(CanvasOverlay, true); m_tipPanel.LayerType = LayerType.Tip; }
/// <summary> /// 文字浮动提示 /// </summary> /// <param name="message">提示内容</param> /// <param name="duration">持续时间</param> /// <param name="from">起始位置</param> /// <param name="to">目标位置</param> public static void ShowFloatTipPanel(string message, float duration = 0.8f, Vector2 from = default(Vector2), Vector2 to = default(Vector2), ETipPanelStyle imgStyle = ETipPanelStyle.NONE, Action hidePanelCallback = null) { if (string.IsNullOrEmpty(message)) { return; } var panelName = typeof(PanelFloatTip).Name; if (!m_panelDic.ContainsKey(panelName)) { m_panelDic.Add(panelName, new PanelFloatTip()); m_panelLoopList.Add(m_panelDic[panelName]); } if (m_floatTipPanel != null) { m_floatTipPanel.HidePanel(); } var param = new FloatTipPanelParams(); param.message = message; param.duration = duration; param.from = from; param.to = to; param.style = imgStyle; param.hidePanelCallback = hidePanelCallback; m_floatTipPanel = m_panelDic[panelName]; m_floatTipPanel.SetParams(new object[] { param }); m_floatTipPanel.ShowPanel(CanvasOverlay); m_floatTipPanel.LayerType = LayerType.Tip; }
public static void ShowTipPanel1(string message, Action onLeft, Action onRight, string leftLabel, string rightLabel, bool showCancel, bool isMaskActive, ETipPanelStyle imgStyle = ETipPanelStyle.WARN) { ShowTipPanel3(message, onLeft: onLeft, onRight: onRight, leftLabel: leftLabel, rightLabel: rightLabel, showCenter: false, showDoubleBtn: true, showCancel: showCancel, isMaskActive: isMaskActive, imgStyle: imgStyle); }
public static void ShowTipPanel2(string message, bool showCenter, string centerLabel, Action onCenter, bool showCancel, bool isMaskActive, ETipPanelStyle imgStyle = ETipPanelStyle.WARN) { ShowTipPanel3(message, onCenter: onCenter, showCenter: showCenter, showCancel: showCancel, isMaskActive: isMaskActive, imgStyle: imgStyle); }
/// <summary> /// 在chat层弹出窗口并置顶,该层需要自己维护显示隐藏 /// </summary> /// <typeparam name="T"></typeparam> /// <param name="params"></param> /// <param name="addMask"></param> /// <param name="parentPanel"></param> //public static T PopChatPanel<T>(object[] @params = null, bool addMask = false, BasePanel parentPanel = null) where T : BasePanel, new() //{ // var panelName = typeof(T).Name; // if (!m_panelDic.ContainsKey(panelName)) // { // m_panelDic.Add(panelName, new T()); // m_panelLoopList.Add(m_panelDic[panelName]); // } // var popPanel = m_panelDic[panelName]; // popPanel.SetParams(@params); // popPanel.ShowPanel(m_chatLayer, addMask); // if (parentPanel != null) // { // parentPanel.AddChildPanel(popPanel); // popPanel.SetParent(parentPanel); // } // return popPanel as T; //} public static void ShowTipPanel(string message, bool isMaskActive = true, Action closePanelCallback = null, ETipPanelStyle imgStyle = ETipPanelStyle.NONE) { ShowTipPanel3(message, showCenter: false, isMaskActive: isMaskActive, hideCallBack: closePanelCallback, imgStyle: imgStyle); }