public void LoadLevelFromDropdown() { Dropdown cbx = GameObject.Find("drpLoad").GetComponent <Dropdown>(); currentLevel.Destroy(); currentLevel = SerializedGameLevels.getLevel(cbx.options[cbx.value].text); }
// Use this for initialization void Start() { Game.game.Initialize(); Init(); currentLevel = SerializedGameLevels.getLevel("testlevel"); }
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); }