示例#1
0
    private void CreatCaption(CaptionInfoPackage pack)
    {
        string[]  _stringArr = GameUtils.getString(pack.m_InfoTable.getText()).Split('#');
        int[]     _typeArr   = pack.m_InfoTable.getDatatype();
        string[]  _colorArr  = pack.m_InfoTable.getColor().Split('#');
        Transform _lastTrans = m_Caption;

        for (int i = 0; i < _stringArr.Length - 1; i++)
        {
            if (_stringArr[i] != string.Empty)//普通文字
            {
                _lastTrans = LoadCaptionText(_stringArr[i], _lastTrans, Color.white);
            }

            switch (_typeArr[i])
            {
            case 1:     //参数为ID
                int _num = -1;
                if (int.TryParse(pack.m_ParaArr[i], out _num))
                {
                    int _level = GetItemStarLv(_num);
                    if (_level > 0)
                    {
                        _lastTrans = LoadStarItem(_level, _lastTrans);
                    }
                    _lastTrans = LoadClickableText(pack.m_ParaArr[i], _lastTrans, StringToColor(_colorArr[i]));
                }
                else
                {
                    LogManager.LogError(string.Format("解析失败:{0}无法转换成ID@参数:{1}", pack.m_ParaArr[i], i));
                    Debug.Log(string.Format("解析失败:{0}无法转换成ID@参数:{1}", pack.m_ParaArr[i], i));
                }
                break;

            case 2:    //参数为05表索引
                string _name = GameUtils.getString(pack.m_ParaArr[i]);
                if (_name != null)
                {
                    _lastTrans = LoadCaptionText(_name, _lastTrans, StringToColor(_colorArr[i]));
                }
                else
                {
                    Debug.Log(string.Format("索引{0}在05表中无效.name={1}", pack.m_ParaArr[i], _name));
                    LogManager.LogError(string.Format("索引{0}在05表中无效", pack.m_ParaArr[i]));
                }
                break;

            default:    //参数为普通字符串
                _lastTrans = LoadCaptionText(pack.m_ParaArr[i], _lastTrans, StringToColor(_colorArr[i]));
                break;
            }
        }
        if (_stringArr[_stringArr.Length - 1] != string.Empty)//普通文字
        {
            _lastTrans = LoadCaptionText(_stringArr[_stringArr.Length - 1], _lastTrans, Color.white);
        }
    }
示例#2
0
    private CaptionInfoPackage CreatInfoPackage(int captionID, string[] paraArray, bool isSelfInfo)
    {
        CaptionInfoPackage    temp   = null;
        RunhorselightTemplate _table = m_CaptionTable.getTableData(captionID) as RunhorselightTemplate;

        if (_table != null)
        {
            temp             = new CaptionInfoPackage();
            temp.m_InfoTable = _table;
            temp.m_ParaArr   = paraArray;
            temp.IsSelfInfo  = isSelfInfo;

            m_EventNotice.Add(temp);
        }
        return(temp);
    }
示例#3
0
 //降序排序
 private int SortHandler(CaptionInfoPackage pack1, CaptionInfoPackage pack2)
 {
     return(pack2.GetSortKey(m_CurrentUI) - pack1.GetSortKey(m_CurrentUI));
 }