Bundles default to unloaded and loading through the StreamableManager will not change any bundle states.
You can call:
UAssetManager.LoadPrimaryAsset/LoadPrimaryAssets/LoadPrimaryAssetsWithType (which take a list of bundles to load along with the asset)
UAssetManager.PreloadPrimaryAssets (also takes a list of bundles)
UAssetManager.ChangeBundleStateForPrimaryAssets/ChangeBundleStateForMatchingPrimaryAssets (which can load or unload bundles on an already loaded primary asset).
These are all async operations that don’t have synchronous versions. (but you can use the handle’s WaitUntilComplete function to make it synchronous on your own) PreloadPrimaryAssets works similar to the call you’re already making to the StreamableManager, where the assets are keep alive through references and the stream handle. The three other LoadPrimaryAsset functions keep the assets loaded through the AssetManager itself and they will remain loaded until you call UnloadPrimaryAsset/UnloadPrimaryAssets/UnloadPrimaryAssetsWithType.
Don’t use TEnumAsByte. Declare your enum as an enum class instead.
You get the AssetManager before the loop, but then you get it every iteration to get the StreamableManager.
Frankly this is a terrifying function. Either you should make 1 load request for all the elements you want, then loop over them. Or cache the category on the slot so that you can limit the assets you load to only the ones you actually need (and not just to check that member). Or just keep the asset loaded all the time (the expensive stuff is behind bundles anyway).
You shouldn’t need to manually release the stream handle. That’ll release when it goes out of scope (the loop iteration, or the function body if you were to take my #3 to heart).