Пример #1
0
        /// <summary>
        /// 外部通过单例直接调用此方法即可
        /// </summary>
        /// <param name="str"></param>
        /// <param name="is_important_msg">是否是重要的msg(是否可以不合并)</param>
        public void ShowMessage(string str, bool is_important_msg = false)
        {
            if (str == null || str.CompareTo("") == 0)
            {
                GameDebug.LogError(string.Format("ShowMessage str === null or string.Empty"));
                return;
            }
            str = GoodsHelper.ReplaceGoodsColor_blackBkg(str);  //颜色全部转成暗底颜色
            int count = 0;

            foreach (var item in mDisplayTips)
            {
                if (item.mLabel.text.CompareTo("") == 0)
                {
                    count += 1;
                }
            }
            if (is_important_msg == false)
            {
                if (mChacheMaxCount >= mCacheText.Count)
                {
                    mCacheText.Add(str);
                }
            }
            else
            {
                mCacheText.Add(str);
            }

            if (count == mTipsObjCount)
            {
                ShowTips();
            }
        }
Пример #2
0
        /// <summary>
        /// 外部通过单例直接调用此方法即可(最多显示一个同样的提示)
        /// </summary>
        /// <param name="str"></param>
        public void ShowMessage_showMaxOne(string str, bool is_important_msg = false)
        {
            if (str == null || str.CompareTo("") == 0)
            {
                GameDebug.LogError(string.Format("ShowMessage str === null or string.Empty"));
                return;
            }
            str = GoodsHelper.ReplaceGoodsColor_blackBkg(str);  //颜色全部转成暗底颜色
            foreach (var item in mDisplayTips)
            {
                if (item.mLabel.text == str)
                {
                    return;
                }
            }
            for (int index = 0; index < mCacheText.Count; ++index)
            {
                if (mCacheText[index] == str)
                {
                    return;
                }
            }

            ShowMessage(str, is_important_msg);
        }
Пример #3
0
 /// <summary>
 /// 弹幕
 /// </summary>
 public void ShowDanmaku(string str)
 {
     ClientEventMgr.Instance.FireEvent((int)ClientEvent.CE_SHOW_DANMAKU, new CEventBaseArgs(GoodsHelper.ReplaceGoodsColor_blackBkg(str)));
 }
Пример #4
0
        public void ShowRollingNotice(string str)
        {
            ClientEventMgr.Instance.FireEvent((int)ClientEvent.CE_SHOW_ROLLING_NOTICE, new CEventBaseArgs(GoodsHelper.ReplaceGoodsColor_blackBkg(str)));

            IsShowingRollingNotice = true;
        }