Esempio n. 1
0
 public void SaveAll()
 {
     SerializedGameLevels.Serialize(SerializedGameLevels.gameLevels, Application.dataPath + "/8BD/Resources/" + Constants.GameLevelsXML + ".xml");
     Debug.Log("Saving : " + currentLevel.sz.mapName);
     Map2D.Save(currentLevel.map, currentLevel.sz.mapName);
     UnityEditor.AssetDatabase.Refresh();
     PopulateLoad();
 }
Esempio n. 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);
        }
Esempio n. 3
0
 private void Test()
 {
     map = new Map2D();
     map.Create(32, 20);
     Map2D.Save(map, "test_map1");
 }