游戏达人
- 贡献度
- 420
- 金元
- 16225
- 积分
- 3333
- 精华
- 3
- 注册时间
- 2014-11-13
|
BTW,或许我们不用打包回去的
public void GetDate(string dateName, Dictionary<int, Dictionary<int, string>> dateList, int passDateIndex = -1)
{
dateList.Clear();
string path = string.Format("{0}/Data/{1}.txt", this.dataPath, dateName);
string text;
if (File.Exists(path))
{
text = File.OpenText(path).ReadToEnd();
}
else
{
text = this.baseGameDate[dateName];
}
string[] array = text.Replace("\r", "").Split(new char[]
{
"\n"[0]
});
string[] array2 = array[0].Split(new char[]
{
','
});
for (int i = 0; i < array.Length; i++)
{
string[] array3 = array[i].Split(new char[]
{
','
});
if (array3[0] != "#" && array3[0] != "")
{
Dictionary<int, string> dictionary = new Dictionary<int, string>();
for (int j = 0; j < array2.Length; j++)
{
if (array2[j] != "#" && array2[j] != "" && int.Parse(array2[j]) != passDateIndex)
{
for (int k = 0; k < this.textColorKeys.Count; k++)
{
array3[j] = array3[j].Replace("C_" + this.textColorKeys[k], this.textColor[this.textColorKeys[k]][0]);
}
array3[j] = array3[j].Replace("C_D", "</color>");
dictionary.Add(int.Parse(array2[j]), Regex.Unescape(array3[j]));
}
}
dateList.Add(int.Parse(array3[0]), dictionary);
}
}
}
这证明或许我们在The Scroll Of Taiwu Alpha V1.0_Data建立一个data\GongFa_Date.txt,之后unity会自动读取这个txt而非数据库之中原有的数值 |
|