1. 官网异步加载文档
https://docs.unrealengine.com/zh-CN/Programming/Assets/AsyncLoading/index.html
2. 官网中的UGameGlobals,没有找到。
3. 解决方法:参考Engine\Source\Runtime\UMG\Private\Components\Image.cpp
void UImage::SetBrushFromSoftTexture(TSoftObjectPtr<UTexture2D> SoftTexture, bool bMatchSize)
{
CancelTextureStreaming();
TWeakObjectPtr<UImage> WeakThis(this); // using weak ptr in case 'this' has gone out of scope by the time this lambda is called
StreamingHandle =
UAssetManager::GetStreamableManager().RequestAsyncLoad(SoftTexture.ToSoftObjectPath(),
[WeakThis, SoftTexture, bMatchSize]() {
if (WeakThis.IsValid())
{
WeakThis->SetBrushFromTexture(SoftTexture.Get(), bMatchSize);
}
}, FStreamableManager::AsyncLoadHighPriority);
}