当前位置: 首页>>代码示例>>C++>>正文


C++ FGameplayEffectContextHandle::GetHitResult方法代码示例

本文整理汇总了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();
}
开发者ID:amyvmiwei,项目名称:UnrealEngine4,代码行数:9,代码来源:AbilitySystemBlueprintLibrary.cpp

示例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());
	}
}
开发者ID:WasPedro,项目名称:UnrealEngine4.11-HairWorks,代码行数:17,代码来源:GameplayAbilityTargetTypes.cpp

示例3: EffectContextHasHitResult

bool UAbilitySystemBlueprintLibrary::EffectContextHasHitResult(FGameplayEffectContextHandle EffectContext)
{
	return EffectContext.GetHitResult() != NULL;
}
开发者ID:amyvmiwei,项目名称:UnrealEngine4,代码行数:4,代码来源:AbilitySystemBlueprintLibrary.cpp

示例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;
}
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:77,代码来源:GameplayCueView.cpp


注:本文中的FGameplayEffectContextHandle::GetHitResult方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。