角色能力,存档
This commit is contained in:
@@ -15,7 +15,7 @@ namespace BaseGames.Camera
|
||||
/// <list type="number">
|
||||
/// <item><see cref="CameraAsymmetricDampingExtension"/> — 先对 Y 轴做非对称阻尼平滑;</item>
|
||||
/// <item><b>本扩展(CameraFallBiasExtension)</b> — 将偏置叠加到平滑后的 Y 上;</item>
|
||||
/// <item><c>CinemachineConfiner2D</c> — 最后将偏置后的位置裁剪回限位边界内。</item>
|
||||
/// <item><c>CinemachineConfiner3D</c> — 最后将偏置后的位置裁剪回限位边界内。</item>
|
||||
/// </list>
|
||||
/// <para>如果顺序错误(本扩展在 Confiner 之后),偏置会导致相机超出限位边界且不被修正。</para>
|
||||
/// </summary>
|
||||
@@ -98,10 +98,10 @@ namespace BaseGames.Camera
|
||||
return;
|
||||
}
|
||||
|
||||
// ── 估算玩家 Y 轴速度(负值 = 下落)────────────────────────────
|
||||
// ── 估算玩家 Y 轴速度(帧率无关指数平滑)─────────────────────
|
||||
float rawVY = (follow.position.y - _lastFollowY) / deltaTime;
|
||||
_lastFollowY = follow.position.y;
|
||||
_smoothedVY = Mathf.Lerp(_smoothedVY, rawVY, deltaTime * 10f);
|
||||
_smoothedVY = Mathf.Lerp(_smoothedVY, rawVY, 1f - Mathf.Exp(-deltaTime * 10f));
|
||||
|
||||
bool isFalling = _smoothedVY < -_fallSpeedThreshold;
|
||||
|
||||
@@ -115,7 +115,7 @@ namespace BaseGames.Camera
|
||||
// 超过 activationDelay 后线性增加偏置;0.4s 达到最大
|
||||
float effectiveMax = _configuredMaxShift >= 0f ? _configuredMaxShift : _maxShift;
|
||||
float ratio = Mathf.Clamp01((_fallTimer - _activationDelay) / 0.4f);
|
||||
float targetShift = -effectiveMax * ratio; // 负就:相机向下
|
||||
float targetShift = -effectiveMax * ratio; // 负值:相机向下
|
||||
|
||||
// 使用指数衰减公式(帧率无关)替代 Lerp*deltaTime
|
||||
float dampingTime = targetShift < _currentShift
|
||||
|
||||
Reference in New Issue
Block a user