コード例 #1
0
ファイル: Controller.cpp プロジェクト: johndpope/UE4
void AController::UpdateNavigationComponents()
{
	UPathFollowingComponent* PathFollowingComp = FindComponentByClass<UPathFollowingComponent>();
	if (PathFollowingComp != NULL)
	{
		PathFollowingComp->UpdateCachedComponents();
	}
}
コード例 #2
0
void AController::UpdateNavigationComponents()
{
	UNavigationComponent* PathFindingComp = FindComponentByClass<UNavigationComponent>();
	if (PathFindingComp != NULL)
	{
		PathFindingComp->OnNavAgentChanged();
		PathFindingComp->UpdateCachedComponents();
	}

	UPathFollowingComponent* PathFollowingComp = FindComponentByClass<UPathFollowingComponent>();
	if (PathFollowingComp != NULL)
	{
		PathFollowingComp->UpdateCachedComponents();
	}

	// initialize movement mode in characters
	ACharacter* MyCharacter = Cast<ACharacter>(GetPawn());
	if (MyCharacter && MyCharacter->CharacterMovement)
	{
		MyCharacter->CharacterMovement->SetDefaultMovementMode();
	}
}