When it comes to unloading of localization assets, I have found in your documentation and forum answers that the addressable system is responsible for it.
Could you explain how exactly the localization system does notify the addressable system that all tables of a locale are being unloaded?
I’ve been analyzing the source code of your package and it is not easy to find an answer.
Releasing assets is not fully implemented yet.
Currently, we only unload when the SelectedLocale is changed which is performed in LocalizedDatabase.OnLocaleChanged
public virtual void OnLocaleChanged(Locale locale)
{
foreach (var to in TableOperations.Values)
{
Addressables.Release(to);
}
m_PreloadOperationHandle = null;
TableOperations.Clear();
}
So as I understand, tables and assets are loaded on demand but just unloaded when switching language.
Is there a possibility to manually unload tables that we don’t need anymore?
Hi there, is there any behavioral change on how localization package handles asset unloads? We are having a problem with our assets. When the parent gameobject is set to inactive, the assets get unloaded. When the object is set to active again, we see only white boxes in our ui images.
EDIT: we are using addressables 1.19.19 and localization 1.4.0-exp.1
How do you know it has not unloaded the bundle? Which bundle is not unloaded?
For the bundle to be unloaded all references to it must be released. We had some bugs in this area which we fixed in 1.4.2.
I’m currently tracking each request directly on webGL build, below you can see that the first time loading “MainMenu” all Localization bundles are loaded as expected, however the same thing does not happen when reloading “MainMenu”.
(The same happens to other scenes)
That makes me believe they are getting cached somewhere which should not happen since im using the same configuration in other asset bundles, and those get properly reloaded.
Currently using 1.3.2, I’ll seek to update if possible.
Updating seems to not fix the issue.
Current versions: Unity 2021.3.15f1 Addressables 1.20.5 Localization 1.4.2
You will need to update to 1.4.2 first. If the option is not in the package manager then you can manually edit the manifest.json file in the Packages directory and change the version.
Try using the Addressables Event Viewer. It will show you what is still loaded and should provide some hints why, operation still held etc. Event Viewer | Addressables | 1.20.5
Updating seems to not fix the issue.
Current versions: Unity 2021.3.15f1 Addressables 1.20.5 Localization 1.4.2
I’ve tried using the EventViewer in the past, but I feel like it shows to much information, i’m not really interested on any calls to a already loaded bundle, the main issue is the localization bundles not getting unloaded in the same way as the other bundles. I’ll make sure to give it another try tho, and get back with any feedback I get.
Tell me If there is any other thing I can try, I would be very grateful. This is currently the only and biggest hiccup we are having on the management of our Assets
The EventViewer should indicate why the bundle is not being released, usually because it still has dependencies.
You can try loading an empty scene with no localized assets being used and see if the bundles are still loaded. If they are feel free to file a bug report.
Update, i’ve managed to fix it mostly by try and error.
Below follows the code that fixed it, the only change I added was LocalizationSettings.SelectedLocale = null; it seems that Localization was not getting properly reloaded since I was changing to the same Locale.