1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-06-02 09:21:54 +08:00

feat(状态条): 添加血量变化延迟动画和强制同步功能

- 在ColorBar中添加lastChangeTime记录最后变化时间,配合GameRule.detainTime实现血量变化延迟动画
- 新增forceSync方法用于强制同步状态条显示
- 调整EntityBase初始化顺序,确保状态条正确初始化
- 在GameRule中添加detainTime配置项控制动画延迟时间
This commit is contained in:
2025-09-06 16:51:12 +08:00
parent 290a1bbef0
commit 73e34e07d2
4 changed files with 18 additions and 5 deletions
+5
View File
@@ -6,3 +6,8 @@ class_name EntityStateBar
@onready var healthBar: ColorBar = $"%health"
@onready var levelLabel: Label = $"%level"
@onready var levelLabels: HBoxContainer = $"%levelLabel"
func forceSync():
healthBar.maxValue = entity.fields[FieldStore.Entity.MAX_HEALTH]
healthBar.currentValue = entity.health
healthBar.forceSync()