Pickup Objective Actor

在角色的头文件中,添加一个布尔变量,设为共有状态,用来判断是否携带目标物体,并暴露给蓝图,类型为仅蓝图可读

    UPROPERTY(BlueprintReadOnly,Category="Gameplay")
bool bIsCarryingObjective;

当NotifyActorBeginOverlap发生时,检查是否与FPSCharacter中的角色发生重叠

AFPSCharacter* MyCharacter = Cast<AFPSCharacter>(OtherActor);
if (MyCharacter)
{
MyCharacter->bIsCarryingObjective = true; Destroy();
}
上一篇:关于C转汇编(转自网上)


下一篇:java scoket Blocking 阻塞IO socket通信二