1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-28 06:51:54 +08:00

feat(WeaponCard): 添加升华按钮动画效果

- 为升华按钮添加开合动画效果
- 更新TextSwitchButton以支持动态文本切换
- 在Weapon.gd中添加动画播放逻辑
This commit is contained in:
2026-05-10 12:10:08 +08:00
parent 70a80c036e
commit 2c705fc4eb
3 changed files with 145 additions and 7 deletions
+5 -4
View File
@@ -6,8 +6,9 @@ class_name TextSwitchButton
@export var unpressedText: String = "未按下"
func _ready():
updateText()
toggled.connect(updateText)
updateText(button_pressed)
toggle_mode = true
toggled.connect(func(on: bool): updateText(on))
func updateText():
text = [unpressedText, pressedText][int(button_pressed)]
func updateText(on: bool):
text = [unpressedText, pressedText][int(on)]