diff --git a/Assets/Scripts/LevelEditor/Editor.cs b/Assets/Scripts/LevelEditor/Editor.cs index 85547c75..7e86d81d 100644 --- a/Assets/Scripts/LevelEditor/Editor.cs +++ b/Assets/Scripts/LevelEditor/Editor.cs @@ -382,7 +382,7 @@ namespace HeavenStudio.Editor private void SaveRemixFile(string path) { - using (FileStream zipFile = File.Open(path, FileMode.Create)) + using (FileStream zipFile = File.Open(path, FileMode.OpenOrCreate)) { using (var archive = new ZipArchive(zipFile, ZipArchiveMode.Update)) { @@ -390,12 +390,14 @@ namespace HeavenStudio.Editor using (var zipStream = levelFile.Open()) zipStream.Write(Encoding.UTF8.GetBytes(GetJson()), 0, Encoding.UTF8.GetBytes(GetJson()).Length); - if (MusicBytes != null) + if ((MusicBytes != null) && (changedMusic == true)) { + Debug.Log("Saving music..."); var musicFile = archive.CreateEntry("song.ogg", System.IO.Compression.CompressionLevel.NoCompression); using (var zipStream = musicFile.Open()) zipStream.Write(MusicBytes, 0, MusicBytes.Length); } + } currentRemixPath = path;