menu
 

La section Questions et réponses de la communauté Audiokinetic est un forum où les utilisateurs de Wwise et de Strata peuvent poser des questions et répondre à celles des autres membres de la communauté. Si vous souhaitez obtenir une réponse de la part de l'équipe de soutien technique d'Audiokinetic, veillez à utiliser le formulaire de Tickets de Soutien.

0 votes
Hello all,

 

I've made an RTPC in my Wwise project and am wondering how to access this in Unity - is there some kind of template script in the integration that I'm missing?

 

Thanks!
dans General Discussion par Tim A. (100 points)

3 Réponses

0 votes
Hi Tim,

 

You can use the scripts that come with the wwise integration such as AkState and AkSwitch.

Those scripts provide a base, so you'll have to enter the state/switch group and value names and IDs in the script.

 

Arnaud.
par Arnaud B. (310 points)
0 votes
Hello again!

 

For RTPC's you'll need to call the SetRTPCValue() function in your script.

 

Arnaud
par Arnaud B. (310 points)
Ah! That's great - thank you :)
+1 vote

You can use this:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class RTPCListener : MonoBehaviour {


    //set your RTPCID to the name of your desired gameparameter (under GameSyncs)
    public string rtpcID;

    // Update is called once per frame
    void Update () {

        // RTPCValue_type.RTPCValue_Global
        // for whatever reason, this constant isn't exposed by name by WWise C#/Unity headers
        int type = 1;

        // will contain the value of the RTPC parameter after the GetRTPCValue call
        float value;

        // retrieves current value of the RTPC parameter and stores it in 'value'
        AkSoundEngine.GetRTPCValue( rtpcID, gameObject, 0, out value, ref type );

        //
        // use 'value' here
        //
        // e.g. transform.localScale += Vector3( value, 0, 0 );
        // which would scale by the value of the RTPC parameter
}

par Kristina W. (490 points)
Would you be able to elaborate more for someone whos barely familiar with c# and still struggling with RTPC implementation?
for example:
what should i exactly replace in ( rtpcID, gameObject, 0, out value, ref type )?i already know that i should replace the rtpcID with the RTPC name in Wwise,i assume gameObject should be left gameObject,but what about out value and ref type?
and what about this?
  // use 'value' here
i would be MORE THAN GRATEFUL for your help,as the RTPC implementation in unity is the only thing i am still struggling with,
thank you!
...