private void LoadLevels() { SettingReader.Load("Levels", (l, i) => { string name = l.GetString(i, "Name"); string nikeName = l.GetString(i, "NikeName"); LevelsInfo.Add(name, nikeName); }); }
private void LoadDiaries() { SettingReader.Load("DiariesText", (l, i) => { int id = l.GetInteger(i, "Id"); string t = l.GetString(i, "Text"); DocsDesc.Add(id, t); }); }
public void CreateLevelItem() { // 创建日志的道具 string fileName = LevelName; // 根据类型,创建不同的对象 SettingReader.Load(fileName, (l, i) => { string path = l.GetString(i, "Prefab"); float x = l.GetFloat(i, "PosX"); float y = l.GetFloat(i, "PosY"); string name = l.GetString(i, "Name"); var o = Resources.Load(path) as GameObject; var item = Instantiate(o) as GameObject; item.name = name; item.transform.position = new Vector3(x, y, 0); item.transform.rotation = Quaternion.identity; }); }