|
Post by JackMariani on Jun 1, 2015 17:18:43 GMT
Hi everyone!
I'd like to do as follows, using code:
- Check if a clip is playing on the playlist. -> if the clip is not playing I'd like to let it start
I think I should do something like:
--------------------
if (SOMETHING) //check if "Name of the Clip" is playing MasterAudio.TriggerPlaylistClip("Name of the Clip");
--------------------
Is there any way I can achieve this? Thank you very much.
|
|
|
Post by DarkTonic Dev on Jun 1, 2015 23:53:10 GMT
Sure, use this. This is all on the API website, if you haven't been there var controller = PlaylistController.Instances[0]; // use if you have only one Playlist Controller, otherwise use InstancesByName instead. var activeAudioClip = controller.ActiveAudioSource.clip; if (activeAudioClip == null || activeAudioClip.name != "Name of the Clip") { MasterAudio.TriggerPlaylistClip("Name of the Clip"); }
|
|