mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-29 07:21:54 +08:00
2c705fc4eb
- 为升华按钮添加开合动画效果 - 更新TextSwitchButton以支持动态文本切换 - 在Weapon.gd中添加动画播放逻辑
15 lines
331 B
GDScript
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)]
|