コード例 #1
0
    void AddWave(JSONNode content)
    {
        print(content);
        for (int a = 0; a < content.Count; a++)
        {
            List <Enemy.types> enemies = new List <Enemy.types> ();
            for (int b = 0; b < content [a] ["enemies"].Count; b++)
            {
                Enemy.types type = Enemy.types.MEDIUM;
                switch (content [a] ["enemies"][b])
                {
                case "0":
                    type = Enemy.types.MEDIUM;
                    break;

                case "1":
                    type = Enemy.types.SMALL;
                    break;

                case "2":
                    type = Enemy.types.BIG;
                    break;
                }
                enemies.Add(type);
                print("________" + content [a] ["enemies"] [b] + " type: " + type);
            }
            int delay = int.Parse(content [a] ["delay"]);
            waves.AddWave(enemies, delay);
        }
    }