コード例 #1
0
    public bool Load(string packName, string tabName)
    {
        CSVDoc doc = new CSVDoc();
        // doc.LoadCsvFile(packName, tabName);


        //对数据的有效性进行验证
        PacketRouting pack = PacketManage.Single.GetPacket(packName);

        if (pack == null)
        {
            Debug.LogError("LoadCsvFile 包不存在" + packName);
            return(false);
        }

        string csvcontent = pack.LoadString(tabName);

        if (csvcontent == null)
        {
            Debug.LogError(string.Format("LoadCsvFile 文件不存在 {0}/{1}", packName, tabName));
            return(false);
        }
        doc.LoadCsvFromMem(csvcontent);



        m_reader = new CSVReader(doc);
        return(true);
    }
コード例 #2
0
    void ReLoad(string path)
    {
        m_Data.Clear();
        var doc = new CSVDoc();

        doc.LoadCsvFromMem(FileSystem.byte2string(FileSystem.ReadFile(path)));
        var reader = new CSVReader(doc);

        MFAModelClipsInfo.FillFieldIndex(reader);

        int count = reader.RowCount;

        for (int row = 0; row < count; row++)
        {
            var info = new MFAModelClipsInfo(reader, row);
            m_Data.Add(info.Name, info);
        }
    }
コード例 #3
0
    void ReLoad(string path)
    {
        m_Data.Clear();

        var doc = new CSVDoc();

        doc.LoadCsvFromMem(FileSystem.byte2string(FileSystem.ReadFile(path)));
        var reader = new CSVReader(doc);

        MFAClipDefineInfo.FillFieldIndex(reader);

        int count = reader.RowCount;

        for (int row = 0; row < count; row++)
        {
            var info = new MFAClipDefineInfo(reader, row);

            if (m_Data.ContainsKey(info.Name))
            {
                throw new Exception(string.Format("表{0}中存在重复的名称 {1}", TabName, info.Name));
            }
            m_Data.Add(info.Name, info);
        }
    }