.obsidian
.vs
00-MOC
01-Diary
02-Note
03-UnrealEngine
Animation
Editor
Gameplay
AI
Animation
Code
Debug
GAS
Gameplay
Http
Lyra
Mass
Online
Other
PuerTS
UObject
UnrealSpecifiers
Flags
Meta
Specifier
UCLASS
UENUM
UFUNCTION
Blueprint
BlueprintCallable
BlueprintImplementableEvent
BlueprintNativeEvent
BlueprintPure
BlueprintPure.md
Untitled.png
CallInEditor
SealedEvent
BlueprintGetter.md
BlueprintSetter.md
Category
Exec
Network
UHT
UINTERFACE
UPARAM
UPROPERTY
USTRUCT
UCLASS.md
UENUM.md
UFUNCTION.md
UINTERFACE.md
UPARAM.md
UPROPERTY.md
USTRUCT.md
UnrealSpecifiers.md
Ue4 c++ UProperty反射 PostEditChangeProperty.md
Ue4Object生命周期.jpg
大钊提供的一种获取UE Private函数的方法.md
LevelScene
Math
Mobile
Plugins
Rendering
Sequence
UI
VirtualProduction
VisualEffect
卡通渲染相关资料
性能优化
流程管理与部署
.keep
03-UnrealEngine.md
04-ComputerGraphics
05-SDHGame
06-DCC
07-Other
08-Assets
09-Templates
.gitattributes
.gitignore
.gitmodules
LICENSE
26 lines
961 B
Markdown
26 lines
961 B
Markdown
|
# BlueprintPure
|
|||
|
|
|||
|
- **功能描述:** 指定作为一个纯函数,一般用于Get函数用来返回值。
|
|||
|
- **元数据类型:** bool
|
|||
|
- **引擎模块:** Blueprint
|
|||
|
- **作用机制:** 在FunctionFlags增加[FUNC_BlueprintCallable](../../../../Flags/EFunctionFlags/FUNC_BlueprintCallable.md)、[FUNC_BlueprintPure](../../../../Flags/EFunctionFlags/FUNC_BlueprintPure.md)
|
|||
|
- **常用程度:** ★★★★★
|
|||
|
|
|||
|
指定作为一个纯函数,一般用于Get函数用来返回值。
|
|||
|
|
|||
|
- 纯函数是指没有执行引脚的函数,不是指const函数。
|
|||
|
- 纯函数可以有多个返回值,用引用参数加到函数里就行。
|
|||
|
- 不能用于void函数,否则会报错“error : BlueprintPure specifier is not allowed for functions with no return value and no output parameters.”
|
|||
|
|
|||
|
## 测试代码:
|
|||
|
|
|||
|
```cpp
|
|||
|
UFUNCTION(BlueprintPure)
|
|||
|
int32 GetMyInt()const { return MyInt; }
|
|||
|
private:
|
|||
|
int32 MyInt;
|
|||
|
```
|
|||
|
|
|||
|
## 效果展示:
|
|||
|
|
|||
|

|