If you try to load more than one asset from a bundle using AssetLoader, you get this message for each asset after the first:
This was mentioned in the "How to convert your Plugin" 1.1 thread, but that sub-forum is now hidden, so I don't know if there was discussion elsewhere.
I've been trying to work around this issue, and one thing I find is that AssetLoader.LoadedBundles has an AssetBundle in it when the loader callback fires, and the bundle has all three shaders I was looking for. So, I suppose that is one way to work around this behavior. The AssetBundle doesn't have a name, so I still have to do some extra checks in case other asset bundles show up in the list.
Here's the code snippet I'm using to trigger this error:
KSPAssets.AssetDefinition[] rpmShaders = KSPAssets.Loaders.AssetLoader.GetAssetDefinitionsWithType("JSI/RasterPropMonitor/rasterpropmonitor", typeof(Shader));
if(rpmShaders == null || rpmShaders.Length == 0)
{
// Log an error
return;
}
KSPAssets.Loaders.AssetLoader.LoadAssets(AssetsLoaded, rpmShaders);
rpmShaders has 3 objects in it. When the callback gets called, only AssetLoader.Loader.objects[0] is valid - the [1] and [2] entries are null.