Hello everyone,
I’ve updated today with UIBuilder with Unity 2019.3.15.
I’ve created 3 simple UXML with that embed into them other UXML.
When I try to add inside theses 3 UXML an other one … That contains a third one. It’s created an error.
To repro the step
1/ Create a simple UXML and save it, let’s call it A.
2/ Create an other simple UXML that contains the first one (A), let’s call it B.
3/ Create a third UXML, and try to add B into it.
You should get that error :
ArgumentException: At least one object must implement IComparable.
System.Collections.Comparer.Compare (System.Object a, System.Object b) (at <437ba245d8404784b9fbab9b439ac908>:0)
System.Collections.Generic.ObjectComparer`1[T].Compare (T x, T y) (at <437ba245d8404784b9fbab9b439ac908>:0)
Unity.UI.Builder.VisualTreeAssetExtensions+UsingEntryAssetComparer.Compare (UnityEngine.UIElements.VisualTreeAsset+UsingEntry x, UnityEngine.UIElements.VisualTreeAsset+UsingEntry y) (at Library/PackageCache/com.unity.ui.builder@1.0.0-preview.2/Editor/Utilities/VisualTreeAssetExtensions/VisualTreeAssetExtensions.cs:32)
System.Collections.Generic.ArraySortHelper`1[T].InternalBinarySearch (T[] array, System.Int32 index, System.Int32 length, T value, System.Collections.Generic.IComparer`1[T] comparer) (at <437ba245d8404784b9fbab9b439ac908>:0)
System.Collections.Generic.ArraySortHelper`1[T].BinarySearch (T[] array, System.Int32 index, System.Int32 length, T value, System.Collections.Generic.IComparer`1[T] comparer) (at <437ba245d8404784b9fbab9b439ac908>:0)
Rethrow as InvalidOperationException: Failed to compare two elements in the array.
System.Collections.Generic.ArraySortHelper`1[T].BinarySearch (T[] array, System.Int32 index, System.Int32 length, T value, System.Collections.Generic.IComparer`1[T] comparer) (at <437ba245d8404784b9fbab9b439ac908>:0)
System.Array.BinarySearch[T] (T[] array, System.Int32 index, System.Int32 length, T value, System.Collections.Generic.IComparer`1[T] comparer) (at <437ba245d8404784b9fbab9b439ac908>:0)
System.Collections.Generic.List`1[T].BinarySearch (System.Int32 index, System.Int32 count, T item, System.Collections.Generic.IComparer`1[T] comparer) (at <437ba245d8404784b9fbab9b439ac908>:0)
System.Collections.Generic.List`1[T].BinarySearch (T item, System.Collections.Generic.IComparer`1[T] comparer) (at <437ba245d8404784b9fbab9b439ac908>:0)
Unity.UI.Builder.VisualTreeAssetExtensions.TemplateExists (UnityEngine.UIElements.VisualTreeAsset windowVTA, UnityEngine.UIElements.VisualTreeAsset draggingInVTA) (at Library/PackageCache/com.unity.ui.builder@1.0.0-preview.2/Editor/Utilities/VisualTreeAssetExtensions/VisualTreeAssetExtensions.cs:370)
Unity.UI.Builder.BuilderDocument.WillCauseCircularDependency (UnityEngine.UIElements.VisualTreeAsset vtaCheck) (at Library/PackageCache/com.unity.ui.builder@1.0.0-preview.2/Editor/Builder/Document/BuilderDocument.cs:286)
Unity.UI.Builder.BuilderLibraryDragger.PerformAction (UnityEngine.UIElements.VisualElement destination, Unity.UI.Builder.BuilderDragger+DestinationPane pane, System.Int32 index) (at Library/PackageCache/com.unity.ui.builder@1.0.0-preview.2/Editor/Builder/Draggers/BuilderLibraryDragger.cs:124)
Unity.UI.Builder.BuilderDragger.OnMouseUp (UnityEngine.UIElements.MouseUpEvent evt) (at Library/PackageCache/com.unity.ui.builder@1.0.0-preview.2/Editor/Builder/Draggers/BuilderDragger.cs:535)
UnityEngine.UIElements.EventCallbackFunctor`1[TEventType].Invoke (UnityEngine.UIElements.EventBase evt) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.EventCallbackRegistry.InvokeCallbacks (UnityEngine.UIElements.EventBase evt) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.CallbackEventHandler.HandleEvent (UnityEngine.UIElements.EventBase evt) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.CallbackEventHandler.HandleEventAtTargetPhase (UnityEngine.UIElements.EventBase evt) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.MouseCaptureDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.EventDispatcher.ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, System.Boolean imguiEventIsInitiallyUsed) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEventQueue () (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.EventDispatcher.OpenGate () (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.EventDispatcherGate.Dispose () (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.UIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <819de1aa368e45faa4f78e26c97c62b0>:0)
I’ve checked if I had any circular dependency and that’s not the case.
Have a good day.