Unity-Technologies / NativeAudioPlugins

MIT License
135 stars 28 forks source link

BUG: Custom GUIs won't update once a parameter has been changed #14

Open DanielRudrich opened 8 months ago

DanielRudrich commented 8 months ago

Summary

With two or more plug-in instances active in an AudioMixer (e.g. in two Groups), the Custom GUI won't reflect the plug-in parameter's state after a parameter has been set via the Custom GUI's script. It only shows the last set value independent of the plug-in instance.

In code words:

after calling

plugin.SetFloatParameter("parameterName", value);

in IAudioEffectPluginGUI's OnGUI(IAudioEffectPlugin plugin) method,

plugin.GetFloatParameter("parameterName", out float value);

always returns the value which was set most recently, independent on which plugin instance is currently selected.

Steps to reproduce

I don't think this is a bug of this repository, but rather one in Unity itself. Or is there something you can do in the scripts to prevent this from happening?

This behaviour renders the CustomGUI feature unusable if the GUI is used to change parameter values and not only displays them (like in all the UI examples in this repository).

DanielRudrich commented 8 months ago

Related Unity Issue: https://issuetracker.unity3d.com/issues/vertical-bar-position-on-demo-audio-effect-does-not-match-their-values-when-using-two-sibling-audio-groups-with-the-same-demo-audio-effect-on