1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-28 06:51:54 +08:00
Files
Dog-Lynx-And-HCN/scripts/Statemachine/TipBox.gd
T
fallingshrimp a6ece59c71 feat(UI): 添加波次开始提示并优化提示框功能
- 在Wave.gd中添加波次开始时的UI提示
- 调整UI.tscn中提示框的布局和位置
- 修复TipBox.gd中实例化组件的错误
- 修改UIState.gd中提示框的显示逻辑,支持自动销毁
2026-01-24 15:54:42 +08:00

25 lines
514 B
GDScript

@tool
extends PanelContainer
class_name TipBox
@export var text: String = "nothing"
@onready var label: Label = $%label
@onready var animator: AnimationPlayer = $%animator
func _ready():
label.text = text
animator.play("show")
func _process(_delta):
label.text = text
func destroy():
animator.play("hide")
await animator.animation_finished
queue_free()
static func create(applyText: String) -> TipBox:
var box = ComponentManager.getUIComponent("TipBox").instantiate()
box.text = applyText
return box