大客流total提供切换相机方法
This commit is contained in:
parent
3246c46577
commit
3fc27d2bb6
36
sceen/totalOfLargePassengerFlow.gd
Normal file
36
sceen/totalOfLargePassengerFlow.gd
Normal file
@ -0,0 +1,36 @@
|
||||
extends TotalScene
|
||||
|
||||
## 照相机名字的枚举
|
||||
enum Camera_name{
|
||||
VehicleControlRoom,#车控室
|
||||
StationHall,#站厅
|
||||
UpPlatform,#上行站台
|
||||
DownPlatform,#下行站台
|
||||
APassageway,#A出入口
|
||||
BPassageway,#B出入口
|
||||
CPassageway,#C出入口
|
||||
DPassageway,#D出入口
|
||||
StaionHallA,#站厅A端
|
||||
StationHallB,#站厅B端
|
||||
}
|
||||
|
||||
@onready var cameras = [$VehicleControlRoom,$StationHall,$UpPlatform]
|
||||
|
||||
##切换相机
|
||||
func switchCamera (camera :Camera_name)-> void:
|
||||
cameras[camera].make_current()
|
||||
|
||||
var zhao = 0
|
||||
func _on_timer_timeout() -> void:
|
||||
if zhao ==0:
|
||||
switchCamera(Camera_name.StationHall)
|
||||
zhao = 1
|
||||
elif zhao ==1:
|
||||
switchCamera(Camera_name.UpPlatform)
|
||||
zhao = 2
|
||||
else :
|
||||
switchCamera(Camera_name.VehicleControlRoom)
|
||||
zhao = 0
|
||||
|
||||
func _ready():
|
||||
$VehicleControlRoom.make_current()
|
136
sceen/totalOfLargePassengerFlow.tscn
Normal file
136
sceen/totalOfLargePassengerFlow.tscn
Normal file
@ -0,0 +1,136 @@
|
||||
[gd_scene load_steps=11 format=3 uid="uid://btcksdsburk7t"]
|
||||
|
||||
[ext_resource type="Script" path="res://sceen/totalOfLargePassengerFlow.gd" id="1_5iiv2"]
|
||||
[ext_resource type="PackedScene" uid="uid://cmnsn2joxo68l" path="res://sceen/platform/platform.tscn" id="1_rjva4"]
|
||||
[ext_resource type="AudioStream" uid="uid://dgqmfnjgrea07" path="res://Assets/training_speech/trainComing.mp3" id="4_6ctdm"]
|
||||
[ext_resource type="PackedScene" uid="uid://5s78rigi2rhw" path="res://UI/CameraSwitch/cameraSwitch.tscn" id="5_lhvgl"]
|
||||
[ext_resource type="PackedScene" uid="uid://nx6xnwcuq8cf" path="res://sceen/train/train.tscn" id="14_g0uwl"]
|
||||
|
||||
[sub_resource type="Environment" id="Environment_ux83q"]
|
||||
|
||||
[sub_resource type="Animation" id="Animation_r7e51"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("../train:position")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector3(20, 0, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_he04d"]
|
||||
resource_name = "trainCome"
|
||||
length = 4.0
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("../train:position")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 4),
|
||||
"transitions": PackedFloat32Array(0.5, 1),
|
||||
"update": 0,
|
||||
"values": [Vector3(20, 0, 0), Vector3(0, 0, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_fssoy"]
|
||||
resource_name = "trainLeave"
|
||||
length = 10.0
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("../train:position")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 10),
|
||||
"transitions": PackedFloat32Array(2, 1),
|
||||
"update": 0,
|
||||
"values": [Vector3(0, 0, 0), Vector3(-120, 0, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_lf7ox"]
|
||||
_data = {
|
||||
"RESET": SubResource("Animation_r7e51"),
|
||||
"trainCome": SubResource("Animation_he04d"),
|
||||
"trainLeave": SubResource("Animation_fssoy")
|
||||
}
|
||||
|
||||
[node name="totalOfLargePassengerFlow" type="Node3D"]
|
||||
script = ExtResource("1_5iiv2")
|
||||
|
||||
[node name="platform" parent="." instance=ExtResource("1_rjva4")]
|
||||
|
||||
[node name="train" parent="." instance=ExtResource("14_g0uwl")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 20, 0, 0)
|
||||
|
||||
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
|
||||
environment = SubResource("Environment_ux83q")
|
||||
|
||||
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="WorldEnvironment"]
|
||||
transform = Transform3D(1, 0, 0, 0, 0.451687, 0.892176, 0, -0.892176, 0.451687, 0, 0, 0)
|
||||
|
||||
[node name="DirectionalLight3D2" type="DirectionalLight3D" parent="WorldEnvironment"]
|
||||
transform = Transform3D(1, 0, 0, 0, 0.99473, -0.102532, 0, 0.102532, 0.99473, 0, 0, 4.02413)
|
||||
|
||||
[node name="trainAnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
root_node = NodePath("../WorldEnvironment")
|
||||
libraries = {
|
||||
"": SubResource("AnimationLibrary_lf7ox")
|
||||
}
|
||||
|
||||
[node name="trainComing" type="AudioStreamPlayer" parent="."]
|
||||
stream = ExtResource("4_6ctdm")
|
||||
|
||||
[node name="BeginTimer" type="Timer" parent="."]
|
||||
wait_time = 6.0
|
||||
one_shot = true
|
||||
|
||||
[node name="EndTimer" type="Timer" parent="."]
|
||||
wait_time = 5.0
|
||||
one_shot = true
|
||||
|
||||
[node name="openAllwindow" type="Timer" parent="."]
|
||||
one_shot = true
|
||||
|
||||
[node name="trainComeDelay" type="Timer" parent="."]
|
||||
wait_time = 2.0
|
||||
one_shot = true
|
||||
|
||||
[node name="trainLeaveDelay" type="Timer" parent="."]
|
||||
wait_time = 2.0
|
||||
one_shot = true
|
||||
|
||||
[node name="VehicleControlRoom" type="Camera3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.424, 1.768, 6.555)
|
||||
current = true
|
||||
|
||||
[node name="StationHall" type="Camera3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.93898, 1.768, 14.2478)
|
||||
current = true
|
||||
|
||||
[node name="UpPlatform" type="Camera3D" parent="."]
|
||||
transform = Transform3D(0.549621, 0, -0.835414, 0, 1, 0, 0.835414, 0, 0.549621, 2.03598, 1.21341, 6.60578)
|
||||
|
||||
[node name="CameraSwitch" parent="." instance=ExtResource("5_lhvgl")]
|
||||
position = Vector2(606, 75)
|
||||
|
||||
[node name="Timer" type="Timer" parent="."]
|
||||
wait_time = 5.0
|
||||
autostart = true
|
||||
|
||||
[connection signal="allClickPlatformSignal" from="platform" to="." method="_on_platform_all_click_platform_signal"]
|
||||
[connection signal="allScreenDoorLcbStateSignal" from="platform" to="." method="emitScreenDoorLcbStateChangeSignal"]
|
||||
[connection signal="animation_finished" from="trainAnimationPlayer" to="train" method="_on_train_animation_player_animation_finished"]
|
||||
[connection signal="timeout" from="BeginTimer" to="." method="openScreenDoor"]
|
||||
[connection signal="timeout" from="EndTimer" to="." method="_on_end_timer_timeout"]
|
||||
[connection signal="timeout" from="openAllwindow" to="." method="_on_open_allwindow_timeout"]
|
||||
[connection signal="timeout" from="trainComeDelay" to="." method="_on_train_come_delay_timeout"]
|
||||
[connection signal="timeout" from="trainLeaveDelay" to="." method="_on_train_leave_delay_timeout"]
|
||||
[connection signal="timeout" from="Timer" to="." method="_on_timer_timeout"]
|
Loading…
Reference in New Issue
Block a user