# Unity v2 Integration v1.07.06: ParamRefDrawer generates errors

**URL:** <https://qa.fmod.com/t/unity-v2-integration-v1-07-06-paramrefdrawer-generates-errors/12294>\
**Category:** Unity\
**Created:** [February 9, 2016, 2:35am UTC](https://qa.fmod.com/t/unity-v2-integration-v1-07-06-paramrefdrawer-generates-errors/12294 "2016-02-09T02:35:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ragtag](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/ragtag/32/626_2.png) [@ragtag](https://qa.fmod.com/u/ragtag)\
**Post date:** [February 9, 2016, 2:35am UTC](https://qa.fmod.com/t/unity-v2-integration-v1-07-06-paramrefdrawer-generates-errors/12294/1 "2016-02-09T02:35:23Z")

</div>

Sorry I did not see where to report bugs is this is the wrong place to do it:

ParamRefDrawer generates errors when viewed in the inspector:

> ArgumentException: GUILayout: Mismatched LayoutGroup.Repaint  
> UnityEngine.GUILayoutUtility.BeginLayoutGroup (UnityEngine.GUIStyle  
> style, UnityEngine.GUILayoutOption options, System.Type layoutType)  
> (at  
> C:/buildslave/unity/build/Runtime/IMGUI/Managed/GUILayoutUtility.cs:264)  
> UnityEditor.EditorGUILayout.BeginHorizontal (UnityEngine.GUIContent  
> content, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption  
> options) (at C:/buildslave/unity/build/Editor/Mono/EditorGUI.cs:6765)  
> UnityEditor.EditorGUILayout.BeginHorizontal  
> (UnityEngine.GUILayoutOption options) (at  
> C:/buildslave/unity/build/Editor/Mono/EditorGUI.cs:6744)  
> UnityEditor.InspectorWindow.AddComponentButton (UnityEditor.Editor  
> editors) (at  
> C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1368)  
> UnityEditor.InspectorWindow.OnGUI () (at  
> C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:379)  
> System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags  
> invokeAttr, System.Reflection.Binder binder, System.Object  
> parameters, System.Globalization.CultureInfo culture) (at  
> /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)

The line at 20:  
EditorGUILayout.Slider(valueProperty, 0, 1.0f, nameProperty.stringValue);

Should be changed to:  
EditorGUI.Slider(position, valueProperty, 0.0f, 1.0f, nameProperty.stringValue);

---

<div class="post-metadata">

**Author:** ![nick1](https://avatars.discourse-cdn.com/v4/letter/n/47e85d/32.png) [@nick1](https://qa.fmod.com/u/nick1)\
**Post date:** [February 9, 2016, 3:19am UTC](https://qa.fmod.com/t/unity-v2-integration-v1-07-06-paramrefdrawer-generates-errors/12294/2 "2016-02-09T03:19:03Z")

</div>

ParamRefDrawer.cs has been removed in upcoming versions of the Unity Integration. The ParamRef class is internal to the StudioEventEmitter and serves no purpose in outside code.

---

<div class="post-metadata">

**Author:** ![ragtag](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/ragtag/32/626_2.png) [@ragtag](https://qa.fmod.com/u/ragtag)\
**Post date:** [February 9, 2016, 3:40am UTC](https://qa.fmod.com/t/unity-v2-integration-v1-07-06-paramrefdrawer-generates-errors/12294/3 "2016-02-09T03:40:53Z")

</div>

> [@](#):
>
> ParamRefDrawer.cs has been removed in upcoming versions of the Unity Integration. The ParamRef class is internal to the StudioEventEmitter and serves no purpose in outside code.

The purpose it serves in outside code is the same as the EventRef attribute. Standardize the serialization and inspector presentation of fundamental data use by the FMOD system in Unity.

Developers will need to be able to serialize parameter data. Not all games will store data in instances of StudioEventEmitter components.

If it is going to be removed is there going to be a standard for serializing and inspecting parameters in Unity or is the expectation that we roll our own again?

Does this mean there is going to be yet another data migration because public facing classes are going to be removed/updated again?

Is there a road map for these kinds of things to help us prepare?

---

<div class="post-metadata">

**Author:** ![nick1](https://avatars.discourse-cdn.com/v4/letter/n/47e85d/32.png) [@nick1](https://qa.fmod.com/u/nick1)\
**Post date:** [February 9, 2016, 4:00am UTC](https://qa.fmod.com/t/unity-v2-integration-v1-07-06-paramrefdrawer-generates-errors/12294/4 "2016-02-09T04:00:34Z")

</div>

ParamRef itself is not going to do disappear. But what value would the current UI code add (if it worked)? It doesn’t know the min, max, or default values for a parameter, it can’t automatically validate parameter names against any event. I don’t see it being to add any value above the default UI code generated by Unity.

---

<div class="post-metadata">

**Author:** ![ragtag](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/ragtag/32/626_2.png) [@ragtag](https://qa.fmod.com/u/ragtag)\
**Post date:** [February 9, 2016, 4:18am UTC](https://qa.fmod.com/t/unity-v2-integration-v1-07-06-paramrefdrawer-generates-errors/12294/5 "2016-02-09T04:18:52Z")

</div>

It is good to hear that ParmRef is not going to disappear. I interpreted your comment about it not having use outside StudioEventEmitter as it being deprecated as a publicly accessible class along with the drawer.

I agree it would be better to have something that would do those things you mentioned. If you’re suggesting that the drawer class is going to be replaced by a more useful inspector implementation that will do those things then that would make me very happy.

As it stands we have had to roll our own custom inspector for parameter data that does do those things you mention, and I would prefer to use a standardized implementation provided by FMOD.

---

<div class="post-metadata">

**Author:** ![nick1](https://avatars.discourse-cdn.com/v4/letter/n/47e85d/32.png) [@nick1](https://qa.fmod.com/u/nick1)\
**Post date:** [February 9, 2016, 6:34am UTC](https://qa.fmod.com/t/unity-v2-integration-v1-07-06-paramrefdrawer-generates-errors/12294/6 "2016-02-09T06:34:41Z")

</div>

In the longer term we could add a ParmaRef attribute such as [https://gist.github.com/fmod-nick/4e452d142c427d541553](https://gist.github.com/fmod-nick/4e452d142c427d541553) which would give the UI the extra information it would need to be worthwhile.
