linch
New Member
Posts: 9
Posts: 9
|
Post by linch on Oct 3, 2023 15:53:08 GMT
Hi there, I've been using Master Audio for almost every one of my projects, but there is a problem that has been bothering me for a long time. I wonder if there is a proper way to restart the playlist only when it is not playing. For instance, I want Scene A and Scene B to play the "Happy Theme," while Scene C plays no song. When I load the scene from A to B, I hope the code can detect that the "Happy Theme" is already playing and do nothing instead of restarting the song and playing it from the beginning. On the other hand, when I load Scene C, the playlist should stop. When I load from scene C to A, Master Audio should know that "Happy Theme" was stopped and will restart the playlist from the beginning. Here is the code I'm using, but it's not working every time. Please help! 
|
|
|
Post by DarkTonic Dev on Oct 4, 2023 13:08:16 GMT
You can detect if it's not playing like this:
if (PlaylistController.InstanceByName("MyPlaylistControllerName").PlaylistState != PlaylistController.PlaylistStates.Playing) { // do something. }
|
|
linch
New Member
Posts: 9
Posts: 9
|
Post by linch on Oct 4, 2023 18:30:24 GMT
Thank you! It's working!
|
|
|
Post by DarkTonic Dev on Oct 4, 2023 18:50:21 GMT
No problem!
|
|