[Bug] Failed to display list of Asset Reference at Inspector

When you try to a Serializable class and make it as array, it failed to display properly but no problem when it’s not array.

Array

3955099--338995--upload_2018-12-3_23-55-58.png

Not array

3955099--339004--upload_2018-12-4_0-1-40.png

Error

NullReferenceException: Object reference not set to an instance of an object
UnityEditor.AddressableAssets.BundledAssetGroupSchema.get_HostingServicesContentRoot () (at Library/PackageCache/com.unity.addressables@0.4.8-preview/Editor/Settings/GroupSchemas/BundledAssetGroupSchema.cs:118)
UnityEditor.AddressableAssets.HostingServicesManager.GetAllContentRoots () (at Library/PackageCache/com.unity.addressables@0.4.8-preview/Editor/HostingServices/HostingServicesManager.cs:393)
UnityEditor.AddressableAssets.HostingServicesManager.ConfigureAllHostingServices () (at Library/PackageCache/com.unity.addressables@0.4.8-preview/Editor/HostingServices/HostingServicesManager.cs:372)
UnityEditor.AddressableAssets.HostingServicesManager.OnSettingsModification (UnityEditor.AddressableAssets.AddressableAssetSettings s, ModificationEvent evt, System.Object obj) (at Library/PackageCache/com.unity.addressables@0.4.8-preview/Editor/HostingServices/HostingServicesManager.cs:365)
UnityEditor.AddressableAssets.AddressableAssetSettings.SetDirty (ModificationEvent modificationEvent, System.Object eventData, Boolean postEvent) (at Library/PackageCache/com.unity.addressables@0.4.8-preview/Editor/Settings/AddressableAssetSettings.cs:865)
UnityEditor.AddressableAssets.AddressableAssetSettings.OnPostprocessAllAssets (System.String[ ] importedAssets, System.String[ ] deletedAssets, System.String[ ] movedAssets, System.String[ ] movedFromAssetPaths) (at Library/PackageCache/com.unity.addressables@0.4.8-preview/Editor/Settings/AddressableAssetSettings.cs:1239)
UnityEditor.AddressableAssets.AddressablesAssetPostProcessor.OnPostprocessAllAssets (System.String[ ] importedAssets, System.String[ ] deletedAssets, System.String[ ] movedAssets, System.String[ ] movedFromAssetPaths) (at Library/PackageCache/com.unity.addressables@0.4.8-preview/Editor/Settings/AddressableAssetPostProcessor.cs:42)
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/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
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/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[ ] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
UnityEditor.AssetPostprocessingInternal.PostprocessAllAssets (System.String[ ] importedAssets, System.String[ ] addedAssets, System.String[ ] deletedAssets, System.String[ ] movedAssets, System.String[ ] movedFromPathAssets) (at C:/buildslave/unity/build/Editor/Mono/AssetPostprocessor.cs:141)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()

Currently only make AssetReference as array is working.

3955099--339040--upload_2018-12-4_0-9-55.png

Hey!

Yeah, this is unfortunately a known issue. :confused: We’re going to try to get a fix in for this by our 1.0 release though.

1 Like

When I can get the fix? I really hope I can get the fix very soon before 1.0 release.

@optimise While we wait for an actual release of this fix, we have posted some workarounds that make this work without problems. You can see them here AssetReferenceDrawer does not dirty the SerialziedProperty

1 Like