master
chendian 8 months ago
parent b98cae37ac
commit 1cecae382a

@ -54,7 +54,7 @@ import/use_multiple_threads=false
[editor_plugins]
enabled=PackedStringArray("res://addons/MagicaVoxel_Importer_with_Extensions/plugin.cfg", "res://addons/beehave/plugin.cfg", "res://addons/nklbdev.aseprite_importers/plugin.cfg", "res://addons/resources_spreadsheet_view/plugin.cfg")
enabled=PackedStringArray("res://addons/MagicaVoxel_Importer_with_Extensions/plugin.cfg", "res://addons/beehave/plugin.cfg", "res://addons/editor_menu_tools/plugin.cfg", "res://addons/nklbdev.aseprite_importers/plugin.cfg", "res://addons/resources_spreadsheet_view/plugin.cfg")
[file_customization]

@ -0,0 +1,18 @@
[remap]
importer="MagicaVoxel.With.Extensions.To.Mesh"
type="Mesh"
uid="uid://bk4x7bpw6iwv3"
path="res://.godot/imported/chara_active_box.vox-c43d4f9bf9a6c007cb6b6aa42c4ddb6c.mesh"
[deps]
source_file="res://resource/mesh_level/chara_active_box.vox"
dest_files=["res://.godot/imported/chara_active_box.vox-c43d4f9bf9a6c007cb6b6aa42c4ddb6c.mesh"]
[params]
Scale=0.02
GreedyMeshGenerator=true
SnapToGround=false
FirstKeyframeOnly=true

@ -0,0 +1,18 @@
[remap]
importer="MagicaVoxel.With.Extensions.To.Mesh"
type="Mesh"
uid="uid://b3biuvng7pxpa"
path="res://.godot/imported/chara_active_button01.vox-2e09da5ef955256a44e1b450b66283bf.mesh"
[deps]
source_file="res://resource/mesh_level/chara_active_button01.vox"
dest_files=["res://.godot/imported/chara_active_button01.vox-2e09da5ef955256a44e1b450b66283bf.mesh"]
[params]
Scale=0.02
GreedyMeshGenerator=true
SnapToGround=false
FirstKeyframeOnly=true

@ -0,0 +1,18 @@
[remap]
importer="MagicaVoxel.With.Extensions.To.Mesh"
type="Mesh"
uid="uid://c8yvc57f6euxy"
path="res://.godot/imported/chara_active_lift01.vox-a473eeb5caf28840a114ea210a7a3782.mesh"
[deps]
source_file="res://resource/mesh_level/chara_active_lift01.vox"
dest_files=["res://.godot/imported/chara_active_lift01.vox-a473eeb5caf28840a114ea210a7a3782.mesh"]
[params]
Scale=0.02
GreedyMeshGenerator=true
SnapToGround=false
FirstKeyframeOnly=true

File diff suppressed because one or more lines are too long

@ -1,7 +0,0 @@
[gd_scene load_steps=2 format=3 uid="uid://bowb22her54ay"]
[ext_resource type="PackedScene" uid="uid://bscaegmui5h5s" path="res://scene/level_active/grass_high.tscn" id="1_yhtq5"]
[node name="SceneActive" type="Node3D"]
[node name="GrassMesh" parent="." instance=ExtResource("1_yhtq5")]

File diff suppressed because one or more lines are too long

