WooshiiDev / HierarchyDecorator

Lightweight Unity Plugin transforming the Hierarchy into what it should be. Adds headers, styles, icons and more.
MIT License
1.02k stars 47 forks source link

Bug - GUI style warning is thrown in 2022.3 #75

Closed oliverbooth closed 3 months ago

oliverbooth commented 1 year ago

Current Unity version used 2022.3.2f1

Describe the bug This is likely due to a change in the Unity Editor API. HierarchyDecorator attempts to use the style ToolbarSearchTextField but Unity 2022.3.2f1 (other versions may also be affected, but this is untested) fails to find it, and a warning is presented. Interestingly, this doesn't affect HD in any other way, and everything else seems to function properly. I guess the fact that it's a warning, not an error, is appropriate.

To Reproduce (If applicable) Use Hierarchy Decorator in 2022.3.2f1 (or any other potentially affected versions)

Screenshots Really, the only screenshot worth showing is of the warning. The full stack trace is provided below. image

Additional context The warning shown is as follows:

Unable to find style 'ToolbarSeachTextField' in skin 'DarkSkin' Layout
UnityEngine.GUIStyle:op_Implicit (string)
HierarchyDecorator.Style:.cctor () (at ./Library/PackageCache/com.wooshii.hierarchydecorator@c5d7d76df5/HierarchyDecorator/Scripts/Editor/Constants.cs:319)
HierarchyDecorator.LayerInfo:DrawInfo (UnityEngine.Rect,UnityEngine.GameObject,HierarchyDecorator.Settings) (at ./Library/PackageCache/com.wooshii.hierarchydecorator@c5d7d76df5/HierarchyDecorator/Scripts/Editor/Hierarchy/Info/LayerInfo.cs:15)
HierarchyDecorator.HierarchyInfo:DrawInternal (UnityEngine.Rect,UnityEngine.GameObject,HierarchyDecorator.Settings) (at ./Library/PackageCache/com.wooshii.hierarchydecorator@c5d7d76df5/HierarchyDecorator/Scripts/Editor/Hierarchy/Info/HierarchyInfo.cs:50)
HierarchyDecorator.HierarchyDrawer:Draw (UnityEngine.Rect,UnityEngine.GameObject,HierarchyDecorator.Settings) (at ./Library/PackageCache/com.wooshii.hierarchydecorator@c5d7d76df5/HierarchyDecorator/Scripts/Editor/Hierarchy/HierarchyDrawer.cs:21)
HierarchyDecorator.HierarchyDecorator:OnHierarchyItem (int,UnityEngine.Rect) (at ./Library/PackageCache/com.wooshii.hierarchydecorator@c5d7d76df5/HierarchyDecorator/Scripts/Editor/HierarchyDecorator.cs:117)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
snoups commented 1 year ago

Wrong name, missing the letter R!

ToolbarTextField = new GUIStyle("ToolbarSeachTextField") ToolbarTextField = new GUIStyle("ToolbarSearchTextField")

WooshiiDev commented 1 year ago

Thanks for posting this Oliver, I need to look through 2022 and make sure everything is working. Going to get a fix for this with other stuff later today 👍

oliverbooth commented 1 year ago

Wrong name, missing the letter R!

ToolbarTextField = new GUIStyle("ToolbarSeachTextField") ToolbarTextField = new GUIStyle("ToolbarSearchTextField")

Ah yes good eye. This does seem to be the problem. Weird that this warning was never thrown prior to updating to 2022 🤔

tanphat110699 commented 1 year ago

image Unable to find style 'ToolbarSeachTextField' in skin 'DarkSkin' Layout UnityEngine.GUIStyle:op_Implicit (string) HierarchyDecorator.Style:.cctor () (at ./Library/PackageCache/com.wooshii.hierarchydecorator@c5d7d76df5/HierarchyDecorator/Scripts/Editor/Constants.cs:319) HierarchyDecorator.LayerInfo:DrawInfo (UnityEngine.Rect,UnityEngine.GameObject,HierarchyDecorator.Settings) (at ./Library/PackageCache/com.wooshii.hierarchydecorator@c5d7d76df5/HierarchyDecorator/Scripts/Editor/Hierarchy/Info/LayerInfo.cs:15) HierarchyDecorator.HierarchyInfo:DrawInternal (UnityEngine.Rect,UnityEngine.GameObject,HierarchyDecorator.Settings) (at ./Library/PackageCache/com.wooshii.hierarchydecorator@c5d7d76df5/HierarchyDecorator/Scripts/Editor/Hierarchy/Info/HierarchyInfo.cs:50) HierarchyDecorator.HierarchyDrawer:Draw (UnityEngine.Rect,UnityEngine.GameObject,HierarchyDecorator.Settings) (at ./Library/PackageCache/com.wooshii.hierarchydecorator@c5d7d76df5/HierarchyDecorator/Scripts/Editor/Hierarchy/HierarchyDrawer.cs:21) HierarchyDecorator.HierarchyDecorator:OnHierarchyItem (int,UnityEngine.Rect) (at ./Library/PackageCache/com.wooshii.hierarchydecorator@c5d7d76df5/HierarchyDecorator/Scripts/Editor/HierarchyDecorator.cs:117) Unity 2022.3.4f1 still have this error. Also the one #77: image

WooshiiDev commented 1 year ago

Hi there, this should be fixed on both develop and main branches. The issue was actually on Unity's side (originally) where they had misspelt the style name, and I had to keep it that way 😭

I've added a check for versions and this should be fixed, could someone confirm?

WooshiiDev commented 1 year ago

Also the one #77: image

@tanphat110699 This already has an issue created (as you've linked) so I'd keep mentions of it there (so issues dont get messy)

WooshiiDev commented 3 months ago

Closing as fix has been in master for some time