コード例 #1
0
 public TObjectIterator(EObjectFlags additionalExclusionFlags       = EObjectFlags.ClassDefaultObject,
                        bool includeDerivedClasses                  = true,
                        EInternalObjectFlags internalExclusionFlags = EInternalObjectFlags.None)
 {
     index       = -1;
     objectArray = UObjectHash.GetObjectsOfClass <T>(includeDerivedClasses, additionalExclusionFlags, internalExclusionFlags);
 }
コード例 #2
0
        public FObjectExport(IAssetConverter converter)
        {
            FPackageFileSummary?summ = converter.GetSummary();

            using (BinaryReader br = new BinaryReader(converter.GetAssetStream(), Encoding.UTF8, true))
            {
                this.ClassIndex = br.ReadInt32();
                this.SuperIndex = br.ReadInt32();

                if (summ.GetUE4Version() >= 508)
                {
                    this.TemplateIndex = br.ReadInt32();
                }

                FObjectResource resource = new FObjectResource(converter);
                this.Index      = resource.Index;
                this.ObjectName = resource.ObjectName;

                this.ObjectFlags = (EObjectFlags)br.ReadInt32();

                if (summ.GetUE4Version() >= 511)
                {
                    this.SerialSize   = br.ReadInt64();
                    this.SerialOffset = br.ReadInt64();
                }
                else
                {
                    this.SerialSize   = br.ReadInt32();
                    this.SerialOffset = br.ReadInt32();
                }

                this.ExportFileOffset = SerialOffset - summ.TotalSize;

                this.IsForcedExport = br.ReadInt32() != 0;
                this.IsNotForClient = br.ReadInt32() != 0;
                this.IsNotForServer = br.ReadInt32() != 0;

                this.PackageGuid  = new FGuid(converter.GetAssetStream());
                this.PackageFlags = (EPackageFlags)br.ReadInt32();

                if (summ.GetUE4Version() >= 365)
                {
                    this.IsNotAlwaysLoadedForEditorGame = br.ReadInt32() != 0;
                }

                if (summ.GetUE4Version() >= 485)
                {
                    this.IsAsset = br.ReadInt32() != 0;
                }

                if (summ.GetUE4Version() >= 507)
                {
                    this.FirstExportDependency = br.ReadInt32();
                    this.SerializationBeforeSerializationDependencies = br.ReadInt32();
                    this.CreateBeforeSerializationDependencies        = br.ReadInt32();
                    this.SerializationBeforeCreateDependencies        = br.ReadInt32();
                    this.CreateBeforeCreateDependencies = br.ReadInt32();
                }
            }
        }
コード例 #3
0
ファイル: FExportMapEntry.cs プロジェクト: FabianFG/CUE4Parse
        public readonly byte                FilterFlags; // EExportFilterFlags: client/server flags

        public FExportMapEntry(FArchive Ar)
        {
            var start = Ar.Position;

            CookedSerialOffset = Ar.Read <ulong>();
            CookedSerialSize   = Ar.Read <ulong>();
            ObjectName         = Ar.Read <FMappedName>();
            OuterIndex         = Ar.Read <FPackageObjectIndex>();
            ClassIndex         = Ar.Read <FPackageObjectIndex>();
            SuperIndex         = Ar.Read <FPackageObjectIndex>();
            TemplateIndex      = Ar.Read <FPackageObjectIndex>();
            if (Ar.Game >= EGame.GAME_UE5_0)
            {
                GlobalImportIndex = new FPackageObjectIndex(FPackageObjectIndex.Invalid);
                PublicExportHash  = Ar.Read <ulong>();
            }
            else
            {
                GlobalImportIndex = Ar.Read <FPackageObjectIndex>();
                PublicExportHash  = 0;
            }

            ObjectFlags = Ar.Read <EObjectFlags>();
            FilterFlags = Ar.Read <byte>();
            Ar.Position = start + Size;
        }
