1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-28 15:01:53 +08:00
Files
Dog-Lynx-And-HCN/scripts/Statemachine/TextSwitchButton.gd
T
fallingshrimp 2c705fc4eb feat(WeaponCard): 添加升华按钮动画效果
- 为升华按钮添加开合动画效果
- 更新TextSwitchButton以支持动态文本切换
- 在Weapon.gd中添加动画播放逻辑
2026-05-10 12:10:08 +08:00

15 lines
331 B
GDScript

@tool
extends Button
class_name TextSwitchButton
@export var pressedText: String = "已按下"
@export var unpressedText: String = "未按下"
func _ready():
updateText(button_pressed)
toggle_mode = true
toggled.connect(func(on: bool): updateText(on))
func updateText(on: bool):
text = [unpressedText, pressedText][int(on)]