Exemplo n.º 1
0
        public string GetTipsInCurLanguage(int tipsId)
        {
            TipsItem tCfg = TipsData.Get(tipsId);

            if (tCfg != null)
            {
                string language = Global.gApp.gSystemMgr.GetMiscMgr().Language;
                if (language == null || language.Equals(GameConstVal.EmepyStr))
                {
                    language = UiTools.GetLanguage();
                }
                string lTxt = ReflectionUtil.GetValueByProperty <TipsItem, string>(language, tCfg);
                if (lTxt == null || lTxt.Equals(GameConstVal.EmepyStr))
                {
                    //Debug.Log("tipsId = " + tipsId + "don't have language = " + language);
                    return(tCfg.txtcontent);
                }
                else
                {
                    return(lTxt);
                }
            }
            else
            {
                //Debug.Log("tipsId = " + tipsId + "don't exist");
            }
            return(GameConstVal.EmepyStr);
        }
Exemplo n.º 2
0
        public TipsItem Get(int id)
        {
            int min = 0;
            int max = items.Length;

            while (min < max)
            {
                int      index = (min + max) >> 1;
                TipsItem item  = _Items[index];
                if (item.id == id)
                {
                    return(item);
                }
                if (id < item.id)
                {
                    max = index;
                }
                else
                {
                    min = index + 1;
                }
            }
            return(null);
        }