コード例 #4
0
ファイル: UObject.cs プロジェクト: OCEAN623/USharp
 /// <summary>
 /// Gets all objects which inherit from a specified base class.
 /// Does not include any class default objects
 /// </summary>
 public static TObjectIterator <T> GetObjects <T>(
     EObjectFlags additionalExclusionFlags       = EObjectFlags.ClassDefaultObject,
     bool includeDerivedClasses                  = true,
     EInternalObjectFlags internalExclusionFlags = EInternalObjectFlags.None) where T : UObject
 {
     return(new TObjectIterator <T>(additionalExclusionFlags, includeDerivedClasses, internalExclusionFlags));
 }
コード例 #5
0
ファイル: UObject.cs プロジェクト: OCEAN623/USharp
 /// <summary>
 /// Gets all objects, including class default objects.
 /// </summary>
 public static FObjectIterator GetObjectsEx <T>(
     bool onlyGCedObjects = false,
     EObjectFlags additionalExclusionFlags       = EObjectFlags.NoFlags,
     EInternalObjectFlags internalExclusionFlags = EInternalObjectFlags.None) where T : UObject
 {
     return(GetObjectsEx(UClass.GetClass <T>(), onlyGCedObjects, additionalExclusionFlags, internalExclusionFlags));
 }
コード例 #6
0
ファイル: UObject.cs プロジェクト: OCEAN623/USharp
 /// <summary>
 /// Gets all objects, including class default objects.
 /// </summary>
 public static FObjectIterator GetObjectsEx(
     bool onlyGCedObjects = false,
     EObjectFlags additionalExclusionFlags       = EObjectFlags.NoFlags,
     EInternalObjectFlags internalExclusionFlags = EInternalObjectFlags.None)
 {
     return(new FObjectIterator(null, onlyGCedObjects, additionalExclusionFlags, internalExclusionFlags));
 }
コード例 #7
0
 /// <summary>
 /// Constructs a gameplay object
 /// </summary>
 /// <typeparam name="T">the object type</typeparam>
 /// <param name="outer">the outer for the new object.  If not specified, object will be created in the transient package.</param>
 /// <param name="name">the name for the new object.  If not specified, the object will be given a transient name via MakeUniqueObjectName</param>
 /// <param name="flags">the object flags to apply to the new object</param>
 /// <param name="template">the object to use for initializing the new object.  If not specified, the class's default object will be used</param>
 /// <param name="copyTransientsFromClassDefaults">if true, copy transient from the class defaults instead of the pass in archetype ptr (often these are the same)</param>
 /// <param name="instanceGraph">contains the mappings of instanced objects and components to their templates</param>
 /// <returns>a pointer of type T to a new object of the specified class</returns>
 public static T NewObject <T>(
     ObjectOuter outer,
     FName name         = default(FName),
     EObjectFlags flags = EObjectFlags.NoFlags,
     UObject template   = null,
     bool copyTransientsFromClassDefaults = false,
     IntPtr instanceGraph = default(IntPtr)) where T : UObject
 {
     return(NewObject <T>(false, outer, UClass.GetClass <T>(), name, flags, template, copyTransientsFromClassDefaults, instanceGraph));
 }
