Ejemplo n.º 1
0
    /// <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;
    }
Ejemplo n.º 2
0
    /// <summary>
    /// 切换显示主要面板
    /// </summary>
    /// <typeparam name="T"></typeparam>
    /// <param name="params">参数数组</param>
    /// <returns></returns>
    public static T ShowPanel <T>(object[] @params = 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]);
        }

        if (m_panelDic[panelName].IsOpen())
        {
            return(m_panelDic[panelName] as T);
        }

        if (m_contentPanel != null)
        {
            m_preContentPanel = m_contentPanel;
            m_contentPanel.HidePanel();
        }

        m_contentPanel = m_panelDic[panelName];
        PushStack(panelName, @params);

        var panel = m_panelDic[panelName];

        panel.SetParams(@params);
        panel.ShowPanel(m_contentLayer);
        panel.LayerType = LayerType.Content;

        return(panel as T);
    }
Ejemplo n.º 3
0
    /// <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);
    }
Ejemplo n.º 4
0
    /// <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;
    }
Ejemplo n.º 5
0
    //private static int m_count;
    public static void ShowMask(string message, float clearTime = 8)
    {
        var panelName = typeof(PanelMask).Name;

        if (!m_panelDic.ContainsKey(panelName))
        {
            m_panelDic.Add(panelName, new PanelMask());
            m_panelLoopList.Add(m_panelDic[panelName]);
        }

        if (m_maskPanel != null)
        {
            m_maskPanel.HidePanel();
        }

        //m_count++;
        clearWatchDog = clearTime;
        m_maskPanel   = m_panelDic[panelName];
        m_maskPanel.SetParams(new object[] { message });
        m_maskPanel.ShowPanel(CanvasOverlay, true);
    }