Exemple #1
0
    private void ReadData()
    {
        textData.Clear();
        string    csvStr = ((TextAsset)Resources.Load(FILE_PATH, typeof(TextAsset))).text;
        CSVLoader loader = new CSVLoader();

        // loader.ReadFile(fileName);
        loader.ReadMultiLine(csvStr);
        int languageIndex = loader.GetFirstIndexAtRow(GetLanguageAB(language), 0);

        if (-1 == languageIndex)
        {
            Debug.LogError("未读取到" + language + "任何数据,请检查配置表");
            return;
        }
        int tempRow = loader.GetRow();

        for (int i = 0; i < tempRow; ++i)
        {
            textData.Add(loader.GetValueAt(0, i), loader.GetValueAt(languageIndex, i));
        }
    }