コード例 #8
0
        /// <summary>
        /// Create a new instance of an object or replace an existing object.  If both an Outer and Name are specified, and there is an object already in memory with the same Class, Outer, and Name, the
        /// existing object will be destructed, and the new object will be created in its place.
        /// </summary>
        /// <param name="unrealClass">the class of the object to create</param>
        /// <param name="outer">the object to create this object within (the Outer property for the new object will be set to the value specified here).</param>
        /// <param name="name">the name to give the new object. If no value (NAME_None) is specified, the object will be given a unique name in the form of ClassName_#.</param>
        /// <param name="outReusedSubobject">flag indicating if the object is a subobject that has already been created (in which case further initialization is not necessary).</param>
        /// <param name="setFlags">the ObjectFlags to assign to the new object. some flags can affect the behavior of constructing the object.</param>
        /// <param name="internalSetFlags">the InternalObjectFlags to assign to the new object. some flags can affect the behavior of constructing the object.</param>
        /// <param name="canReuseSubobjects">if set to true, SAO will not attempt to destroy a subobject if it already exists in memory.</param>
        /// <returns>a pointer to a fully initialized object of the specified class.</returns>
        public static UObject StaticAllocateObject(UClass unrealClass, ObjectOuter outer, FName name, out bool outReusedSubobject,
                                                   EObjectFlags setFlags, EInternalObjectFlags internalSetFlags, bool canReuseSubobjects = false)
        {
            csbool  outReusedSubobjectTemp;
            UObject result = GCHelper.Find(Native_UObjectGlobals.StaticAllocateObject(
                                               unrealClass == null ? IntPtr.Zero : unrealClass.Address,
                                               outer.Address, ref name, setFlags, internalSetFlags, canReuseSubobjects, out outReusedSubobjectTemp));

            outReusedSubobject = outReusedSubobjectTemp;
            return(result);
        }
コード例 #9
0
        /// <summary>
        /// Find an optional object, relies on the name being unqualified
        /// </summary>
        public static T FindObjectFast <T>(
            ObjectOuter outer,
            FName name,
            bool exactClass             = false,
            bool anyPackage             = false,
            EObjectFlags exclusiveFlags = EObjectFlags.NoFlags,
            EInternalObjectFlags exclusiveInternalFlags = EInternalObjectFlags.None) where T : UObject
        {
            UClass unrealClass = UClass.GetClass <T>();

            return(GCHelper.Find <T>(Native_UObjectGlobals.StaticFindObjectFast(
                                         unrealClass == null ? IntPtr.Zero : unrealClass.Address,
                                         outer.Address, ref name, exactClass, anyPackage, exclusiveFlags, exclusiveInternalFlags)));
        }
コード例 #10
0
        public FExportMapEntry(IoPackageReader reader)
        {
            CookedSerialOffset = reader.ReadUInt64();
            CookedSerialSize   = reader.ReadUInt64();
            ObjectName         = new FMappedName(reader);
            OuterIndex         = new FPackageObjectIndex(reader);
            ClassIndex         = new FPackageObjectIndex(reader);
            SuperIndex         = new FPackageObjectIndex(reader);
            TemplateIndex      = new FPackageObjectIndex(reader);
            GlobalImportIndex  = new FPackageObjectIndex(reader);

            ObjectFlags = (EObjectFlags)reader.ReadUInt32();
            FilterFlags = (EExportFilterFlags)reader.ReadByte();
            reader.SkipBytes(3);
        }
コード例 #11
0
 public FObjectIterator(UClass unrealClass,
                        bool onlyGCedObjects = false,
                        EObjectFlags additionalExclusionFlags       = EObjectFlags.NoFlags,
                        EInternalObjectFlags internalExclusionFlags = EInternalObjectFlags.None)
 {
     objectArrayPtr              = Native_FUObjectArray.GetGUObjectArray();
     index                       = -1;
     this.unrealClass            = unrealClass;
     this.exclusionFlags         = additionalExclusionFlags;
     this.internalExclusionFlags = internalExclusionFlags;
     if (this.unrealClass == UClass.GetClass <UObject>())
     {
         // Set to null to avoid additional UClass checks if this already the UObject class
         this.unrealClass = null;
     }
 }