@ -0,0 +1,23 @@
[gd_scene load_steps=4 format=3 uid="uid://ddsegosfqo0a1"]
[ext_resource type="Script" path="res://script/level/level_active_press_button.gd" id="1_ra6v8"]
[ext_resource type="ArrayMesh" uid="uid://b3biuvng7pxpa" path="res://resource/mesh_level/chara_active_button01.vox" id="2_jp0bw"]
[sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_ra6v8"]
data = PackedVector3Array(-0.34, 0.08, -0.34, -0.3, 0.08, -0.34, -0.3, 0.08, 0.34, -0.3, 0.08, 0.34, -0.34, 0.08, 0.34, -0.34, 0.08, -0.34, -0.3, 0.08, 0.3, 0.34, 0.08, 0.3, 0.34, 0.08, 0.34, 0.34, 0.08, 0.34, -0.3, 0.08, 0.34, -0.3, 0.08, 0.3, -0.3, 0.08, -0.3, -0.28, 0.08, -0.3, -0.28, 0.08, 0.3, -0.28, 0.08, 0.3, -0.3, 0.08, 0.3, -0.3, 0.08, -0.3, -0.3, 0.08, -0.34, 0.34, 0.08, -0.34, 0.34, 0.08, -0.3, 0.34, 0.08, -0.3, -0.3, 0.08, -0.3, -0.3, 0.08, -0.34, -0.28, 0.08, 0.28, 0.3, 0.08, 0.28, 0.3, 0.08, 0.3, 0.3, 0.08, 0.3, -0.28, 0.08, 0.3, -0.28, 0.08, 0.28, -0.28, 0.08, -0.28, 0.28, 0.08, -0.28, 0.28, 0.08, 0.28, 0.28, 0.08, 0.28, -0.28, 0.08, 0.28, -0.28, 0.08, -0.28, -0.28, 0.08, -0.3, 0.3, 0.08, -0.3, 0.3, 0.08, -0.28, 0.3, 0.08, -0.28, -0.28, 0.08, -0.28, -0.28, 0.08, -0.3, 0.28, 0.08, -0.28, 0.3, 0.08, -0.28, 0.3, 0.08, 0.28, 0.3, 0.08, 0.28, 0.28, 0.08, 0.28, 0.28, 0.08, -0.28, 0.3, 0.08, -0.3, 0.34, 0.08, -0.3, 0.34, 0.08, 0.3, 0.34, 0.08, 0.3, 0.3, 0.08, 0.3, 0.3, 0.08, -0.3, 0.34, 0, 0.34, 0.34, 0, -0.34, -0.34, 0, -0.34, -0.34, 0, -0.34, -0.34, 0, 0.34, 0.34, 0, 0.34, -0.34, 0.08, -0.34, -0.34, 0.08, 0.34, -0.34, 0, 0.34, -0.34, 0, 0.34, -0.34, 0, -0.34, -0.34, 0.08, -0.34, 0.34, 0.08, -0.34, 0.34, 0, -0.34, 0.34, 0, 0.34, 0.34, 0, 0.34, 0.34, 0.08, 0.34, 0.34, 0.08, -0.34, -0.34, 0, 0.34, -0.34, 0.08, 0.34, 0.34, 0.08, 0.34, 0.34, 0.08, 0.34, 0.34, 0, 0.34, -0.34, 0, 0.34, 0.34, 0.08, -0.34, -0.34, 0.08, -0.34, -0.34, 0, -0.34, -0.34, 0, -0.34, 0.34, 0, -0.34, 0.34, 0.08, -0.34)
[node name="LevelActivePressButton" type="Node3D"]
script = ExtResource("1_ra6v8")
open_duration = 0.2
metadata/_custom_type_script = ExtResource("1_ra6v8")
[node name="Mesh" type="MeshInstance3D" parent="."]
unique_name_in_owner = true
mesh = ExtResource("2_jp0bw")
[node name="Area3D" type="Area3D" parent="."]
unique_name_in_owner = true
collision_mask = 2
[node name="CollisionShape3D" type="CollisionShape3D" parent="Area3D"]
shape = SubResource("ConcavePolygonShape3D_ra6v8")

@ -1,19 +0,0 @@
[gd_scene load_steps=5 format=3 uid="uid://bscaegmui5h5s"]
[ext_resource type="Material" uid="uid://nufv335woq2s" path="res://render/material/level_grass.tres" id="1_7v81s"]
[ext_resource type="ArrayMesh" uid="uid://ddvgn8mvwnjka" path="res://render/mesh/grass_triangle.obj" id="2_u7lt8"]
[ext_resource type="Script" uid="uid://bhpy71py00ss7" path="res://script/editor_tool/grass_mesh.gd" id="3_iww1o"]
[sub_resource type="MultiMesh" id="MultiMesh_i0fnp"]
transform_format = 1
instance_count = 40
mesh = ExtResource("2_u7lt8")
buffer = PackedFloat32Array(0.850267, 0, 0, -0.236901, 0, 0.850267, 0, 0, 0, 0, 0.850267, 0.011678, 0.885421, 0, 0, -0.28987, 0, 0.885421, 0, 0, 0, 0, 0.885421, -0.299164, 0.753295, 0, 0, -0.208137, 0, 0.753295, 0, 0, 0, 0, 0.753295, -0.104484, 0.763127, 0, 0, 0.293253, 0, 0.763127, 0, 0, 0, 0, 0.763127, -0.237958, 0.875643, 0, 0, -0.300975, 0, 0.875643, 0, 0, 0, 0, 0.875643, 0.174365, 0.812294, 0, 0, 0.279535, 0, 0.812294, 0, 0, 0, 0, 0.812294, -0.196263, 0.805134, 0, 0, 0.0703121, 0, 0.805134, 0, 0, 0, 0, 0.805134, -0.0421476, 0.762721, 0, 0, -0.0287569, 0, 0.762721, 0, 0, 0, 0, 0.762721, 0.122738, 0.787612, 0, 0, -0.0149276, 0, 0.787612, 0, 0, 0, 0, 0.787612, -0.228186, 0.812725, 0, 0, 0.129561, 0, 0.812725, 0, 0, 0, 0, 0.812725, 0.289499, 0.890968, 0, 0, -0.258548, 0, 0.890968, 0, 0, 0, 0, 0.890968, -0.0983578, 0.722272, 0, 0, -0.142265, 0, 0.722272, 0, 0, 0, 0, 0.722272, 0.00631809, 0.763407, 0, 0, 0.0242455, 0, 0.763407, 0, 0, 0, 0, 0.763407, -0.0644098, 0.798859, 0, 0, 0.0546614, 0, 0.798859, 0, 0, 0, 0, 0.798859, -0.179269, 0.844168, 0, 0, 0.309653, 0, 0.844168, 0, 0, 0, 0, 0.844168, -0.15087, 0.819652, 0, 0, -0.131903, 0, 0.819652, 0, 0, 0, 0, 0.819652, 0.238383, 0.738998, 0, 0, 0.0488455, 0, 0.738998, 0, 0, 0, 0, 0.738998, 0.0430205, 0.7594, 0, 0, 0.206912, 0, 0.7594, 0, 0, 0, 0, 0.7594, -0.281935, 0.781441, 0, 0, 0.183891, 0, 0.781441, 0, 0, 0, 0, 0.781441, -0.221743, 0.704245, 0, 0, 0.290893, 0, 0.704245, 0, 0, 0, 0, 0.704245, -0.137151, 0.807799, 0, 0, 0.239029, 0, 0.807799, 0, 0, 0, 0, 0.807799, -0.0187869, 0.826738, 0, 0, -0.0219874, 0, 0.826738, 0, 0, 0, 0, 0.826738, -0.278481, 0.809137, 0, 0, -0.00259447, 0, 0.809137, 0, 0, 0, 0, 0.809137, 0.0512622, 0.801655, 0, 0, 0.00857547, 0, 0.801655, 0, 0, 0, 0, 0.801655, 0.214294, 0.854602, 0, 0, 0.134782, 0, 0.854602, 0, 0, 0, 0, 0.854602, -0.0262177, 0.70378, 0, 0, -0.148668, 0, 0.70378, 0, 0, 0, 0, 0.70378, 0.148927, 0.856184, 0, 0, 0.235763, 0, 0.856184, 0, 0, 0, 0, 0.856184, 0.178996, 0.713512, 0, 0, -0.0637904, 0, 0.713512, 0, 0, 0, 0, 0.713512, 0.000412762, 0.722176, 0, 0, 0.00617713, 0, 0.722176, 0, 0, 0, 0, 0.722176, -0.193158, 0.775462, 0, 0, 0.0303999, 0, 0.775462, 0, 0, 0, 0, 0.775462, -0.0277684, 0.786996, 0, 0, 0.0209769, 0, 0.786996, 0, 0, 0, 0, 0.786996, -0.206117, 0.89983, 0, 0, 0.180177, 0, 0.89983, 0, 0, 0, 0, 0.89983, 0.286512, 0.802054, 0, 0, -0.0968045, 0, 0.802054, 0, 0, 0, 0, 0.802054, 0.15324, 0.737515, 0, 0, -0.127443, 0, 0.737515, 0, 0, 0, 0, 0.737515, -0.0427554, 0.809675, 0, 0, 0.275429, 0, 0.809675, 0, 0, 0, 0, 0.809675, -0.319483, 0.742134, 0, 0, 0.0211135, 0, 0.742134, 0, 0, 0, 0, 0.742134, 0.212784, 0.798657, 0, 0, 0.0671035, 0, 0.798657, 0, 0, 0, 0, 0.798657, 0.117133, 0.822658, 0, 0, -0.184188, 0, 0.822658, 0, 0, 0, 0, 0.822658, -0.158328, 0.834859, 0, 0, -0.055608, 0, 0.834859, 0, 0, 0, 0, 0.834859, -0.0925495, 0.846971, 0, 0, 0.0535535, 0, 0.846971, 0, 0, 0, 0, 0.846971, 0.24802)
[node name="GrassMesh" type="MultiMeshInstance3D"]
material_override = ExtResource("1_7v81s")
cast_shadow = 2
multimesh = SubResource("MultiMesh_i0fnp")
script = ExtResource("3_iww1o")
extents = Vector2(0.32, 0.32)
scale_basic = 0.8

@ -1,18 +0,0 @@
[gd_scene load_steps=5 format=3 uid="uid://cugqj3mjnb3k8"]
[ext_resource type="Material" uid="uid://nufv335woq2s" path="res://render/material/level_grass.tres" id="1_mi2yd"]
[ext_resource type="ArrayMesh" uid="uid://ddvgn8mvwnjka" path="res://render/mesh/grass_triangle.obj" id="2_mqml2"]
[ext_resource type="Script" uid="uid://bhpy71py00ss7" path="res://script/editor_tool/grass_mesh.gd" id="3_sbbi8"]
[sub_resource type="MultiMesh" id="MultiMesh_i0fnp"]
transform_format = 1
instance_count = 60
mesh = ExtResource("2_mqml2")
buffer = PackedFloat32Array(0.422679, 0, 0, -0.31932, 0, 0.422679, 0, 0, 0, 0, 0.422679, 0.222035, 0.565589, 0, 0, -0.163921, 0, 0.565589, 0, 0, 0, 0, 0.565589, 0.166128, 0.557743, 0, 0, 0.231122, 0, 0.557743, 0, 0, 0, 0, 0.557743, 0.157646, 0.436782, 0, 0, -0.108736, 0, 0.436782, 0, 0, 0, 0, 0.436782, -0.213432, 0.472302, 0, 0, -0.0302663, 0, 0.472302, 0, 0, 0, 0, 0.472302, -0.101251, 0.459377, 0, 0, -0.0367711, 0, 0.459377, 0, 0, 0, 0, 0.459377, -0.0663798, 0.41596, 0, 0, 0.143099, 0, 0.41596, 0, 0, 0, 0, 0.41596, 0.309669, 0.462596, 0, 0, 0.122331, 0, 0.462596, 0, 0, 0, 0, 0.462596, 0.236068, 0.588548, 0, 0, -0.0276043, 0, 0.588548, 0, 0, 0, 0, 0.588548, 0.0835775, 0.592027, 0, 0, 0.0622364, 0, 0.592027, 0, 0, 0, 0, 0.592027, 0.240621, 0.482222, 0, 0, -0.0598195, 0, 0.482222, 0, 0, 0, 0, 0.482222, -0.185888, 0.508889, 0, 0, -0.31975, 0, 0.508889, 0, 0, 0, 0, 0.508889, -0.0251259, 0.57917, 0, 0, 0.116746, 0, 0.57917, 0, 0, 0, 0, 0.57917, 0.207793, 0.476953, 0, 0, -0.0256726, 0, 0.476953, 0, 0, 0, 0, 0.476953, 0.313863, 0.552328, 0, 0, -0.140257, 0, 0.552328, 0, 0, 0, 0, 0.552328, 0.131966, 0.534333, 0, 0, -0.309444, 0, 0.534333, 0, 0, 0, 0, 0.534333, -0.080676, 0.480466, 0, 0, 0.143088, 0, 0.480466, 0, 0, 0, 0, 0.480466, -0.0384474, 0.595769, 0, 0, -0.0051313, 0, 0.595769, 0, 0, 0, 0, 0.595769, 0.173477, 0.471711, 0, 0, -0.0842564, 0, 0.471711, 0, 0, 0, 0, 0.471711, -0.149921, 0.493693, 0, 0, 0.0253143, 0, 0.493693, 0, 0, 0, 0, 0.493693, 0.163388, 0.524832, 0, 0, 0.119908, 0, 0.524832, 0, 0, 0, 0, 0.524832, 0.00929523, 0.517474, 0, 0, 0.229999, 0, 0.517474, 0, 0, 0, 0, 0.517474, 0.0641421, 0.43585, 0, 0, 0.252399, 0, 0.43585, 0, 0, 0, 0, 0.43585, -0.291608, 0.408826, 0, 0, 0.209503, 0, 0.408826, 0, 0, 0, 0, 0.408826, -0.267097, 0.474232, 0, 0, 0.187525, 0, 0.474232, 0, 0, 0, 0, 0.474232, -0.192769, 0.415695, 0, 0, -0.22959, 0, 0.415695, 0, 0, 0, 0, 0.415695, 0.317299, 0.459235, 0, 0, 0.133561, 0, 0.459235, 0, 0, 0, 0, 0.459235, -0.105574, 0.515192, 0, 0, 0.261943, 0, 0.515192, 0, 0, 0, 0, 0.515192, 0.216434, 0.550368, 0, 0, 0.127448, 0, 0.550368, 0, 0, 0, 0, 0.550368, 0.0934071, 0.57073, 0, 0, 0.0705428, 0, 0.57073, 0, 0, 0, 0, 0.57073, -0.064085, 0.542206, 0, 0, -0.080071, 0, 0.542206, 0, 0, 0, 0, 0.542206, -0.24098, 0.599446, 0, 0, 0.229488, 0, 0.599446, 0, 0, 0, 0, 0.599446, 0.230828, 0.562075, 0, 0, -0.121035, 0, 0.562075, 0, 0, 0, 0, 0.562075, 0.205745, 0.477919, 0, 0, 0.0221415, 0, 0.477919, 0, 0, 0, 0, 0.477919, -0.136622, 0.408849, 0, 0, 0.235256, 0, 0.408849, 0, 0, 0, 0, 0.408849, 0.200507, 0.577776, 0, 0, -0.316105, 0, 0.577776, 0, 0, 0, 0, 0.577776, 0.109228, 0.489896, 0, 0, 0.039913, 0, 0.489896, 0, 0, 0, 0, 0.489896, 0.266593, 0.55952, 0, 0, -0.251103, 0, 0.55952, 0, 0, 0, 0, 0.55952, -0.237683, 0.424979, 0, 0, -0.0163222, 0, 0.424979, 0, 0, 0, 0, 0.424979, -0.135474, 0.544441, 0, 0, -0.114926, 0, 0.544441, 0, 0, 0, 0, 0.544441, -0.125013, 0.441275, 0, 0, 0.276719, 0, 0.441275, 0, 0, 0, 0, 0.441275, -0.0566853, 0.441208, 0, 0, 0.284965, 0, 0.441208, 0, 0, 0, 0, 0.441208, -0.170354, 0.545374, 0, 0, 0.22708, 0, 0.545374, 0, 0, 0, 0, 0.545374, -0.0750098, 0.483538, 0, 0, 0.166933, 0, 0.483538, 0, 0, 0, 0, 0.483538, -0.0592494, 0.501156, 0, 0, 0.0648109, 0, 0.501156, 0, 0, 0, 0, 0.501156, 0.310273, 0.416906, 0, 0, -0.101839, 0, 0.416906, 0, 0, 0, 0, 0.416906, 0.114669, 0.580051, 0, 0, -0.0869363, 0, 0.580051, 0, 0, 0, 0, 0.580051, 0.0148138, 0.486025, 0, 0, -0.0506034, 0, 0.486025, 0, 0, 0, 0, 0.486025, -0.111222, 0.561763, 0, 0, -0.132322, 0, 0.561763, 0, 0, 0, 0, 0.561763, -0.279143, 0.588378, 0, 0, -0.156966, 0, 0.588378, 0, 0, 0, 0, 0.588378, 0.264466, 0.587942, 0, 0, 0.00191143, 0, 0.587942, 0, 0, 0, 0, 0.587942, -0.271856, 0.422839, 0, 0, -0.180986, 0, 0.422839, 0, 0, 0, 0, 0.422839, -0.257386, 0.583304, 0, 0, 0.166498, 0, 0.583304, 0, 0, 0, 0, 0.583304, 0.299894, 0.469133, 0, 0, -0.0869951, 0, 0.469133, 0, 0, 0, 0, 0.469133, 0.258686, 0.501141, 0, 0, -0.0690251, 0, 0.501141, 0, 0, 0, 0, 0.501141, 0.211844, 0.445388, 0, 0, 0.0627016, 0, 0.445388, 0, 0, 0, 0, 0.445388, 0.196344, 0.505713, 0, 0, 0.267159, 0, 0.505713, 0, 0, 0, 0, 0.505713, -0.315608, 0.561086, 0, 0, 0.231257, 0, 0.561086, 0, 0, 0, 0, 0.561086, -0.190699, 0.544177, 0, 0, 0.169978, 0, 0.544177, 0, 0, 0, 0, 0.544177, 0.167157, 0.487531, 0, 0, -0.274127, 0, 0.487531, 0, 0, 0, 0, 0.487531, 0.245489)
[node name="GrassMesh" type="MultiMeshInstance3D"]
material_override = ExtResource("1_mi2yd")
multimesh = SubResource("MultiMesh_i0fnp")
script = ExtResource("3_sbbi8")
extents = Vector2(0.32, 0.32)
scale_basic = 0.5

@ -1,18 +0,0 @@
[gd_scene load_steps=5 format=3 uid="uid://bjqr42b8i5aqe"]
[ext_resource type="Material" uid="uid://nufv335woq2s" path="res://render/material/level_grass.tres" id="1_l4t4d"]
[ext_resource type="ArrayMesh" uid="uid://ddvgn8mvwnjka" path="res://render/mesh/grass_triangle.obj" id="2_7id7u"]
[ext_resource type="Script" uid="uid://bhpy71py00ss7" path="res://script/editor_tool/grass_mesh.gd" id="3_4bfc1"]
[sub_resource type="MultiMesh" id="MultiMesh_i0fnp"]
transform_format = 1
instance_count = 20
mesh = ExtResource("2_7id7u")
buffer = PackedFloat32Array(0.447556, 0, 0, 0.214988, 0, 0.447556, 0, 0, 0, 0, 0.447556, -0.179775, 0.402864, 0, 0, 0.00355405, 0, 0.402864, 0, 0, 0, 0, 0.402864, 0.153977, 0.466052, 0, 0, -0.0347098, 0, 0.466052, 0, 0, 0, 0, 0.466052, -0.0682281, 0.377455, 0, 0, -0.0436905, 0, 0.377455, 0, 0, 0, 0, 0.377455, -0.312027, 0.388893, 0, 0, 0.0321143, 0, 0.388893, 0, 0, 0, 0, 0.388893, 0.316336, 0.433887, 0, 0, 0.00524941, 0, 0.433887, 0, 0, 0, 0, 0.433887, -0.0804169, 0.423926, 0, 0, 0.177719, 0, 0.423926, 0, 0, 0, 0, 0.423926, -0.0279486, 0.386352, 0, 0, 0.24718, 0, 0.386352, 0, 0, 0, 0, 0.386352, 0.217906, 0.372492, 0, 0, 0.10613, 0, 0.372492, 0, 0, 0, 0, 0.372492, -0.129829, 0.482979, 0, 0, 0.215392, 0, 0.482979, 0, 0, 0, 0, 0.482979, -0.301264, 0.403461, 0, 0, -0.304334, 0, 0.403461, 0, 0, 0, 0, 0.403461, 0.28521, 0.305712, 0, 0, 0.133187, 0, 0.305712, 0, 0, 0, 0, 0.305712, 0.237432, 0.467374, 0, 0, 0.242138, 0, 0.467374, 0, 0, 0, 0, 0.467374, 0.276226, 0.340186, 0, 0, 0.196599, 0, 0.340186, 0, 0, 0, 0, 0.340186, -0.0352196, 0.359262, 0, 0, -0.286212, 0, 0.359262, 0, 0, 0, 0, 0.359262, -0.290231, 0.428309, 0, 0, -0.296598, 0, 0.428309, 0, 0, 0, 0, 0.428309, -0.132031, 0.307916, 0, 0, 0.135875, 0, 0.307916, 0, 0, 0, 0, 0.307916, -0.0619626, 0.331092, 0, 0, -0.0777463, 0, 0.331092, 0, 0, 0, 0, 0.331092, 0.202209, 0.342283, 0, 0, -0.187628, 0, 0.342283, 0, 0, 0, 0, 0.342283, -0.000626862, 0.454191, 0, 0, 0.311841, 0, 0.454191, 0, 0, 0, 0, 0.454191, 0.106484)
[node name="GrassMesh" type="MultiMeshInstance3D"]
material_override = ExtResource("1_l4t4d")
multimesh = SubResource("MultiMesh_i0fnp")
script = ExtResource("3_4bfc1")
extents = Vector2(0.32, 0.32)
scale_basic = 0.4

@ -0,0 +1,45 @@
[gd_scene load_steps=7 format=3 uid="uid://y56utpi0ouet"]
[ext_resource type="Script" path="res://script/level/level_active_plat_lift.gd" id="1_ibdg3"]
[ext_resource type="PackedScene" uid="uid://ddsegosfqo0a1" path="res://scene/level_active/button01.tscn" id="2_1npfg"]
[ext_resource type="ArrayMesh" uid="uid://c8yvc57f6euxy" path="res://resource/mesh_level/chara_active_lift01.vox" id="3_2jayo"]
[ext_resource type="ArrayMesh" uid="uid://bk4x7bpw6iwv3" path="res://resource/mesh_level/chara_active_box.vox" id="4_08hge"]
[sub_resource type="BoxShape3D" id="BoxShape3D_1npfg"]
size = Vector3(1.28, 0.08, 1.28)
[sub_resource type="BoxShape3D" id="BoxShape3D_een0y"]
size = Vector3(1.28, 2.56, 1.28)
[node name="LevelActivePlatLift" type="Node3D"]
script = ExtResource("1_ibdg3")
metadata/_custom_type_script = ExtResource("1_ibdg3")
[node name="LevelActivePressButton" parent="." node_paths=PackedStringArray("target_level_active") instance=ExtResource("2_1npfg")]
target_level_active = NodePath("..")
[node name="Area3D" type="Area3D" parent="."]
unique_name_in_owner = true
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.04, 0)
collision_mask = 2
[node name="CollisionShape3D" type="CollisionShape3D" parent="Area3D"]
shape = SubResource("BoxShape3D_1npfg")
[node name="Mesh" type="MeshInstance3D" parent="."]
mesh = ExtResource("3_2jayo")
[node name="Mesh2" type="MeshInstance3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1.28, 0)
mesh = ExtResource("4_08hge")
[node name="Mesh3" type="MeshInstance3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -2.56, 0)
mesh = ExtResource("4_08hge")
[node name="StaticBody3D" type="StaticBody3D" parent="."]
collision_mask = 2
[node name="CollisionShape3D" type="CollisionShape3D" parent="StaticBody3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1.28, 0)
shape = SubResource("BoxShape3D_een0y")

@ -1,13 +1,13 @@
@tool
extends Node3D
func get_resource_name(resource: Resource) -> String: return resource.resource_path.get_file().trim_suffix('.tres') #todo 性能
func get_resource_name(resource: Resource) -> String: return resource.resource_path.get_file().trim_suffix('.tres') # todo 性能
func snap_vector3(value: Vector3) -> Vector3: return Vector3(snap_float(value.x), snap_float(value.y), snap_float(value.z))
func snap_float(value: float) -> float: return floor(value/Setting.pixel_size) * Setting.pixel_size
func snap_float(value: float) -> float: return floor(value / Setting.pixel_size) * Setting.pixel_size
func dir_angle(dir: Vector2) -> float:
@ -23,32 +23,36 @@ func vector_reduce(vector: Vector2, reduce: float) -> Vector2:
var length: float = vector.length()
if length == 0:
return vector
var new_len = max(length - reduce, 0)
var new_len = max(length - reduce, 0)
var scale_rate = new_len / length
return vector * scale_rate
func get_level_grid_pos(pos: Vector3) -> Vector3i:
var grid_size: float = Setting.pixel_size* Setting.grid_pixel_size
var ret: Vector3i = Vector3i(get_div_scale(pos.x, grid_size), get_div_scale(pos.y, grid_size), get_div_scale(pos.z, grid_size))
var grid_size: float = Setting.pixel_size * Setting.grid_pixel_size
var ret: Vector3i = Vector3i(get_div_scale(pos.x, grid_size), get_div_scale(pos.y, grid_size), get_div_scale(pos.z, grid_size))
return ret
func get_level_grid_pos2(pos: Vector3) -> Vector3i:
pos += Vector3.ONE * Setting.pixel_size* Setting.grid_pixel_size;
var grid_size: float = Setting.pixel_size* Setting.grid_pixel_size * 2
var ret: Vector3i = Vector3i(get_div_scale(pos.x, grid_size), get_div_scale(pos.y, grid_size), get_div_scale(pos.z, grid_size))
pos += Vector3.ONE * Setting.pixel_size * Setting.grid_pixel_size;
var grid_size: float = Setting.pixel_size * Setting.grid_pixel_size * 2
var ret: Vector3i = Vector3i(get_div_scale(pos.x, grid_size), get_div_scale(pos.y, grid_size), get_div_scale(pos.z, grid_size))
return ret
func get_level_float_pos(pos: Vector3i) -> Vector3:
var grid_size: float = Setting.pixel_size* Setting.grid_pixel_size
return Vector3(pos.x*grid_size, pos.y*grid_size, pos.z*grid_size)
var grid_size: float = Setting.pixel_size * Setting.grid_pixel_size
return Vector3(pos.x * grid_size, pos.y * grid_size, pos.z * grid_size)
func get_level_float_pos2(pos: Vector3i) -> Vector3:
var grid_size: float = Setting.pixel_size* Setting.grid_pixel_size * 2
return Vector3(pos.x*grid_size, pos.y*grid_size, pos.z*grid_size)
var grid_size: float = Setting.pixel_size * Setting.grid_pixel_size * 2
return Vector3(pos.x * grid_size, pos.y * grid_size, pos.z * grid_size)
func get_level_float_pos2_floor(pos: Vector3i) -> Vector3:
var grid_size: float = Setting.pixel_size * Setting.grid_pixel_size
return get_level_float_pos2(pos) - Vector3(0, grid_size, 0)
func get_level_id(pos: Vector3) -> Vector3i:
@ -58,9 +62,9 @@ func get_level_id(pos: Vector3) -> Vector3i:
func get_div_scale(a: float, b: float) -> int:
#解决浮点数精度问题
var div: float = a / b
var div: float = a / b
var is_positive: bool = div > 0
var decimal: float = abs(div - int(div))
var decimal: float = abs(div - int(div))
if is_positive and decimal > 0.999:
div += 0.001
if not is_positive and decimal < 0.001:
@ -70,13 +74,13 @@ func get_div_scale(a: float, b: float) -> int:
func raycast_character(shape: Shape3D, origin: Vector3, dir: Vector2) -> Array[Character]:
var space_state: PhysicsDirectSpaceState3D = get_world_3d().direct_space_state
var query: PhysicsShapeQueryParameters3D = PhysicsShapeQueryParameters3D.new()
var angle: float = dir_angle(dir)
var query: PhysicsShapeQueryParameters3D = PhysicsShapeQueryParameters3D.new()
var angle: float = dir_angle(dir)
query.shape = shape
query.transform.origin = origin
query.transform.basis = query.transform.basis.rotated(Vector3.UP, angle)
var result: Array[Dictionary] = space_state.intersect_shape(query)
var result2: Array = result.map(func(v): return v["collider"]).filter(func(v): return v is Character)
var result: Array[Dictionary] = space_state.intersect_shape(query)
var result2: Array = result.map(func(v): return v["collider"]).filter(func(v): return v is Character)
var result3: Array[Character]
for node in result2:
result3.append(node as Character)
@ -92,15 +96,15 @@ func clean_animation_lib():
func refresh_animation_lib():
#刷新animation库 使其与animation文件同步
var animation_library_path: String = "res://resource/skill_animation_library/animation_library.tres"
var animation_library = load(animation_library_path)
var animation_library = load(animation_library_path)
var dir_path: String = "res://resource/skill_animation"
var dir: DirAccess = DirAccess.open(dir_path)
var dir: DirAccess = DirAccess.open(dir_path)
for file in dir.get_files():
var path: String = dir_path + "/" + file
var res = load(path)
var res = load(path)
if res is Animation:
var animation: Animation = res as Animation
var animation: Animation = res as Animation
var animation_name: String = Util.get_resource_name(animation)
print("refresh_animation_lib: ", animation_name)
animation_library.add_animation(animation_name, animation)
@ -111,22 +115,22 @@ func refresh_animation_lib():
func refresh_mesh_library(path_list: Array, from_editor_tool: bool = false):
print("refresh_mesh_library")
var default_shape_normal_full: Array[Variant] = [load("res://resource/mesh_library/default_shape_normal_full.tres") as Shape3D, Transform3D.IDENTITY]
var default_shape_normal_half: Array[Variant] = [load("res://resource/mesh_library/default_shape_normal_half.tres") as Shape3D, Transform3D.IDENTITY]
var default_shape_normal_full: Array[Variant] = [load("res://resource/mesh_library/default_shape_normal_full.tres") as Shape3D, Transform3D.IDENTITY]
var default_shape_normal_half: Array[Variant] = [load("res://resource/mesh_library/default_shape_normal_half.tres") as Shape3D, Transform3D.IDENTITY]
var default_shape_normal_stair1: Array[Variant] = [load("res://resource/mesh_library/default_shape_normal_stair1.tres") as Shape3D, Transform3D.IDENTITY]
var default_shape_normal_stair2: Array[Variant] = [load("res://resource/mesh_library/default_shape_normal_stair2.tres") as Shape3D, Transform3D.IDENTITY]
var default_shape_large_full: Array[Variant] = [load("res://resource/mesh_library/default_shape_large_full.tres") as Shape3D, Transform3D.IDENTITY]
var default_shape_large_half: Array[Variant] = [load("res://resource/mesh_library/default_shape_large_half.tres") as Shape3D, Transform3D.IDENTITY]
var default_shape_large_stair1: Array[Variant] = [load("res://resource/mesh_library/default_shape_large_stair1.tres") as Shape3D, Transform3D.IDENTITY]
var default_shape_large_stair2: Array[Variant] = [load("res://resource/mesh_library/default_shape_large_stair2.tres") as Shape3D, Transform3D.IDENTITY]
var mesh_library_main: MeshLibrary = load("res://resource/mesh_library/mesh_library_main.tres") as MeshLibrary
var mesh_library_sub: MeshLibrary = load("res://resource/mesh_library/mesh_library_sub.tres") as MeshLibrary
var mesh_library_deco1: MeshLibrary = load("res://resource/mesh_library/mesh_library_deco1.tres") as MeshLibrary
var mesh_library_deco2: MeshLibrary = load("res://resource/mesh_library/mesh_library_deco2.tres") as MeshLibrary
var mesh_library_chara: MeshLibrary = load("res://resource/mesh_library/mesh_library_chara.tres") as MeshLibrary
var mesh_library_main_id_list: Array[int] = []
var mesh_library_sub_id_list: Array[int] = []
var default_shape_large_full: Array[Variant] = [load("res://resource/mesh_library/default_shape_large_full.tres") as Shape3D, Transform3D.IDENTITY]
var default_shape_large_half: Array[Variant] = [load("res://resource/mesh_library/default_shape_large_half.tres") as Shape3D, Transform3D.IDENTITY]
var default_shape_large_stair1: Array[Variant] = [load("res://resource/mesh_library/default_shape_large_stair1.tres") as Shape3D, Transform3D.IDENTITY]
var default_shape_large_stair2: Array[Variant] = [load("res://resource/mesh_library/default_shape_large_stair2.tres") as Shape3D, Transform3D.IDENTITY]
var mesh_library_main: MeshLibrary = load("res://resource/mesh_library/mesh_library_main.tres") as MeshLibrary
var mesh_library_sub: MeshLibrary = load("res://resource/mesh_library/mesh_library_sub.tres") as MeshLibrary
var mesh_library_deco1: MeshLibrary = load("res://resource/mesh_library/mesh_library_deco1.tres") as MeshLibrary
var mesh_library_deco2: MeshLibrary = load("res://resource/mesh_library/mesh_library_deco2.tres") as MeshLibrary
var mesh_library_chara: MeshLibrary = load("res://resource/mesh_library/mesh_library_chara.tres") as MeshLibrary
var mesh_library_main_id_list: Array[int] = []
var mesh_library_sub_id_list: Array[int] = []
var mesh_library_deco1_id_list: Array[int] = []
var mesh_library_deco2_id_list: Array[int] = []
var mesh_library_chara_id_list: Array[int] = []
@ -157,7 +161,7 @@ func refresh_mesh_library(path_list: Array, from_editor_tool: bool = false):
mesh_library = mesh_library_chara; mesh_library_id_list = mesh_library_chara_id_list;
_: continue
var mesh: Mesh = load(file_name_full) as Mesh
var mesh: Mesh = load(file_name_full) as Mesh
var mesh_id: int = mesh_library.find_item_by_name(mesh_name)
if mesh_id == -1:
mesh_id = mesh_library.get_last_unused_item_id()
@ -167,9 +171,9 @@ func refresh_mesh_library(path_list: Array, from_editor_tool: bool = false):
mesh_library.set_item_mesh(mesh_id, mesh)
if has_material:
var material: Material = mesh.surface_get_material(0) as Material
var material: Material = mesh.surface_get_material(0) as Material
var material_set: Material = material_grid_block
if (mesh.get_surface_count() >0) and ((not material) or (material.get_path() != material_set.get_path())):
if (mesh.get_surface_count() > 0) and ((not material) or (material.get_path() != material_set.get_path())):
if from_editor_tool:
reimport_files.append(file_name_full)
else:
@ -179,7 +183,7 @@ func refresh_mesh_library(path_list: Array, from_editor_tool: bool = false):
if has_shape:
var item_shapes: Array
var is_main = name_prefix == "main"
var is_main = name_prefix == "main"
var name_subfix = mesh_name.split("_")[-1]
match name_subfix:
"full": item_shapes = default_shape_normal_full if not is_main else default_shape_large_full
@ -218,15 +222,15 @@ func _save_mesh_library(mesh_library: MeshLibrary, id_list: Array[int], from_edi
func refresh_all_animation_by_sprite_frames(sprite_frames: SpriteFrames):
var dir_path: String = "res://resource/skill_animation"
var dir: DirAccess = DirAccess.open(dir_path)
var dir_path: String = "res://resource/skill_animation"
var dir: DirAccess = DirAccess.open(dir_path)
var sprite_frames_name: String = sprite_frames.resource_path.get_file().split('-')[0]
for file in dir.get_files():
var path: String = dir_path + "/" + file
var res = load(path)
var res = load(path)
if not res is Animation:
continue
var animation: Animation = res as Animation
var animation: Animation = res as Animation
var sprite_frames_track: int = animation.find_track(NodePath("View:sprite_frames"), Animation.TYPE_VALUE)
if sprite_frames_track < 0:
continue
@ -269,9 +273,9 @@ func refresh_animation_by_sprite_frames(animation_path: String, sprite_frames: S
animation.remove_track(track_frame)
track_frame = animation.add_track(Animation.TYPE_VALUE)
animation.track_set_path(track_frame, "View:frame")
var animation_speed: float = Setting.animation_frame_rate
var animation_speed: float = Setting.animation_frame_rate
var animation_frame_count: int = sprite_frames.get_frame_count(animation_name)
animation.length = animation_speed*animation_frame_count
animation.length = animation_speed * animation_frame_count
for i in range(0, animation_frame_count):
var time = i * animation_speed
animation.track_insert_key(track_frame, time, i)
@ -284,16 +288,16 @@ func refresh_animation_by_sprite_frames(animation_path: String, sprite_frames: S
func get_all_skill() -> Array[SkillCfg]:
var ret: Array[SkillCfg] = []
var dir_path: String = "res://config"
var dir: DirAccess = DirAccess.open(dir_path)
var dir_path: String = "res://config"
var dir: DirAccess = DirAccess.open(dir_path)
for sub_dir_name: String in dir.get_directories():
if not sub_dir_name.begins_with("skill_"):
continue
var sub_dir_path: String = dir_path + "/" + sub_dir_name
var sub_dir: DirAccess = DirAccess.open(sub_dir_path)
var sub_dir: DirAccess = DirAccess.open(sub_dir_path)
for file: String in sub_dir.get_files():
var path: String = sub_dir_path + "/" + file
var res = load(path)
var res = load(path)
if res is SkillCfg:
ret.append(res)
return ret
@ -301,11 +305,11 @@ func get_all_skill() -> Array[SkillCfg]:
func get_all_skill_player_weapon() -> Array[SkillWeaponCfg]:
var ret: Array[SkillWeaponCfg] = []
var dir_path: String = "res://config/skill_player_weapon"
var dir: DirAccess = DirAccess.open(dir_path)
for file: String in dir.get_files():
var dir_path: String = "res://config/skill_player_weapon"
var dir: DirAccess = DirAccess.open(dir_path)
for file: String in dir.get_files():
var path: String = dir_path + "/" + file
var res = load(path)
var res = load(path)
if res is SkillWeaponCfg:
ret.append(res)
return ret
@ -313,11 +317,11 @@ func get_all_skill_player_weapon() -> Array[SkillWeaponCfg]:
func get_all_skill_player_basic() -> Array[SkillWeaponCfg]:
var ret: Array[SkillWeaponCfg] = []
var dir_path: String = "res://config/skill_player_basic"
var dir: DirAccess = DirAccess.open(dir_path)
var dir_path: String = "res://config/skill_player_basic"
var dir: DirAccess = DirAccess.open(dir_path)
for file: String in dir.get_files():
var path: String = dir_path + "/" + file
var res = load(path)
var res = load(path)
if res is SkillWeaponCfg:
ret.append(res)
return ret
@ -325,11 +329,11 @@ func get_all_skill_player_basic() -> Array[SkillWeaponCfg]:
func get_skill_player_weapon_by_weapon(weapon: WeaponCfg) -> Array[SkillWeaponCfg]:
var ret: Array[SkillWeaponCfg] = []
var dir_path: String = "res://config/skill_player_weapon"
var dir: DirAccess = DirAccess.open(dir_path)
var dir_path: String = "res://config/skill_player_weapon"
var dir: DirAccess = DirAccess.open(dir_path)
for file: String in dir.get_files():
var path: String = dir_path + "/" + file
var res = load(path)
var res = load(path)
if res is SkillWeaponCfg:
if res.weapon == weapon:
ret.append(res)

@ -89,6 +89,8 @@ func _debug_draw_attack_box(shape: Shape3D, offset: Vector3) -> void:
func on_attack_character(result: Character, attack_info: Struct.AttackInfo) -> void:
if not result:
return
if attack_info.attack_box.is_hit_self != (result.team() == character.team()):
return
status.is_hit_character = true
@ -187,7 +189,9 @@ func settle(from: int, to: int, attack_info: Struct.AttackInfo) -> Struct.HitRes
elif is_kill:
pause_time = 0.3
break_level_sub = 4
pause_time *= 0.6
if not attack.damage_type == Enum.EDamageType.Blunt:
pause_time *= 0.6
#眩晕值累加
if not is_stun:

@ -129,8 +129,10 @@ func set_shield(value: float):
func set_pos(pos_new: Vector3):
position = pos_new
SignalManager.character_pos_changed.emit(id(), pos())
emit_pos_changed()
func emit_pos_changed():
SignalManager.character_pos_changed.emit(id(), pos())
func move_to(dir: Vector2): set_status("move_dir", dir.normalized())

@ -0,0 +1,61 @@
extends Node3D
class_name LevelActive
@export var open_duration: float = 1
@export var target_level_active: LevelActive
var is_open_target: bool = false
var is_open: bool = false
var is_openning: bool = false
var open_progress: float = 0
var body_entered_count: int
var character_list: Array[Character] = []
func init() -> void:
var area3D: Area3D = %Area3D as Area3D
if area3D:
area3D.connect("body_entered", on_body_entered)
area3D.connect("body_exited", on_body_exited)
for node in get_children():
if node is LevelActive:
node.init()
on_init()
func _process(delta):
if is_openning:
var delta_dir = 1 if is_open_target else -1
open_progress += delta * delta_dir
open_progress = clamp(open_progress, 0, open_duration)
var progress = open_progress / open_duration
if progress == 1 or progress == 0:
is_open = is_open_target
is_openning = false
on_open_finished()
on_process_open(progress)
func on_body_entered(body: Node3D) -> void:
if body is Character:
character_list.append(body)
body_entered_count += 1
on_body_entered_count_changed()
func on_body_exited(body: Node3D) -> void:
if body is Character and body in character_list:
character_list.erase(body)
body_entered_count -= 1
on_body_entered_count_changed()
func set_open(is_open_set: bool) -> void:
is_open_target = is_open_set
is_openning = true
func on_open_finished() -> void:
on_set_open(is_open)
if target_level_active:
target_level_active.set_open(is_open)
func on_init() -> void: pass
func on_set_open(_is_open_set: bool) -> void: pass
func on_process_open(_rate: float) -> void: pass
func on_body_entered_count_changed() -> void: pass

@ -0,0 +1,18 @@
extends LevelActive
class_name LevelActivePlatLift
var original_position_y: float
func on_init() -> void:
original_position_y = position.y
func on_set_open(is_open_set: bool) -> void:
print("[on_set_open]", is_open_set)
func on_process_open(rate: float) -> void:
print("LevelActivePlatLift on_process_open", rate)
var offset_y = rate * 2.56
position.y = original_position_y + offset_y
print(original_position_y)
for character in character_list:
character.emit_pos_changed()

@ -0,0 +1,20 @@
extends LevelActive
class_name LevelActivePressButton
func on_body_entered_count_changed() -> void:
if body_entered_count > 0:
set_open(true)
else:
set_open(false)
func on_set_open(is_open_set: bool) -> void:
pass
func on_process_open(rate: float) -> void:
var mesh: Node3D = %Mesh as Node3D
if not mesh:
print("Mesh not found!")
return
var offset_y = rate * -0.06
mesh.position.y = offset_y

@ -1,7 +1,7 @@
extends Node3D
extends LevelActive
class_name LevelDoor
func set_open(is_open: bool) -> void:
func on_set_open(is_open: bool) -> void:
if is_open:
$AnimationPlayer.play("open")
else:

@ -5,20 +5,13 @@ class_name LevelGrid
@export_group("替换item_id")
@export var id_from: int = 0
@export var id_to: int = 0
@export_tool_button("替换", "Callable")
var replace_id: Callable = replace_id_func
var replace_id: Callable = func() -> void:
for cell_position in get_used_cells():
if get_cell_item(cell_position) == id_from:
set_cell_item(cell_position, id_to, get_cell_item_orientation(cell_position))
@export_tool_button("打印item详情", "Callable")
var print_item: Callable = print_item_func
@export_group("整体平移")
@export var translate_dir: Vector3i
@export_tool_button("平移", "Callable")
var translate: Callable = translate_func
func print_item_func ()-> void:
var print_item: Callable = func() -> void:
var item_count_map: Dictionary = {}
for cell_position in get_used_cells():
var item_id: int = get_cell_item(cell_position)
@ -29,22 +22,16 @@ func print_item_func ()-> void:
for item_id: int in item_count_map:
print("[", item_id, "]", mesh_library.get_item_name(item_id), ":", item_count_map[item_id])
func replace_id_func()->void:
for cell_position in get_used_cells():
if get_cell_item(cell_position) == id_from:
set_cell_item(cell_position, id_to, get_cell_item_orientation(cell_position))
func translate_func() -> void:
@export_group("整体平移")
@export var translate_dir: Vector3i
@export_tool_button("平移", "Callable")
var translate_func: Callable = func() -> void:
if translate_dir.x != 0:
var used_cells: Array[Vector3i] = get_used_cells()
used_cells.sort_custom(func(a, b): return (a.x > b.x) if translate_dir.x >= 0 else (b.x < a.x))
for cell_position in used_cells:
print(cell_position.x)
set_cell_item(cell_position + Vector3i(translate_dir.x, 0, 0), get_cell_item(cell_position), get_cell_item_orientation(cell_position))
set_cell_item(cell_position, GridMap.INVALID_CELL_ITEM)
if translate_dir.y != 0:
var used_cells: Array[Vector3i] = get_used_cells()
used_cells.sort_custom(func(a, b): return (a.y > b.y) if translate_dir.y >= 0 else (b.y < a.y))
@ -58,4 +45,3 @@ func translate_func() -> void:
for cell_position in used_cells:
set_cell_item(cell_position + Vector3i(0, 0, translate_dir.z), get_cell_item(cell_position), get_cell_item_orientation(cell_position))
set_cell_item(cell_position, GridMap.INVALID_CELL_ITEM)

@ -3,10 +3,13 @@ extends Node3D
class_name LevelInstance
@export_tool_button("视野锁定", "Callable")
var view_focus_on: Callable = view_focus_on_func
var view_focus_on: Callable = func() -> void:
grid_block_material.set_shader_parameter("is_focus", true)
set_focus_editor()
@export_tool_button("视野解锁", "Callable")
var view_focus_off: Callable = view_focus_off_func
var view_focus_off: Callable = func() -> void:
grid_block_material.set_shader_parameter("is_focus", false)
set_focus()
@export var size: Vector3i = Vector3i.ONE:
set(value):
@ -17,29 +20,39 @@ var view_focus_off: Callable = view_focus_off_func
@export var is_force_battle: bool
@export var enemy_nums: Array[LevelEnemy]
@export_group("替换item_id")
@export var id_from: int = 0
@export var id_to: int = 0
@export_tool_button("替换", "Callable")
var replace_id: Callable = replace_id_func
@export_tool_button("打印item详情", "Callable")
var print_item: Callable = print_item_func
func view_focus_on_func() -> void:
grid_block_material.set_shader_parameter("is_focus", true)
set_focus_editor()
@export_group("快速操作")
@export_tool_button("清空", "Callable")
var remove_all: Callable = func() -> void:
var level_main: GridMap = %LevelGridMain as GridMap
var id_min: Vector3i = Util.get_level_grid_pos2(pos_min())
var id_max: Vector3i = Util.get_level_grid_pos2(pos_max())
for x in range(id_min.x, id_max.x + 1):
for y in range(id_min.y, id_max.y + 1):
for z in range(id_min.z, id_max.z + 1):
var pos: Vector3i = Vector3i(x, y, z)
level_main.set_cell_item(pos, GridMap.INVALID_CELL_ITEM)
func view_focus_off_func() -> void:
grid_block_material.set_shader_parameter("is_focus", false)
set_focus()
@export_tool_button("快速创建", "Callable")
var quick_build: Callable = func() -> void:
var level_main: GridMap = %LevelGridMain as GridMap
var id_min: Vector3i = Util.get_level_grid_pos2(pos_min())
var id_max: Vector3i = Util.get_level_grid_pos2(pos_max())
for x in range(id_min.x, id_max.x + 1):
for y in range(id_min.y, id_max.y + 1):
for z in range(id_min.z, id_max.z + 1):
var pos: Vector3i = Vector3i(x, y, z)
if x == id_min.x or x == id_max.x or y == id_min.y or z == id_min.z:
level_main.set_cell_item(pos, 2)
func replace_id_func() -> void:
@export_group("替换item_id")
@export var id_from: int = 0
@export var id_to: int = 0
@export_tool_button("替换", "Callable")
var replace_id: Callable = func() -> void:
var level_main: GridMap = %LevelGridMain as GridMap
var id_min: Vector3i = Util.get_level_grid_pos2(pos_min())
var id_max: Vector3i = Util.get_level_grid_pos2(pos_max())
@ -50,9 +63,8 @@ func replace_id_func() -> void:
var pos: Vector3i = Vector3i(x, y, z)
if level_main.get_cell_item(pos) == id_from:
level_main.set_cell_item(pos, id_to, level_main.get_cell_item_orientation(pos))
func print_item_func() -> void:
@export_tool_button("打印item详情", "Callable")
var print_item: Callable = func() -> void:
var level_main: GridMap = %LevelGridMain as GridMap
var id_min: Vector3i = Util.get_level_grid_pos2(pos_min())
var id_max: Vector3i = Util.get_level_grid_pos2(pos_max())
@ -152,8 +164,8 @@ func init_level_character() -> void:
character_born_spots = []
level_active_spots = []
enemy_cfgs = []
var id_min: Vector3i = Util.get_level_grid_pos(pos_min())
var id_max: Vector3i = Util.get_level_grid_pos(pos_max())
var id_min: Vector3i = Util.get_level_grid_pos2(pos_min())
var id_max: Vector3i = Util.get_level_grid_pos2(pos_max())
var mesh_library: MeshLibrary = level_character.get_mesh_library()
var used_cells: Array[Vector3i] = level_character.get_used_cells()
for pos in used_cells:
@ -163,7 +175,7 @@ func init_level_character() -> void:
continue
if pos.z < id_min.z or pos.z > id_max.z:
continue
var float_pos: Vector3 = Util.get_level_float_pos(pos)
var float_pos: Vector3 = Util.get_level_float_pos2_floor(pos)
var item_id: int = level_character.get_cell_item(pos)
if item_id == GridMap.INVALID_CELL_ITEM:
continue

@ -109,12 +109,13 @@ func enter_level() -> void:
for level_active_spot: Node in level_active_spots:
level_active_spot.queue_free()
for level_active_spot: LevelInstance.LevelActiveSpot in cur_level_instance.get_level_active_spots():
var new_level_active: Node = level_active_spot.scene.instantiate()
var new_level_active: LevelActive = level_active_spot.scene.instantiate()
add_child(new_level_active)
new_level_active.global_position = level_active_spot.pos
level_active_spots.append(new_level_active)
if new_level_active is LevelDoor:
level_doors.append(new_level_active)
new_level_active.init()
#更新刷怪数据
level_character_born_spots = cur_level_instance.get_character_born_spots()
level_enemy_cfgs = cur_level_instance.get_enemy_cfgs()

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Before

Width:  |  Height:  |  Size: 138 B

After

Width:  |  Height:  |  Size: 138 B

Before

Width:  |  Height:  |  Size: 157 B

After

Width:  |  Height:  |  Size: 157 B

Before

Width:  |  Height:  |  Size: 176 B

After

Width:  |  Height:  |  Size: 176 B

Before

Width:  |  Height:  |  Size: 122 B

After

Width:  |  Height:  |  Size: 122 B

Before

Width:  |  Height:  |  Size: 146 B

After

Width:  |  Height:  |  Size: 146 B

Before

Width:  |  Height:  |  Size: 129 B

After

Width:  |  Height:  |  Size: 129 B

Before

Width:  |  Height:  |  Size: 146 B

After

Width:  |  Height:  |  Size: 146 B

Before

Width:  |  Height:  |  Size: 126 B

After

Width:  |  Height:  |  Size: 126 B

Before

Width:  |  Height:  |  Size: 362 B

After

Width:  |  Height:  |  Size: 362 B

Before

Width:  |  Height:  |  Size: 362 B

After

Width:  |  Height:  |  Size: 362 B

Before

Width:  |  Height:  |  Size: 301 B

After

Width:  |  Height:  |  Size: 301 B

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save