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:
@@ -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)]
|
||||
|
||||
Reference in New Issue
Block a user