The current MRTK3 Unity project uses the editor version 2021.3.2f1, upgrading to Unity Editor 2022.3.2f1 causes the ExperimentalDrawer.cs file to fail compilation with the error:
ArgumentException: You can only call GUI functions from inside OnGUI.
This results in the components of Theme Provider showing as empty in the Inspector.
When it should be:
To reproduce
Steps to reproduce the behavior:
Open the CoreUXThemingExample scene in Unity Editor 2022.3.2f1 (or later). I haven't tested the editors between 2021.3.2f1 (working) and 2022.3.2f1 (not working)
Go to 'the Theme Provider under SceneContent'
Click on 'Theme Provider'
Open the Console window ''
See error
In the Inspector window you'll see Data Source Provider Singleton; Data Source Theme Provider; and Theme Selector all empty.
Expected behavior
There should be no compile errors and the Inspector window should show all components for the Theme Provider.
Removing the file will fix the compilation error as well as the Inspector window error. The only use for this file is to add the warning message above these components and isn't necessary for the correct operation of the editor.
Removing the [CustomPropertyDrawer(typeof(ExperimentalAttribute))] from the class will also fix this issue, however the Inspector will not show the warning.
Original issue opened by:
Describe the bug
The current MRTK3 Unity project uses the editor version 2021.3.2f1, upgrading to Unity Editor 2022.3.2f1 causes the ExperimentalDrawer.cs file to fail compilation with the error:
This results in the components of Theme Provider showing as empty in the Inspector.![image](https://github.com/microsoft/MixedRealityToolkit-Unity/assets/89234545/d4d2cded-d176-459e-803c-3420902ac87e)
When it should be:![image](https://github.com/microsoft/MixedRealityToolkit-Unity/assets/89234545/037f2c45-536f-472a-9954-f598e722804a)
To reproduce
Steps to reproduce the behavior:
Expected behavior
There should be no compile errors and the Inspector window should show all components for the Theme Provider.![image](https://github.com/microsoft/MixedRealityToolkit-Unity/assets/89234545/037f2c45-536f-472a-9954-f598e722804a)
My setup
Target platform
Additional context
Removing the file will fix the compilation error as well as the Inspector window error. The only use for this file is to add the warning message above these components and isn't necessary for the correct operation of the editor.
ISSUE MIGRATION
Issue migrated from: https://github.com/microsoft/MixedRealityToolkit-Unity/issues/11770