From b20452a7cbf8eaf92ec6d0de3af6434a378243e3 Mon Sep 17 00:00:00 2001 From: cakipaul Date: Tue, 1 Apr 2025 16:12:29 +0800 Subject: [PATCH] =?UTF-8?q?grounds=20=E8=AF=BB=E5=8F=96=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scene/ground/ground_loader.gd | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/scene/ground/ground_loader.gd b/scene/ground/ground_loader.gd index b556d4d7..ae25f96e 100644 --- a/scene/ground/ground_loader.gd +++ b/scene/ground/ground_loader.gd @@ -22,25 +22,17 @@ var ground: Ground2D var display_mask_sec = 0.0 -static func _static_init() -> void: - _read_grounds() - - # 场景名字映射到路径 -static var GROUND_SCENE_PATH_DICT = {} - - -static func _read_grounds() -> void: - var scenes_dir = "res://scene/ground/scene/" - # read grounds - var dir = DirAccess.open(scenes_dir) - for c_dir in dir.get_directories(): - var c_path = scenes_dir + c_dir + "/" - for s_file in DirAccess.open(c_path).get_files(): - if s_file.ends_with(".tscn"): - var s_path = c_path + s_file - GROUND_SCENE_PATH_DICT[c_dir.substr(0, 3) + "_" + s_file.substr(0, 3)] = s_path - +static var GROUND_SCENE_PATH_DICT = { + "c01_s05": "res://scene/ground/scene/c01/s05_院长房间.tscn", + "c01_s06": "res://scene/ground/scene/c01/s06_孤儿院长廊围墙.tscn", + "c01_s07": "res://scene/ground/scene/c01/s07_书店外.tscn", + "c01_s08": "res://scene/ground/scene/c01/s08_书店.tscn", + "c01_s09": "res://scene/ground/scene/c01/s09_公寓楼外.tscn", + "c01_s10": "res://scene/ground/scene/c01/s10_公寓楼道.tscn", + "c01_s11": "res://scene/ground/scene/c01/s11_黄包车演出.tscn", + "c01_s12": "res://scene/ground/scene/c01/s12_书店外_诡异版.tscn", +} func _ready() -> void: mask_layer.layer = GlobalConfig.CANVAS_LAYER_GROUND_MASK