StatefulUI
StatefulUI copied to clipboard
ToolbarSearchStyle is broken in newer unity versions
I tried using the tool in a newer unity version and the create role menu doesn't work. It's complaining because it doesn't find the correct UI style. and therefore errors out and just draws an empty selector. this is because there's a typo in the GUI style in specific unity versions. I've come across this same error multiple times and it's fixed by doing this:
public static GUIStyle ToolbarSearchTextField = GUI.skin.FindStyle("ToolbarSeachTextField") ?? GUI.skin.FindStyle("ToolbarSearchTextField");
public static GUIStyle ToolbarSearchCancelButtonStyle = GUI.skin.FindStyle("ToolbarSeachCancelButton") ?? GUI.skin.FindStyle("ToolbarSearchCancelButton");
(also caching these inside a static variable makes sense, otherwise it's gonna call FindStyle too many times)