extends Node3D class_name EffectBase @export var lifetime: float = 1 var lifetime_now: float var is_pause: bool = false var rate: float func _ready(): on_ready() for child in get_children(): if child is EffectBase: if child.lifetime > lifetime: lifetime = child.lifetime else: continue lifetime_now = lifetime func _process(delta) -> void: if is_pause: return lifetime_now -= delta if lifetime_now <= 0: queue_free() return rate = lifetime_now / lifetime on_process(delta) return func set_pause(is_pause_set: bool): is_pause = is_pause_set for child in get_children(): if child is EffectBase: child.set_pause(is_pause) else: continue on_set_pause() func on_ready(): pass func on_process(delta: float): pass func on_set_pause(): pass