extends Node3D


var material: StandardMaterial3D

# Called when the node enters the scene tree for the first time.
func _ready() -> void:
	var mat = $"Flask".mesh.surface_get_material(1)
	material = mat.duplicate()
	$"Flask".mesh.surface_set_material(1, material)
	$"Flask/Heart".mesh.surface_set_material(0, material)
	$"Flask/Star".mesh.surface_set_material(0, material)
	$"Flask/Star_001".mesh.surface_set_material(0, material)
	$"Flask/Star_002".mesh.surface_set_material(0, material)
	$"Flask/Star_003".mesh.surface_set_material(0, material)
	
	$AnimationPlayer.play("HeartAction")
	$AnimationPlayer.play("StarAction")
	$AnimationPlayer.play("StarAction_001")
	$AnimationPlayer.play("StarAction_002")
	$AnimationPlayer.play("StarAction_003")
		
func _on_target_1_occupancy_changed(value: float) -> void:
	material.emission_energy_multiplier = value * 10
	$AnimationPlayer.speed_scale = value
