challenge-editor/scene/character_select_card.gd
2024-09-20 12:02:11 +08:00

37 lines
731 B
GDScript

extends TextureRect
var is_selected:bool=false:
set(val):
if val!=is_selected:
if val:
%select_texture.show()
else:
%select_texture.hide()
pass
is_selected=val
@onready var texture_face: TextureRect = %texture_face
var data:Dictionary={
}
signal pressed(data,node,is_select)
func _on_tool_button_pressed() -> void:
is_selected=!is_selected
pressed.emit(data,self,is_selected)
pass # Replace with function body.
func _ready() -> void:
#set_data(Global.get_character_data("test_character_01"))
pass
func set_data(_data:Dictionary):
data=_data
var skin_data=data["character"]["skin"][data["character"]["skin_now_use"]]
texture_face.texture=Global.get_texture(skin_data["card_face"])
pass