From 11c78bc818b17ae85c223819b8c467358737886b Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Wed, 17 Jul 2024 11:23:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=BA=E7=89=A9=E6=8E=92=E9=98=9Fbug?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=88=E6=BD=9C=E5=9C=A8=E7=9A=84=E6=8E=92?= =?UTF-8?q?=E9=98=9F=E5=90=8E=E4=B8=8D=E8=B5=B0=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sceen/people/Player.gd | 12 +++++++ sceen/people/peopleWalkFollow.gd | 4 +-- sceen/people/player.tscn | 14 +++++++- sceen/platform/gate/gate.tscn | 4 +-- sceen/platform/gate/gateDoor.gd | 25 ++++++++++--- sceen/platform/gate/gateDoor.tscn | 38 +++++++++++++------- sceen/totalOfLargePassengerFlow.gd | 54 +++++++++++++++------------- sceen/totalOfLargePassengerFlow.tscn | 4 --- 8 files changed, 104 insertions(+), 51 deletions(-) diff --git a/sceen/people/Player.gd b/sceen/people/Player.gd index a2ca125..14e0815 100644 --- a/sceen/people/Player.gd +++ b/sceen/people/Player.gd @@ -65,3 +65,15 @@ func _on_area_3d_area_exited(area: Area3D) -> void: AreaExit.emit(area) if currentExerciseType == Exercise_type.navigation and area.is_in_group('needStopWalk') : goToTarget() + +var frontPeople = 0 +func _on_people_front_area_3d_area_entered(area: Area3D) -> void: + var peopleWalkFollow = area.get_parent().get_parent() + if ( area.is_in_group('player') and peopleWalkFollow.id != self.get_parent().id ) or area.is_in_group('needStopWalk') : + frontPeople += 1 + + +func _on_people_front_area_3d_area_exited(area: Area3D) -> void: + var peopleWalkFollow = area.get_parent().get_parent() + if ( area.is_in_group('player') and peopleWalkFollow.id != self.get_parent().id ) or area.is_in_group('needStopWalk') : + frontPeople -= 1 diff --git a/sceen/people/peopleWalkFollow.gd b/sceen/people/peopleWalkFollow.gd index 018e8c6..b31d6d7 100644 --- a/sceen/people/peopleWalkFollow.gd +++ b/sceen/people/peopleWalkFollow.gd @@ -16,7 +16,7 @@ var generateArea = 'A' var speed:float = 1 #生成时候的id -var id = 0 +var id = '0A' ##设置路线点坐标 func setPathPoints(points : Array,angle :Vector3 = Vector3()) -> void: @@ -52,7 +52,7 @@ func _on_path_follow_timer_timeout() -> void: func _on_player_area_enter(area: Area3D) -> void: - if player.currentExerciseType == player.Exercise_type.pathFollow and (area.is_in_group('needStopWalk') or area.is_in_group('player')): + if player.currentExerciseType == player.Exercise_type.pathFollow and (area.is_in_group('needStopWalk') or area.is_in_group('player') ) and player.frontPeople == 1 : peopleStopWalk() var waitTimeWalkAgain = 0.2 diff --git a/sceen/people/player.tscn b/sceen/people/player.tscn index 080cd28..db65889 100644 --- a/sceen/people/player.tscn +++ b/sceen/people/player.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=7 format=3 uid="uid://c6noskjp3ks4p"] +[gd_scene load_steps=8 format=3 uid="uid://c6noskjp3ks4p"] [ext_resource type="Script" path="res://sceen/people/Player.gd" id="1_pursd"] [ext_resource type="PackedScene" uid="uid://ql5aokids4f6" path="res://sceen/people/people.tscn" id="2_ggqm4"] @@ -9,6 +9,9 @@ [sub_resource type="CapsuleShape3D" id="CapsuleShape3D_n25t3"] radius = 0.4 +[sub_resource type="BoxShape3D" id="BoxShape3D_ywkfy"] +size = Vector3(0.113147, 0.145019, 0.102899) + [node name="Player" type="CharacterBody3D"] script = ExtResource("1_pursd") @@ -45,6 +48,15 @@ height = 2.0 [node name="NavigationTimer" type="Timer" parent="."] wait_time = 0.05 +[node name="PeopleFrontArea3D" type="Area3D" parent="."] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.00255, -0.378363) + +[node name="CollisionShape3D" type="CollisionShape3D" parent="PeopleFrontArea3D"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00299683, -0.0159907, 0.00346985) +shape = SubResource("BoxShape3D_ywkfy") + [connection signal="area_entered" from="Area3D" to="." method="_on_area_3d_area_entered"] [connection signal="area_exited" from="Area3D" to="." method="_on_area_3d_area_exited"] [connection signal="timeout" from="NavigationTimer" to="." method="_on_navigation_timer_timeout"] +[connection signal="area_entered" from="PeopleFrontArea3D" to="." method="_on_people_front_area_3d_area_entered"] +[connection signal="area_exited" from="PeopleFrontArea3D" to="." method="_on_people_front_area_3d_area_exited"] diff --git a/sceen/platform/gate/gate.tscn b/sceen/platform/gate/gate.tscn index 8d3e039..cf75860 100644 --- a/sceen/platform/gate/gate.tscn +++ b/sceen/platform/gate/gate.tscn @@ -10,7 +10,7 @@ albedo_texture = ExtResource("2_0v5rh") metallic = 1.0 roughness = 0.858579 -[sub_resource type="ArrayMesh" id="ArrayMesh_5f2fo"] +[sub_resource type="ArrayMesh" id="ArrayMesh_f10wl"] _surfaces = [{ "aabb": AABB(-0.150002, -0.578827, -0.794207, 0.300009, 1.15765, 1.58841), "format": 34896613377, @@ -42,7 +42,7 @@ _surfaces = [{ "vertex_data": PackedByteArray(252, 255, 191, 234, 199, 192, 23, 245, 252, 255, 191, 234, 199, 192, 128, 219, 252, 255, 191, 234, 199, 192, 255, 191, 253, 255, 191, 234, 100, 22, 240, 235, 0, 0, 191, 234, 100, 22, 195, 202, 0, 0, 191, 234, 199, 192, 114, 179, 0, 0, 191, 234, 199, 192, 126, 193, 0, 0, 191, 234, 199, 192, 114, 179, 253, 255, 18, 217, 113, 2, 135, 248, 253, 255, 18, 217, 113, 2, 125, 248, 0, 0, 18, 217, 113, 2, 205, 223, 0, 0, 18, 217, 113, 2, 207, 223, 0, 0, 18, 217, 102, 248, 70, 174, 0, 0, 18, 217, 102, 248, 150, 195, 0, 0, 18, 217, 102, 248, 168, 198, 252, 255, 18, 217, 102, 248, 56, 199, 252, 255, 18, 217, 102, 248, 216, 195, 252, 255, 18, 217, 102, 248, 74, 235, 252, 255, 191, 234, 44, 167, 26, 253, 252, 255, 191, 234, 44, 167, 255, 191, 0, 0, 191, 234, 44, 167, 149, 204, 0, 0, 191, 234, 44, 167, 62, 205, 0, 0, 18, 217, 224, 231, 255, 191, 252, 255, 18, 217, 224, 231, 255, 255, 252, 255, 89, 237, 199, 192, 21, 204, 252, 255, 89, 237, 199, 192, 255, 191, 0, 0, 89, 237, 199, 192, 156, 192, 0, 0, 89, 237, 199, 192, 113, 167, 0, 0, 254, 255, 44, 167, 114, 217, 0, 0, 254, 255, 44, 167, 64, 220, 252, 255, 255, 255, 44, 167, 3, 251, 252, 255, 255, 255, 44, 167, 255, 191, 0, 0, 116, 227, 69, 9, 202, 210, 0, 0, 116, 227, 69, 9, 172, 213, 0, 0, 116, 227, 120, 239, 68, 188, 0, 0, 116, 227, 120, 239, 98, 192, 0, 0, 116, 227, 120, 239, 245, 198, 252, 255, 116, 227, 120, 239, 131, 199, 252, 255, 116, 227, 120, 239, 63, 229, 252, 255, 116, 227, 120, 239, 33, 223, 253, 255, 116, 227, 69, 9, 28, 249, 253, 255, 116, 227, 69, 9, 244, 239, 0, 0, 116, 227, 44, 167, 255, 191, 252, 255, 116, 227, 44, 167, 255, 255, 0, 0, 254, 255, 153, 171, 102, 195, 0, 0, 254, 255, 153, 171, 147, 191, 252, 255, 254, 255, 153, 171, 180, 223, 252, 255, 254, 255, 153, 171, 255, 191, 56, 218, 14, 210, 237, 252, 117, 202, 56, 218, 14, 210, 237, 252, 15, 199, 56, 218, 14, 210, 237, 252, 190, 195, 56, 218, 14, 210, 237, 252, 150, 210, 197, 37, 14, 210, 238, 252, 180, 194, 197, 37, 14, 210, 238, 252, 107, 195, 197, 37, 14, 210, 238, 252, 148, 184, 197, 37, 14, 210, 238, 252, 199, 188, 197, 37, 18, 217, 102, 248, 66, 192, 197, 37, 18, 217, 102, 248, 242, 193, 197, 37, 18, 217, 102, 248, 136, 195, 197, 37, 18, 217, 102, 248, 111, 198, 197, 37, 73, 225, 153, 241, 88, 192, 197, 37, 73, 225, 153, 241, 74, 213, 197, 37, 73, 225, 153, 241, 198, 198, 197, 37, 73, 225, 153, 241, 160, 228, 56, 218, 73, 225, 153, 241, 73, 219, 56, 218, 73, 225, 153, 241, 192, 199, 56, 218, 73, 225, 153, 241, 240, 195, 56, 218, 73, 225, 153, 241, 160, 216, 56, 218, 18, 217, 102, 248, 104, 199, 56, 218, 18, 217, 102, 248, 72, 196, 56, 218, 18, 217, 102, 248, 244, 210, 56, 218, 18, 217, 102, 248, 215, 216, 230, 194, 66, 214, 159, 251, 158, 192, 230, 194, 66, 214, 159, 251, 139, 198, 230, 194, 66, 214, 159, 251, 126, 213, 23, 61, 66, 214, 159, 251, 202, 201, 23, 61, 66, 214, 159, 251, 215, 201, 23, 61, 66, 214, 159, 251, 219, 204, 23, 61, 189, 218, 40, 249, 66, 203, 23, 61, 189, 218, 40, 249, 16, 205, 23, 61, 189, 218, 40, 249, 65, 212, 23, 61, 23, 223, 225, 244, 44, 205, 23, 61, 23, 223, 225, 244, 180, 212, 230, 194, 23, 223, 225, 244, 122, 192, 230, 194, 23, 223, 225, 244, 183, 191, 230, 194, 189, 218, 40, 249, 249, 192, 230, 194, 189, 218, 40, 249, 47, 192, 230, 194, 189, 218, 40, 249, 103, 194, 143, 206, 89, 213, 165, 253, 193, 192, 143, 206, 89, 213, 165, 253, 207, 201, 143, 206, 89, 213, 165, 253, 65, 212, 143, 206, 89, 213, 165, 253, 187, 210, 110, 49, 89, 213, 165, 253, 104, 194, 110, 49, 89, 213, 165, 253, 213, 182, 110, 49, 89, 213, 165, 253, 109, 201, 110, 49, 89, 213, 165, 253, 203, 204, 110, 49, 83, 220, 232, 249, 58, 192, 110, 49, 83, 220, 232, 249, 166, 193, 110, 49, 83, 220, 232, 249, 247, 204, 110, 49, 83, 220, 232, 249, 106, 212, 110, 49, 150, 226, 194, 243, 81, 192, 110, 49, 150, 226, 194, 243, 156, 217, 110, 49, 150, 226, 194, 243, 73, 228, 110, 49, 150, 226, 194, 243, 209, 212, 143, 206, 150, 226, 194, 243, 90, 192, 143, 206, 150, 226, 194, 243, 134, 218, 143, 206, 150, 226, 194, 243, 136, 198, 143, 206, 150, 226, 194, 243, 176, 216, 143, 206, 83, 220, 232, 249, 203, 192, 143, 206, 83, 220, 232, 249, 100, 192, 143, 206, 83, 220, 232, 249, 25, 211, 143, 206, 83, 220, 232, 249, 233, 216, 253, 255, 204, 199, 67, 254, 84, 213, 253, 255, 204, 199, 67, 254, 149, 196, 253, 255, 204, 199, 67, 254, 118, 195, 253, 255, 204, 199, 67, 254, 204, 230, 0, 0, 204, 199, 67, 254, 133, 171, 0, 0, 204, 199, 67, 254, 132, 195, 0, 0, 204, 199, 67, 254, 130, 215, 0, 0, 204, 199, 67, 254, 234, 187, 0, 0, 204, 199, 114, 0, 147, 248, 0, 0, 204, 199, 114, 0, 58, 222, 0, 0, 204, 199, 114, 0, 84, 213, 253, 255, 204, 199, 114, 0, 84, 213, 253, 255, 204, 199, 114, 0, 97, 220, 253, 255, 204, 199, 114, 0, 249, 242, 0, 0, 204, 199, 89, 245, 252, 197, 0, 0, 204, 199, 89, 245, 143, 214, 253, 255, 204, 199, 89, 245, 121, 213, 253, 255, 204, 199, 89, 245, 173, 233, 0, 0, 0, 0, 67, 254, 255, 127, 253, 255, 0, 0, 67, 254, 255, 127, 253, 255, 204, 199, 67, 254, 255, 127, 0, 0, 204, 199, 67, 254, 255, 127, 253, 255, 98, 7, 67, 254, 255, 127, 0, 0, 98, 7, 67, 254, 255, 127, 253, 255, 98, 7, 114, 0, 0, 0, 0, 0, 98, 7, 114, 0, 0, 0, 0, 0, 98, 7, 114, 0, 0, 0, 0, 0, 204, 199, 114, 0, 0, 0, 0, 0, 204, 199, 114, 0, 0, 0, 253, 255, 204, 199, 114, 0, 0, 0, 253, 255, 98, 7, 67, 254, 0, 0, 253, 255, 98, 7, 206, 248, 0, 0, 253, 255, 204, 199, 206, 248, 0, 0, 253, 255, 204, 199, 67, 254, 0, 0, 0, 0, 0, 0, 47, 89, 2, 58, 0, 0, 0, 0, 47, 89, 84, 22, 253, 255, 0, 0, 47, 89, 84, 22, 253, 255, 0, 0, 47, 89, 84, 22, 253, 255, 0, 0, 197, 158, 84, 22, 253, 255, 0, 0, 197, 158, 84, 22, 0, 0, 0, 0, 197, 158, 2, 58, 0, 0, 0, 0, 197, 158, 84, 22, 0, 0, 98, 7, 197, 158, 0, 0, 0, 0, 204, 199, 198, 158, 0, 0, 0, 0, 204, 199, 47, 89, 0, 0, 0, 0, 98, 7, 47, 89, 0, 0, 0, 0, 98, 7, 67, 254, 0, 0, 0, 0, 204, 199, 67, 254, 0, 0, 253, 255, 98, 7, 47, 89, 0, 0, 253, 255, 204, 199, 47, 89, 0, 0, 253, 255, 204, 199, 198, 158, 0, 0, 253, 255, 98, 7, 197, 158, 0, 0, 0, 0, 0, 0, 206, 248, 2, 58, 0, 0, 0, 0, 206, 248, 83, 22, 253, 255, 0, 0, 206, 248, 84, 22, 253, 255, 0, 0, 206, 248, 84, 22, 253, 255, 0, 0, 67, 254, 84, 22, 253, 255, 0, 0, 67, 254, 84, 22, 0, 0, 0, 0, 67, 254, 3, 58, 0, 0, 0, 0, 67, 254, 83, 22, 0, 0, 204, 199, 206, 248, 0, 0, 0, 0, 98, 7, 206, 248, 0, 0, 0, 0, 0, 0, 156, 170, 2, 58, 0, 0, 0, 0, 156, 170, 84, 22, 253, 255, 0, 0, 156, 170, 84, 22, 253, 255, 0, 0, 156, 170, 84, 22, 253, 255, 0, 0, 35, 77, 84, 22, 253, 255, 0, 0, 35, 77, 84, 22, 0, 0, 0, 0, 35, 77, 2, 58, 0, 0, 0, 0, 35, 77, 84, 22, 0, 0, 0, 0, 12, 5, 2, 58, 0, 0, 0, 0, 12, 5, 84, 22, 253, 255, 0, 0, 12, 5, 84, 22, 253, 255, 0, 0, 12, 5, 84, 22, 0, 0, 204, 199, 156, 170, 0, 0, 0, 0, 98, 7, 156, 170, 0, 0, 0, 0, 98, 7, 12, 5, 0, 0, 0, 0, 204, 199, 12, 5, 0, 0, 253, 255, 204, 199, 12, 5, 0, 0, 253, 255, 98, 7, 12, 5, 0, 0, 253, 255, 98, 7, 156, 170, 0, 0, 253, 255, 204, 199, 156, 170, 0, 0, 0, 0, 98, 7, 35, 77, 0, 0, 0, 0, 204, 199, 35, 77, 0, 0, 253, 255, 98, 7, 35, 77, 0, 0, 253, 255, 204, 199, 35, 77, 0, 0, 253, 255, 0, 0, 114, 0, 104, 14, 253, 255, 0, 0, 114, 0, 28, 23, 0, 0, 0, 0, 114, 0, 108, 30, 0, 0, 0, 0, 114, 0, 190, 35, 0, 0, 0, 0, 114, 0, 105, 14, 0, 0, 77, 4, 47, 89, 84, 213, 253, 255, 77, 4, 47, 89, 84, 213, 253, 255, 77, 4, 197, 158, 84, 213, 0, 0, 77, 4, 197, 158, 84, 213, 0, 0, 77, 4, 206, 248, 84, 213, 253, 255, 77, 4, 206, 248, 84, 213, 253, 255, 77, 4, 67, 254, 84, 213, 0, 0, 77, 4, 67, 254, 85, 213, 0, 0, 77, 4, 156, 170, 84, 213, 253, 255, 77, 4, 156, 170, 84, 213, 253, 255, 77, 4, 35, 77, 84, 213, 0, 0, 77, 4, 35, 77, 84, 213, 0, 0, 77, 4, 12, 5, 84, 213, 253, 255, 77, 4, 12, 5, 84, 213, 0, 0, 77, 4, 114, 0, 84, 213, 253, 255, 77, 4, 114, 0, 84, 213, 0, 0, 124, 200, 206, 248, 0, 0, 0, 0, 98, 7, 206, 248, 0, 0, 0, 0, 124, 200, 156, 170, 0, 0, 0, 0, 98, 7, 156, 170, 0, 0, 250, 62, 50, 171, 124, 254, 232, 153, 250, 62, 50, 171, 124, 254, 231, 141, 202, 196, 50, 171, 124, 254, 231, 141, 202, 196, 50, 171, 124, 254, 232, 153, 199, 194, 150, 177, 124, 254, 143, 140, 253, 64, 150, 177, 124, 254, 143, 140, 28, 220, 244, 166, 235, 250, 187, 183, 28, 220, 244, 166, 235, 250, 225, 175, 115, 208, 99, 168, 255, 255, 187, 183, 115, 208, 99, 168, 255, 255, 232, 153, 115, 208, 99, 168, 255, 255, 143, 164, 115, 208, 99, 168, 255, 255, 224, 175, 81, 51, 99, 168, 255, 255, 224, 175, 81, 51, 99, 168, 255, 255, 148, 164, 81, 51, 99, 168, 255, 255, 187, 183, 81, 51, 99, 168, 255, 255, 232, 153, 168, 39, 244, 166, 235, 250, 225, 175, 168, 39, 244, 166, 235, 250, 187, 183, 193, 53, 221, 177, 255, 255, 241, 175, 193, 53, 221, 177, 255, 255, 222, 175, 193, 53, 221, 177, 255, 255, 117, 139, 132, 42, 213, 177, 235, 250, 241, 175, 132, 42, 213, 177, 235, 250, 223, 175, 95, 45, 183, 188, 235, 250, 242, 175, 95, 45, 183, 188, 235, 250, 16, 184, 47, 56, 87, 187, 255, 255, 241, 175, 47, 56, 87, 187, 255, 255, 92, 163, 47, 56, 87, 187, 255, 255, 132, 150, 47, 56, 87, 187, 255, 255, 16, 184, 148, 203, 87, 187, 255, 255, 132, 150, 148, 203, 87, 187, 255, 255, 16, 184, 148, 203, 87, 187, 255, 255, 96, 163, 148, 203, 87, 187, 255, 255, 240, 175, 101, 214, 183, 188, 235, 250, 16, 184, 101, 214, 183, 188, 235, 250, 241, 175, 4, 206, 221, 177, 255, 255, 118, 139, 4, 206, 221, 177, 255, 255, 222, 175, 4, 206, 221, 177, 255, 255, 240, 175, 64, 217, 213, 177, 235, 250, 223, 175, 64, 217, 213, 177, 235, 250, 240, 175, 0, 67, 251, 183, 124, 254, 132, 150, 0, 67, 251, 183, 124, 254, 30, 141, 196, 192, 251, 183, 124, 254, 30, 141, 196, 192, 251, 183, 124, 254, 132, 150, 84, 22, 70, 99, 0, 0, 255, 255, 84, 22, 53, 45, 0, 0, 255, 255, 65, 230, 70, 99, 0, 0, 255, 255, 65, 230, 53, 45, 0, 0, 255, 255, 100, 238, 180, 100, 72, 255, 255, 127, 100, 238, 199, 43, 72, 255, 255, 127, 115, 19, 180, 100, 72, 255, 255, 127, 115, 19, 199, 43, 72, 255, 255, 127, 120, 217, 7, 240, 166, 190, 193, 168, 120, 217, 96, 253, 125, 175, 193, 168, 53, 34, 96, 253, 125, 175, 193, 168, 53, 34, 7, 240, 166, 190, 193, 168, 252, 255, 191, 234, 199, 192, 255, 255, 252, 255, 191, 234, 199, 192, 193, 203, 252, 255, 191, 234, 199, 192, 205, 196, 252, 255, 191, 234, 199, 192, 93, 209, 253, 255, 191, 234, 100, 22, 54, 236, 253, 255, 191, 234, 100, 22, 255, 255, 253, 255, 191, 234, 100, 22, 214, 246, 253, 255, 191, 234, 100, 22, 50, 219, 0, 0, 191, 234, 100, 22, 48, 226, 0, 0, 191, 234, 100, 22, 236, 211, 0, 0, 191, 234, 100, 22, 33, 207, 0, 0, 191, 234, 199, 192, 111, 188, 0, 0, 191, 234, 199, 192, 162, 191, 0, 0, 191, 234, 199, 192, 73, 195, 0, 0, 191, 234, 199, 192, 193, 196, 252, 255, 18, 217, 102, 248, 174, 241, 252, 255, 18, 217, 102, 248, 255, 255, 252, 255, 18, 217, 102, 248, 255, 255, 252, 255, 191, 234, 44, 167, 218, 238, 252, 255, 191, 234, 44, 167, 235, 233, 252, 255, 191, 234, 44, 167, 169, 204, 0, 0, 89, 237, 199, 192, 135, 214, 0, 0, 89, 237, 199, 192, 20, 197, 0, 0, 89, 237, 199, 192, 173, 193, 0, 0, 89, 237, 199, 192, 176, 209, 0, 0, 116, 227, 69, 9, 36, 224, 0, 0, 116, 227, 69, 9, 236, 235, 0, 0, 116, 227, 69, 9, 99, 215, 0, 0, 116, 227, 69, 9, 114, 208, 0, 0, 116, 227, 120, 239, 225, 182, 0, 0, 116, 227, 120, 239, 24, 195, 0, 0, 116, 227, 120, 239, 151, 192, 252, 255, 116, 227, 120, 239, 54, 200, 252, 255, 116, 227, 120, 239, 34, 206, 56, 218, 14, 210, 237, 252, 115, 202, 197, 37, 14, 210, 238, 252, 161, 193, 197, 37, 73, 225, 153, 241, 95, 196, 56, 218, 73, 225, 153, 241, 107, 190, 56, 218, 73, 225, 153, 241, 145, 207, 56, 218, 18, 217, 102, 248, 154, 207, 23, 61, 66, 214, 159, 251, 135, 199, 143, 206, 89, 213, 165, 253, 67, 202, 143, 206, 89, 213, 165, 253, 171, 193, 110, 49, 89, 213, 165, 253, 208, 207, 110, 49, 89, 213, 165, 253, 124, 185, 110, 49, 150, 226, 194, 243, 16, 194, 143, 206, 150, 226, 194, 243, 83, 199, 143, 206, 83, 220, 232, 249, 93, 196, 253, 255, 204, 199, 67, 254, 234, 208, 253, 255, 204, 199, 67, 254, 49, 240, 0, 0, 204, 199, 67, 254, 20, 173, 0, 0, 204, 199, 114, 0, 255, 255, 0, 0, 204, 199, 114, 0, 170, 217, 253, 255, 204, 199, 114, 0, 255, 255, 253, 255, 204, 199, 114, 0, 255, 255, 253, 255, 204, 199, 114, 0, 255, 255, 253, 255, 204, 199, 114, 0, 217, 231, 0, 0, 204, 199, 89, 245, 111, 195, 0, 0, 204, 199, 89, 245, 129, 183, 253, 255, 204, 199, 89, 245, 162, 236, 0, 0, 98, 7, 114, 0, 0, 0, 0, 0, 98, 7, 114, 0, 0, 0, 0, 0, 98, 7, 114, 0, 172, 10, 0, 0, 98, 7, 114, 0, 130, 27, 0, 0, 204, 199, 114, 0, 0, 0, 253, 255, 204, 199, 114, 0, 0, 0, 253, 255, 204, 199, 114, 0, 0, 0, 0, 0, 0, 0, 67, 254, 188, 14, 0, 0, 0, 0, 12, 5, 116, 7, 253, 255, 0, 0, 114, 0, 0, 0, 253, 255, 0, 0, 114, 0, 232, 35, 253, 255, 0, 0, 114, 0, 21, 21, 0, 0, 0, 0, 114, 0, 166, 20, 0, 0, 0, 0, 114, 0, 33, 11, 250, 62, 50, 171, 124, 254, 235, 129, 115, 208, 99, 168, 255, 255, 113, 134, 115, 208, 99, 168, 255, 255, 255, 127, 115, 208, 99, 168, 255, 255, 215, 162, 81, 51, 99, 168, 255, 255, 106, 168, 81, 51, 99, 168, 255, 255, 65, 161, 81, 51, 99, 168, 255, 255, 117, 144, 81, 51, 99, 168, 255, 255, 255, 127, 168, 39, 244, 166, 235, 250, 242, 176, 132, 42, 213, 177, 235, 250, 16, 171, 132, 42, 213, 177, 235, 250, 111, 162, 47, 56, 87, 187, 255, 255, 68, 162, 47, 56, 87, 187, 255, 255, 255, 127, 47, 56, 87, 187, 255, 255, 219, 166, 47, 56, 87, 187, 255, 255, 117, 144, 148, 203, 87, 187, 255, 255, 255, 127, 148, 203, 87, 187, 255, 255, 44, 150, 148, 203, 87, 187, 255, 255, 247, 167, 101, 214, 183, 188, 235, 250, 167, 176, 4, 206, 221, 177, 255, 255, 219, 137, 0, 67, 251, 183, 124, 254, 168, 129, 84, 22, 70, 99, 0, 0, 4, 248, 84, 22, 53, 45, 0, 0, 249, 245, 84, 22, 53, 45, 0, 0, 255, 253, 65, 230, 70, 99, 0, 0, 189, 253, 65, 230, 70, 99, 0, 0, 77, 249, 65, 230, 53, 45, 0, 0, 217, 248, 120, 217, 7, 240, 166, 190, 30, 164, 120, 217, 7, 240, 166, 190, 17, 159, 120, 217, 96, 253, 125, 175, 123, 168, 53, 34, 96, 253, 125, 175, 144, 166, 53, 34, 96, 253, 125, 175, 226, 164, 53, 34, 7, 240, 166, 190, 236, 158, 119, 177, 38, 136, 184, 179, 219, 115, 253, 127, 0, 0, 215, 181, 14, 154, 163, 161, 122, 197, 24, 143, 110, 219, 5, 113, 180, 191, 23, 143, 109, 219, 54, 45, 114, 53, 174, 204, 73, 146, 61, 191, 53, 201, 200, 150, 102, 223, 160, 148, 61, 197, 253, 141, 146, 158, 92, 158, 15, 159, 18, 159, 20, 158, 53, 158, 109, 142, 174, 168, 26, 140, 54, 191, 236, 144, 255, 127, 0, 0, 30, 154, 115, 225, 54, 144, 231, 227, 3, 128, 253, 255, 254, 191, 253, 127, 50, 171, 120, 121, 252, 127, 1, 0, 202, 120, 160, 175, 159, 146, 160, 193, 204, 180, 48, 197, 142, 160, 149, 206, 32, 181, 145, 168, 255, 127, 0, 0, 254, 175, 107, 199, 179, 158, 239, 205, 129, 155, 12, 191, 135, 148, 78, 191, 39, 158, 31, 159, 224, 158, 36, 158, 194, 173, 243, 147, 181, 177, 36, 144, 215, 180, 128, 163, 58, 191, 228, 152, 2, 128, 253, 255, 254, 191, 253, 127, 201, 149, 98, 192, 163, 156, 195, 191, 168, 179, 117, 145, 255, 127, 0, 0, 93, 116, 43, 113, 61, 136, 190, 137, 66, 158, 102, 142, 225, 177, 2, 122, 222, 119, 26, 184, 19, 142, 147, 158, 158, 110, 230, 113, 112, 138, 144, 137, 233, 129, 177, 195, 121, 120, 233, 184, 4, 142, 146, 158, 131, 158, 3, 159, 204, 129, 173, 195, 26, 147, 16, 170, 71, 158, 21, 159, 37, 168, 36, 181, 189, 184, 26, 171, 183, 158, 50, 158, 53, 173, 213, 152, 196, 182, 112, 129, 242, 158, 30, 158, 254, 157, 137, 142, 228, 177, 72, 122, 159, 182, 157, 129, 232, 132, 116, 176, 49, 152, 165, 166, 148, 159, 123, 168, 82, 170, 248, 163, 98, 165, 251, 151, 99, 171, 254, 132, 31, 165, 201, 146, 69, 171, 28, 133, 133, 174, 80, 141, 66, 160, 212, 148, 58, 174, 145, 141, 206, 143, 90, 182, 102, 150, 102, 164, 77, 143, 86, 182, 58, 133, 135, 176, 212, 147, 2, 168, 207, 132, 110, 176, 47, 116, 48, 113, 154, 160, 13, 168, 226, 177, 29, 122, 26, 120, 106, 184, 237, 109, 253, 113, 180, 170, 207, 163, 109, 171, 245, 132, 242, 129, 179, 195, 184, 120, 60, 185, 84, 171, 14, 133, 106, 174, 103, 141, 213, 129, 174, 195, 91, 147, 156, 178, 169, 168, 212, 180, 40, 174, 161, 141, 238, 143, 91, 182, 115, 186, 17, 170, 52, 186, 182, 150, 185, 182, 125, 129, 123, 143, 87, 182, 19, 133, 126, 176, 229, 177, 100, 122, 146, 182, 172, 129, 170, 42, 84, 213, 186, 136, 180, 137, 101, 158, 84, 142, 158, 12, 96, 220, 163, 59, 228, 234, 6, 142, 147, 158, 242, 43, 228, 215, 166, 138, 140, 137, 121, 199, 208, 216, 190, 80, 19, 224, 170, 42, 84, 213, 170, 42, 84, 213, 218, 48, 125, 70, 254, 26, 196, 187, 1, 70, 0, 227, 101, 43, 202, 214, 193, 42, 129, 213, 248, 21, 252, 202, 255, 127, 255, 127, 255, 255, 255, 255, 255, 127, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 127, 255, 127, 129, 218, 255, 127, 255, 255, 124, 165, 255, 255, 124, 165, 255, 255, 124, 165, 255, 255, 124, 165, 129, 218, 255, 127, 255, 191, 255, 127, 255, 191, 255, 127, 255, 191, 255, 127, 255, 191, 255, 127, 1, 70, 255, 226, 250, 74, 9, 106, 246, 21, 250, 202, 246, 21, 250, 202, 246, 21, 250, 202, 246, 21, 250, 202, 1, 70, 255, 226, 250, 74, 9, 106, 255, 63, 255, 127, 255, 63, 255, 127, 255, 63, 255, 127, 255, 63, 255, 127, 0, 64, 255, 127, 0, 64, 255, 127, 255, 191, 255, 127, 255, 191, 255, 127, 255, 191, 255, 127, 255, 191, 255, 127, 1, 70, 255, 226, 250, 74, 9, 106, 245, 21, 250, 202, 246, 21, 250, 202, 246, 21, 250, 202, 246, 21, 250, 202, 0, 70, 255, 226, 251, 74, 9, 106, 0, 64, 255, 127, 0, 64, 255, 127, 1, 70, 255, 226, 250, 74, 9, 106, 246, 21, 250, 202, 246, 21, 250, 202, 246, 21, 250, 202, 246, 21, 250, 202, 1, 70, 255, 226, 250, 74, 9, 106, 1, 70, 255, 226, 250, 74, 9, 106, 246, 21, 250, 202, 246, 21, 250, 202, 255, 63, 255, 127, 255, 63, 255, 127, 255, 63, 255, 127, 255, 63, 255, 127, 255, 191, 255, 127, 255, 191, 255, 127, 255, 191, 255, 127, 255, 191, 255, 127, 255, 63, 255, 127, 255, 63, 255, 127, 255, 191, 255, 127, 255, 191, 255, 127, 113, 27, 188, 189, 231, 10, 49, 173, 177, 39, 160, 139, 151, 78, 113, 223, 190, 61, 141, 100, 84, 213, 170, 42, 84, 213, 170, 42, 84, 213, 170, 42, 84, 213, 170, 42, 84, 213, 170, 42, 84, 213, 170, 42, 84, 213, 170, 42, 84, 213, 169, 42, 84, 213, 170, 42, 84, 213, 170, 42, 84, 213, 170, 42, 84, 213, 170, 42, 84, 213, 170, 42, 84, 213, 170, 42, 84, 213, 170, 42, 84, 213, 170, 42, 255, 63, 255, 127, 255, 63, 255, 127, 255, 63, 255, 127, 255, 63, 255, 127, 254, 255, 252, 127, 40, 192, 211, 58, 200, 186, 207, 191, 252, 255, 246, 127, 68, 119, 127, 246, 131, 118, 187, 8, 0, 0, 0, 128, 225, 136, 75, 6, 0, 0, 0, 128, 252, 255, 247, 127, 26, 20, 185, 51, 163, 136, 212, 6, 205, 134, 87, 247, 73, 76, 19, 148, 0, 0, 0, 128, 254, 255, 252, 127, 68, 134, 25, 247, 0, 0, 0, 128, 172, 135, 191, 247, 171, 135, 188, 247, 174, 147, 4, 248, 158, 136, 186, 247, 17, 135, 118, 247, 129, 138, 12, 247, 253, 255, 251, 127, 63, 137, 127, 247, 244, 236, 30, 201, 3, 0, 13, 128, 253, 255, 251, 127, 1, 0, 7, 128, 253, 255, 251, 127, 221, 182, 252, 108, 131, 136, 77, 9, 253, 255, 251, 127, 246, 136, 141, 10, 254, 135, 237, 19, 63, 136, 178, 7, 60, 136, 179, 7, 132, 136, 24, 7, 73, 136, 172, 8, 3, 0, 14, 128, 156, 67, 64, 64, 197, 63, 146, 195, 1, 0, 7, 128, 0, 128, 254, 255, 0, 128, 253, 255, 0, 128, 253, 255, 0, 128, 253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 255, 255, 127, 254, 255, 254, 127, 252, 255, 0, 128, 251, 255, 0, 128, 241, 181, 228, 122, 151, 168, 177, 141, 113, 155, 204, 153, 36, 177, 31, 133, 192, 178, 7, 159, 158, 171, 127, 158, 148, 173, 225, 163, 83, 172, 13, 174, 218, 171, 41, 170, 28, 163, 138, 190, 39, 162, 192, 194, 101, 142, 101, 221, 218, 134, 88, 178, 67, 137, 72, 181, 147, 151, 25, 163, 150, 170, 244, 128, 91, 177, 146, 128, 125, 199, 16, 88, 134, 188, 34, 153, 214, 178, 77, 168, 207, 179, 206, 163, 147, 116, 158, 197, 239, 154, 233, 148, 137, 139, 224, 162, 74, 106, 199, 193, 38, 166, 112, 200, 223, 176, 201, 176, 36, 181, 54, 184, 114, 153, 165, 225, 233, 133, 209, 222, 254, 156, 201, 177, 180, 155, 157, 172, 177, 156, 9, 164, 226, 168, 32, 147, 200, 141, 54, 109, 2, 134, 7, 171, 7, 151, 114, 169, 173, 187, 190, 174, 194, 170, 100, 143, 135, 171, 165, 140, 66, 170, 54, 159, 18, 161, 92, 151, 170, 114, 45, 156, 187, 162, 216, 150, 100, 172, 236, 99, 22, 140, 246, 183, 50, 160, 67, 162, 214, 155, 107, 163, 239, 42, 222, 213, 208, 3, 190, 43, 198, 172, 150, 249, 202, 226, 83, 148, 111, 97, 192, 226, 200, 18, 254, 202, 111, 174, 171, 157, 59, 198, 199, 72, 82, 191, 229, 66, 23, 115, 150, 249, 203, 116, 171, 250, 3, 15, 211, 199, 255, 127, 0, 0, 255, 127, 0, 0, 46, 58, 153, 99, 80, 72, 143, 175, 255, 127, 0, 0, 255, 127, 255, 255, 255, 127, 255, 255, 113, 71, 29, 113, 104, 71, 97, 113, 64, 128, 164, 255, 182, 50, 157, 51, 162, 38, 227, 194, 31, 34, 90, 119, 36, 55, 253, 109, 83, 143, 203, 240, 3, 0, 5, 128, 124, 221, 0, 0, 192, 132, 49, 6, 45, 134, 1, 249, 18, 135, 236, 252, 1, 0, 2, 128, 124, 221, 0, 0, 0, 0, 0, 128, 70, 137, 58, 248, 113, 140, 166, 250, 190, 141, 167, 250, 210, 225, 255, 255, 252, 255, 251, 127, 250, 255, 247, 127, 210, 225, 255, 255, 251, 255, 249, 127, 136, 135, 182, 10, 253, 255, 251, 127, 60, 135, 128, 21, 197, 143, 226, 240, 1, 128, 253, 255, 2, 128, 252, 255, 253, 127, 2, 0, 1, 128, 252, 255, 253, 127, 2, 0, 252, 127, 3, 0, 75, 238, 76, 110, 76, 245, 177, 138, 3, 234, 3, 106, 119, 252, 121, 124, 200, 233, 52, 150, 149, 234, 102, 149) }] blend_shape_mode = 0 -shadow_mesh = SubResource("ArrayMesh_5f2fo") +shadow_mesh = SubResource("ArrayMesh_f10wl") [node name="Gate" type="Node3D"] script = ExtResource("1_qlmgq") diff --git a/sceen/platform/gate/gateDoor.gd b/sceen/platform/gate/gateDoor.gd index 3dcae06..249430f 100644 --- a/sceen/platform/gate/gateDoor.gd +++ b/sceen/platform/gate/gateDoor.gd @@ -1,12 +1,12 @@ extends Node3D -##车门 +##闸机门 class_name GateDoor @onready var left_animation_player: AnimationPlayer = $LeftAnimationPlayer @onready var right_animation_player: AnimationPlayer = $RightAnimationPlayer -## 车门的状态枚举 +## 闸机门的状态枚举 enum Gate_Door_STATE{ opening,# 正在开门 open,#开到位 @@ -14,7 +14,7 @@ enum Gate_Door_STATE{ close,# 关到位 } -##车门的状态 +##闸机门的状态 @onready var gateDoorState : Gate_Door_STATE = Gate_Door_STATE.close : set(value): if gateDoorState != value: @@ -27,13 +27,28 @@ enum Gate_Door_STATE{ right_animation_player.play("rightClose") -##打开车门 +##打开闸机门 func openGateDoor ()-> void: if gateDoorState == Gate_Door_STATE.close : gateDoorState = Gate_Door_STATE.open -##关闭车门 +##关闭闸机门 func closeGateDoor ()-> void: if gateDoorState == Gate_Door_STATE.open : gateDoorState=Gate_Door_STATE.close + +var waitPeopleCount = 0 +func _on_area_3d_area_entered(area: Area3D) -> void: + var peopleWalkFollow = area.get_parent().get_parent() + if peopleWalkFollow is PlayerPathFollow : + waitPeopleCount += 1 + openGateDoor() + + +func _on_area_3d_area_exited(area: Area3D) -> void: + var peopleWalkFollow = area.get_parent().get_parent() + if peopleWalkFollow is PlayerPathFollow : + waitPeopleCount -= 1 + if waitPeopleCount==0 : + closeGateDoor() diff --git a/sceen/platform/gate/gateDoor.tscn b/sceen/platform/gate/gateDoor.tscn index ea2fc5e..24b8284 100644 --- a/sceen/platform/gate/gateDoor.tscn +++ b/sceen/platform/gate/gateDoor.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=16 format=3 uid="uid://c0368j6203bj8"] +[gd_scene load_steps=17 format=3 uid="uid://c0368j6203bj8"] [ext_resource type="Script" path="res://sceen/platform/gate/gateDoor.gd" id="1_b8ekv"] [ext_resource type="Texture2D" uid="uid://dwjh85d7n6c6d" path="res://Model/trainingLargePassengerFlow/textures/DKL_zhaji.jpg" id="1_uqk0r"] @@ -90,12 +90,12 @@ tracks/0/keys = { "times": PackedFloat32Array(0), "transitions": PackedFloat32Array(1), "update": 0, -"values": [Vector3(0, 0, 0)] +"values": [Vector3(0, 0, -0.0872665)] } [sub_resource type="Animation" id="Animation_hyiee"] resource_name = "leftClose" -length = 0.8 +length = 0.5 tracks/0/type = "value" tracks/0/imported = false tracks/0/enabled = true @@ -103,7 +103,7 @@ tracks/0/path = NodePath("left:rotation") tracks/0/interp = 1 tracks/0/loop_wrap = true tracks/0/keys = { -"times": PackedFloat32Array(0, 0.8), +"times": PackedFloat32Array(0, 0.5), "transitions": PackedFloat32Array(1, 1), "update": 0, "values": [Vector3(0, 0, 0.506145), Vector3(0, 0, -0.0872665)] @@ -111,7 +111,7 @@ tracks/0/keys = { [sub_resource type="Animation" id="Animation_0sy4u"] resource_name = "leftOpen" -length = 0.8 +length = 0.5 tracks/0/type = "value" tracks/0/imported = false tracks/0/enabled = true @@ -119,7 +119,7 @@ tracks/0/path = NodePath("left:rotation") tracks/0/interp = 1 tracks/0/loop_wrap = true tracks/0/keys = { -"times": PackedFloat32Array(0, 0.8), +"times": PackedFloat32Array(0, 0.5), "transitions": PackedFloat32Array(1, 1), "update": 0, "values": [Vector3(0, 0, -0.0872665), Vector3(0, 0, 0.506145)] @@ -144,12 +144,12 @@ tracks/0/keys = { "times": PackedFloat32Array(0), "transitions": PackedFloat32Array(1), "update": 0, -"values": [Vector3(0, 0, 0)] +"values": [Vector3(0, 0, 0.0872665)] } [sub_resource type="Animation" id="Animation_60d8m"] resource_name = "rightClose" -length = 0.8 +length = 0.5 tracks/0/type = "value" tracks/0/imported = false tracks/0/enabled = true @@ -157,7 +157,7 @@ tracks/0/path = NodePath("right:rotation") tracks/0/interp = 1 tracks/0/loop_wrap = true tracks/0/keys = { -"times": PackedFloat32Array(0, 0.8), +"times": PackedFloat32Array(0, 0.5), "transitions": PackedFloat32Array(1, 1), "update": 0, "values": [Vector3(0, 0, -0.506145), Vector3(0, 0, 0.0872665)] @@ -165,7 +165,7 @@ tracks/0/keys = { [sub_resource type="Animation" id="Animation_oxrhd"] resource_name = "rightOpen" -length = 0.8 +length = 0.5 tracks/0/type = "value" tracks/0/imported = false tracks/0/enabled = true @@ -173,7 +173,7 @@ tracks/0/path = NodePath("right:rotation") tracks/0/interp = 1 tracks/0/loop_wrap = true tracks/0/keys = { -"times": PackedFloat32Array(0, 0.8), +"times": PackedFloat32Array(0, 0.5), "transitions": PackedFloat32Array(1, 1), "update": 0, "values": [Vector3(0, 0, 0.0872665), Vector3(0, 0, -0.506145)] @@ -186,17 +186,20 @@ _data = { "rightOpen": SubResource("Animation_oxrhd") } +[sub_resource type="BoxShape3D" id="BoxShape3D_qkt18"] +size = Vector3(0.754211, 0.91748, 0.72006) + [node name="GateDoor" type="Node3D"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.4, 0) script = ExtResource("1_b8ekv") [node name="left" type="MeshInstance3D" parent="."] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.3, 0, 0) +transform = Transform3D(0.996195, 0.0871557, 0, -0.0871557, 0.996195, 0, 0, 0, 1, -0.3, 0, 0) mesh = SubResource("ArrayMesh_rgh8h") skeleton = NodePath("") [node name="right" type="MeshInstance3D" parent="."] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.3, 0, 0) +transform = Transform3D(0.996195, -0.0871557, 0, 0.0871557, 0.996195, 0, 0, 0, 1, 0.3, 0, 0) mesh = SubResource("ArrayMesh_eyu4m") skeleton = NodePath("") @@ -209,3 +212,12 @@ libraries = { libraries = { "": SubResource("AnimationLibrary_ppdod") } + +[node name="Area3D" type="Area3D" parent="."] + +[node name="CollisionShape3D" type="CollisionShape3D" parent="Area3D"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.000457764, 0.0412598, 0.376033) +shape = SubResource("BoxShape3D_qkt18") + +[connection signal="area_entered" from="Area3D" to="." method="_on_area_3d_area_entered"] +[connection signal="area_exited" from="Area3D" to="." method="_on_area_3d_area_exited"] diff --git a/sceen/totalOfLargePassengerFlow.gd b/sceen/totalOfLargePassengerFlow.gd index f868b36..644cba4 100644 --- a/sceen/totalOfLargePassengerFlow.gd +++ b/sceen/totalOfLargePassengerFlow.gd @@ -71,9 +71,9 @@ const areaInfo = { 'passage':Vector3(3,5.22,41), 'stationHallExit':Vector3(3,5.22,18.74), 'ticketingArea':[Vector3(-11.27,5.22,18.74)], - 'entranceGateArea':[Vector3(-11.27,5.22,17.25),Vector3(36,5.22,17.25),Vector3(36,5.22,14)], + 'entranceGateArea':[Vector3(-11.27,5.22,17.25),Vector3(36,5.22,17.25),Vector3(36,5.22,14.48)], 'gangwayUpArea':[Vector3(36,5.22,7.45),Vector3(31,5.22,7.45)], - 'gangwayDownArea': [Vector3(14.12,0.85,7.45)] + 'gangwayDownArea': [Vector3(14.12,0.85,7.45),Vector3(11.6,0.85,7.45)] }, 'B':{ 'entrance':[ Vector3(-54.8,9.8,-67.3),Vector3(-50,9.8,-64),Vector3(-30.1,9.8,-62.3)], @@ -88,9 +88,9 @@ const areaInfo = { 'passage':Vector3(93.38,5.22,39.55), 'stationHallExit':Vector3(93.38,5.22,21.04), 'ticketingArea':[Vector3(99,5.22,14.25),Vector3(99,5.22,7.86),Vector3(109.26,5.22,7.86)], - 'entranceGateArea':[Vector3(109.26,5.22,6.86),Vector3(92,5.22,6.86),Vector3(92,5.22,12.98),Vector3(78.33,5.22,17.29),Vector3(56,5.22,17.29),Vector3(56,5.22,14)], + 'entranceGateArea':[Vector3(109.26,5.22,6.86),Vector3(92,5.22,6.86),Vector3(92,5.22,12.98),Vector3(78.33,5.22,17.29),Vector3(56.29,5.22,17.29),Vector3(56.29,5.22,14.48)], 'gangwayUpArea':[Vector3(56,5.22,7.45),Vector3(61.46,5.22,7.45)], - 'gangwayDownArea': [Vector3(77,0.85,7.45)] + 'gangwayDownArea': [Vector3(77,0.85,7.45),Vector3(81.2,0.85,7.45)] } } @@ -125,7 +125,7 @@ func playerGoToNextArea(peopleWalkFollow:PlayerPathFollow,nextArea: PlayerWalkAr peopleWalkFollow.waitTimeWalkAgain = 0.5 walkByPathFollow(targetAreaInfo.entranceGateArea,peopleWalkFollow) await peopleWalkFollow.player.ArriveTargetPos - await get_tree().create_timer(0.2).timeout + await get_tree().create_timer(0.5).timeout playerGoToNextArea(peopleWalkFollow,PlayerWalkArea3D.gangwayUpArea) PlayerWalkArea3D.gangwayUpArea: walkByPathFollow(targetAreaInfo.gangwayUpArea,peopleWalkFollow) @@ -134,6 +134,7 @@ func playerGoToNextArea(peopleWalkFollow:PlayerPathFollow,nextArea: PlayerWalkAr PlayerWalkArea3D.gangwayDownArea: walkByPathFollow(targetAreaInfo.gangwayDownArea,peopleWalkFollow) await peopleWalkFollow.player.ArriveTargetPos + peopleWalkFollow.queue_free() #playerGoToNextArea(peopleWalkFollow,PlayerWalkArea3D.screenDoorWaitArea) PlayerWalkArea3D.screenDoorWaitArea: goToScreenDoorAreaAndWaitTrain(peopleWalkFollow,0) @@ -234,20 +235,24 @@ func walkByPathFollow(allTargetPos:Array,peopleWalkFollow:PlayerPathFollow,curve var people_scene = preload("res://sceen/people/peopleWalkFollow.tscn") func startGeneratePeople() -> void: $AllTimer/generatePeopleAEntranceTimer.start() + $AllTimer/generatePeopleBEntranceTimer.start() + $AllTimer/generatePeopleCEntranceTimer.start() + $AllTimer/generatePeopleDEntranceTimer.start() + $AllTimer/generatePeopleAtBTicketingArea.start() ##A入口生成 var totalOfAEntrance=0 func generatePeopleAtAEntrance() -> void: - if $AllAreaDetection/APassageAreaDetection.passPeopleCount< 0 and currentActiveCameraOfLarge != Camera_name.APassage: + if $AllAreaDetection/APassageAreaDetection.passPeopleCount< 1 and currentActiveCameraOfLarge != Camera_name.APassage: generatePeopleAPassage() - if $AllAreaDetection/TicketingLfetAreaDetection.passPeopleCount< 0 and currentActiveCameraOfLarge != Camera_name.BTVM: + if $AllAreaDetection/TicketingLfetAreaDetection.passPeopleCount< 1 and currentActiveCameraOfLarge != Camera_name.BTVM: generatePeopleAtBTVM() totalOfAEntrance += 1 - if totalOfAEntrance > 15: + if totalOfAEntrance > 10: $AllTimer/generatePeopleAEntranceTimer.wait_time = 10 var peoplePosition = Vector3(-80,9.8,40.5) - generatePeopleAtDesignatedArea(peoplePosition,PlayerWalkArea3D.entrance,'A',totalOfAEntrance) + generatePeopleAtDesignatedArea(peoplePosition,PlayerWalkArea3D.entrance,'A','A{0}'.format([totalOfAEntrance])) ##A通道生成 @@ -255,23 +260,25 @@ var totalOfAPassage=0 func generatePeopleAPassage() -> void: totalOfAPassage += 1 var peoplePosition = Vector3(3,5.22,41) - generatePeopleAtDesignatedArea(peoplePosition,PlayerWalkArea3D.stationHallExit,'A') + generatePeopleAtDesignatedArea(peoplePosition,PlayerWalkArea3D.stationHallExit,'A','A{0}'.format([totalOfAPassage])) ##A闸机生成 var totalOfBTVM=0 func generatePeopleAtBTVM() -> void: totalOfBTVM += 1 var peoplePosition = Vector3(-11.27,5.22,18.74) - generatePeopleAtDesignatedArea(peoplePosition,PlayerWalkArea3D.entranceGateArea,'A') + generatePeopleAtDesignatedArea(peoplePosition,PlayerWalkArea3D.entranceGateArea,'A','A{0}'.format([totalOfBTVM])) ##售票厅循环排队 -var totalOfBTicketingArea = 8 +var totalOfBTicketingArea = 0 func generatePeopleAtBTicketingArea() -> void: - if $AllAreaDetection/TicketingAreaDetection.waitPeopleCount < totalOfBTicketingArea: + if $AllAreaDetection/TicketingAreaDetection.waitPeopleCount < 8: var peoplrInstance = people_scene.instantiate() add_child(peoplrInstance) peoplrInstance.global_position = Vector3(1,5.22,15.84) peoplrInstance.buildPos = Vector3(1,5.22,15.84) + totalOfBTicketingArea += 1 + peoplrInstance.id = 'A{0}'.format([totalOfBTicketingArea]) walkByPathFollow([Vector3(-11.27,5.22,15.84)],peoplrInstance) await peoplrInstance.player.ArriveTargetPos await get_tree().create_timer(5).timeout @@ -288,7 +295,7 @@ func generatePeopleAtDownPlatform() -> void: if totalOfDownPlatform > 0: totalOfDownPlatform -= 1 var peoplePosition = Vector3(13.54,0.85,11.2) - generatePeopleAtDesignatedArea(peoplePosition,PlayerWalkArea3D.screenDoorWaitArea,'A') + generatePeopleAtDesignatedArea(peoplePosition,PlayerWalkArea3D.screenDoorWaitArea,'A','A{0}'.format([totalOfDownPlatform])) else : $AllTimer/generatePeopleDownPlatformTimer.stop() @@ -298,7 +305,7 @@ func generatePeopleAtBEntrance() -> void: if totalOfBEntrance> 0: totalOfBEntrance -= 1 var peoplePosition = Vector3(-54.8,9.8,-61) - generatePeopleAtDesignatedArea(peoplePosition,PlayerWalkArea3D.entrance,'B',totalOfAEntrance) + generatePeopleAtDesignatedArea(peoplePosition,PlayerWalkArea3D.entrance,'B','B{0}'.format([totalOfDownPlatform])) else : $AllTimer/generatePeopleBEntranceTimer.stop() @@ -308,22 +315,21 @@ func generatePeopleAtCEntrance() -> void: if totalOfCEntrance> 0: totalOfCEntrance -= 1 var peoplePosition = Vector3(146.12,9.8,-60) - generatePeopleAtDesignatedArea(peoplePosition,PlayerWalkArea3D.entrance,'C',totalOfAEntrance) + generatePeopleAtDesignatedArea(peoplePosition,PlayerWalkArea3D.entrance,'C','C{0}'.format([totalOfDownPlatform])) else : $AllTimer/generatePeopleCEntranceTimer.stop() ##D入口生成 -var totalOfDEntrance=15 +var totalOfDEntrance = 0 func generatePeopleAtDEntrance() -> void: - if totalOfDEntrance > 0: - totalOfDEntrance -= 1 - var peoplePosition = Vector3(146.12,9.8,46) - generatePeopleAtDesignatedArea(peoplePosition,PlayerWalkArea3D.entrance,'D',totalOfAEntrance) - else : - $AllTimer/generatePeopleDEntranceTimer.stop() + totalOfDEntrance += 1 + if totalOfDEntrance > 10: + $AllTimer/generatePeopleDEntranceTimer.wait_time = 10 + var peoplePosition = Vector3(146.12,9.8,46) + generatePeopleAtDesignatedArea(peoplePosition,PlayerWalkArea3D.entrance,'D','D{0}'.format([totalOfDownPlatform])) ##在指定区域增加人 -func generatePeopleAtDesignatedArea(peoplePosition:Vector3, goToNextArea: PlayerWalkArea3D,generateArea:String, peopleId:int=0) -> void: +func generatePeopleAtDesignatedArea(peoplePosition:Vector3, goToNextArea: PlayerWalkArea3D,generateArea:String, peopleId:String='0A') -> void: var peoplrInstance = people_scene.instantiate() add_child(peoplrInstance) peoplrInstance.global_position = peoplePosition diff --git a/sceen/totalOfLargePassengerFlow.tscn b/sceen/totalOfLargePassengerFlow.tscn index 60a4ee1..9097b2e 100644 --- a/sceen/totalOfLargePassengerFlow.tscn +++ b/sceen/totalOfLargePassengerFlow.tscn @@ -144,19 +144,15 @@ wait_time = 2.0 [node name="generatePeopleBEntranceTimer" type="Timer" parent="AllTimer"] wait_time = 10.0 -autostart = true [node name="generatePeopleCEntranceTimer" type="Timer" parent="AllTimer"] wait_time = 10.0 -autostart = true [node name="generatePeopleDEntranceTimer" type="Timer" parent="AllTimer"] wait_time = 2.0 -autostart = true [node name="generatePeopleAtBTicketingArea" type="Timer" parent="AllTimer"] wait_time = 2.0 -autostart = true [node name="generatePeopleDownPlatformTimer" type="Timer" parent="AllTimer"] wait_time = 2.0