//移动控制,包括X轴移动、跳跃、下蹲;通过向移动组件“请求”实现。 private void MoveControl() { if (platform == PlatformJudge.Platfrom.PC || platform == PlatformJudge.Platfrom.WEB_PC) { tempMovement.x = Input.GetAxis("Horizontal"); movementComponent.RequestMoveByFrame(tempMovement, MovementPlayer.MovementMode.PlayerControl, Space.Self); if (Input.GetButtonDown("Jump")) { movementComponent.RequestJump(); } if (Input.GetButton("Crouch")) { movementComponent.RequestChangeControlStatus(0f, MovementPlayer.PlayerControlStatus.Crouch); } } else { tempMovement.x = joystick.Horizontal; movementComponent.RequestMoveByFrame(tempMovement, MovementPlayer.MovementMode.PlayerControl, Space.Self); if (platformJudge.IsJump()) { movementComponent.RequestJump(); platformJudge.ClearJump(); } if (joystick.Vertical < -0.5f) { movementComponent.RequestChangeControlStatus(0f, MovementPlayer.PlayerControlStatus.Crouch); } } }
public override void ReleaseSpell() { GameObject target = thunderAbility.GetClosestTargetInList(thunderAbility.GetTargetInThunderCircle()); if (target != null) { Vector2 targetPosition = target.transform.position; targetPosition.x += target.transform.localScale.x < 0 ? 2 : -2; movementPlayer.RequestMoveByFrame(targetPosition, MovementPlayer.MovementMode.Ability, Space.World); canFight.Attack(target.GetComponent <CanBeFighted>(), 1, AttackInterruptType.WEAK, ElementAbilityManager.Element.Ice); } //播放攻击动画 }
public override void ReleaseSpell() { movementComponent.RequestMoveByFrame(blinkBackPositions[(BBCurPointer + 1) % BBVectorSize], MovementPlayer.MovementMode.Ability, Space.World); }