예제 #1
0
        //拉栓
        private void DoPull(PlayerWeaponController controller, WeaponSideCmd cmd)
        {
            if (controller.RelatedThrowAction.IsReady && !controller.RelatedThrowAction.IsPull)
            {
                if (GlobalConst.EnableWeaponLog)
                {
                    DebugUtil.MyLog("Do Pull");
                }

                controller.RelatedThrowAction.IsPull          = true;
                controller.RelatedThrowAction.LastPullTime    = controller.RelatedTime;
                controller.RelatedThrowAction.ShowCountdownUI = true;
                controller.RelatedThrowAction.IsInterrupt     = false;
                //生成Entity
                int renderTime = cmd.UserCmd.RenderTime;
                var dir        = BulletDirUtility.GetThrowingDir(controller);
                controller.RelatedThrowAction.ThrowingEntityKey           = _throwingFactory.CreateThrowing(controller, dir, renderTime, GetInitVel(controller));
                controller.HeldWeaponAgent.RunTimeComponent.LastBulletDir = dir;
                //弹片特效
                if (cmd.UserCmd.IsReload)
                {
                    controller.AddAuxEffect(EClientEffectType.PullBolt);
                }
                if (controller.AudioController != null)
                {
                    controller.AudioController.PlaySimpleAudio(EAudioUniqueId.GrenadeTrigger, true);
                }
            }
        }
예제 #2
0
 //拉栓
 private void DoPull(PlayerWeaponController controller, IWeaponCmd cmd)
 {
     if (controller.RelatedThrowActionInfo.IsReady && !controller.RelatedThrowActionInfo.IsPull)
     {
         controller.RelatedThrowActionInfo.IsPull          = true;
         controller.RelatedThrowActionInfo.LastPullTime    = controller.RelatedTime.ClientTime;
         controller.RelatedThrowActionInfo.ShowCountdownUI = true;
         controller.RelatedThrowActionInfo.IsInterrupt     = false;
         //生成Entity
         int renderTime = cmd.RenderTime;
         var dir        = BulletDirUtility.GetThrowingDir(controller);
         controller.RelatedThrowActionInfo.ThrowingEntityKey       = _throwingFactory.CreateThrowing(controller, dir, renderTime, GetInitVel(controller));
         controller.HeldWeaponAgent.RunTimeComponent.LastBulletDir = dir;
         //弹片特效
         if (cmd.IsReload)
         {
             controller.AddAuxEffect(EClientEffectType.PullBolt);
         }
         //     controller.weaponState.BagLocked = true;
     }
 }
예제 #3
0
 //拉栓
 private void DoPull(IPlayerWeaponState playerWeapon, IWeaponCmd cmd)
 {
     if (playerWeapon.ThrowingActionInfo.IsReady && !playerWeapon.ThrowingActionInfo.IsPull)
     {
         playerWeapon.ThrowingActionInfo.IsPull          = true;
         playerWeapon.ThrowingActionInfo.LastPullTime    = playerWeapon.ClientTime;
         playerWeapon.ThrowingActionInfo.ShowCountdownUI = true;
         playerWeapon.ThrowingActionInfo.IsInterrupt     = false;
         //生成Entity
         int renderTime = cmd.RenderTime;
         var dir        = BulletDirUtility.GetThrowingDir(playerWeapon);
         playerWeapon.ThrowingActionInfo.ThrowingEntityKey = _throwingFactory.CreateThrowing(playerWeapon, dir, renderTime, GetInitVel(playerWeapon));
         playerWeapon.LastBulletDir = dir;
         //弹片特效
         if (cmd.IsReload)
         {
             _weaponEffectLogic.CreatePullBoltEffect(playerWeapon);
         }
         playerWeapon.OnWeaponStateChanged();
     }
 }