Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Resolved [Solved in v1.16.15] AssetReferenceDrawer error with SpriteAtlas (v1.16.13)

Discussion in 'Addressables' started by yuweichang, Nov 25, 2020.

  1. yuweichang

    yuweichang

    Joined:
    Nov 22, 2018
    Posts:
    6
    Hello,

    After updating to v1.16.13 (1.16.12 as well), there are errors from AssetReference assigned to a atlas with a sprite (sub asset).

    Here are the outputs:

    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. UnityEditor.AddressableAssets.GUI.AssetReferenceDrawer.DrawSubAssetsControl (UnityEditor.SerializedProperty property, System.Collections.Generic.List`1[T] subAssets) (at Library/PackageCache/com.unity.addressables@1.16.13/Editor/GUI/AssetReferenceDrawer.cs:489)
    3. UnityEditor.AddressableAssets.GUI.AssetReferenceDrawer.OnGUI (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label) (at Library/PackageCache/com.unity.addressables@1.16.13/Editor/GUI/AssetReferenceDrawer.cs:278)
    4. UnityEditor.PropertyDrawer.OnGUISafe (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label) (at <a8e33794c0064f2aa201ade069162226>:0)
    5. UnityEditor.PropertyHandler.OnGUI (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren, UnityEngine.Rect visibleArea) (at <a8e33794c0064f2aa201ade069162226>:0)
    6. UnityEditor.GenericInspector.OnOptimizedInspectorGUI (UnityEngine.Rect contentRect) (at <a8e33794c0064f2aa201ade069162226>:0)
    7. UnityEditor.UIElements.InspectorElement+<>c__DisplayClass58_0.<CreateIMGUIInspectorFromEditor>b__0 () (at <a8e33794c0064f2aa201ade069162226>:0)
    8. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
    It's caused by the null m_AssetRefObject.SubOjbectType.
    So I took a look at AssetReference.SetEditorSubObject, and found that in case of a SpriteAtlas m_SubObjectType is never assigned.
    It looks like a bug for me. Any idea about this? Thanks.
     
  2. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,796
  3. yuweichang

    yuweichang

    Joined:
    Nov 22, 2018
    Posts:
    6
    Hi TreyK-47,

    I've checked this issue with v1.16.15 and found that it's been solved.
    Thanks a lot for your helps.
     
    TreyK-47 likes this.
  4. magmagma

    magmagma

    Joined:
    Oct 27, 2017
    Posts:
    41
    There was a lil' sneaky change where 1.16.13 was marked as verified so I updated to that and then today when we discovered this bug it turns out 1.16.13 is no longer marked as verified and 1.16.15 is... lol

    But at least it is fixed so thank you.