Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Question Does Localization cause Addressable to be initialized automatically?

Discussion in 'Localization Tools' started by nick0937, Dec 2, 2022.

  1. nick0937

    nick0937

    Joined:
    May 14, 2014
    Posts:
    8
    Hi, there!

    I have a project using both Addressable system and Localization system, Addressables uses the "Static Profile variables" way to modify the URLs it uses to load assets at runtime, but "Static Profile variables" must be set before Addressables are initialized.

    But the localization system seems to make the addressable system initialized automatically.

    My guess is that "Localization Settings > Available Locales" causes Addressable System to initialize?!

    The question is, is there any way to disable automatic initialization of the localization system when the application starts?

    I'm using Localization 1.4.2 and Unity 2020.3.42f1.

    Any advice would be greatly appreciated!
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,056
    Yes, localization will cause Addressables to initialize. You cant stop it but you could try using an Initialization object to set your value.

    https://docs.unity3d.com/Packages/com.unity.addressables@1.19/manual/InitializeAsync.html
    https://docs.unity3d.com/Packages/c...AssetSettings.html#initialization-object-list

    Alternatively you could place a scriptable object asset in the projects player settings preloaded assets. The OnEnable will be called first before localization initialization, you could then do your initialization here.
     
    Last edited: Dec 2, 2022