private void Serialize(string jsonPath, BuildEnvironmentOption buildEnvironment) { var json = JsonUtility.ToJson(buildEnvironment, true); using (var sw = new StreamWriter(jsonPath)) { sw.WriteLine(json); } }
public void SaveJson(string environment, BuildEnvironmentOption buildEnvironment) { if (!Directory.Exists(JSON_FILE_PATH)) { Directory.CreateDirectory(JSON_FILE_PATH); } string fileName = $"{environment}.json"; string path = Path.Combine(JSON_FILE_PATH, fileName); Serialize(path, buildEnvironment); }