|
Post by Colin on May 6, 2022 19:23:45 GMT
Hi, I'm working a project that use a playlist controller to switch between differents songs. I have different "main" songs that are in the playlist at the start. I have a video player that adds a song to the playlist when the video is played. Currently, the video song is added, the song starts and the fade between the 2 songs work perfectly. I want my user to be able to pause the video and the song and unpause it. When i call MasterAudio.Unpause(), i get this error. NullReferenceException: Object reference not set to an instance of an object DarkTonic.MasterAudio.PlaylistController.GetClipDuration (UnityEngine.AudioSource src) (at Assets/_External/Plugins/DarkTonic/MasterAudio/Scripts/Utility/PlaylistController.cs:1920) I fixed it by adding this checker at line 885 of the masteraudio PlayListController script. if (_transitioningAudio.clip != null) { ScheduleClipPlay(newSongStartOffset, _transitioningAudio, true); } I'm 80% sure I didnt have this error before upgrading my unity version, but I thought i should let you know. I might not be using your features correctly, and if you think its the case with the few lines I just wrote, please let me know Thank you and have a nice day! Colin
|
|
|
Post by DarkTonic Dev on May 6, 2022 23:51:48 GMT
Hm, I will need to be able to reproduce it to fix it. Tell me, what Audio Origin are you using for your song: Audio Clip, Addressable, Resource file? If it's an Audio Clip, is Preload Audio Data checked or unchecked? Easiest would be for you to send me a stripped down example Scene that reproduces it. I definitely don't have code handy that adds a song to the Playlist, that will probably be hard to reproduce.
Thanks, -Brian
|
|