Search Unity

  1. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Let us know a bit about your interests, and if you'd like to become more directly involved. Take our survey!
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  5. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Exceptions in drawing GUI for Standard Analytics Event

Discussion in 'Unity Analytics' started by ferretnt, Jul 27, 2018.

  1. ferretnt

    ferretnt

    Joined:
    Apr 10, 2012
    Posts:
    258
    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)
     
    IES likes this.
  2. Benvictus

    Benvictus

    Unity Technologies

    Joined:
    Sep 12, 2013
    Posts:
    86
    @ferretnt

    I'm not sure on how you've set this up in your project.

    Could you please provide me with a small project that reproduces this issue?

    I will test this on my end and look at reporting this as a bug.
     
  3. ferretnt

    ferretnt

    Joined:
    Apr 10, 2012
    Posts:
    258
    Thanks. I'm very surprised nobody has hit this before as so far as I can see it isn't possible to change (or rename) any attribute which an AnalyticsTracker uses as a parameter without hitting the issue.

    Bug with teeny-tiny repro project (a scene with one script and two components) submitted. Fogbugz 1064881.

    Alex
     
  4. ferretnt

    ferretnt

    Joined:
    Apr 10, 2012
    Posts:
    258
    @Benvictus. Not sure if you were watching thread for replies but I figured I’d tag you in case.
     
  5. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,033
    @ferretnt

    Thanks for reporting this. I will assign the ticket to the correct team and they will take a look at how we can handle this case a bit more gracefully.