コード例 #12
0
        private static T NewObject <T>(
            bool checkClass,
            ObjectOuter outer,
            UClass unrealClass,
            FName name         = default(FName),
            EObjectFlags flags = EObjectFlags.NoFlags,
            UObject template   = null,
            bool copyTransientsFromClassDefaults = false,
            IntPtr instanceGraph = default(IntPtr)) where T : UObject
        {
            if (unrealClass == null)
            {
                return(null);
            }

            if (!outer.IsAnyPackage && outer.Object == null)
            {
                outer.Object = GetTransientPackage();
            }

            if (name == FName.None)
            {
                FObjectInitializer.AssertIfInConstructor(outer.Object);
            }

            if (checkClass)
            {
                // DO_CHECK
                // Class was specified explicitly, so needs to be validated
                if (Native_UObjectGlobals.CheckIsClassChildOf_Internal != null)
                {
                    UClass parentClass = UClass.GetClass <T>();
                    Native_UObjectGlobals.CheckIsClassChildOf_Internal(
                        parentClass == null ? IntPtr.Zero : parentClass.Address,
                        unrealClass == null ? IntPtr.Zero : unrealClass.Address);
                }
            }

            return(GCHelper.Find <T>(Native_UObjectGlobals.StaticConstructObject_Internal(
                                         unrealClass == null ? IntPtr.Zero : unrealClass.Address,
                                         outer.Address, ref name, flags, EInternalObjectFlags.None,
                                         template == null ? IntPtr.Zero : template.Address,
                                         copyTransientsFromClassDefaults,
                                         instanceGraph)));
        }
コード例 #13
0
 public ExportTableItem(BinaryReader reader)
     : base(reader)
 {
     Class = UnrealIndex.Read(reader);
     Super = UnrealIndex.Read(reader);
     Package = reader.ReadInt32();
     ObjectName = UnrealIndex.Read(reader);
     ObjectFlags = (EObjectFlags)reader.ReadUInt32();
     SerialSize = UnrealIndex.Read(reader);
     if (SerialSize > 0)
     {
         SerialOffset = UnrealIndex.Read(reader);
     }
     else
     {
         SerialOffset = 0;
     }
 }
コード例 #14
0
 /// <summary>
 /// Creates a copy of SourceObject using the Outer and Name specified, as well as copies of all objects contained by SourceObject.
 /// Any objects referenced by SourceOuter or RootObject and contained by SourceOuter are also copied, maintaining their name relative to SourceOuter.  Any
 /// references to objects that are duplicated are automatically replaced with the copy of the object.
 /// </summary>
 /// <typeparam name="T">the object type</typeparam>
 /// <param name="sourceObject">the object to duplicate</param>
 /// <param name="outer">the object to use as the Outer for the copy of SourceObject</param>
 /// <param name="name">the name to use for the copy of SourceObject</param>
 /// <param name="flagMask">a bitmask of EObjectFlags that should be propagated to the object copies.  The resulting object copies will only have the object flags
 /// specified copied from their source object.</param>
 /// <param name="destClass">optional class to specify for the destination object. MUST BE SERIALIZATION COMPATIBLE WITH SOURCE OBJECT!!!</param>
 /// <param name="duplicateForPIE"></param>
 /// <param name="internalFlagsMask">bitmask of EInternalObjectFlags that should be propagated to the object copies.</param>
 /// <returns></returns>
 public static T DuplicateObject <T>(
     T sourceObject,
     ObjectOuter outer,
     FName name                             = default(FName),
     EObjectFlags flagMask                  = EObjectFlags.AllFlags,
     UClass destClass                       = null,
     EDuplicateMode duplicateMode           = EDuplicateMode.Normal,
     EInternalObjectFlags internalFlagsMask = EInternalObjectFlags.AllFlags) where T : UObject
 {
     if (sourceObject != null)
     {
         if (!outer.IsAnyPackage && outer.Object == null)
         {
             outer.Object = GetTransientPackage();
         }
         return(GCHelper.Find <T>(Native_UObjectGlobals.StaticDuplicateObject(
                                      sourceObject == null ? IntPtr.Zero : sourceObject.Address,
                                      outer.Address, ref name, flagMask,
                                      destClass == null ? IntPtr.Zero : destClass.Address,
                                      duplicateMode, internalFlagsMask)));
     }
     return(null);
 }
コード例 #15
0
 public void TagSubobjects(EObjectFlags newFlags)
 {
     Native_UStruct.TagSubobjects(Address, newFlags);
 }
コード例 #16
0
 public NameTableItem(BinaryReader reader)
     : base(reader)
 {
     name = new UnrealName(reader);
     flags = (EObjectFlags)reader.ReadUInt32();
 }
