Initializes a new instance of the .
()
| 44 | /// Initializes a new instance of the <see cref="Object"/>. |
| 45 | /// </summary> |
| 46 | protected Object() |
| 47 | { |
| 48 | // Construct missing native object if managed objects gets created in managed world |
| 49 | if (__unmanagedPtr == IntPtr.Zero) |
| 50 | { |
| 51 | Internal_ManagedInstanceCreated(this, FlaxEngine.Interop.NativeInterop.GetTypeHolder(GetType()).managedClassPointer); |
| 52 | if (__unmanagedPtr == IntPtr.Zero) |
| 53 | throw new Exception($"Failed to create native instance for object of type {GetType().FullName} (assembly: {GetType().Assembly.FullName})."); |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | /// <summary> |
| 58 | /// Notifies the unmanaged interop object that the managed instance was finalized. |