예제 #1
0
    public override void OnHide()
    {
        if (m_data != null && m_data.hideCallBack != null)
        {
            m_data.hideCallBack();
        }

        m_params = null;
        m_data   = null;
        SetIconUnActive();
    }
예제 #2
0
파일: UIManager.cs 프로젝트: zs9024/Jungle
    /// <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;
    }
예제 #3
0
파일: PanelTip.cs 프로젝트: zs9024/Jungle
    public override void OnHide()
    {
        if (m_data != null && m_data.hideCallBack != null)
        {
            m_data.hideCallBack();
        }

        m_params = null;
        m_data = null;
        SetIconUnActive();
    }
예제 #4
0
파일: PanelTip.cs 프로젝트: zs9024/Jungle
    public override void OnShow()
    {
        if (m_params == null || m_params.Length == 0 || !(m_params[0] is TipPanelParams))
        {
            m_content.text = "";
            return;
        }

        m_data = m_params[0] as TipPanelParams;
        isMaskActive = m_data.isMaskActive;

        curIcon = warnImg;
        SetIconUnActive();
        if (m_data.style == ETipPanelStyle.NONE)
        {
            m_content.gameObject.SetActive(false);
            m_content2.gameObject.SetActive(true);
            m_content2.text = m_data.message;
        }
        #region
        else
        {
            m_content.gameObject.SetActive(true);
            m_content2.gameObject.SetActive(false);
            m_content.text = m_data.message;
            m_tranCancel.gameObject.SetActive(m_data.showCancel);

            m_tranLeft.gameObject.SetActive(m_data.showDoubleBtn);
            m_tranRight.gameObject.SetActive(m_data.showDoubleBtn);

            m_tranCenter.gameObject.SetActive(m_data.showCenter);
            line.SetActive(m_data.showDoubleBtn);
            nebula = m_tran.Find("background/nebula").gameObject;

            m_txtLeft.text = m_data.leftLabel ?? m_strDefaultLeft;
            m_txtRight.text = m_data.rightLabel ?? m_strDefaultRight;
            m_txtCenter.text = m_data.centerLabel ?? m_strDefaultCenter;

            if( m_data.style == ETipPanelStyle.STARBABY && nebula != null)
            {
                nebula.SetActive(true);
                curIcon = nebula;
            }
            else
            {
                if (m_data.style == ETipPanelStyle.WARN && warnImg != null)
                {
                    warnImg.SetActive(true);
                }
                else if (m_data.style == ETipPanelStyle.ERROR && errorImg != null)
                {
                    errorImg.SetActive(true);
                    curIcon = errorImg;
                }
                else if (m_data.style == ETipPanelStyle.SUCCESS && okImg != null)
                {
                    okImg.SetActive(true);
                    curIcon = okImg;
                }

                else if (warnImg != null)
                {
                    warnImg.SetActive(true);
                }

                SetContentPos(m_content.text);
            }

        }
        #endregion

        //PlayActionManager.Instance.PlayAction(m_go);
    }
예제 #5
0
    public override void OnShow()
    {
        if (m_params == null || m_params.Length == 0 || !(m_params[0] is TipPanelParams))
        {
            m_content.text = "";
            return;
        }

        m_data       = m_params[0] as TipPanelParams;
        isMaskActive = m_data.isMaskActive;

        curIcon = warnImg;
        SetIconUnActive();
        if (m_data.style == ETipPanelStyle.NONE)
        {
            m_content.gameObject.SetActive(false);
            m_content2.gameObject.SetActive(true);
            m_content2.text = m_data.message;
        }
        #region
        else
        {
            m_content.gameObject.SetActive(true);
            m_content2.gameObject.SetActive(false);
            m_content.text = m_data.message;
            m_tranCancel.gameObject.SetActive(m_data.showCancel);

            m_tranLeft.gameObject.SetActive(m_data.showDoubleBtn);
            m_tranRight.gameObject.SetActive(m_data.showDoubleBtn);

            m_tranCenter.gameObject.SetActive(m_data.showCenter);
            line.SetActive(m_data.showDoubleBtn);
            nebula = m_tran.Find("background/nebula").gameObject;

            m_txtLeft.text   = m_data.leftLabel ?? m_strDefaultLeft;
            m_txtRight.text  = m_data.rightLabel ?? m_strDefaultRight;
            m_txtCenter.text = m_data.centerLabel ?? m_strDefaultCenter;

            if (m_data.style == ETipPanelStyle.STARBABY && nebula != null)
            {
                nebula.SetActive(true);
                curIcon = nebula;
            }
            else
            {
                if (m_data.style == ETipPanelStyle.WARN && warnImg != null)
                {
                    warnImg.SetActive(true);
                }
                else if (m_data.style == ETipPanelStyle.ERROR && errorImg != null)
                {
                    errorImg.SetActive(true);
                    curIcon = errorImg;
                }
                else if (m_data.style == ETipPanelStyle.SUCCESS && okImg != null)
                {
                    okImg.SetActive(true);
                    curIcon = okImg;
                }

                else if (warnImg != null)
                {
                    warnImg.SetActive(true);
                }

                SetContentPos(m_content.text);
            }
        }
        #endregion


        //PlayActionManager.Instance.PlayAction(m_go);
    }