I can’t see any of my local parameters in the Unity ParamRef browser. Is that by design? Is there any way to see their names from unity’s editor?
Just to clarify- are you doing something like:
[FMODUnity.ParamRef]
public string myParam;
and asking why you can’t see local parameters? If so, the FMODUnity.ParamRef
attribute is intended to be used on global parameters. This does make sense as a limitation because if you could see local parameters globally, they would no longer be local. A good way to see which parameters are available on which events, and to audition them within the Unity Editor, is to use the Event Browser.
Oh awesome! I wasn’t aware of the Event Browser. I’ll just use:
EventManager.EventFromPath();
And then read the local parameters from there. Thank you!
Hi Jeff. So how can we create a refference to the the fmod local parameter to use in code if we can’t use [ParamRef] ?
You can get a list of event-level parameters by calling EventReference.GetEventDescription
on a Studio Event Emitter instance to get the underlying EventDescription
object, and from there you can get a count of parameters using EventDescription.getParameterDescriptionCount
, and iterate over them using EventDescription.getParameterDescriptionByIndex
to build up a list of PARAMETER_DESCRIPTION
.
From these parameter descriptions, you have access to their names, min-max values etc, which you can use to pass into EventInstance.setParameterByName
.