vault backup: 2024-10-12 17:19:45
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
# Blueprintable
|
||||
|
||||
- **功能描述:** 可以在蓝图中实现
|
||||
- **元数据类型:** bool
|
||||
- **引擎模块:** Blueprint
|
||||
- **作用机制:** 在Meta中加入[IsBlueprintBase](../../../../Meta/Blueprint/IsBlueprintBase.md), [BlueprintType](../../../../Meta/Blueprint/BlueprintType.md)
|
||||
- **关联项:** [NotBlueprintable](../NotBlueprintable/NotBlueprintable.md)
|
||||
- **常用程度:★★★★★**
|
||||
|
||||
是否可以在蓝图中实现。
|
||||
|
||||
## 示例代码:
|
||||
|
||||
```cpp
|
||||
UINTERFACE(Blueprintable,MinimalAPI)
|
||||
class UMyInterface_Blueprintable:public UInterface
|
||||
{
|
||||
GENERATED_UINTERFACE_BODY()
|
||||
};
|
||||
|
||||
class INSIDER_API IMyInterface_Blueprintable
|
||||
{
|
||||
GENERATED_IINTERFACE_BODY()
|
||||
public:
|
||||
UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
|
||||
void Func_ImplementableEvent() const;
|
||||
|
||||
UFUNCTION(BlueprintCallable,BlueprintNativeEvent)
|
||||
void Func_NativeEvent() const;
|
||||
};
|
||||
|
||||
UINTERFACE(NotBlueprintable,MinimalAPI)
|
||||
class UMyInterface_NotBlueprintable:public UInterface
|
||||
{
|
||||
GENERATED_UINTERFACE_BODY()
|
||||
};
|
||||
|
||||
class INSIDER_API IMyInterface_NotBlueprintable
|
||||
{
|
||||
GENERATED_IINTERFACE_BODY()
|
||||
public:
|
||||
//也不得定义蓝图函数,因为已经不能在蓝图中实现了
|
||||
//UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
|
||||
//void Func_ImplementableEvent() const;
|
||||
|
||||
// UFUNCTION(BlueprintCallable,BlueprintNativeEvent)
|
||||
// void Func_NativeEvent() const;
|
||||
};
|
||||
```
|
||||
|
||||
## 示例效果:
|
||||
|
||||
在蓝图中测试,发现UMyInterface_NotBlueprintable并不能找到。
|
||||
|
||||

|
Binary file not shown.
After Width: | Height: | Size: 24 KiB |
@@ -0,0 +1,14 @@
|
||||
# NotBlueprintable
|
||||
|
||||
- **功能描述:** 指定不可以在蓝图中实现
|
||||
- **元数据类型:** bool
|
||||
- **引擎模块:** Blueprint
|
||||
- **作用机制:** 在Meta中去除[IsBlueprintBase](../../../../Meta/Blueprint/IsBlueprintBase.md)、[BlueprintType](../../../../Meta/Blueprint/BlueprintType.md),等价于[CannotImplementInterfaceInBlueprint](../../../../Meta/Blueprint/CannotImplementInterfaceInBlueprint.md)
|
||||
- **关联项:** [Blueprintable](../Blueprintable/Blueprintable.md)
|
||||
- **常用程度:★★★**
|
||||
|
||||
在Class Settings里的Interface里找不到不允许实现的接口。
|
||||
|
||||

|
||||
|
||||
什么情况下需要用到该标记?虽然不能在蓝图中实现,但是依然可以在C++里实现,也可以通过反射判断一个对象是否实现该接口。
|
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
@@ -0,0 +1,8 @@
|
||||
# ConversionRoot
|
||||
|
||||
- **功能描述:** Sets IsConversionRoot metadata flag for this interface.
|
||||
- **元数据类型:** bool
|
||||
- **引擎模块:** Blueprint
|
||||
- **作用机制:** 在Meta中加入[IsConversionRoot](../../../Meta/Blueprint/IsConversionRoot.md)
|
||||
|
||||
在源码中并不能找到该使用示例
|
@@ -0,0 +1,18 @@
|
||||
# MinimalAPI
|
||||
|
||||
- **功能描述:** 指定该UInterface对象不导出到别的模块
|
||||
- **元数据类型:** bool
|
||||
- **引擎模块:** DllExport
|
||||
- **常用程度:★**
|
||||
|
||||
可以参照UCLASS里的MinimalAPI的解释。
|
||||
|
||||
简单来说UInterface对象,只是作为接口的辅助对象,因此本身并没有什么可值得暴露出来的函数。因此源码里的大部分UInterface对象都被标记成了MinimalAPI,以加快编译同时隔绝别的模块使用。
|
||||
|
||||
```cpp
|
||||
UINTERFACE(MinimalAPI, BlueprintType)
|
||||
class USoundLibraryProviderInterface : public UInterface
|
||||
{
|
||||
GENERATED_BODY()
|
||||
};
|
||||
```
|
Reference in New Issue
Block a user