Пример #1
0
 public Characters(SerializedGameLevel lvl)
 {
     characters.Clear();
     foreach (SerializedCharacterInstance sc in lvl.characters)
     {
         characters.Add(new Character(sc));
     }
     //characters = lvl.characters;
 }
Пример #2
0
        public void CreateNew()
        {
            SerializedGameLevel gl = new SerializedGameLevel();

            gl.crtSettings_id = "crt";
            gl.mapName        = GameObject.Find("inpMapName").GetComponent <InputField>().text;
            gl.name           = GameObject.Find("inpNewName").GetComponent <InputField>().text;

            Map2D map = new Map2D();
            int   x   = int.Parse(GameObject.Find("inpX").GetComponent <InputField>().text);
            int   y   = int.Parse(GameObject.Find("inpY").GetComponent <InputField>().text);

            map.Create(x, y);
            Map2D.Save(map, gl.mapName);

            SerializedGameLevels.gameLevels.levels.Add(gl);
            SaveAll();

            currentLevel.Destroy();
            currentLevel = SerializedGameLevels.getLevel(gl.name);
        }
Пример #3
0
 public GameLevel(SerializedGameLevel s)
 {
     sz = s;
     Initialize();
     characters = new Characters(s);
 }