Add function to force update streaming

This commit is contained in:
Steve Streeting 2024-07-30 12:31:31 +01:00
parent 5870e7b2fb
commit 39f9aefb68
2 changed files with 18 additions and 0 deletions

View File

@ -38,3 +38,13 @@ void UStevesBPL::AddViewOriginToStreaming(const FVector& ViewOrigin,
Duration,
ActorToBoost);
}
void UStevesBPL::UpdateStreaming(float DeltaTime, bool bBlockUntilDone)
{
FStreamingManagerCollection& SM = IStreamingManager::Get();
SM.UpdateResourceStreaming(DeltaTime, true);
if (bBlockUntilDone)
{
SM.BlockTillAllRequestsFinished();
}
}

View File

@ -98,4 +98,12 @@ public:
AActor* ActorToBoost = nullptr);
/**
* Force content streaming to update. Useful if you need things to stream in sooner than usual.
* @param DeltaTime The amount of time to tell the streaming system that has passed.
* @param bBlockUntilDone If true, this call will not return until the streaming system has updated
*/
UFUNCTION(BlueprintCallable, Category="StevesUEHelpers|Streaming")
static void UpdateStreaming(float DeltaTime, bool bBlockUntilDone = false);
};