更新game HUD 界面
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,8 +7,8 @@ namespace IndianOceanAssets.Engine2_5D
|
||||
{
|
||||
[Range(1, 100)]
|
||||
[SerializeField]
|
||||
private int maxHealth = 100; // Maximum health
|
||||
private int health = 100; // Current health
|
||||
private int maxHealth = 5; // Maximum health
|
||||
private int health = 5; // Current health
|
||||
|
||||
[SerializeField]
|
||||
private GameObject deathEffect; // Effect prefab on death
|
||||
|
||||
Reference in New Issue
Block a user