mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 06:51:54 +08:00
a6ece59c71
- 在Wave.gd中添加波次开始时的UI提示 - 调整UI.tscn中提示框的布局和位置 - 修复TipBox.gd中实例化组件的错误 - 修改UIState.gd中提示框的显示逻辑,支持自动销毁
25 lines
514 B
GDScript
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
|