StatefulUI icon indicating copy to clipboard operation
StatefulUI copied to clipboard

ToolbarSearchStyle is broken in newer unity versions

Open Ants-Aare opened this issue 2 years ago • 0 comments

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)

Ants-Aare avatar Oct 25 '23 00:10 Ants-Aare