public UnrealArrayReadOnly <T> FromNative(IntPtr nativeBuffer, int arrayIndex, UnrealObject owner) { if (Wrappers[arrayIndex] == null) { Wrappers[arrayIndex] = new UnrealArrayReadOnly <T>(owner, NativeProperty, nativeBuffer + arrayIndex * Marshal.SizeOf(typeof(ScriptArray)), null, InnerTypeFromNative); } return(Wrappers[arrayIndex]); }
public UnrealArrayReadWrite(UnrealObject baseObject, IntPtr nativeUnrealProperty, IntPtr nativeBuffer, MarshalingDelegates <T> .ToNative toNative, MarshalingDelegates <T> .FromNative fromNative) : base(baseObject, nativeUnrealProperty, nativeBuffer, toNative, fromNative) { }
public void ToNative(IntPtr nativeBuffer, int arrayIndex, UnrealObject owner, UnrealArrayReadOnly <T> obj) { throw new NotImplementedException("Copying UnrealArrays from managed memory to native memory is unsupported."); }
public SubclassOf(IntPtr nativeClass) { NativeClassPtr = nativeClass; if (NativeClassPtr != IntPtr.Zero && SystemType == null) { throw new InvalidOperationException(string.Format("{0} is not a valid value for SubclassOf<{1}>", UnrealObject.GetFName(NativeClassPtr), typeof(T).Name)); } }
// Get the default object for the UClass represented by this SubclassOf wrapper. public T GetDefault() { return(UnrealObject.GetClassDefaultObject <T>(NativeClass)); }
// Get the default object for the UClass represented by this SubclassOf wrapper, cast to a specific subclass of the type parameter. public U GetDefault <U>() where U : T { return(UnrealObject.GetClassDefaultObject <U>(NativeClass)); }
public override string ToString() { return(Valid ? UnrealObject.GetFName(NativeClass).ToString() : "null"); }
public static T NewObject <T>(UnrealObject outer) where T : UnrealObject { IntPtr nativeOuter = outer?.NativeObject ?? IntPtr.Zero; return((T)ConstructUnrealObjectNative(typeof(T), IntPtr.Zero, nativeOuter, Name.None, ObjectFlags.NoFlags, IntPtr.Zero, false, IntPtr.Zero, false)); }
protected static Text ConstructPropertyText(UnrealObject owner, int offset) { return(new Text(owner, offset)); }
public static T ConstructUnrealObject <T>(UnrealObject outer = null, Name objectName = default(Name)) where T : UnrealObject { return(NewObject <T>(outer, objectName)); }
public static T FromNative(IntPtr nativeBuffer, int arrayIndex, UnrealObject owner) { return(Marshal.PtrToStructure <T>(nativeBuffer + arrayIndex * Marshal.SizeOf(Enum.GetUnderlyingType(typeof(T))))); }
public static void ToNative(IntPtr nativeBuffer, int arrayIndex, UnrealObject owner, T obj) { Marshal.StructureToPtr <T>(obj, nativeBuffer + arrayIndex * Marshal.SizeOf(Enum.GetUnderlyingType(typeof(T))), false); }
public static T FromNative(IntPtr nativeBuffer, int arrayIndex, UnrealObject owner) { return(Marshal.PtrToStructure <T>(nativeBuffer + arrayIndex * Marshal.SizeOf <T>())); }
public static void ToNative(IntPtr nativeBuffer, int arrayIndex, UnrealObject owner, T obj) { Marshal.StructureToPtr <T>(obj, nativeBuffer + arrayIndex * Marshal.SizeOf <T>(), false); }