本文整理汇总了C++中FGameplayEffectContextHandle::GetHitResult方法的典型用法代码示例。如果您正苦于以下问题:C++ FGameplayEffectContextHandle::GetHitResult方法的具体用法?C++ FGameplayEffectContextHandle::GetHitResult怎么用?C++ FGameplayEffectContextHandle::GetHitResult使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FGameplayEffectContextHandle
的用法示例。
在下文中一共展示了FGameplayEffectContextHandle::GetHitResult方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: EffectContextGetHitResult
FHitResult UAbilitySystemBlueprintLibrary::EffectContextGetHitResult(FGameplayEffectContextHandle EffectContext)
{
if (EffectContext.GetHitResult())
{
return *EffectContext.GetHitResult();
}
return FHitResult();
}
示例2: AddTargetDataToContext
void FGameplayAbilityTargetData::AddTargetDataToContext(FGameplayEffectContextHandle& Context, bool bIncludeActorArray) const
{
if (bIncludeActorArray && (GetActors().Num() > 0))
{
Context.AddActors(GetActors());
}
if (HasHitResult() && !Context.GetHitResult())
{
Context.AddHitResult(*GetHitResult());
}
if (HasOrigin())
{
Context.AddOrigin(GetOrigin().GetLocation());
}
}
示例3: EffectContextHasHitResult
bool UAbilitySystemBlueprintLibrary::EffectContextHasHitResult(FGameplayEffectContextHandle EffectContext)
{
return EffectContext.GetHitResult() != NULL;
}
示例4: if
TSharedPtr<FGameplayCueViewEffects> FGameplayCueViewInfo::SpawnViewEffects(AActor *Owner, TArray<UObject*> *SpawnedObjects, const FGameplayEffectContextHandle& EffectContext) const
{
check(Owner);
TSharedPtr<FGameplayCueViewEffects> SpawnedEffects = TSharedPtr<FGameplayCueViewEffects>(new FGameplayCueViewEffects());
if (Sound)
{
SpawnedEffects->AudioComponent = UGameplayStatics::PlaySoundAttached(Sound, Owner->GetRootComponent());
if (SpawnedObjects)
{
SpawnedObjects->Add(SpawnedEffects->AudioComponent.Get());
}
}
if (ParticleSystem)
{
if (EffectContext.GetHitResult())
{
const FHitResult &HitResult = *EffectContext.GetHitResult();
if (AttachParticleSystem)
{
SpawnedEffects->ParticleSystemComponent = UGameplayStatics::SpawnEmitterAttached(ParticleSystem, Owner->GetRootComponent(), NAME_None, HitResult.Location,
HitResult.Normal.Rotation(), EAttachLocation::KeepWorldPosition);
}
else
{
bool AutoDestroy = SpawnedObjects == nullptr;
SpawnedEffects->ParticleSystemComponent = UGameplayStatics::SpawnEmitterAtLocation(Owner->GetWorld(), ParticleSystem, HitResult.Location, HitResult.Normal.Rotation(), AutoDestroy);
}
}
else
{
if (AttachParticleSystem)
{
SpawnedEffects->ParticleSystemComponent = UGameplayStatics::SpawnEmitterAttached(ParticleSystem, Owner->GetRootComponent());
}
else
{
bool AutoDestroy = SpawnedObjects == nullptr;
SpawnedEffects->ParticleSystemComponent = UGameplayStatics::SpawnEmitterAtLocation(Owner->GetWorld(), ParticleSystem, Owner->GetActorLocation(), Owner->GetActorRotation(), AutoDestroy);
}
}
if (SpawnedObjects)
{
SpawnedObjects->Add(SpawnedEffects->ParticleSystemComponent.Get());
}
else if (SpawnedEffects->ParticleSystemComponent.IsValid())
{
for (int32 EmitterIndx = 0; EmitterIndx < SpawnedEffects->ParticleSystemComponent->EmitterInstances.Num(); EmitterIndx++)
{
if (SpawnedEffects->ParticleSystemComponent->EmitterInstances[EmitterIndx] &&
SpawnedEffects->ParticleSystemComponent->EmitterInstances[EmitterIndx]->CurrentLODLevel &&
SpawnedEffects->ParticleSystemComponent->EmitterInstances[EmitterIndx]->CurrentLODLevel->RequiredModule &&
SpawnedEffects->ParticleSystemComponent->EmitterInstances[EmitterIndx]->CurrentLODLevel->RequiredModule->EmitterLoops == 0)
{
ABILITY_LOG(Warning, TEXT("%s - particle system has a looping emitter. This should not be used in a executed GameplayCue!"), *SpawnedEffects->ParticleSystemComponent->GetName());
break;
}
}
}
}
if (ActorClass)
{
FVector Location = Owner->GetActorLocation();
FRotator Rotation = Owner->GetActorRotation();
SpawnedEffects->SpawnedActor = Cast<AGameplayCueActor>(Owner->GetWorld()->SpawnActor(ActorClass, &Location, &Rotation));
if (SpawnedObjects)
{
SpawnedObjects->Add(SpawnedEffects->SpawnedActor.Get());
}
}
return SpawnedEffects;
}