You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
548 B
GDScript
30 lines
548 B
GDScript
extends Node3D
|
|
class_name EffectBase
|
|
|
|
@export var lifetime : float = 1
|
|
var lifetime_now : float
|
|
var is_pause : bool = false
|
|
var rate : float
|
|
|
|
func _ready():
|
|
lifetime_now = lifetime
|
|
on_ready()
|
|
|
|
func _process(delta):
|
|
if is_pause:
|
|
return
|
|
lifetime_now -= delta
|
|
if lifetime_now <= 0:
|
|
queue_free()
|
|
return
|
|
rate = lifetime_now / lifetime
|
|
on_process(delta)
|
|
|
|
func set_pause(is_pause_set:bool):
|
|
is_pause = is_pause_set
|
|
on_set_pause(is_pause_set)
|
|
|
|
func on_ready():pass
|
|
func on_process(delta:float):pass
|
|
func on_set_pause(is_pause_set:bool):pass
|