Currently my load path for externally exported Addressables packages is set to
{MapLevel.CurrentMapPath}/UnityData/[BuildTarget]
For ex. this code:
MapLevel.CurrentMapPath = "something";
var catalogPath = myPathHere;
Addressables.LoadContentCatalogAsync( catalogPath ).Completed += obj =>
{
if ( obj.Result != null )
{
Addressables.AddResourceLocator( obj.Result );
foreach ( var item in obj.Result.Keys )
{
//handling resources here
}
Addressables.RemoveResourceLocator( obj.Result );
}
Addressables.Release( obj );
};
Works fine until I run it again with different package. If on the 2nd run I change MapLevel.CurrentMapPath = "something2";
then do for ex. Addressables.LoadAssetAsync<SomeObject>( item )
the MapLevel.CurrentMapPath
is still evaluated (or cached?) to old "“something” and I get wrong path and missing file exception. How do I remove cached value and reevaluate {MapLevel.CurrentMapPath}?