Example #1
0
        //准备
        private void DoReady(PlayerWeaponController controller, WeaponSideCmd cmd)
        {
            var throwAction = controller.RelatedThrowAction;

            if (!throwAction.IsReady &&
                throwAction.ThrowingEntityKey == EntityKey.Default &&
                controller.RelatedThrowAction.LastFireWeaponKey == 0)
            {
                if (GlobalConst.EnableWeaponLog)
                {
                    DebugUtil.MyLog("Do Ready");
                }
                throwAction.IsReady   = true;
                throwAction.ReadyTime = controller.RelatedTime;
                throwAction.Config    = _throwingFactory.ThrowingConfig;
                //准备动作
                controller.RelatedCharState.InterruptAction();
                controller.RelatedCharState.StartFarGrenadeThrow(() =>
                {
                    controller.AutoStuffGrenade();
                    DebugUtil.MyLog("ThrowGrenadeFinished");
                });
                controller.RelatedThrowAction.LastFireWeaponKey = controller.HeldWeaponAgent.WeaponKey.EntityId;
            }
        }
Example #2
0
 //准备
 private void DoReady(PlayerWeaponController controller, WeaponSideCmd cmd)
 {
     if (!throwingActionData.CanReady())
     {
         return;
     }
     throwingActionData.SetReady(holdAgent.WeaponKey.EntityId, throwCfg.Throwing);
     //准备动作
     Logger.Info("[Tmp]Throw Interrupt");
     characterState.InterruptAction();
     characterState.StartFarGrenadeThrow(() =>
     {
         throwingActionData.IsThrowing = false;
         controller.AutoStuffGrenade();
     });
     controller.AudioController.PlaySimpleAudio(EAudioUniqueId.GrenadeReady, true);
 }