extends Area3D


@export var title: String = "Info" 

@export_multiline var text: String = "Text"

var game_scene
var info_box_scene

func _ready() -> void:
	game_scene = SceneManager.game_scene
	if game_scene != null:
		info_box_scene = game_scene.info_box_scene


func _on_InfoButton_body_entered(body: Node3D) -> void:
	if info_box_scene != null:
		info_box_scene.show_info_box(title, text)


func _on_InfoButton_body_exited(body: Node3D) -> void:
	if info_box_scene != null:
		info_box_scene.hide_info_box()
