コード例 #1
0
ファイル: AssetManager.cs プロジェクト: Algorithman/Veilheim
 /// <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);
     }
 }
コード例 #2
0
ファイル: AssetLoader.cs プロジェクト: Algorithman/Veilheim
        /// <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);
            }
        }