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

71 lines
1.9 KiB
GDScript3
Raw Normal View History

2024-06-17 16:35:21 +08:00
extends Node2D
func switchCamera(camera,emit = true):
$"..".switchCamera(camera,emit)
2024-06-17 16:35:21 +08:00
func _on_vehicle_control_room_pressed():
$"..".AllClickCameraSwitchUi.emit('VehicleControlRoom',$"..")
if !$"..".allowHandle :
return
switchCamera(LargePassengerFlowScene.Camera_name.SparePartsCabinet,false)
2024-06-18 10:22:05 +08:00
$"..".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():
$"..".AllClickCameraSwitchUi.emit('APassageway',$"..")
if !$"..".allowHandle :
return
switchCamera(LargePassengerFlowScene.Camera_name.AEntrance,false)
2024-06-17 19:49:24 +08:00
$"..".uiChange('APassageway')
2024-06-17 16:35:21 +08:00
func _on_b_passageway_pressed():
$"..".AllClickCameraSwitchUi.emit('BPassageway',$"..")
if !$"..".allowHandle :
return
switchCamera(LargePassengerFlowScene.Camera_name.BEntrance,false)
2024-06-17 19:49:24 +08:00
$"..".uiChange('BPassageway')
2024-06-17 16:35:21 +08:00
func _on_c_passageway_pressed():
$"..".AllClickCameraSwitchUi.emit('CPassageway',$"..")
if !$"..".allowHandle :
return
switchCamera(LargePassengerFlowScene.Camera_name.CEntrance,false)
2024-06-17 19:49:24 +08:00
$"..".uiChange('CPassageway')
2024-06-17 16:35:21 +08:00
func _on_d_passageway_pressed():
$"..".AllClickCameraSwitchUi.emit('DPassageway',$"..")
if !$"..".allowHandle :
return
switchCamera(LargePassengerFlowScene.Camera_name.DEntrance,false)
2024-06-17 19:49:24 +08:00
$"..".uiChange('DPassageway')
2024-06-17 16:35:21 +08:00
func _on_staion_hall_a_pressed():
$"..".AllClickCameraSwitchUi.emit('StaionHallA',$"..")
if !$"..".allowHandle :
return
switchCamera(LargePassengerFlowScene.Camera_name.AExitGate,false)
2024-06-18 10:22:05 +08:00
$"..".uiChange('StaionHallA')
2024-06-17 16:35:21 +08:00
func _on_station_hall_b_pressed():
2024-06-21 18:09:22 +08:00
$"..".AllClickCameraSwitchUi.emit('StationHallB',$"..")
if !$"..".allowHandle :
return
switchCamera(LargePassengerFlowScene.Camera_name.BExitGate,false)
2024-06-18 10:22:05 +08:00
$"..".uiChange('StaionHallB')