7069人加入学习
(30人评价)
Unreal入门第一季 - 虚幻C++基础训练

制作完成于2019.8.27,基于Unreal 4.22

价格 免费

UPROPERTY();的宏参数

EditInstanceOnly 只能在实例中设置

VisibleInstanceOnly 只能在实例中可见

EditDefaultsOnly 只能在蓝图类中设置

VisibleDefaultsOnly 只能在蓝图类中可见

 

EditAnywhere 任何地方可设置

VisibleAnywhere 任何地方可见

[展开全文]

406

1.在MyActor头文件中声明两个成员变量:

public:

UPROPERTY(VisibleInstanceOnly,Category="My Actor Propertys|Vector")

FVector PlacedLocation;

UPROPERTY(EditDefaultsOnly,Category="My Actor Propertys|Vector")

//声明bool变量时,变量名必须以小写b开头(UE4要求)

bool bGotoInitLocation;

2.在MyActor源文件中进行初始化

PlacedLocation=FVector(0.0f);

bGotoInitLocation=false;

3.修改BeginPlay函数:

PlacedLocation=GetActorLocation();

if(bGotoInitLocation){

SetActorLocation(InitLocation);

}

 

[展开全文]

授课教师

SiKi学院讲师

课程特色

视频(49)
下载资料(1)