130 lines
5.8 KiB
GDScript
130 lines
5.8 KiB
GDScript
extends Node3D
|
|
|
|
class_name ShortcutToolModel2
|
|
|
|
##是否允许操作
|
|
var allowHandle :bool = true
|
|
|
|
##所有ShortTool点击操作汇总
|
|
signal AllClickShortcutToolModel2(equipmentName:String, equipmentInfo: Variant)
|
|
|
|
|
|
func _on_mouse_entered() -> void:
|
|
Input.set_default_cursor_shape(Input.CursorShape.CURSOR_POINTING_HAND)
|
|
|
|
|
|
func _on_mouse_exited() -> void:
|
|
Input.set_default_cursor_shape(Input.CursorShape.CURSOR_ARROW)
|
|
|
|
|
|
func _on_hoarding_at_escalator_area_3d_input_event(camera: Node, event: InputEvent, position: Vector3, normal: Vector3, shape_idx: int) -> void:
|
|
if event is InputEventMouseButton and event.pressed and event.button_index == MOUSE_BUTTON_LEFT:
|
|
AllClickShortcutToolModel2.emit('hoardingAtEscalatorUp',self)
|
|
if !allowHandle :
|
|
return
|
|
$hoardingAtEscalatorUp.visible = false
|
|
|
|
|
|
func _on_hoarding_at_escalator_down_area_3d_input_event(camera: Node, event: InputEvent, position: Vector3, normal: Vector3, shape_idx: int) -> void:
|
|
if event is InputEventMouseButton and event.pressed and event.button_index == MOUSE_BUTTON_LEFT:
|
|
AllClickShortcutToolModel2.emit('hoardingAtEscalatorDown',self)
|
|
if !allowHandle :
|
|
return
|
|
$hoardingAtEscalatorDown.visible = false
|
|
|
|
|
|
func _on_picketline_model_at_b_area_3d_input_event(camera: Node, event: InputEvent, position: Vector3, normal: Vector3, shape_idx: int) -> void:
|
|
if event is InputEventMouseButton and event.pressed and event.button_index == MOUSE_BUTTON_LEFT:
|
|
AllClickShortcutToolModel2.emit('picketlineModelAtB',self)
|
|
if !allowHandle :
|
|
return
|
|
$picketlineModelAtB.visible = false
|
|
|
|
|
|
func _on_picketline_model_at_a_area_3d_input_event(camera: Node, event: InputEvent, position: Vector3, normal: Vector3, shape_idx: int) -> void:
|
|
if event is InputEventMouseButton and event.pressed and event.button_index == MOUSE_BUTTON_LEFT:
|
|
AllClickShortcutToolModel2.emit('picketlineModelAtA',self)
|
|
if !allowHandle :
|
|
return
|
|
$picketlineModelAtA.visible = false
|
|
|
|
|
|
func _on_picketline_model_at_gate_b_area_3d_input_event(camera: Node, event: InputEvent, position: Vector3, normal: Vector3, shape_idx: int) -> void:
|
|
if event is InputEventMouseButton and event.pressed and event.button_index == MOUSE_BUTTON_LEFT:
|
|
AllClickShortcutToolModel2.emit('picketlineModelAtGateB',self)
|
|
if !allowHandle :
|
|
return
|
|
$picketlineModelAtGateB.visible = false
|
|
|
|
|
|
func _on_picketline_model_at_gate_a_area_3d_input_event(camera: Node, event: InputEvent, position: Vector3, normal: Vector3, shape_idx: int) -> void:
|
|
if event is InputEventMouseButton and event.pressed and event.button_index == MOUSE_BUTTON_LEFT:
|
|
AllClickShortcutToolModel2.emit('picketlineModelAtGateA',self)
|
|
if !allowHandle :
|
|
return
|
|
$picketlineModelAtGateA.visible = false
|
|
|
|
|
|
func _on_notice_signs_model_at_a_entrance_area_3d_input_event(camera: Node, event: InputEvent, position: Vector3, normal: Vector3, shape_idx: int) -> void:
|
|
if event is InputEventMouseButton and event.pressed and event.button_index == MOUSE_BUTTON_LEFT:
|
|
AllClickShortcutToolModel2.emit('noticeSignsModelAtAEntrance',self)
|
|
if !allowHandle :
|
|
return
|
|
$noticeSignsModelAtAEntrance.visible = false
|
|
|
|
|
|
func _on_notice_signs_model_at_b_entrance_area_3d_input_event(camera: Node, event: InputEvent, position: Vector3, normal: Vector3, shape_idx: int) -> void:
|
|
if event is InputEventMouseButton and event.pressed and event.button_index == MOUSE_BUTTON_LEFT:
|
|
AllClickShortcutToolModel2.emit('noticeSignsModelAtBEntrance',self)
|
|
if !allowHandle :
|
|
return
|
|
$noticeSignsModelAtBEntrance.visible = false
|
|
|
|
|
|
func _on_notice_signs_model_at_c_entrance_area_3d_input_event(camera: Node, event: InputEvent, position: Vector3, normal: Vector3, shape_idx: int) -> void:
|
|
if event is InputEventMouseButton and event.pressed and event.button_index == MOUSE_BUTTON_LEFT:
|
|
AllClickShortcutToolModel2.emit('noticeSignsModelAtCEntrance',self)
|
|
if !allowHandle :
|
|
return
|
|
$noticeSignsModelAtCEntrance.visible = false
|
|
|
|
|
|
func _on_notice_signs_model_at_d_entrance_area_3d_input_event(camera: Node, event: InputEvent, position: Vector3, normal: Vector3, shape_idx: int) -> void:
|
|
if event is InputEventMouseButton and event.pressed and event.button_index == MOUSE_BUTTON_LEFT:
|
|
AllClickShortcutToolModel2.emit('noticeSignsModelAtDEntrance',self)
|
|
if !allowHandle :
|
|
return
|
|
$noticeSignsModelAtDEntrance.visible = false
|
|
|
|
|
|
func _on_metal_barrier_model_at_d_entrance_area_3d_input_event(camera: Node, event: InputEvent, position: Vector3, normal: Vector3, shape_idx: int) -> void:
|
|
if event is InputEventMouseButton and event.pressed and event.button_index == MOUSE_BUTTON_LEFT:
|
|
AllClickShortcutToolModel2.emit('metalBarrierModelAtDEntrance',self)
|
|
if !allowHandle :
|
|
return
|
|
$metalBarrierModelAtDEntrance.visible = false
|
|
|
|
|
|
func _on_metal_barrier_model_at_station_hall_d_exit_area_3d_input_event(camera: Node, event: InputEvent, position: Vector3, normal: Vector3, shape_idx: int) -> void:
|
|
if event is InputEventMouseButton and event.pressed and event.button_index == MOUSE_BUTTON_LEFT:
|
|
AllClickShortcutToolModel2.emit('metalBarrierModelAtStationHallDExit',self)
|
|
if !allowHandle :
|
|
return
|
|
$metalBarrierModelAtStationHallDExit.visible = false
|
|
|
|
|
|
func _on_metal_barrier_model_at_c_entrance_area_3d_input_event(camera: Node, event: InputEvent, position: Vector3, normal: Vector3, shape_idx: int) -> void:
|
|
if event is InputEventMouseButton and event.pressed and event.button_index == MOUSE_BUTTON_LEFT:
|
|
AllClickShortcutToolModel2.emit('metalBarrierModelAtCEntrance',self)
|
|
if !allowHandle :
|
|
return
|
|
$metalBarrierModelAtCEntrance.visible = false
|
|
|
|
|
|
func _on_metal_barrier_model_at_c_passage_area_3d_input_event(camera: Node, event: InputEvent, position: Vector3, normal: Vector3, shape_idx: int) -> void:
|
|
if event is InputEventMouseButton and event.pressed and event.button_index == MOUSE_BUTTON_LEFT:
|
|
AllClickShortcutToolModel2.emit('metalBarrierModelAtStationHallCExit',self)
|
|
if !allowHandle :
|
|
return
|
|
$metalBarrierModelAtStationHallCExit.visible = false
|