30 lines
973 B
C++
30 lines
973 B
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "LyraAssetManagerStartupJob.h"
|
|
|
|
#include "HAL/Platform.h"
|
|
#include "Logging/LogCategory.h"
|
|
#include "Logging/LogMacros.h"
|
|
#include "LyraLogChannels.h"
|
|
#include "Trace/Detail/Channel.h"
|
|
|
|
TSharedPtr<FStreamableHandle> FLyraAssetManagerStartupJob::DoJob() const
|
|
{
|
|
const double JobStartTime = FPlatformTime::Seconds();
|
|
|
|
TSharedPtr<FStreamableHandle> Handle;
|
|
UE_LOG(LogLyra, Display, TEXT("Startup job \"%s\" starting"), *JobName);
|
|
JobFunc(*this, Handle);
|
|
|
|
if (Handle.IsValid())
|
|
{
|
|
Handle->BindUpdateDelegate(FStreamableUpdateDelegate::CreateRaw(this, &FLyraAssetManagerStartupJob::UpdateSubstepProgressFromStreamable));
|
|
Handle->WaitUntilComplete(0.0f, false);
|
|
Handle->BindUpdateDelegate(FStreamableUpdateDelegate());
|
|
}
|
|
|
|
UE_LOG(LogLyra, Display, TEXT("Startup job \"%s\" took %.2f seconds to complete"), *JobName, FPlatformTime::Seconds() - JobStartTime);
|
|
|
|
return Handle;
|
|
}
|