@tool
extends GunkNode
## Triggers other components when destroyed.

@export var quick_connect_to: SignalNode:
	set = _editor_connect

@onready var mesh_instance_3d: MeshInstance3D = %MeshInstance3D


func _process(delta: float) -> void:
	if Engine.is_editor_hint():
		return

	super._process(delta)
	# TODO proper animation
	var mat: StandardMaterial3D = mesh_instance_3d.mesh.surface_get_material(0)
	mat.emission_energy_multiplier = pct_damage()


func _editor_connect(node: SignalNode) -> void:
	self.connect("destroyed", node.trigger, CONNECT_PERSIST)
	self.notify_property_list_changed()
