欢迎大家加入Unreal Engine C++ & Blueprint群一起交流:1143575617
本节要为GroundBlast招式发招地点增加一个粒子系统。
将ConfirmTargetingAndContinue方法中的代码进行修改,如下:
FGameplayAbilityTargetData_LocationInfo* centerlocation = new FGameplayAbilityTargetData_LocationInfo();
centerlocation->TargetLocation.LocationType = EGameplayAbilityTargetingLocationType::LiteralTransform;
centerlocation->TargetLocation.LiteralTransform = Decal->GetComponentTransform();
if (overlapedActors.Num() > 0) {
FGameplayAbilityTargetDataHandle TargetDataHandle = StartLocation.MakeTargetDataHandleFromActors(overlapedActors);
TargetDataHandle.Add(centerlocation);
TargetDataReadyDelegate.Broadcast(TargetDataHandle);
}
else {
TargetDataReadyDelegate.Broadcast(FGameplayAbilityTargetDataHandle(centerlocation));
}
其他代码保持不动。
在招式中增加粒子系统