Search Issue Tracker
Fixed in 2021.2.X
InvalidOperationException is thrown when Toggle component is toggled in Inspector window, using "Is On" field
1. Open user's project "ToggleEditorExceptionInPlaymode.zip"
2. Open "SampleScene" Scene
3. Enter Play Mode and click on "Toggle" under "Canvas" in the Hierarchy window
4. Try toggling the Toggle in Game View while looking at the Inspector window
5. Notice how the "Is On" field in Inspector is toggled as well
6. Try toggling the "Is On" field in Inspector
Expected result: Toggle in Game View is toggled when toggling the "Is On" field in the Inspector
Actual result: "InvalidOperationException: This cannot be used during play mode." exception is thrown when toggling the "Is On" field in the Inspector
Reproducible with: (using UGUI 1.0.0) 2019.2.0b4, 2019.4.0f1, 2019.4.19f1, 2020.2.3f1, 2021.1.0b4, 2021.2.0a3
Not reproducible with: (using UGUI 1.0.0) 2018.4.31f1, 2019.2.0b3
Note: on version 2018.4.31f1 toggling the "Is On" field in the Inspector doesn't toggle the Toggle in the Game View
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
- Editor directs to non-existent page when pressing "Learn more..." for Asset Pipeline
- ChangeSets are not detected when created via Editor Scripts
- "Cyclic Prefab nesting not supported" error window is thrown when trying to nest two sibling prefab variants
- BuildPipeline error is thrown when building Asset Bundles
- "IndexOutOfRangeException" errors appear when entering Play Mode if using "AsDeferredJobArray"