internal static MusicTrack ParseAsset(BinaryReader reader, Asset asset, AssetImportCollection imports) { var result = new MusicTrack(); result.SetNameAndInstanceId(asset); ParseAsset(reader, result); result.File = imports.GetImportedData <AudioFile>(reader); return(result); }
public void PlayMusicTrack(MusicTrack musicTrack, bool fadeIn, bool fadeOut) { // TODO: fading if (_currentTrack != null) { _currentTrack.Stop(); _currentTrack.Dispose(); } _currentTrackName = musicTrack.Name; _currentTrack = GetStream(musicTrack.File.Value.Entry); _currentTrack.Volume = (float)musicTrack.Volume; _currentTrack.Play(); }