UAssetObject undefined (asynchronous asset loading)

I’m following this documentation on asynchronous asset loading.

The problem in below code snippet is that UAssetObject is undefined.

TArray<FAssetData> AssetDatas;
ObjectLibrary->GetAssetDataList(AssetDatas);

for (int32 i = 0; i < AssetDatas.Num(); ++i)
{
       FAssetData& AssetData = AssetDatas[i];

       const FString* FoundTypeNameString = AssetData.TagsAndValues.Find(GET_MEMBER_NAME_CHECKED(UAssetObject,TypeName));

       if (FoundTypeNameString && FoundTypeNameString->Contains(TEXT("FooType")))
       {
              return AssetData;
       }
}

Is UAssetObject here just a dummy class name? what do I need to input here?

Yea it seems like dummy, i think need to put asset class name in there, like UTexture2D or UStaticMesh, every asset type you see in content browser have such a class which is usually name of asset type without spaces and with U prefix, asset class name will also be visible form reference path (right click “Copy Reference”) it the first word in there with U-prefix

Good, obviously the documentation regarding async asset loading is horrible, making fun of a reader, I tried this:

 const FString* found = ref.TagsAndValues.Find(GET_MEMBER_NAME_CHECKED(UStaticMeshComponent, UStaticMeshComponent::StaticClass()));

It compiles just fine(I know this should not work lol), but the problem is how to figure out what to input into GET_MEMBER_NAME_CHECKED and expect to get a valid asset string?

Looks like the answer is stay away of documentation, and go read engine code 10h per day and you will figure out a lot of cool stuff which even google won’t tell you :wink: