fix nasty bugs with saving / loading

- duplicate property names no longer soft crash loading (thanks, tap trial)
- fix remix saving nothing music
This commit is contained in:
minenice55
2022-09-03 21:51:37 -04:00
parent 68c1802e87
commit 7084d96cc1
4 changed files with 77 additions and 39 deletions

View File

@ -307,18 +307,31 @@ namespace HeavenStudio.Editor
try
{
if (clip != null)
MusicBytes = OggVorbis.VorbisPlugin.GetOggVorbis(Conductor.instance.musicSource.clip, 1);
MusicBytes = OggVorbis.VorbisPlugin.GetOggVorbis(clip, 1);
else
{
MusicBytes = null;
Debug.LogWarning("Failed to load music file! The stream is currently empty.");
}
}
catch (System.Exception)
catch (System.ArgumentNullException)
{
clip = null;
MusicBytes = null;
Debug.LogWarning("Failed to load music file! The stream is currently empty.");
}
catch (System.ArgumentOutOfRangeException)
{
clip = null;
MusicBytes = null;
Debug.LogWarning("Failed to load music file! The stream is malformed.");
}
catch (System.ArgumentException)
{
clip = null;
MusicBytes = null;
Debug.LogWarning("Failed to load music file! Only 1 or 2 channels are supported!.");
}
return clip;
}