extends Button


var reagent: Reagent

func _ready() -> void:
	text = reagent.substance.get_formula()

func _on_button_down() -> void:
	var scene = reagent.storage.instantiate()
	
	scene.get_node("SubstanceData").substance = reagent.substance
	get_tree().current_scene.add_child(scene)
	if scene is DraggableObject:
		scene.dragged = true
		scene.mouse_in = true
	var camera = get_viewport().get_camera_3d()
	scene.global_position = camera.plane_position
