#302
Rod_RealSpace3D
Keymaster

Follow up to previous answer. If you don’t wish to use prefabs and you have created your RS3D AudioSources in the Unity “Inspector” and de-selected “PlayOnStart”, then via script you can do this…

// find all the RS3D AudioSource
RealSpace3D_AudioSource[] theAudioSources = FindObjectsOfType(typeof(RealSpace3D_AudioSource)) as RealSpace3D_AudioSource[];

foreach(RealSpace3D_AudioSource rs3d_AS in theAudioSources)
{
if(rs3d_AS != null && rs3d_AS.GetSoundSourceStarted())
{
rs3d_AS.rs3d_PlaySound();
}
}

That will find the 3D audiosources and play them. Check out the API because if your AudioSource has multiple audio clips attached (no license limit on number of audio clips tied to audio source) you can via the rs3d_PlaySound API play the sound you wish by index or its name.

Post back or send me email if you have difficulties, find bug(s), etc…

-Rod