/// <summary>
 /// 加载字典
 /// </summary>
 /// <param name="dictionaryName">字典名称</param>
 /// <param name="dictionaryAssetName">字典资源名称</param>
 /// <param name="loadType">字典加载方式</param>
 /// <param name="priority">加载字典资源的优先级</param>
 /// <param name="userData">用户自定义数据</param>
 public void LoadDictionary(string dictionaryName, string dictionaryAssetName, LoadType loadType, int priority, object userData = null)
 {
     if (string.IsNullOrEmpty(dictionaryName))
     {
         Log.Error("[LocalizationComponent.LoadDictionary] Dictionary name is invalid.");
         return;
     }
     m_LocalizationManager.LoadDictionary(dictionaryAssetName, loadType, priority, new LoadDictionaryInfo(dictionaryName, userData));
 }
Exemplo n.º 2
0
        /// <summary>
        /// 加载字典。
        /// </summary>
        /// <param name="dictionaryName">字典名称。</param>
        /// <param name="dictionaryAssetName">字典资源名称。</param>
        /// <param name="userData">用户自定义数据。</param>
        public void LoadDictionary(string dictionaryName, string dictionaryAssetName, object userData)
        {
            if (string.IsNullOrEmpty(dictionaryName))
            {
                Log.Error("Dictionary name is invalid.");
                return;
            }

            m_LocalizationManager.LoadDictionary(dictionaryAssetName, new LoadDictionaryInfo(dictionaryName, userData));
        }
        /// <summary>
        /// 加载字典。
        /// </summary>
        /// <param name="dictionaryName">字典名称。</param>
        /// <param name="dictionaryAssetName">字典资源名称。</param>
        /// <param name="loadType">字典加载方式。</param>
        /// <param name="priority">加载字典资源的优先级。</param>
        /// <param name="userData">用户自定义数据。</param>
        public void LoadDictionary(string dictionaryName, string dictionaryAssetName, LoadType loadType, int priority, object userData)
        {
            if (string.IsNullOrEmpty(dictionaryName))
            {
                Log.Error("Dictionary name is invalid.");
                return;
            }

            LoadDictionaryInfo loadDictionaryInfo = ReferencePool.Acquire <LoadDictionaryInfo>();

            loadDictionaryInfo.Initialize(dictionaryName, userData);
            m_LocalizationManager.LoadDictionary(dictionaryAssetName, loadType, priority, loadDictionaryInfo);
        }