godot-psd-training/UI/CameraSwitch/cameraSwitch.gd
2024-06-18 10:22:05 +08:00

58 lines
1.5 KiB
GDScript

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():
switchCamera(LargePassengerFlowScene.Camera_name.SparePartsCabinet)
$"..".uiChange('VehicleControlRoom')
func _on_station_hall_pressed():
switchCamera(LargePassengerFlowScene.Camera_name.StationHall)
func _on_up_platform_pressed():
switchCamera(LargePassengerFlowScene.Camera_name.UpPlatform)
func _on_down_platform_pressed():
switchCamera(LargePassengerFlowScene.Camera_name.DownPlatform)
func _on_a_passageway_pressed():
switchCamera(LargePassengerFlowScene.Camera_name.AEntrance)
$"..".uiChange('APassageway')
func _on_b_passageway_pressed():
switchCamera(LargePassengerFlowScene.Camera_name.BEntrance)
$"..".uiChange('BPassageway')
func _on_c_passageway_pressed():
switchCamera(LargePassengerFlowScene.Camera_name.CEntrance)
$"..".uiChange('CPassageway')
func _on_d_passageway_pressed():
switchCamera(LargePassengerFlowScene.Camera_name.DEntrance)
$"..".uiChange('DPassageway')
func _on_staion_hall_a_pressed():
switchCamera(LargePassengerFlowScene.Camera_name.AExitGate)
$"..".uiChange('StaionHallA')
func _on_station_hall_b_pressed():
switchCamera(LargePassengerFlowScene.Camera_name.BExitGate)
$"..".uiChange('StaionHallB')