Calling this function creates Garbage due to the internal code.
public RESULT setParameterValue(string name, float value)
{
return FMOD_Studio_EventInstance_SetParameterValue(rawPtr, Encoding.UTF8.GetBytes(name + Char.MinValue), value);
}
Is there an alternative way to set the parameter, i.e. by caching the parameter instance. The API seems to have hidden the instances pretty well for some reason. Is there another API that I should be using for this?
Is there an example somewhere of parameter being set every frame in Unity?
If you are worried about excess garbage then it’s probably a better idea to create your own class for playing sounds and getting/setting parameters.
StudioEventEmitter can still be used as a guide.
Thank you. Anyone developing games in unity would(should be) concerned about per frame garbage. It is a core issue with developing games in managed languages. There are some easy things you could do to fix this.