Skip to content

ToolbarSearchStyle is broken in newer unity versions #5

@Ants-Aare

Description

@Ants-Aare

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)

Metadata

Metadata

Labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions