Xerios / ScreenManager

Flexible way to manage screens with transitions for Unity
MIT License
560 stars 69 forks source link

Fix 2021.3.28 GUIStyle render issue #19

Closed danieldownes closed 1 year ago

danieldownes commented 1 year ago

There was a typo fix with GUIStyle strings in Unity version 2021.3.28 and later meaning the ScreenManagerEditor inspector would not render correctly as elements were being set to null style.

Of course this was not documented by Unity in their release notes and probably should not have been part of a minor update on Unity's side.

I spent quite a bit of time tracking down the specific Unity minor version to which the 'typo fix' was introduced.

I'm not happy that the compiler directives for detecting a Unity minor version dosn't cover all versions, and didn't want to bloat the code with 27 directives; the directive #if UNITY_2021_3_28_OR_ABOVE is not recognised.

As you can see I reconsidered this limitation and moved away from directives and changed it to check for the GUIStyle.find resolves in null and if so then look up using an the 'corrected' spelling. Happy to change if you have a better idea.

PS Been using this for several years on most of my Unity projects, so more than happy to contribute :)

danieldownes commented 1 year ago

I'm happy for this to be merged now.. if you want to test..

Xerios commented 1 year ago

Thanks for the PR, I haven't been doing much unity lately but changes look good!