bool AAIController::ResumeMove(FAIRequestID RequestToResume) { if (PathFollowingComponent != NULL && RequestToResume.IsEquivalent(PathFollowingComponent->GetCurrentRequestId())) { PathFollowingComponent->ResumeMove(RequestToResume); return true; } return false; }
bool AAIController::PauseMove(FAIRequestID RequestToPause) { if (PathFollowingComponent != NULL && RequestToPause.IsEquivalent(PathFollowingComponent->GetCurrentRequestId())) { PathFollowingComponent->PauseMove(RequestToPause, EPathFollowingVelocityMode::Reset); return true; } return false; }
void UCrowdFollowingComponent::PauseMove(FAIRequestID RequestID, bool bResetVelocity) { if (bEnableCrowdSimulation && (Status != EPathFollowingStatus::Paused) && RequestID.IsEquivalent(GetCurrentRequestId())) { UCrowdManager* CrowdManager = UCrowdManager::GetCurrent(GetWorld()); if (CrowdManager) { CrowdManager->PauseAgent(this); } } Super::PauseMove(RequestID, bResetVelocity); }
void UCrowdFollowingComponent::AbortMove(const FString& Reason, FAIRequestID RequestID, bool bResetVelocity, bool bSilent, uint8 MessageFlags) { if (bEnableCrowdSimulation && (Status != EPathFollowingStatus::Idle) && RequestID.IsEquivalent(GetCurrentRequestId())) { UCrowdManager* CrowdManager = UCrowdManager::GetCurrent(GetWorld()); if (CrowdManager) { CrowdManager->ClearAgentMoveTarget(this); } } Super::AbortMove(Reason, RequestID, bResetVelocity, bSilent, MessageFlags); }
void UCrowdFollowingComponent::ResumeMove(FAIRequestID RequestID) { if (bEnableCrowdSimulation && (Status == EPathFollowingStatus::Paused) && RequestID.IsEquivalent(GetCurrentRequestId())) { UCrowdManager* CrowdManager = UCrowdManager::GetCurrent(GetWorld()); if (CrowdManager) { const bool bReplanPath = bEnableSimulationReplanOnResume && HasMovedDuringPause(); CrowdManager->ResumeAgent(this, bReplanPath); } // reset cached direction, will be set again after velocity update // but before it happens do not change actor's focus point (rotation) CrowdAgentMoveDirection = FVector::ZeroVector; } Super::ResumeMove(RequestID); }
void UAIAsyncTaskBlueprintProxy::OnMoveCompleted(FAIRequestID RequestID, EPathFollowingResult::Type MovementResult) { if (RequestID.IsEquivalent(MoveRequestId) && AIController.IsValid(true)) { AIController->ReceiveMoveCompleted.RemoveDynamic(this, &UAIAsyncTaskBlueprintProxy::OnMoveCompleted); if (MovementResult == EPathFollowingResult::Success) { OnSuccess.Broadcast(MovementResult); } else { OnFail.Broadcast(MovementResult); } UAISystem* const AISystem = UAISystem::GetCurrentSafe(MyWorld.Get()); if (AISystem) { AISystem->RemoveReferenceToProxyObject(this); } } }