コード例 #1
0
    // 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);
        }
    }
コード例 #2
0
    public void InitData()
    {
        ParserXML parse = new ParserXML();

        parse.LoadFile("LevelsInfo");
        levels.Clear();

        levels = parse.GetAllLevels();
    }