challenge-editor/scene/game_flow_touch.gd
2024-09-23 17:27:43 +08:00

38 lines
956 B
GDScript

extends MarginContainer
@onready var name_debug: Label = $name_debug
signal touch_click(data:Dictionary)
var data:Dictionary
var scene_id:String
var ind:String
func set_data(_data:Dictionary):
data=_data
name_debug.text==data["name"]
position=Vector2(data["position"][0],data["position"][1])
pass
func update_time():
pass
func judge():
var res:bool=true
if data.has("condition"):
var condition_data:Array=data["condition"]
for i in condition_data.size():
var new_condition_data:Dictionary=condition_data[i].duplicate()
var type:String=new_condition_data["type"]
var _data:Dictionary=new_condition_data["data"]
_data["scene_id"]=data["scene_id"]
_data["touch_id"]=data["name"]
_data["index"]=str(i)
res=res and Global.call_condition_triger(type,_data)
if res:
self.show()
else:
self.hide()
print(data["name"]+"判定结果:"+str(res))
func _on_tool_button_pressed() -> void:
pass # Replace with function body.