Only Load Resources Corresponding to the Current Language
If the game is small and not extreme, and you don't have to worry about memory, you can load resources for the current language without worrying about it.
However, if the game is large, or memory is limited, it is often only necessary to load the resources corresponding to the current language.
The first step in MyLocalization is typically to create localization items and associate resources in localization that, if not processed, will become available when their container resources (StringTable or current scene or LocalizationSetting presets) load. It is automatically loaded into memory by Unity. Instead of using Unity's default resource reference method, use the path load method to load the resource associated with the localization item on demand.
When it comes to path loading, MyLocalization needs a loader to load required resources based on the path. MyLocalization doesn't implement a complete loading scheme for users, but allows users to select or develop a loading scheme suitable for their projects.
So MyLocalization provides a loader interface called IResLoader for users to implement, allowing users to assign a resource loader to MyLocalization.
With the resource path and loader, MyLocalization gets resources properly even without Unity's default association. Different loaders may require different resource paths for the same resource, even though they all correspond to the same resource, so loaders that inherit the IResLoader interface need to tell MyLocalization what resource paths each resource generated and return them to MyLocalization.
Last updated