diff --git a/Source/StevesUEHelpers/Private/StevesBPL.cpp b/Source/StevesUEHelpers/Private/StevesBPL.cpp index 9ef490b..03c4c9c 100644 --- a/Source/StevesUEHelpers/Private/StevesBPL.cpp +++ b/Source/StevesUEHelpers/Private/StevesBPL.cpp @@ -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(); + } +} \ No newline at end of file diff --git a/Source/StevesUEHelpers/Public/StevesBPL.h b/Source/StevesUEHelpers/Public/StevesBPL.h index aaa19c5..e53797b 100644 --- a/Source/StevesUEHelpers/Public/StevesBPL.h +++ b/Source/StevesUEHelpers/Public/StevesBPL.h @@ -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); + };