更新game HUD 界面

This commit is contained in:
2026-07-04 12:15:13 +08:00
parent 58d1f54e0d
commit 0b6dc2653f
21 changed files with 5347 additions and 597 deletions
@@ -10,12 +10,16 @@ namespace IndianOceanAssets.Engine2_5D
// The positional offset from the target.
[SerializeField] private Vector3 offset;
// Called once per frame.
private void Update()
[Tooltip("跟随平滑度(值越大跟随越紧密,10=几乎即时跟随)")]
[SerializeField] private float followSmoothness = 20f;
// Called once per frame — 使用 LateUpdate 确保在 FixedUpdate 物理移动之后执行,
// 与 LightMaskSystem 的 LateUpdate 同步,避免光照抖动
private void LateUpdate()
{
// If a target is assigned, smoothly move the camera towards the target's position plus the offset.
if (target)
transform.position = Vector3.Lerp(transform.position, target.position + offset, Time.deltaTime * 8f);
transform.position = Vector3.Lerp(transform.position, target.position + offset, Time.deltaTime * followSmoothness);
}
}
}