示例#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;
     }
 }