/// <summary> /// Finds the first native (non-managed) class for this managed class. This also caches the native parent /// class constructor for calling the parent constructor and setting it as the fallback constructor on hotreload. /// </summary> public void ResolveNativeParentClass() { NativeParentClassConstructor = IntPtr.Zero; if (Address == IntPtr.Zero) { return; } // We could possibly update this code to do a deep search for the first non-C# class (e.g. C# : X : C# : X : UObject). // We aren't currently calling the parent constructor in a way which would allow this. If we supported it as-is the C# // constructors would get called multiple times when calling the parent constructor. IntPtr parentClass = Native_UClass.GetSuperClass(Address); while (parentClass != IntPtr.Zero) { if (!Native_UObjectBaseUtility.IsA(parentClass, Runtime.Classes.USharpClass)) { NativeParentClass = parentClass; NativeParentClassConstructor = Native_UClass.Get_ClassConstructor(parentClass); break; } parentClass = Native_UClass.GetSuperClass(parentClass); } Debug.Assert(NativeParentClass != IntPtr.Zero); }