Exemplo n.º 1
0
 private void OnLoadDictionaryUpdate(object sender, GameFramework.Localization.LoadDictionaryUpdateEventArgs e)
 {
     if (m_EnableLoadDictionaryUpdateEvent)
     {
         m_EventComponent.Fire(this, ReferencePool.Acquire <LoadDictionaryUpdateEventArgs>().Fill(e));
     }
 }
        /// <summary>
        /// 初始化加载字典更新事件的新实例。
        /// </summary>
        /// <param name="e">内部事件。</param>
        public LoadDictionaryUpdateEventArgs(GameFramework.Localization.LoadDictionaryUpdateEventArgs e)
        {
            LoadDictionaryInfo loadDictionaryInfo = e.UserData as LoadDictionaryInfo;

            DictionaryName      = loadDictionaryInfo.DictionaryName;
            DictionaryAssetName = e.DictionaryAssetName;
            Progress            = e.Progress;
            UserData            = loadDictionaryInfo.UserData;
        }
        /// <summary>
        /// 填充加载字典更新事件。
        /// </summary>
        /// <param name="e">内部事件。</param>
        /// <returns>加载字典更新事件。</returns>
        public LoadDictionaryUpdateEventArgs Fill(GameFramework.Localization.LoadDictionaryUpdateEventArgs e)
        {
            LoadDictionaryInfo loadDictionaryInfo = (LoadDictionaryInfo)e.UserData;

            DictionaryName      = loadDictionaryInfo.DictionaryName;
            DictionaryAssetName = e.DictionaryAssetName;
            Progress            = e.Progress;
            UserData            = loadDictionaryInfo.UserData;

            return(this);
        }
Exemplo n.º 4
0
        /// <summary>
        /// 创建加载字典更新事件。
        /// </summary>
        /// <param name="e">内部事件。</param>
        /// <returns>创建的加载字典更新事件。</returns>
        public static LoadDictionaryUpdateEventArgs Create(GameFramework.Localization.LoadDictionaryUpdateEventArgs e)
        {
            LoadDictionaryInfo            loadDictionaryInfo            = (LoadDictionaryInfo)e.UserData;
            LoadDictionaryUpdateEventArgs loadDictionaryUpdateEventArgs = ReferencePool.Acquire <LoadDictionaryUpdateEventArgs>();

            loadDictionaryUpdateEventArgs.DictionaryName      = loadDictionaryInfo.DictionaryName;
            loadDictionaryUpdateEventArgs.DictionaryAssetName = e.DictionaryAssetName;
            loadDictionaryUpdateEventArgs.Progress            = e.Progress;
            loadDictionaryUpdateEventArgs.UserData            = loadDictionaryInfo.UserData;
            return(loadDictionaryUpdateEventArgs);
        }