mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 23:11:54 +08:00
14 lines
281 B
GDScript
14 lines
281 B
GDScript
|
|
@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)]
|