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)); }
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); }
public bool TryFindClass <T>(string searchString, out SubclassOf <T> @class) where T : UnrealObject { @class = new SubclassOf <T>(ClassFinder_FindNativeClass(searchString)); return(@class.Valid); }
public static void ToNative(IntPtr nativeBuffer, int arrayIndex, UnrealObject owner, SubclassOf <T> obj) { unsafe { *((IntPtr *)(nativeBuffer + arrayIndex * IntPtr.Size)) = obj.NativeClass; } }