I’ve used the EventBrowser.cs as well as EditorUtils.cs to create my own Audio preview editor in Unity, and I’m able to play event sounds just like the Event Browser.
The issue I’m running into is that I can’t figure out how to preview/access Programmer sounds.
I can’t figure out how to access an AudioTable and assign it to an EditorEventRef through the Editor. Kind of like we would do in-game:
eventInstance.setUserData(GCHandle.ToIntPtr(stringHandle));
eventInstance.setCallback(dialogueCallback);
I can’t seem to find an example to go from in the FMOD Editor menu options, making me wonder if its possible or not.
UPDATE:
To be more precise, I’m trying to understand how to call the equivalent methods between EventInstance methods and EditorEventRef (Or at least I assume that is the right way to go at this).
For example, if I want to change a parameter in a Editor instance rather than doing:
eventInstance.setParameterByName("parameterName", parameterValue);
I do:
foreach (EditorParamRef selectedParamRef in eventRef.Parameters) {
if (selectedParamRef.Name == "parameterName") selectedParamRef.Default = parameterValue;
}
My question is, how can I do this for the following methods (used for Programmer sounds)?
eventInstance.setUserData(GCHandle.ToIntPtr(stringHandle));
eventInstance.setCallback(dialogueCallback);