/// <summary> /// Register an <see cref="AssetLocalization" />.<br /> /// </summary> /// <param name="localization"></param> public static void RegisterLocalization(AssetLocalization localization) { if (!Instance.RegisteredLocalizations.Contains(localization)) { localization.SetupLanguage(Localization.instance.GetSelectedLanguage()); Instance.RegisteredLocalizations.Add(localization); } }
/// <summary> /// Load the localization <see cref="TextAsset" /> from a bundle. Asset name must be "localization". /// </summary> /// <param name="assetBundle"></param> public static void LoadLocalization(AssetBundle assetBundle) { var asset = assetBundle.LoadAsset <TextAsset>("localization"); if (asset != null) { var localization = new AssetLocalization(assetBundle.name, asset); AssetManager.RegisterLocalization(localization); } }