|
Post by scornflake on Jun 1, 2022 10:08:07 GMT
I'm wanting to allow a user to disable some/any/all of the songs in the games music. Assuming I have a way to do this in the UI - is there a way to do this in MA?
I have a playlist running fine at the moment. It runs and does its thing, as expected. Yay!
I've got it to play any song from itself (user presses 'play' on a song in the list)...
public void BeginPlayAudioItem(MusicSetting musicItem)
{
MasterAudioPlaylist.StopPlaylist();
MasterAudioPlaylist.StartPlaylist(MasterAudioPlaylist.PlaylistName, musicItem.songName);
}
but there doesn't seem to be a way to disable specific songs in the defined playlist. By that I mean the playlist as defined in Unity, linked to the MA instance. In my case there is just one playlist.
btw: the list is not atm built dynamically. its all compile time. I just need/want some songs to be able to be skipped. (i.e: if disabled)
|
|
|
Post by DarkTonic Dev on Jun 1, 2022 14:17:06 GMT
There's no way to have to auto-advance through the songs and skip certain ones. However if you're playing individual songs, you could set up & use song Metadata to filter out songs any way you like and choose another one from the filtered list.
-Brian
|
|
|
Post by scornflake on Jun 2, 2022 0:41:50 GMT
by "use song Metadata", do you mean: make my own "playlist state controller", which then plays one song at a time through MA?
i.e: manipulate a playlist at runtime via PlaylistControler.CurrentPlaylist.MusicSettings? Dunno if that works at runtime (hence asking if this was also the direction you were thinking of).
|
|
|
Post by DarkTonic Dev on Jun 2, 2022 2:13:21 GMT
Yes. There's a Song Metadata feature built in, but requires code to do anything with the Metadata. There's an example on the documentation website. You wouldn't manipulate the Playlist at runtime, you would set up the metadata for each song ahead of time, then use code to find your song and play it.
|
|