Question by
Serafim-Pr · Sep 26, 2016 at 10:47 AM ·
editor-scriptingeditorwindowbackgroundeditorguilayouttoolbar
How to return the default value for EditorStyles.toolbarButton.normal.background ???
Good afternoon. I changed the script variable EditorStyles.toolbarButton.normal.background.
GUIStyle td = EditorStyles.toolbarButton;
td.normal.background = customBackground;
Now I can not return to the initial value EditorStyles.toolbarButton.normal.background.
Help me please !
Comment
Best Answer
Answer by solkar · Sep 26, 2016 at 07:52 PM
Save the original texture into a variable:
GUIStyle td = EditorStyles.toolbarButton;
var originalBackground = td.normal.background;
td.normal.background = customBackground;
Then when you want to recover the original assign it back.
td.normal.background = originalBackground;