Hello,
we have started getting errors with our FMOD Unity integration in the editor recently.
We are using Unity 5.2.4f1 and the FMOD Studio Unity Integration 1.08.04. We are not doing any specific platform build, just working for Windows on a PC.
It looks like it has something to do with the OnGUI events. The errors we get on the console are these ones:
It happens when we use a parameter on our own scripts (for example, having a [FMODUnity.EventRef] public string):
NullReferenceException: Object reference not set to an instance of an object
FMODUnity.EventRefDrawer.OnGUI (Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label) (at Assets/Plugins/Editor/FMOD/EventRefDrawer.cs:53)
UnityEditor.PropertyDrawer.OnGUISafe (Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label) (at C:/buildslave/unity/build/Editor/Mono/ScriptAttributeGUI/PropertyDrawer.cs:23)
UnityEditor.PropertyHandler.OnGUI (Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, Boolean includeChildren) (at C:/buildslave/unity/build/Editor/Mono/ScriptAttributeGUI/PropertyHandler.cs:134) …
…
Or when trying to look at an item on the Event Browser from the FMOD top menu:
NullReferenceException: Object reference not set to an instance of an object
FMODUnity.EventBrowser.PreviewEvent (Rect previewRect, FMODUnity.EditorEventRef selectedEvent) (at Assets/Plugins/Editor/FMOD/EventBrowser.cs:651)
FMODUnity.EventBrowser.OnGUI () (at Assets/Plugins/Editor/FMOD/EventBrowser.cs:473)
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)
At first we didn’t have this issues for a long time using the integration, but now the only thing that I can think of that can have some relation to when it started happening, is that we changed the Asset Serialization Mode to “Force Text”.
Could this be the reason for the error showing up now? I’ve been looking around but haven’t seen anything that solves the problem. The most similar thing that I’ve found is this issue: http://www.fmod.org/questions/question/forum-39671/ , but it’s been 3 years since that and, as the answer suggests, I think that problem would be solved now.
Has anybody faced a similar error or know how to solve this?
Thank you very much!