UPROPERTY()
作用是利用反射将属性暴露在蓝图中用以和蓝图交互
//仅在类默认设置可见
UPROPERTY(VisibleDefaultsOnly)
int32 VisibleDefaultsOnlyInt;
//仅在实例化细节面板可见
UPROPERTY(VisibleInstanceOnly)
FString VisibleInstancestring;
//类默认设置和实例化细节面板都可见
UPROPERTY(VisibleAnywhere)
FVector VisibleAnywhereVector;
//仅在类默认设置里面编辑
UPROPERTY(EditDefaultsOnly)
int32 EditDefaultsonlyInt;
//仅在实例化细节面板编辑
UPROPERTY(EditInstanceOnly)
FString EditInstanceOnlystring;
//类默认设置和实例化细节面板都可以编辑
UPROPERTY(EditAnywhere)
FVector EditAnywhereVector;
//仅仅在蓝图中可读
UPROPERTY(EditAnywhere,BlueprintReadOnly)
int32 BlueprintReadOnlyInt;
//在蓝图中可读可写即可以获取和设置变量
UPROPERTY(EditAnywhere,BlueprintReadWrite)
int32 BlueprintReadWriteInt;
Category目录说明符
UPROPERTY(EditAnywhere,BlueprintReadWrite,Category="MyIntValue")
int32 Value1;
UPROPERTY(EditAnywhere,BlueprintReadWrite,Category ="MyIntValue | MySubIntValue")
int32 Value2:
meta元数据说明符
//DisPlayName别名
UPROPERTY(EditAnywhere,BlueprintReadWrite,meta=(DisplayName ="MyValue3DisplayName"))
int32 MyValue3;
//EditCondition条件控制编辑,条件控制可编辑性
UPROPERTY(EditAnywhere,BlueprintReadWrite,meta=(DisplayName ="Controller"))
bool isController:
UPROPERTY(EditAnywhere,BlueprintReadWrite,meta=(EditCondition="isController"))
float value3;
//Tooltip解释说明我们的变量
UPROPERTY(EditAnywhere,BlueprintReadWrite,meta =(ToolTip ="isControllerTrue"))
bool isTrue;