5argon / ModifyEditorStyle

Change fonts throughout Unity editor
44 stars 7 forks source link

Font members of `EditorStyles` is no longer using backing fields since 2019.3 #13

Open EmiyaSyahriel opened 6 months ago

EmiyaSyahriel commented 6 months ago

Since Unity 2019.3, the properties to get fonts (e.g EditorStyles.standardFont) is changed from getting the value from a backing field to calling EditorResources.GetFont(FontDef.Style.[style]), and the backing field seems to be removed. Changes : UnityCsReference 2019.2 -> UnityCsReference 2019.3

Therefore these lines :

https://github.com/5argon/ModifyEditorStyle/blob/1fa5ecb4bc930f82d0916844defcd5bc90839355/Editor/ModifyEditorStyle.cs#L318-L325

will throw either NullPointerException or FieldNotFoundException and the code will no longer works.