29 lines
641 B
GDScript
29 lines
641 B
GDScript
extends Node2D
|
|
class_name map
|
|
@export var map_id:String=""
|
|
@export var map_born_mark:Array[BornMark]
|
|
var pre_character_data:Array=[]
|
|
func _ready() -> void:
|
|
Global.now_map_id=map_id
|
|
for i in get_children():
|
|
if i is UnitMark2D:
|
|
var new_dic={
|
|
"unit_id":i.unit_id,
|
|
"type":i.unit_type,
|
|
"unit_data_from_id":i.unit_data_from_id,
|
|
"position":i.global_position
|
|
}
|
|
pre_character_data.append(new_dic)
|
|
i.queue_free()
|
|
#获取第ind个门的位置
|
|
func get_mark_postion(ind:int):
|
|
|
|
|
|
if ind<map_born_mark.size() and ind>=0:
|
|
var mark=map_born_mark[ind]
|
|
if mark is Node2D:
|
|
return mark.global_position
|
|
|
|
pass
|
|
pass
|