TAssetSubclassOf Already loaded


I have this struct

class URoadList : public UDataAsset

	UPROPERTY(Category = Roads, EditAnywhere)
	TArray<TAssetSubclassOf<AActor>> RoadTypes;

The TArray is populated inside the ue4 editor containing several assets from which only one or two are suppose to load for each game session. So I am using FStreamableManager to do the async loading of those 1 or 2 assets.
FStreamableManager was not calling the delegate after it finished loading so after digging around I found out the TAssetSubClassOf were already loaded and the FStreamableManager did not bother to load them again.

The problem: why is TAssetSubClassOf.IsValid() returning true in the very beginning? I don’t want the asset to be loaded until I tell it to, the DataAsset may have a large number of assets that will never be used. I tried restarting the editor but still IsValid() is returning true for all assets.

Could someone enlighten me on how TAssetSubClassOf behavior is and why is this happening? By reading the documentation I assume that isValid() returns true then I can call Get() and obtain a valid asset which means the asset is already loaded…I don’t want this, I am doing something wrong?

Edit: The issue resolved itself out. I assume this has to do with editor caching mechanism. Taking a look at the source code I realized FStreamableManager only calls the delegate if at least one asset was loaded in the process. If anyone happens to have the same issue as me here is what I recommend: Check the array to see if at least one asset is Not Loaded and call for async loading. Otherwise assume that async loader will not call delegate and just call it yourself manually as all assets are already loaded. This verification seems to be needed at least when the editor is open as sometimes assets pointers are already loaded at game start but it’s not a bad idea to use it on the shipped game just to be sure.