extends Node3D

@export var debug_open: bool:
	set(value):
		open()

@export var debug_close: bool:
	set(value):
		close()

@onready var animation: AnimationPlayer = $AnimationPlayer
@onready var dust_animation: AnimationPlayer = %DustAnimation
@onready var open_sfx: AudioStreamPlayer3D = %OpenSFX
@onready var bulkhead_game_sound_emitter: GameSoundEmitter = %BulkheadGameSoundEmitter
@onready var nav_link: NavigationLink3D = %NavLink


func open() -> void:
	nav_link.enabled = true
	animation.play("open")
	dust_animation.play("spray")
	open_sfx.play()
	bulkhead_game_sound_emitter.emit_sound_here()


func close() -> void:
	# TODO bespoke close anim?
	animation.play_backwards("open")
	nav_link.enabled = false
