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


C++ AAIController::GetPathFollowingComponent方法代码示例

本文整理汇总了C++中AAIController::GetPathFollowingComponent方法的典型用法代码示例。如果您正苦于以下问题:C++ AAIController::GetPathFollowingComponent方法的具体用法?C++ AAIController::GetPathFollowingComponent怎么用?C++ AAIController::GetPathFollowingComponent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AAIController的用法示例。


在下文中一共展示了AAIController::GetPathFollowingComponent方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: AbortTask

EBTNodeResult::Type UBTTask_MoveDirectlyToward::AbortTask(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory)
{
	FBTMoveDirectlyTowardMemory* MyMemory = reinterpret_cast<FBTMoveDirectlyTowardMemory*>(NodeMemory);
	AAIController* MyController = OwnerComp.GetAIOwner();

	if (MyController && MyController->GetPathFollowingComponent())
	{
		MyController->GetPathFollowingComponent()->AbortMove(TEXT("BehaviorTree abort"), MyMemory->MoveRequestID);
	}

	return Super::AbortTask(OwnerComp, NodeMemory);
}
开发者ID:Foreven,项目名称:Unreal4-1,代码行数:12,代码来源:BTTask_MoveDirectlyToward.cpp

示例2: CalculateRawConditionValue

bool UBTDecorator_IsAtLocation::CalculateRawConditionValue(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory) const
{
	bool bHasReached = false;

	AAIController* AIOwner = OwnerComp.GetAIOwner();
	UPathFollowingComponent* PathFollowingComponent = AIOwner ? AIOwner->GetPathFollowingComponent() : nullptr;
	if (PathFollowingComponent)
	{
		const UBlackboardComponent* MyBlackboard = OwnerComp.GetBlackboardComponent();

		if (BlackboardKey.SelectedKeyType == UBlackboardKeyType_Object::StaticClass())
		{
			UObject* KeyValue = MyBlackboard->GetValue<UBlackboardKeyType_Object>(BlackboardKey.GetSelectedKeyID());
			AActor* TargetActor = Cast<AActor>(KeyValue);
			if (TargetActor)
			{
				bHasReached = PathFollowingComponent->HasReached(*TargetActor, AcceptableRadius, false, bUseNavAgentGoalLocation);
			}
		}
		else if (BlackboardKey.SelectedKeyType == UBlackboardKeyType_Vector::StaticClass())
		{
			const FVector TargetLocation = MyBlackboard->GetValue<UBlackboardKeyType_Vector>(BlackboardKey.GetSelectedKeyID());
			if (FAISystem::IsValidLocation(TargetLocation))
			{
				bHasReached = PathFollowingComponent->HasReached(TargetLocation, AcceptableRadius);
			}
		}
	}

	return bHasReached;
}
开发者ID:amyvmiwei,项目名称:UnrealEngine4,代码行数:31,代码来源:BTDecorator_IsAtLocation.cpp

示例3: End

void C_DudeMoveTo::End()
{
	if (cbHandle.IsValid())
	{
		AAIController* controller = CastChecked<AAIController>(m_Dude.GetController());
		controller->GetPathFollowingComponent()->OnMoveFinished.Remove(cbHandle);
		cbHandle.Reset();
	}
}
开发者ID:jijik,项目名称:portal_game,代码行数:9,代码来源:DudeActions.cpp

示例4: UnlockAIResourcesWithAnimation

void UAIBlueprintHelperLibrary::UnlockAIResourcesWithAnimation(UAnimInstance* AnimInstance, bool bUnlockMovement, bool UnlockAILogic)
{
	if (AnimInstance == NULL)
	{
		return;
	}

	APawn* PawnOwner = AnimInstance->TryGetPawnOwner();
	if (PawnOwner)
	{
		AAIController* OwningAI = Cast<AAIController>(PawnOwner->Controller);
		if (OwningAI)
		{
			if (bUnlockMovement && OwningAI->GetPathFollowingComponent())
			{
				OwningAI->GetPathFollowingComponent()->ClearResourceLock(EAIRequestPriority::HardScript);
			}
			if (UnlockAILogic && OwningAI->BrainComponent)
			{
				OwningAI->BrainComponent->ClearResourceLock(EAIRequestPriority::HardScript);
			}
		}
	}
}
开发者ID:amyvmiwei,项目名称:UnrealEngine4,代码行数:24,代码来源:AIBlueprintHelperLibrary.cpp

示例5: Start

//========================================================================
void C_DudeMoveTo::Start()
{
	AAIController* controller = CastChecked<AAIController>(m_Dude.GetController());
	auto ret = controller->MoveToLocation(target, -1.f, true, true, false, true, 0, false); //do not allow partial paths!
	if (ret == EPathFollowingRequestResult::Failed)
	{
		m_Dude.ClearActionQueue();
		cbHandle.Reset();
	}
	else
	{
		cbHandle = controller->GetPathFollowingComponent()->OnMoveFinished.AddRaw(this, &C_DudeMoveTo::OnMoveCompleted);
	}

}
开发者ID:jijik,项目名称:portal_game,代码行数:16,代码来源:DudeActions.cpp


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