godot-psd-training/sceen/totalOfLargePassengerFlow.gd
2024-06-17 14:22:23 +08:00

37 lines
789 B
GDScript

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()