Example #1
0
 private void OnLoadConfigSuccess(object sender, GameFramework.Config.LoadConfigSuccessEventArgs e)
 {
     if (m_EnableLoadConfigSuccessEvent)
     {
         m_EventComponent.Fire(this, ReferencePool.Acquire <LoadConfigSuccessEventArgs>().Fill(e));
     }
 }
Example #2
0
        /// <summary>
        /// 填充加载配置成功事件。
        /// </summary>
        /// <param name="e">内部事件。</param>
        /// <returns>加载配置成功事件。</returns>
        public LoadConfigSuccessEventArgs Fill(GameFramework.Config.LoadConfigSuccessEventArgs e)
        {
            LoadConfigInfo loadConfigInfo = (LoadConfigInfo)e.UserData;

            ConfigName      = loadConfigInfo.ConfigName;
            ConfigAssetName = e.ConfigAssetName;
            Duration        = e.Duration;
            UserData        = loadConfigInfo.UserData;

            return(this);
        }
        /// <summary>
        /// 填充加载配置成功事件
        /// </summary>
        /// <param name="e">框架内部事件</param>
        /// <returns>加载配置成功事件</returns>
        public LoadConfigSuccessEventArgs Fill(GameFramework.Config.LoadConfigSuccessEventArgs e)
        {
            LoadConfigInfo info = e.UserData as LoadConfigInfo; //内部的自定义数据为加载配置信息

            ConfigName      = info.ConfigName;
            ConfigAssetName = e.ConfigAssetName;
            LoadType        = e.LoadType;
            Duration        = e.Duration;
            UserData        = info.UserData;

            return(this);
        }
Example #4
0
        /// <summary>
        /// 创建加载全局配置成功事件。
        /// </summary>
        /// <param name="e">内部事件。</param>
        /// <returns>创建的加载全局配置成功事件。</returns>
        public static LoadConfigSuccessEventArgs Create(GameFramework.Config.LoadConfigSuccessEventArgs e)
        {
            LoadConfigInfo             loadConfigInfo             = (LoadConfigInfo)e.UserData;
            LoadConfigSuccessEventArgs loadConfigSuccessEventArgs = ReferencePool.Acquire <LoadConfigSuccessEventArgs>();

            loadConfigSuccessEventArgs.ConfigName      = loadConfigInfo.ConfigName;
            loadConfigSuccessEventArgs.ConfigAssetName = e.ConfigAssetName;
            loadConfigSuccessEventArgs.Duration        = e.Duration;
            loadConfigSuccessEventArgs.UserData        = loadConfigInfo.UserData;
            ReferencePool.Release(loadConfigInfo);
            return(loadConfigSuccessEventArgs);
        }
        /// <summary>
        /// 填充加载配置成功事件。
        /// </summary>
        /// <param name="e">内部事件。</param>
        /// <returns>加载配置成功事件。</returns>
        public LoadConfigSuccessEventArgs Fill(GameFramework.Config.LoadConfigSuccessEventArgs e)
        {
            LoadConfigInfo loadConfigInfo = (LoadConfigInfo)e.UserData;

            ConfigName      = loadConfigInfo.ConfigName;
            ConfigAssetName = e.ConfigAssetName;
            LoadType        = e.LoadType;
            Duration        = e.Duration;
            UserData        = loadConfigInfo.UserData;

            ReferencePool.Release(loadConfigInfo);
            return(this);
        }