class_name CockpitSonarConsole extends Node3D ## Imported sonar monitor. Exposes its glass as the cockpit's `%SonarScreen` so ## the instrument panel can put the shared sonar texture on it. ## Lamps and knobs are modelled into the housing mesh, not separate nodes: ## three amber push-buttons and two knurled knobs (model contract). const HOUSING_CONTROL_COUNT := 5 var _housing: MeshInstance3D var _screen: MeshInstance3D func _ready() -> void: _housing = find_child("Sonar", true, false) as MeshInstance3D _screen = find_child("SonarScreen", true, false) as MeshInstance3D if _housing == null or _screen == null: push_error("Sonar model is missing its Sonar or SonarScreen node") return # The glass belongs to the imported scene; adopt it so the cockpit scene # can address it by unique name like any other instrument. _screen.owner = owner _screen.unique_name_in_owner = true func housing() -> MeshInstance3D: return _housing func screen() -> MeshInstance3D: return _screen func control_count() -> int: return 0 if _housing == null else HOUSING_CONTROL_COUNT