예제 #1
0
 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]);
 }
예제 #2
0
 public UnrealArrayReadWrite(UnrealObject baseObject, IntPtr nativeUnrealProperty, IntPtr nativeBuffer, MarshalingDelegates <T> .ToNative toNative, MarshalingDelegates <T> .FromNative fromNative)
     : base(baseObject, nativeUnrealProperty, nativeBuffer, toNative, fromNative)
 {
 }
예제 #3
0
 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.");
 }
예제 #4
0
 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));
     }
 }
예제 #5
0
 // Get the default object for the UClass represented by this SubclassOf wrapper.
 public T GetDefault()
 {
     return(UnrealObject.GetClassDefaultObject <T>(NativeClass));
 }
예제 #6
0
 // 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));
 }
예제 #7
0
 public override string ToString()
 {
     return(Valid ? UnrealObject.GetFName(NativeClass).ToString() : "null");
 }
예제 #8
0
        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));
        }
예제 #9
0
 protected static Text ConstructPropertyText(UnrealObject owner, int offset)
 {
     return(new Text(owner, offset));
 }
예제 #10
0
 public static T ConstructUnrealObject <T>(UnrealObject outer = null, Name objectName = default(Name)) where T : UnrealObject
 {
     return(NewObject <T>(outer, objectName));
 }
예제 #11
0
 public static T FromNative(IntPtr nativeBuffer, int arrayIndex, UnrealObject owner)
 {
     return(Marshal.PtrToStructure <T>(nativeBuffer + arrayIndex * Marshal.SizeOf(Enum.GetUnderlyingType(typeof(T)))));
 }
예제 #12
0
 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);
 }
예제 #13
0
 public static T FromNative(IntPtr nativeBuffer, int arrayIndex, UnrealObject owner)
 {
     return(Marshal.PtrToStructure <T>(nativeBuffer + arrayIndex * Marshal.SizeOf <T>()));
 }
예제 #14
0
 public static void ToNative(IntPtr nativeBuffer, int arrayIndex, UnrealObject owner, T obj)
 {
     Marshal.StructureToPtr <T>(obj, nativeBuffer + arrayIndex * Marshal.SizeOf <T>(), false);
 }