예제 #1
0
        public static T NewObject <T>(
            UnrealObject outer, SubclassOf <T> klass,
            Name objectName       = default(Name), ObjectFlags flags = ObjectFlags.NoFlags,
            UnrealObject template = null, bool copyTransientsFromClassDefaults = false, bool assumeTemplateIsArchetype = false
            ) where T : UnrealObject
        {
            IntPtr nativeOuter    = outer?.NativeObject ?? IntPtr.Zero;
            IntPtr nativeTemplate = template?.NativeObject ?? IntPtr.Zero;

            return((T)ConstructUnrealObjectNative(typeof(T), klass.NativeClass, nativeOuter, objectName, flags, nativeTemplate, copyTransientsFromClassDefaults, IntPtr.Zero, assumeTemplateIsArchetype));
        }
예제 #2
0
        public override bool Equals(object obj)
        {
            if (!(obj is SubclassOf <T>))
            {
                return(false);
            }

            SubclassOf <T> rhs = (SubclassOf <T>)obj;

            // we can do a reference comparison here
            return(NativeClass == rhs.NativeClass);
        }
예제 #3
0
 public bool TryFindClass <T>(string searchString, out SubclassOf <T> @class) where T : UnrealObject
 {
     @class = new SubclassOf <T>(ClassFinder_FindNativeClass(searchString));
     return(@class.Valid);
 }
예제 #4
0
 public static void ToNative(IntPtr nativeBuffer, int arrayIndex, UnrealObject owner, SubclassOf <T> obj)
 {
     unsafe
     {
         *((IntPtr *)(nativeBuffer + arrayIndex * IntPtr.Size)) = obj.NativeClass;
     }
 }