• Author
    Posts
  • #1265

    Rod_RealSpace3D
    Keymaster

    Our API manual needs to be updated but for those looking for how to load their RS3D AudioSources with the Unity Mixer via script. Below are the API calls and a sample…

    void rs3d_LoadAudioMixerGroup(string sAudioMixer, string sAudioMixerGroup, int nIndex);

    void rs3d_LoadAudioMixerGroup(AudioMixerGroup theAMG, int nIndex)

    Sample use…

    theAudioSource = GameObject.Find(“Cube”).GetComponent(“RealSpace3D_AudioSource”) as RealSpace3D.RealSpace3D_AudioSource;

    void LoadAudioMixerGroup()
    {
    AudioMixer theAMG = Resources.Load(“RodsAudioMixer”) as AudioMixer;

    if(theAMG == null)
    {
    Debug.LogWarning(“Could not load RodsAudioMixer”);
    return;
    }

    theAudioSource.rs3d_LoadAudioMixerGroup(theAMG.FindMatchingGroups(“Master”)[0], 0);

    theAudioSource.rs3d_LoadAudioMixerGroup(“RodsAudioMixer”, “SlickRickDaRuler”, 1);
    }

You must be logged in to reply to this topic.