Choose your operating system:
Windows
macOS
Linux
Module |
|
Header |
/Engine/Source/Runtime/CoreUObject/Public/UObject/UObjectGlobals.h |
Include |
#include "UObject/UObjectGlobals.h" |
Source |
/Engine/Source/Runtime/CoreUObject/Private/UObject/UObjectGlobals.cpp |
UObject * StaticAllocateObject
(
const UClass * Class,
UObject * InOuter,
FName Name,
EObjectFlags SetFlags,
EInternalObjectFlags InternalSetFlags,
bool bCanReuseSubobjects,
bool * bOutReusedSubobject,
UPackage * ExternalPackage
)
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.
a pointer to a fully initialized object of the specified class.
Parameter |
Description |
---|---|
Class |
the class of the object to create |
InOuter |
the object to create this object within (the Outer property for the new object will be set to the value specified here). |
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_#. |
SetFlags |
the ObjectFlags to assign to the new object. some flags can affect the behavior of constructing the object. |
InternalSetFlags |
the InternalObjectFlags to assign to the new object. some flags can affect the behavior of constructing the object. |
bCanReuseSubobjects |
if set to true, SAO will not attempt to destroy a subobject if it already exists in memory. |
bOutReusedSubobject |
flag indicating if the object is a subobject that has already been created (in which case further initialization is not necessary). |
ExternalPackage |
External Package assigned to the allocated object, if any |