Search Issue Tracker
Duplicate
Votes
0
Found in
2022.1.0b6
Issue ID
1400437
Regression
Yes
UIToolkit with UIDocument - InvalidOperationException
1. What happened
- Changing any value to any VisualElement in UIBuilder or via scripts creates an error (Invalid Operation Exception, see the stacktrace below).
2. How can we reproduce it using the example you attached
- Open the scene file
- Select UIDocument in the scene, open Test (Visual Tree Asset) so UI Builder opens up
- Do anything to any element (Label) in the tree, e.g. change opacity, position, apply any style (via editor or style script) and the error message will appear in the console
This error occours in Unity 2022.1.b5 and 2022.1.b6. No errors with 2021.2.10f1 version.
Stacktrace:
InvalidOperationException: Collection was modified; enumeration operation may not execute.
System.Collections.Generic.List`1+Enumerator[T].MoveNextRare () (at <cdc4992cc04a4e77a24a09cd121af77b>:0)
System.Collections.Generic.List`1+Enumerator[T].MoveNext () (at <cdc4992cc04a4e77a24a09cd121af77b>:0)
UnityEngine.UIElements.UIElementsRuntimeUtility.UpdateRuntimePanels () (at <9fb9706855a847a1926259ab0baf1b3c>:0)
UnityEngine.UIElements.UIElementsRuntimeUtilityNative.UpdateRuntimePanels () (at <05a8bc2f25e84bdebc90d31147b4881d>:0)
Note: We tried on Windows and it looks like its affecting MAC only.
-
manuelgoellnitz
Mar 22, 2022 08:32
If this is a duplicate, where is the other ticket with the same bug?
A link would be nice.I have this problem on WebGL, so it seams not MAC only and on Unity 2021.2.15
-
Nanomid
Feb 24, 2022 23:05
I have this issue constantly.
InvalidOperationException: Collection was modified; enumeration operation may not execute.
System.Collections.Generic.List`1+Enumerator[T].MoveNextRare () (at <7b935204f5ff4bcab44b3b0ebca330bf>:0)
System.Collections.Generic.List`1+Enumerator[T].MoveNext () (at <7b935204f5ff4bcab44b3b0ebca330bf>:0)
UnityEngine.UIElements.UIElementsRuntimeUtility.UpdateRuntimePanels () (at <a40fb3db3ff84d2d9bf85ec84d6c5573>:0)
UnityEngine.UIElements.UIElementsRuntimeUtilityNative.UpdateRuntimePanels () (at <4e881c99ae1a43bfa47861981e2726e0>:0)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- [HDRP] Game view renders artifacts when Camera's Component "Post Anti-aliasing" is set to "TAA" and Dynamic Resolution's "Forced Screen Percentage" is changed
- A deactivated Prefab's name color becomes white when a GameObject in the scene is deactivated
- The Game view becomes blank when using Frame Debugger with MSAA and Texture binding enabled in Play Mode
- NullReferenceException is thrown when changing the Inspector preview selection
- The build size is larger when Models have Animation Type set to Generic
This is a duplicate of issue #1402588