In quite a few cases, the Unity Analytics Tracker GUI “breaks” if it is referencing, for example a field on an object as a dynamic parameter, and then the source code for the object changes such that that parameter no longer exists.
For example, suppose we have a GameObject, and we’re logging its “DriveableObject.driveableName”. If the member driveableName is then renamed to e.g. drivableIdentifier, then the Analytics tracker refresh throws an exception at TrackableField.cs:48.
Is there a quick way to work around this? The problem is that any of our engineers can recognize and fix this, but our designers can’t, and the Standard Events are kind of about keeping the engineers independent from Analytics implementation.
We’re using Unity 2017.4 (.6 or something, typically whatever’s latest) and the current Asset Store package. We can’t move away from the package as we need to modify the standard events source code ourselves in a number of ways.
NullReferenceException: Object reference not set to an instance of an object
UnityEngine.Analytics.Experimental.Tracker.TrackableField.GetValue () (at Assets/Services/Analytics/Tracker/TrackableProperty/TrackableField.cs:48)
UnityEngine.Analytics.Experimental.Tracker.ValueProperty.IsValid () (at Assets/Services/Analytics/Tracker/TrackableProperty/ValueProperty.cs:91)
UnityEngine.Analytics.Experimental.Tracker.StandardEventPayloadDrawer.ParametersGUI (Rect position, UnityEditor.SerializedProperty property, Boolean draw) (at Assets/Services/Analytics/Tracker/Payload/Editor/StandardEventPayloadDrawer.cs:300)
UnityEngine.Analytics.Experimental.Tracker.StandardEventPayloadDrawer.OnGUI (Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, Boolean draw) (at Assets/Services/Analytics/Tracker/Payload/Editor/StandardEventPayloadDrawer.cs:71)
UnityEngine.Analytics.Experimental.Tracker.StandardEventPayloadDrawer.GetPropertyHeight (UnityEditor.SerializedProperty property, UnityEngine.GUIContent label) (at Assets/Services/Analytics/Tracker/Payload/Editor/StandardEventPayloadDrawer.cs:420)
UnityEditor.PropertyDrawer.GetPropertyHeightSafe (UnityEditor.SerializedProperty property, UnityEngine.GUIContent label) (at /Users/builduser/buildslave/unity/build/Editor/Mono/ScriptAttributeGUI/PropertyDrawer.cs:36)
UnityEditor.PropertyHandler.GetHeight (UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, Boolean includeChildren) (at /Users/builduser/buildslave/unity/build/Editor/Mono/ScriptAttributeGUI/PropertyHandler.cs:216)
UnityEditor.PropertyHandler.OnGUILayout (UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, Boolean includeChildren, UnityEngine.GUILayoutOption[ ] options) (at /Users/builduser/buildslave/unity/build/Editor/Mono/ScriptAttributeGUI/PropertyHandler.cs:201)
UnityEditor.EditorGUILayout.PropertyField (UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, Boolean includeChildren, UnityEngine.GUILayoutOption[ ] options) (at /Users/builduser/buildslave/unity/build/Editor/Mono/EditorGUI.cs:8116)
UnityEditor.EditorGUILayout.PropertyField (UnityEditor.SerializedProperty property, UnityEngine.GUILayoutOption[ ] options) (at /Users/builduser/buildslave/unity/build/Editor/Mono/EditorGUI.cs:8098)
UnityEngine.Analytics.Experimental.Tracker.AnalyticsEventTrackerEditor.PayloadGUI () (at Assets/Services/Analytics/Tracker/Editor/AnalyticsEventTrackerEditor.cs:57)
UnityEngine.Analytics.Experimental.Tracker.AnalyticsEventTrackerEditor.OnInspectorGUI () (at Assets/Services/Analytics/Tracker/Editor/AnalyticsEventTrackerEditor.cs:40)
UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor[ ] editors, Int32 editorIndex, Boolean rebuildOptimizedGUIBlock, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect) (at /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1253)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)