Does anyone know whether JUCE 8 is up-to-date with the lastest Unity SDK? I’m wondering because when I compile a plugin for Unity, the associated script is buggy when it comes to drawing a custom UI.
public override bool OnGUI(IAudioEffectPlugin plugin)
{
...
float[] arr;
plugin.GetFloatBuffer("Size", out arr, 6); // RANDOM NUMBERS
Rect r = GUILayoutUtility.GetRect( // BAD CALL
arr[0],
arr[1],
new GUILayoutOption[] {
GUILayout.MinWidth(arr[2]),
GUILayout.MinHeight(arr[3]),
GUILayout.MaxWidth(arr[4]),
GUILayout.MaxHeight(arr[5])
}
);
...
}
After allocating 6 floats for arr, arr is uninitialized. A follow-up call to GetRect leads to undesired behavior, meaning that the GUI is not painted. When I changed this part to
Rect r = GUILayoutUtility.GetRect(200, 150, GUILayout.ExpandWidth(true));
everything worked as expected. I also had to correct the auto-generated name of the plugin and the DLL.