godot-psd-training/UI/CameraSwitch/cameraSwitch.gd

58 lines
1.5 KiB
GDScript3
Raw Normal View History

2024-06-17 16:35:21 +08:00
extends Node2D
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
func switchCamera(camera):
$"..".switchCamera(camera)
func _on_vehicle_control_room_pressed():
2024-06-18 10:22:05 +08:00
switchCamera(LargePassengerFlowScene.Camera_name.SparePartsCabinet)
$"..".uiChange('VehicleControlRoom')
2024-06-17 16:35:21 +08:00
func _on_station_hall_pressed():
2024-06-18 10:22:05 +08:00
switchCamera(LargePassengerFlowScene.Camera_name.StationHall)
2024-06-17 16:35:21 +08:00
func _on_up_platform_pressed():
2024-06-18 10:22:05 +08:00
switchCamera(LargePassengerFlowScene.Camera_name.UpPlatform)
2024-06-17 16:35:21 +08:00
func _on_down_platform_pressed():
2024-06-18 10:22:05 +08:00
switchCamera(LargePassengerFlowScene.Camera_name.DownPlatform)
2024-06-17 16:35:21 +08:00
func _on_a_passageway_pressed():
2024-06-18 10:22:05 +08:00
switchCamera(LargePassengerFlowScene.Camera_name.AEntrance)
2024-06-17 19:49:24 +08:00
$"..".uiChange('APassageway')
2024-06-17 16:35:21 +08:00
func _on_b_passageway_pressed():
2024-06-18 10:22:05 +08:00
switchCamera(LargePassengerFlowScene.Camera_name.BEntrance)
2024-06-17 19:49:24 +08:00
$"..".uiChange('BPassageway')
2024-06-17 16:35:21 +08:00
func _on_c_passageway_pressed():
2024-06-18 10:22:05 +08:00
switchCamera(LargePassengerFlowScene.Camera_name.CEntrance)
2024-06-17 19:49:24 +08:00
$"..".uiChange('CPassageway')
2024-06-17 16:35:21 +08:00
func _on_d_passageway_pressed():
2024-06-18 10:22:05 +08:00
switchCamera(LargePassengerFlowScene.Camera_name.DEntrance)
2024-06-17 19:49:24 +08:00
$"..".uiChange('DPassageway')
2024-06-17 16:35:21 +08:00
func _on_staion_hall_a_pressed():
2024-06-18 10:22:05 +08:00
switchCamera(LargePassengerFlowScene.Camera_name.AExitGate)
$"..".uiChange('StaionHallA')
2024-06-17 16:35:21 +08:00
func _on_station_hall_b_pressed():
2024-06-18 10:22:05 +08:00
switchCamera(LargePassengerFlowScene.Camera_name.BExitGate)
$"..".uiChange('StaionHallB')