File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -69,6 +69,7 @@ Assets/UdonSharp/Scripts/Editor.meta
6969.idea /*
7070Assets /Udon.meta
7171[Aa ]ssets /SerializedUdonPrograms *
72+ Packages /
7273
7374# UdonSharp stuff
7475/Assets /UdonSharp /UdonSharpSettings.asset
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -160,7 +160,9 @@ static UdonBehaviourDrawerOverride()
160160 /// </summary>
161161 public static void OverrideUdonBehaviourDrawer ( )
162162 {
163+ #if ! UNITY_2019_4_OR_NEWER
163164 if ( customEditorField == null )
165+ #endif
164166 {
165167 Assembly editorAssembly = typeof ( UnityEditor . Editor ) . Assembly ;
166168
@@ -205,7 +207,22 @@ public static void OverrideUdonBehaviourDrawer()
205207 editorTypeList = Activator . CreateInstance ( monoEditorTypeListType ) ;
206208
207209 listCreateParams [ 0 ] = editorTypeObject ;
210+
211+ #if UNITY_2019_4_OR_NEWER
212+ FieldInfo initializedField = editorAttributesClass . GetField ( "s_Initialized" , BindingFlags . Static | BindingFlags . NonPublic ) ;
213+
214+ if ( ! ( bool ) initializedField . GetValue ( null ) )
215+ {
216+ MethodInfo rebuildMethod =
217+ editorAttributesClass . GetMethod ( "Rebuild" , BindingFlags . Static | BindingFlags . NonPublic ) ;
218+
219+ rebuildMethod . Invoke ( null , null ) ;
220+
221+ initializedField . SetValue ( null , true ) ;
222+ }
223+ #endif
208224 }
225+
209226
210227 listClearMethod . Invoke ( editorTypeList , null ) ;
211228 listAddTypeMethod . Invoke ( editorTypeList , listCreateParams ) ;
You can’t perform that action at this time.
0 commit comments