Ejemplo n.º 1
0
        /// <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;
            LoadType            = e.LoadType;
            Progress            = e.Progress;
            UserData            = loadDictionaryInfo.UserData;

            return(this);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 填充加载字典失败事件
        /// </summary>
        /// <param name="e">内部事件</param>
        /// <returns>加载字典失败事件</returns>
        public LoadDictionaryFailureEventArgs Fill(GameFramework.Localization.LoadDictionaryFailureEventArgs e)
        {
            LoadDictionaryInfo loadDictionaryInfo = (LoadDictionaryInfo)e.UserData;

            DictionaryName      = loadDictionaryInfo.DictionaryName;
            DictionaryAssetName = e.DictionaryAssetName;
            LoadType            = e.LoadType;
            ErrorMessage        = e.ErrorMessage;
            UserData            = loadDictionaryInfo.UserData;

            return(this);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 填充加载字典成功事件
        /// </summary>
        /// <param name="e">内部事件</param>
        /// <returns>加载字典成功事件</returns>
        public LoadDictionarySuccessEventArgs Fill(GameFramework.Localization.LoadDictionarySuccessEventArgs e)
        {
            LoadDictionaryInfo loadDictionaryInfo = (LoadDictionaryInfo)e.UserData;

            DictionaryName      = loadDictionaryInfo.DictionaryName;
            DictionaryAssetName = e.DictionaryAssetName;
            LoadType            = e.LoadType;
            Duration            = e.Duration;
            UserData            = loadDictionaryInfo.UserData;

            return(this);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 填充加载字典依赖资源事件
        /// </summary>
        /// <param name="e">内部事件</param>
        /// <returns>加载字典依赖资源事件</returns>
        public LoadDictionaryDependencyAssetEventArgs Fill(GameFramework.Localization.LoadDictionaryDependencyAssetEventArgs e)
        {
            LoadDictionaryInfo loadDictionaryInfo = (LoadDictionaryInfo)e.UserData;

            DictionaryName      = loadDictionaryInfo.DictionaryName;
            DictionaryAssetName = e.DictionaryAssetName;
            DependencyAssetName = e.DependencyAssetName;
            LoadedCount         = e.LoadedCount;
            TotalCount          = e.TotalCount;
            UserData            = loadDictionaryInfo.UserData;

            return(this);
        }
        /// <summary>
        /// 加载字典
        /// </summary>
        /// <param name="dictionaryAsset">字典资源</param>
        /// <param name="loadType">字典加载方式。</param>
        /// <param name="userData">用户自定义数据</param>
        /// <returns>加载是否成功</returns>
        public bool LoadDictionary(object dictionaryAsset, LoadType loadType, object userData)
        {
            LoadDictionaryInfo info = userData as LoadDictionaryInfo;

            return(LoadDictionary(info.DictionaryName, dictionaryAsset, loadType, info.UserData));
        }