コード例 #17
0
ファイル: UObject.cs プロジェクト: OCEAN623/USharp
 /// <summary>
 /// Determines whether this object is a template object
 /// </summary>
 /// <param name="templateTypes"></param>
 /// <returns>true if this object is a template object (owned by a UClass)</returns>
 public bool IsTemplate(EObjectFlags templateTypes = EObjectFlags.ArchetypeObject | EObjectFlags.ClassDefaultObject)
 {
     return(Native_UObjectBaseUtility.IsTemplate(Address, templateTypes));
 }
コード例 #18
0
ファイル: UObject.cs プロジェクト: OCEAN623/USharp
 /// <summary>
 /// Returns object flags that are both in the mask and set on the object.
 /// </summary>
 /// <param name="mask">Mask to mask object flags with</param>
 /// <returns>flags that are set in both the object and the mask</returns>
 public EObjectFlags GetMaskedFlags(EObjectFlags mask)
 {
     return(Native_UObjectBaseUtility.GetMaskedFlags(Address, mask));
 }
コード例 #19
0
ファイル: UObject.cs プロジェクト: OCEAN623/USharp
 /// <summary>
 /// Atomically clears the specified flags.
 /// Do not use unless you know what you are doing.
 /// Designed to be used only by parallel GC and UObject loading thread.
 /// </summary>
 /// <param name="flagsToClear"></param>
 public void AtomicallyClearFlags(EObjectFlags flagsToClear)
 {
     Native_UObjectBase.AtomicallyClearFlags(Address, flagsToClear);
 }
コード例 #20
0
ファイル: UObject.cs プロジェクト: OCEAN623/USharp
 /// <summary>
 /// Atomically adds the specified flags.
 /// Do not use unless you know what you are doing.
 /// Designed to be used only by parallel GC and UObject loading thread.
 /// </summary>
 /// <param name="flagsToAdd"></param>
 public void AtomicallySetFlags(EObjectFlags flagsToAdd)
 {
     Native_UObjectBase.AtomicallySetFlags(Address, flagsToAdd);
 }
コード例 #21
0
ファイル: UObject.cs プロジェクト: OCEAN623/USharp
 /// <summary>
 /// Used to safely check whether all of the passed in flags are set.
 /// </summary>
 /// <param name="flagsToCheck">Object flags to check for</param>
 /// <returns>true if all of the passed in flags are set (including no flags passed in), false otherwise</returns>
 public bool HasAllFlags(EObjectFlags flagsToCheck)
 {
     return(Native_UObjectBaseUtility.HasAllFlags(Address, flagsToCheck));
 }
コード例 #22
0
 public virtual void Read(AssetBinaryReader reader)
 {
     Name  = reader.ReadFName();
     Flags = (EObjectFlags)reader.ReadUInt32();
 }
コード例 #23
0
 /// <summary>
 /// Returns an array of objects of a specific class. Optionally, results can include objects of derived classes as well.
 /// </summary>
 /// <param name="classToLookFor">Class of the objects to return.</param>
 /// <param name="includeDerivedClasses">If true, the results will include objects of child classes as well.</param>
 /// <param name="additionalExcludeFlags">Objects with any of these flags will be excluded from the results.</param>
 /// <param name="exclusionInternalFlags">Specifies internal flags to use as a filter for which objects to return</param>
 /// <returns></returns>
 public static UObject[] GetObjectsOfClass(UClass classToLookFor, bool includeDerivedClasses = true, EObjectFlags additionalExcludeFlags = EObjectFlags.ClassDefaultObject, EInternalObjectFlags exclusionInternalFlags = EInternalObjectFlags.None)
 {
     using (TArrayUnsafe <UObject> result = new TArrayUnsafe <UObject>())
     {
         Native_UObjectHash.GetObjectsOfClass(classToLookFor.Address, result.Address, includeDerivedClasses, additionalExcludeFlags, exclusionInternalFlags);
         return(result.ToArray());
     }
 }
