Search Issue Tracker
By Design
Votes
0
Found in
2019.3.0a3
2019.4
2019.4.7f1
2020.1
2020.2
Issue ID
1269588
Regression
Yes
GUI.Button and GUILayout.Button stay in the normal GUIStyleState even when the normal GUIStyleState is changed to another one
How to reproduce:
1. Open the user's attached "GuiButtonStyle2019.4.7f1.zip" project
2. Open the "SampleScene" Scene
3. Open the "TestInspector.cs" script
4. Observe the script and notice that the normal GUIStyleState is changed to active (line 12) and is applied to the two buttons (line 15, 16)
5. Go back to the Editor
6. Select the "GameObject" GameObject in the Hierarchy window
7. Observe the three buttons in the Inspector
Expected result: The active GUIStyleState is applied to the normal GUIStyleState for the two upper buttons and the buttons look like they are pressed
Actual result: The normal GUIStyleState is not changed to the active GUIStyleState for the two upper buttons, buttons look the same as the lowermost button
Reproducible with: 2019.3.0a3, 2019.4.8f1, 2020.1.2f1, 2020.2.0a20
Not reproducible with: 2018.4.26f1, 2019.3.0a2
Notes:
- The active GUIStyleState was used as an example, but no GUIStyleState on a button can be applied in the reproducible versions (stays in the normal GUIStyleState)
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
- Any small change in UI Builder Inspector refreshes Editor Inspector
- Inaccurate Box Collider boundaries on a rotated child Cube when the parent GameObject Scale is non-uniform
- [Android] "SHADOWS_SCREEN" set as shader Keyword when no "_ShadowMapTexture" is bound leads to freeze on a build on some Mali GPU devices
- The global scene list is overridden in a project built with command line when the Override Global Scene List setting is disabled in the build profile
- Global Scenes are not included in the Build when building multiple Build Profiles at the same time
Resolution Note (2020.2.X):
With the introduction of NorthStar theme the way styles work had been updated and the styles no longer use images for backgrounds, instead it uses background color. If you wish to achieve the same behavior as before you can do that by using the background images which are still in resource bundle else you can create a new uss file for your style which is recommended for new theme.
Here are a few reference that might help:
https://docs.unity3d.com/Manual/class-GUISkin.html
https://docs.unity3d.com/Manual/class-GUIStyle.html