1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-28 23:11:54 +08:00
Files
Dog-Lynx-And-HCN/scripts/Statemachine/TextSwitchButton.gd
T

14 lines
281 B
GDScript
Raw Normal View History

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