コード例 #24
0
 /// <summary>
 /// Return all objects with a given outer
 /// </summary>
 /// <param name="outer">Outer to search for</param>
 /// <param name="includeNestedObjects">If true, then things whose outers directly or indirectly have Outer as an outer are included, these are the nested objects.</param>
 /// <param name="exclusionFlags">Specifies flags to use as a filter for which objects to return</param>
 /// <param name="exclusionInternalFlags">Specifies internal flags to use as a filter for which objects to return</param>
 /// <returns></returns>
 public static UObject[] GetObjectsWithOuter(UObject outer, bool includeNestedObjects = true, EObjectFlags exclusionFlags = EObjectFlags.NoFlags, EInternalObjectFlags exclusionInternalFlags = EInternalObjectFlags.None)
 {
     using (TArrayUnsafe <UObject> result = new TArrayUnsafe <UObject>())
     {
         Native_UObjectHash.GetObjectsWithOuter(outer.Address, result.Address, includeNestedObjects, exclusionFlags, exclusionInternalFlags);
         return(result.ToArray());
     }
 }
コード例 #25
0
 /// <summary>
 /// Deletes all unreferenced objects, keeping objects that have any of the passed in KeepFlags set. Will wait for other threads to unlock GC.
 /// </summary>
 /// <param name="keepFlags">objects with those flags will be kept regardless of being referenced or not</param>
 /// <param name="performFullPurge">if true, perform a full purge after the mark pass</param>
 public static void CollectGarbage(EObjectFlags keepFlags, bool performFullPurge = true)
 {
     Native_UObjectGlobals.CollectGarbage(keepFlags, performFullPurge);
 }
コード例 #26
0
 /// <summary>
 /// Returns whether an object is referenced, not counting the one
 /// reference at Obj.
 /// </summary>
 /// <param name="res">Object to check</param>
 /// <param name="keepFlags">Objects with these flags will be considered as being referenced</param>
 /// <param name="internalKeepFlags">Objects with these internal flags will be considered as being referenced</param>
 /// <param name="checkSubObjects">Treat subobjects as if they are the same as passed in object</param>
 /// <returns>true if object is referenced, false otherwise</returns>
 public static bool IsReferenced(UObject res, EObjectFlags keepFlags, EInternalObjectFlags internalKeepFlags, bool checkSubObjects = false)
 {
     // TODO: Support FReferencerInformationList
     return(Native_UObjectGlobals.IsReferenced(res == null ? IntPtr.Zero : res.Address, keepFlags, internalKeepFlags, checkSubObjects, IntPtr.Zero));
 }
コード例 #27
0
 /// <summary>
 /// Returns an array of objects of a specific class. Optionally, results can include objects of derived classes as well.
 /// </summary>
 /// <typeparam name="T">Class of the objects to return.</typeparam>
 /// <param name="includeDerivedClasses">If true, the results will include objects of child classes as well.</param>
 /// <param name="additionalExcludeFlags">Objects with any of these flags will be excluded from the results.</param>
 /// <param name="exclusionInternalFlags">Specifies internal flags to use as a filter for which objects to return</param>
 /// <returns></returns>
 public static UObject[] GetObjectsOfClass <T>(bool includeDerivedClasses = true, EObjectFlags additionalExcludeFlags = EObjectFlags.ClassDefaultObject, EInternalObjectFlags exclusionInternalFlags = EInternalObjectFlags.None)
 {
     return(GetObjectsOfClass(UClass.GetClass <T>(), includeDerivedClasses, additionalExcludeFlags, exclusionInternalFlags));
 }
