mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 15:01:53 +08:00
73e34e07d2
- 在ColorBar中添加lastChangeTime记录最后变化时间,配合GameRule.detainTime实现血量变化延迟动画 - 新增forceSync方法用于强制同步状态条显示 - 调整EntityBase初始化顺序,确保状态条正确初始化 - 在GameRule中添加detainTime配置项控制动画延迟时间
14 lines
366 B
GDScript
14 lines
366 B
GDScript
extends Node
|
|
class_name EntityStateBar
|
|
|
|
@export var entity: EntityBase
|
|
|
|
@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()
|