public override void LoadLevel() { if (levelName != "") { string levelString = fileHandler.LoadLevel(levelName); IntegerGrid levelData = JsonUtility.FromJson <IntegerGrid>(levelString); creator.Init(levelData.size, levelName); foreach (PositionTile tileData in levelData.tiles) { creator.PlaceTile((TileInteger)tileData.tile, tileData.position); } if (LevelLoaded != null) { LevelLoaded(); } } }
public void CreateLevel() { levelCreator.Init(Vector3Int.one * Int32.Parse(sizeField.text), levelNameField.text); levelCreationMenu.SetActive(false); }