コード例 #1
0
        private void Serialize(string jsonPath, BuildEnvironmentOption buildEnvironment)
        {
            var json = JsonUtility.ToJson(buildEnvironment, true);

            using (var sw = new StreamWriter(jsonPath))
            {
                sw.WriteLine(json);
            }
        }
コード例 #2
0
        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);
        }