Files
NeonCollapse/game/entities/guidance/control_guidance_switcher.gd
T
2026-07-02 21:34:10 +03:00

27 lines
646 B
GDScript

class_name ContolGuidanceSwitcher
extends Node
@export var keyboard_guidance : Guidance
@export var gamepad_guidance : Guidance
func _ready() -> void:
if not Engine.is_editor_hint():
_updated_by_input_type(InputManager.get_type())
InputManager.type_changed.connect(_updated_by_input_type)
func _updated_by_input_type(type: InputManager.Type) -> void:
match type:
InputManager.Type.Keyboard:
if keyboard_guidance:
keyboard_guidance.show()
if gamepad_guidance:
gamepad_guidance.hide()
InputManager.Type.Gamepad:
if keyboard_guidance:
keyboard_guidance.hide()
if gamepad_guidance:
gamepad_guidance.show()