// Use this for initialization void Awake() { levels = new Dictionary <string, List <GameObject> >(); ParserXML parse = new ParserXML(); parse.LoadFile("LevelsInfo"); Dictionary <string, Dictionary <string, int> > levelParse = parse.GetAllLevels(); Dictionary <string, Dictionary <string, int> > .KeyCollection levelParseKeys = levelParse.Keys; mainLevelsName = new string[levelParseKeys.Count]; int i = 0; foreach (string main in levelParse.Keys) { mainLevelsName[i] = main; ++i; string[] mainYlevels = new string[(levelParse[main].Keys).Count]; (levelParse[main].Keys).CopyTo(mainYlevels, 0); levels[main] = new List <GameObject>(); CreateLevels(main, mainYlevels); } }
public void InitData() { ParserXML parse = new ParserXML(); parse.LoadFile("LevelsInfo"); levels.Clear(); levels = parse.GetAllLevels(); }