コード例 #28
0
        private IntPtr CreateProperty(IntPtr outer, Type type, string propertyName, EPropertyType propertyType,
                                      EPropertyType innerPropertyType1, EPropertyType innerPropertyType2)
        {
            propertyType = ManagedUnrealTypes.GetPropertyType(type, propertyType);

            IntPtr propertyClass = ManagedUnrealTypes.GetPropertyClass(propertyType);

            if (propertyClass == IntPtr.Zero)
            {
                return(IntPtr.Zero);
            }

            EObjectFlags objectFlags = EObjectFlags.Public | EObjectFlags.Transient | EObjectFlags.MarkAsNative;
            IntPtr       property    = NativeReflection.NewObject(outer, propertyClass, new FName(propertyName), objectFlags);

            Native_UProperty.SetPropertyFlags(property, EPropertyFlags.BlueprintVisible | EPropertyFlags.BlueprintAssignable | EPropertyFlags.Edit);

            // Set type specific information
            switch (propertyType)
            {
            case EPropertyType.Array:
                if (!firstRun)
                {
                    Native_UArrayProperty.Set_Inner(property,
                                                    CreateProperty(property, typeof(int), propertyName, innerPropertyType1));
                }
                else
                {
                    Native_UArrayProperty.Set_Inner(property,
                                                    CreateProperty(property, type.GenericTypeArguments[0], propertyName, innerPropertyType1));
                }
                break;

            case EPropertyType.Set:
                Native_USetProperty.Set_ElementProp(property,
                                                    CreateProperty(property, type.GenericTypeArguments[0], propertyName, innerPropertyType1));
                break;

            case EPropertyType.Map:
                Native_UMapProperty.Set_KeyProp(property,
                                                CreateProperty(property, type.GenericTypeArguments[0], propertyName, innerPropertyType1));
                Native_UMapProperty.Set_ValueProp(property,
                                                  CreateProperty(property, type.GenericTypeArguments[1], propertyName, innerPropertyType2));
                break;

            case EPropertyType.Class:
                Native_UClassProperty.SetMetaClass(property, UClass.GetClass(type.GenericTypeArguments[0]).Address);
                break;

            case EPropertyType.Object:
                var v1 = ManagedUnrealTypes.GetStaticClass(type);
                var v2 = ManagedUnrealTypes.GetStaticClass(typeof(UObject));
                Native_UObjectPropertyBase.SetPropertyClass(property, v1 == IntPtr.Zero ? v2 : v1);
                break;

            case EPropertyType.LazyObject:
            case EPropertyType.WeakObject:
            case EPropertyType.SoftObject:
                Native_UObjectPropertyBase.SetPropertyClass(property, UClass.GetClass(type.GenericTypeArguments[0]).Address);
                break;

            case EPropertyType.SoftClass:
                Native_USoftClassProperty.SetMetaClass(property, UClass.GetClass(type.GenericTypeArguments[0]).Address);
                break;

            case EPropertyType.Enum:
                Native_UEnumProperty.SetEnum(property, ManagedUnrealTypes.GetEnum(type));
                break;

            case EPropertyType.Delegate:
                //Native_UDelegateProperty.Set_SignatureFunction(property, ManagedUnrealTypes.GetSignatureFunction(type));
                break;

            case EPropertyType.MulticastDelegate:
                //Native_UMulticastDelegateProperty.Set_SignatureFunction(property, ManagedUnrealTypes.GetSignatureFunction(type));
                break;
            }

            Native_UField.AddCppProperty(outer, property);

            return(property);
        }
コード例 #29
0
 /// <summary>
 /// Performs garbage collection only if no other thread holds a lock on GC
 /// </summary>
 /// <param name="keepFlags">objects with those flags will be kept regardless of being referenced or not</param>
 /// <param name="performFullPurge">if true, perform a full purge after the mark pass</param>
 /// <returns></returns>
 public static bool TryCollectGarbage(EObjectFlags keepFlags, bool performFullPurge = true)
 {
     return(Native_UObjectGlobals.TryCollectGarbage(keepFlags, performFullPurge));
 }
コード例 #30
0
ファイル: UObject.cs プロジェクト: OCEAN623/USharp
 /// <summary>
 /// Clears passed in object flags.
 /// </summary>
 /// <param name="newFlags">Object flags to clear.</param>
 public void ClearFlags(EObjectFlags newFlags)
 {
     Native_UObjectBaseUtility.ClearFlags(Address, newFlags);
 }