Navigation
API > API/Runtime > API/Runtime/CoreUObject
This utility class stores the FProperty data for an interface property used in both blueprint and native code. For objects natively implementing an interface, ObjectPointer and InterfacePointer point to different locations in the same UObject. For objects that only implement an interface in blueprint, only ObjectPointer will be set because there is no native representation. UClass::ImplementsInterface can be used along with Execute_ event wrappers to properly handle BP-implemented interfaces.
| Name | FScriptInterface |
| Type | class |
| Header File | /Engine/Source/Runtime/CoreUObject/Public/UObject/ScriptInterface.h |
| Include Path | #include "UObject/ScriptInterface.h" |
Syntax
class FScriptInterface
Derived Classes
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| Default constructor | UObject/ScriptInterface.h | ||
FScriptInterface
(
const FScriptInterface& |
Copyable | UObject/ScriptInterface.h | |
FScriptInterface
(
UObject* InObjectPointer, |
Construction from object and interface | UObject/ScriptInterface.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| InterfacePointer | void * | For native interfaces, pointer to the location of the interface object within the UObject referenced by ObjectPointer. | UObject/ScriptInterface.h | |
| ObjectPointer | TObjectPtr< UObject > | A pointer to a UObject that implements an interface. | UObject/ScriptInterface.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void AddReferencedObjects
(
FReferenceCollector& Collector |
UObject/ScriptInterface.h | ||
void * GetInterface() |
Returns the pointer to the native interface if it is valid | UObject/ScriptInterface.h | |
UObject * GetObject() |
Returns the ObjectPointer contained by this FScriptInterface | UObject/ScriptInterface.h | |
TObjectPtr< UObject > & GetObjectRef() |
Returns the ObjectPointer contained by this FScriptInterface | UObject/ScriptInterface.h | |
void SetInterface
(
void* InInterfacePointer |
Sets the value of the InterfacePointer for this FScriptInterface | UObject/ScriptInterface.h | |
void SetObject
(
UObject* InObjectPointer |
Sets the value of the ObjectPointer for this FScriptInterface | UObject/ScriptInterface.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| Serialize ScriptInterface | UObject/ScriptInterface.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool operator!=
(
const FScriptInterface& Other |
UObject/ScriptInterface.h | ||
FScriptInterface & operator=
(
const FScriptInterface& |
UObject/ScriptInterface.h | ||
bool operator==
(
const FScriptInterface& Other |
Comparison operator, taking a reference to another FScriptInterface | UObject/ScriptInterface.h |