2025-04-19 22:55:11 -06:00
|
|
|
@tool
|
2025-03-14 16:46:25 -06:00
|
|
|
extends GunkNode
|
|
|
|
## Periodically emits a pulse.
|
|
|
|
|
|
|
|
## Emitted at a regular interval.
|
|
|
|
signal pulsed
|
|
|
|
|
|
|
|
## Time in seconds between pulses.
|
|
|
|
@export var interval := 3.0
|
|
|
|
|
2025-04-19 22:55:11 -06:00
|
|
|
@export var quick_connect_to: SignalNode:
|
|
|
|
set = _editor_connect
|
|
|
|
|
2025-03-14 16:46:25 -06:00
|
|
|
@onready var pulse_timer: Timer = %PulseTimer
|
|
|
|
@onready var animation_player: AnimationPlayer = %AnimationPlayer
|
|
|
|
|
|
|
|
|
|
|
|
func _ready() -> void:
|
2025-04-19 22:55:11 -06:00
|
|
|
if not Engine.is_editor_hint():
|
|
|
|
pulse_timer.start(interval)
|
2025-03-14 16:46:25 -06:00
|
|
|
|
|
|
|
|
|
|
|
func pulse() -> void:
|
|
|
|
# TODO animation
|
|
|
|
animation_player.play("pulse")
|
|
|
|
pulsed.emit()
|
2025-04-19 22:55:11 -06:00
|
|
|
|
|
|
|
|
|
|
|
func _editor_connect(node: SignalNode) -> void:
|
|
|
|
self.pulsed.connect(node.pulse, CONNECT_PERSIST)
|
|
|
|
self.notify_property_list_changed()
|