Exemplo n.º 1
0
        /// <summary>
        /// 初始化显示实体成功事件的新实例。
        /// </summary>
        /// <param name="e">内部事件。</param>
        public ShowEntitySuccessEventArgs(GameFramework.Entity.ShowEntitySuccessEventArgs e)
        {
            ShowEntityInfo showEntityInfo = (ShowEntityInfo)e.UserData;

            EntityLogicType = showEntityInfo.EntityLogicType;
            Entity          = (Entity)e.Entity;
            Duration        = e.Duration;
            UserData        = showEntityInfo.UserData;
        }
        /// <summary>
        /// 初始化显示实体成功事件的新实例。
        /// </summary>
        /// <param name="e">内部事件。</param>
        public ShowEntitySuccessEventArgs(GameFramework.Entity.ShowEntitySuccessEventArgs e)
        {
            ShowEntityInfo showEntityInfo = e.UserData as ShowEntityInfo;

            EntityLogicType = showEntityInfo.EntityLogicType;
            EntityAssetName = e.EntityAssetName;
            Entity          = e.Entity as Entity;
            UserData        = showEntityInfo.UserData;
        }
        /// <summary>
        /// 填充显示实体成功事件
        /// </summary>
        /// <param name="e">内部事件</param>
        /// <returns>显示实体成功事件</returns>
        public ShowEntitySuccessEventArgs Fill(GameFramework.Entity.ShowEntitySuccessEventArgs e)
        {
            ShowEntityInfo showEntityInfo = e.UserData as ShowEntityInfo;

            EntityLogicType = showEntityInfo.EntityLogicType;
            Entity          = (Entity)e.Entity;
            Duration        = e.Duration;
            UserData        = showEntityInfo.UserData;
            ReferencePool.Release(showEntityInfo);  //这里回收
            return(this);
        }
        /// <summary>
        /// 创建显示实体成功事件。
        /// </summary>
        /// <param name="e">内部事件。</param>
        /// <returns>创建的显示实体成功事件。</returns>
        public static ShowEntitySuccessEventArgs Create(GameFramework.Entity.ShowEntitySuccessEventArgs e)
        {
            ShowEntityInfo             showEntityInfo             = (ShowEntityInfo)e.UserData;
            ShowEntitySuccessEventArgs showEntitySuccessEventArgs = ReferencePool.Acquire <ShowEntitySuccessEventArgs>();

            showEntitySuccessEventArgs.EntityLogicType = showEntityInfo.EntityLogicType;
            showEntitySuccessEventArgs.Entity          = (Entity)e.Entity;
            showEntitySuccessEventArgs.Duration        = e.Duration;
            showEntitySuccessEventArgs.UserData        = showEntityInfo.UserData;
            ReferencePool.Release(showEntityInfo);
            return(showEntitySuccessEventArgs);
        }
Exemplo n.º 5
0
 private void OnShowEntitySuccess(object sender, GameFramework.Entity.ShowEntitySuccessEventArgs e)
 {
     m_EventComponent.Fire(this, ReferencePool.Acquire <ShowEntitySuccessEventArgs>().Fill(e));
 }