extends Node2D

onready var buttonPlayer = $"%ButtonPlayer"
onready var activatorArea = $"%ActivatorArea"
onready var indicatorPlayer = $"%IndicatorPlayer"
onready var elevator = get_node("./Portal")
onready var signalManager = get_node("../GameplaySignalManager")


func selfActivate():
	indicatorPlayer.play("onning")
	buttonPlayer.play("pushing")
	elevator.visible = true
	elevator.monitoring = true
	#TODO dis importante
	activatorArea.set_deferred("monitoring", false)


func _on_ActivatorArea_area_entered(_area:Area2D) -> void:
	selfActivate()
	signalManager.emit_signal("terminal_activated")


