Search Issue Tracker

Fix In Review for 2021.2.X

Votes

0

Found in

2019.4.0f1

2020.1

2020.2

2021.1

2021.1.0a10

Issue ID

1300092

Regression

No

[UI Builder] InvalidCastException error is thrown on assigning Cursor Image in Stylesheets Selector.

UI Builder

-

InvalidCastException error is thrown on assigning Cursor Image in Stylesheets Selector.

Steps to repro:
1. Create a new Project.
2. Window > UI Toolkit > UI Builder.
3. StyleSheets > Click on "+" > Create New USS > "Test".
4. Select "Test" > Inspector > Create New USS Selector > MyTest.
5. MyTest > Inspector > Cursor > Assign any Image.

Actual Result:
InvalidCastException error in the console.

Expected Result:
No error in the console.

Reproducible in:
2021.1.0a10, 2020.2.0f1, 2020.1.0f1, 2019.4.0f1 with Package version 1.0.0-preview.9.

Environment:
Occurring on Windows 10 & Mac 10.15.

Stack trace:
InvalidCastException: Specified cast is not valid.
Unity.UI.Builder.BuilderInspectorStyleFields.OnFieldObjectValueChange (UnityEngine.UIElements.IEventHandler target, UnityEngine.Object newValue, UnityEngine.Object previousValue, System.String styleName) (at <185bda1d3c3049d3b8a4852e0de3edf6>:0)
Unity.UI.Builder.BuilderInspectorStyleFields.OnFieldValueChangeImpl (UnityEngine.UIElements.IEventHandler target, UnityEngine.Object newValue, UnityEngine.Object previousValue, System.String styleName) (at <185bda1d3c3049d3b8a4852e0de3edf6>:0)
Unity.UI.Builder.BuilderInspectorStyleFields.OnFieldValueChange (UnityEngine.UIElements.ChangeEvent`1[T] e, System.String styleName) (at <185bda1d3c3049d3b8a4852e0de3edf6>:0)
Unity.UI.Builder.BuilderInspectorStyleFields+<>c__DisplayClass28_0.<BindStyleField>b__13 (UnityEngine.UIElements.ChangeEvent`1[T] e) (at <185bda1d3c3049d3b8a4852e0de3edf6>:0)
UnityEngine.UIElements.EventCallbackFunctor`1[TEventType].Invoke (UnityEngine.UIElements.EventBase evt) (at <b82edc26c1654793bdaefb66b6a2a38a>:0)
UnityEngine.UIElements.EventCallbackRegistry.InvokeCallbacks (UnityEngine.UIElements.EventBase evt) (at <b82edc26c1654793bdaefb66b6a2a38a>:0)
UnityEngine.UIElements.CallbackEventHandler.HandleEvent (UnityEngine.UIElements.EventBase evt) (at <b82edc26c1654793bdaefb66b6a2a38a>:0)
UnityEngine.UIElements.EventDispatchUtilities.PropagateEvent (UnityEngine.UIElements.EventBase evt) (at <b82edc26c1654793bdaefb66b6a2a38a>:0)
UnityEngine.UIElements.DefaultDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <b82edc26c1654793bdaefb66b6a2a38a>:0)
UnityEngine.UIElements.EventDispatcher.ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, System.Boolean imguiEventIsInitiallyUsed) (at <b82edc26c1654793bdaefb66b6a2a38a>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <b82edc26c1654793bdaefb66b6a2a38a>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEventQueue () (at <b82edc26c1654793bdaefb66b6a2a38a>:0)
UnityEngine.UIElements.EventDispatcher.OpenGate () (at <b82edc26c1654793bdaefb66b6a2a38a>:0)
UnityEngine.UIElements.EventDispatcherGate.Dispose () (at <b82edc26c1654793bdaefb66b6a2a38a>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <b82edc26c1654793bdaefb66b6a2a38a>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEventQueue () (at <b82edc26c1654793bdaefb66b6a2a38a>:0)
UnityEngine.UIElements.EventDispatcher.OpenGate () (at <b82edc26c1654793bdaefb66b6a2a38a>:0)
UnityEngine.UIElements.EventDispatcherGate.Dispose () (at <b82edc26c1654793bdaefb66b6a2a38a>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <b82edc26c1654793bdaefb66b6a2a38a>:0)
UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at <b82edc26c1654793bdaefb66b6a2a38a>:0)
UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at <b82edc26c1654793bdaefb66b6a2a38a>:0)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <b82edc26c1654793bdaefb66b6a2a38a>:0)
UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at <b82edc26c1654793bdaefb66b6a2a38a>:0)
UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <b82edc26c1654793bdaefb66b6a2a38a>:0)
UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at <b82edc26c1654793bdaefb66b6a2a38a>:0)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at <df88399a35f0499085499d10ca7e0e5d>:0)

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.