Files
zeling_v2/Assets/_Game/Scripts/Player/PlayerMovementConfigSO.cs
Joywayer 47bdc67cdf feat: Implement DownDash ability and related systems
- Added DownDash ability with cooldown and speed configuration.
- Introduced DownDashState to handle down dashing mechanics, including gravity manipulation and animation playback.
- Updated PlayerMovement to support DownDash functionality.
- Enhanced PlayerStats to manage spring charge consumption and healing.
- Modified PlayerCombat and WeaponHitBoxInstance to support new hit confirmation events.
- Updated AbilityType to include new form types for character abilities.
- Improved Gizmos for better visualization of enemy detection and attack ranges.
- Added feedback systems for form switching in PlayerFeedback and IFeedbackPlayer.
- Refactored combat and movement states to accommodate new abilities and ensure smooth transitions.
2026-05-22 00:09:50 +08:00

97 lines
5.5 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using UnityEngine;
namespace BaseGames.Player
{
[CreateAssetMenu(menuName = "BaseGames/Player/MovementConfig")]
public class PlayerMovementConfigSO : ScriptableObject
{
[Header("地面移动")]
public float RunSpeed = 7f;
[Header("空中移动")]
[Tooltip("无水平输入时每个 FixedUpdate 帧水平速度的保留比例0~1。" +
"0.92 ≈ 半衰期 0.17s50Hz松开方向键后空中动量自然衰减。")]
[Range(0f, 1f)]
public float AirDragFactor = 0.92f;
[Header("跳跃")]
[Tooltip("一段跳初速度。推荐 18-20对应 ~4-5 格高度。")]
public float JumpForce = 19f;
[Tooltip("按住跳跃键可保持的郊狼时间。推荐 0.12s。")]
public float CoyoteTime = 0.12f;
[Tooltip("下落阶段额外重力倍率。推荐 3.5,使下落比上升更快、手感更紧实。")]
public float FallGravityMult = 3.5f;
[Tooltip("最大下落速度(终端速度)。推荐 22。")]
public float MaxFallSpeed = 22f;
[Tooltip("松开跳跃键时速度保留比例(变高跳)。推荐 0.35,越小跳跃越低。")]
[Range(0f, 1f)]
public float JumpCutMultiplier = 0.35f;
[Header("跳跃 — 顶点悬停")]
[Tooltip("顶点悬停触发阈值(单位/秒)。当 |垂直速度| 低于此值时,重力缩减为 ApexGravityMultiplier 倍,\n产生\"滞空感\"。推荐 3。调高 → 悬停段更长;调低 → 悬停段更短乃至消失。")]
public float ApexThreshold = 3f;
[Tooltip("顶点区间内重力缩减比例(乘以 DefaultGravityScale。推荐 0.3。\n0 = 完全无重力悬停1 = 无悬停效果(等同于关闭此功能)。")]
[Range(0f, 1f)]
public float ApexGravityMultiplier = 0.3f;
[Header("空中跳跃N 段跳)")]
[Tooltip("腾空期间最多可追加的跳跃次数。1 = 二段跳2 = 三段跳,以此类推。\n需同时在 PlayerStats 中解锁 DoubleJump 能力,否则此值无效。")]
public int MaxAirJumps = 1;
[Tooltip("空中追加跳跃的初速度。所有段数共用同一数值;设为与 JumpForce 相同可获得等高多段跳。")]
public float DoubleJumpForce = 19f;
[Header("冲刺")]
[Tooltip("冲刺速度(单位/秒)。推荐 25在 0.35s 内约穿越 7-8 格。")]
public float DashSpeed = 25f;
[Tooltip("冲刺持续时长(秒)。推荐 0.35s。")]
public float DashDuration = 0.35f;
[Tooltip("冲刺冷却时长(秒)。推荐 0.6s,落地后才可再次冲刺。")]
public float DashCooldown = 0.6f;
[Header("冲刺无敌帧(窗口 < 冲刺时长,且有独立 CD")]
[Tooltip("冲刺无敌窗口时长(秒)。仅为冲刺前段;窗口结束后即使仍在冲刺中也可受伤被打断(推荐 0.20s)。")]
public float DashInvincibilityDuration = 0.20f;
[Tooltip("无敌的独立冷却。CD 内再次冲刺不会获得无敌帧,防止连冲变相持续无敌(推荐 0.9s)。")]
public float DashInvincibilityCooldown = 0.9f;
[Header("下冲刺")]
[Tooltip("向下冲刺速度(单位/秒)。推荐 22快速向下穿透空间。")]
public float DownDashSpeed = 22f;
[Tooltip("向下冲刺持续时长(秒)。推荐 0.25s。")]
public float DownDashDuration = 0.25f;
[Header("抓墙 / 壁滑")]
[Tooltip("受限抓墙时(高于 wallGrabY的下滑速度单位/秒)。推荐 2。")]
public float WallSlideSpeed = 2f;
[Tooltip("正常抓墙时(低于等于 wallGrabY可蹬墙跳区间的缓慢下滑速度单位/秒)。\n" +
"设为 0 = 完全静止悬挂;推荐 1轻微下滑更有手感。")]
public float WallHangSpeed = 1f;
public float WallRayLength = 0.55f;
public float WallRayOffsetY = 0.2f;
[Tooltip("抓墙高度容差:当前 Y 不超过 wallGrabY + 此值时视为未抬升,防止浮点抖动误判。")]
public float WallGrabHeightTolerance = 0.05f;
[Tooltip("离开墙面后仍可触发蹬墙跳的缓冲时长(秒)。" +
"类比地面土狼时间,主动按↓脱离或墙面消失后,此窗口内按跳跃仍视为有效的蹬墙跳。推荐 0.12。")]
public float WallCoyoteTime = 0.12f;
[Header("蹬墙跳 — 背墙跳Jump Away远离墙壁斜上方")]
[Tooltip("背墙跳水平速度(远离墙壁方向)。推荐 14。")]
public float WallJumpAwayForceX = 14f;
[Tooltip("背墙跳垂直速度。推荐 18。")]
public float WallJumpAwayForceY = 18f;
[Header("蹬墙跳 — 对墙跳Jump Toward沿墙壁斜上方")]
[Tooltip("对墙跳水平速度(朝向墙壁方向,较小)。推荐 6。")]
public float WallJumpTowardForceX = 6f;
[Tooltip("对墙跳垂直速度(偏向正上方)。推荐 18。")]
public float WallJumpTowardForceY = 18f;
[Header("蹬墙跳 — 公共")]
[Tooltip("蹬墙跳后水平输入锁定时长(秒)。防止玩家立即向原墙壁方向输入取消起跳。推荐 0.15。")]
public float WallJumpInputLockDuration = 0.15f;
[Header("重力")]
public float DefaultGravityScale = 3f;
}
}