private void AddOverworldToOverworldList() { OverworldNamesData overworldNameData = new OverworldNamesData(_overworldName).AddOverworldName(_overworldName); JsonOverworldListFileWriter fileWriter = new JsonOverworldListFileWriter(); fileWriter.SerialiseData(overworldNameData); }
public void SerialiseData <T>(T levelNamesData) { _levelNamesData = levelNamesData as OverworldNamesData; _path = Path.Combine(Application.dataPath, "StreamingAssets", "overworld", "levels.json"); string jsonLevelNamesData = JsonUtility.ToJson(_levelNamesData, true).ToString(); File.WriteAllText(_path, jsonLevelNamesData); }