Search Unity

  1. Get all the Unite Berlin 2018 news on the blog.
    Dismiss Notice
  2. Unity 2018.2 has arrived! Read about it here.
    Dismiss Notice
  3. We're looking for your feedback on the platforms you use and how you use them. Let us know!
    Dismiss Notice
  4. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  6. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  7. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  8. 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:
    245
    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)
     
  2. Benvictus

    Benvictus

    Unity Technologies

    Joined:
    Sep 12, 2013
    Posts:
    64
    @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:
    245
    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:
    245
    @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:
    997
    @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.