Search Issue Tracker
By Design
By Design in 2023.2.X
Votes
0
Found in
2021.3.29f1
2022.3.7f1
2023.1.9f1
2023.2.0b6
Issue ID
UUM-46681
Regression
No
The Button is not activated when using IMGUI in the Inspector window
Reproduction steps:
1. Open the attached project “ButtonBug“
2. Select the Text Asset “Assets/XML/Test”
3. In the Inspector window press the Button “Test”
4. Observe the Console Window
Expected result: The Console window is empty
Actual result: “Clicked Test” message is displayed in the Console window
Reproducible with: 2021.3.29f1, 2022.3.7f1, 2023.1.9f1, 2023.2.0b6
Reproducible on: Windows 10
Not reproducible on: No other environment tested
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
- EnterPlayModeOptions doesn't take effect if user manually modifies m_EnterPlayModeOptionsEnabled to 0
- VFX Graph Documentation dropdown button does nothing when clicked on the right side
- Required SpriteMask class (ID 331) is stripped when "Strip Engine Code" is enabled
- “Maximized serialized file backup not found” error is thrown when minimizing a window in a newly opened project
- Build stack trace contains invalid lines when building with IL2CPP using scripts with delegates containing generic types in the signature
Resolution Note:
This behaviour is expected because the custom inspector builds its own rectangle and draws a button on screen without going through the normal IMGUI layout system.
As a result the IMGUIContainer that is auto-created for IMGUI inspector has no idea about the size of the IMGUI content, so it ends up having a height of 0, therefore not receiving clicks.
The fact that the hover state is responding is misleading, this is because of how the hover effect is implemented (it is not based on mouse events, it just changes accordingly if the mouse is over the object in the repaint code).
It should be possible to get the desired effect by using GUILayout.Button.
Resolution Note (2023.2.X):
This behaviour is expected because the custom inspector builds its own rectangle and draws a button on screen without going through the normal IMGUI layout system.
As a result the IMGUIContainer that is auto-created for IMGUI inspector has no idea about the size of the IMGUI content, so it ends up having a height of 0, therefore not receiving clicks.
The fact that the hover state is responding is misleading, this is because of how the hover effect is implemented (it is not based on mouse events, it just changes accordingly if the mouse is over the object in the repaint code).
It should be possible to get the desired effect by using GUILayout.Button.