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.
|
|
|
|
extends EffectBase
|
|
|
|
|
class_name Particle
|
|
|
|
|
|
|
|
|
|
@export var is_billboard: bool
|
|
|
|
|
@export var is_ground: bool
|
|
|
|
|
|
|
|
|
|
var particle_list: Array[GPUParticles3D] = []
|
|
|
|
|
var particle_speed_scale_list: Array[float] = []
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func on_ready():
|
|
|
|
|
for child in get_children():
|
|
|
|
|
if child is GPUParticles3D:
|
|
|
|
|
var particle: GPUParticles3D = child as GPUParticles3D
|
|
|
|
|
particle_list.append(particle)
|
|
|
|
|
particle_speed_scale_list.append(particle.speed_scale)
|
|
|
|
|
particle.restart()
|
|
|
|
|
else:
|
|
|
|
|
continue
|
|
|
|
|
if child.lifetime > lifetime:
|
|
|
|
|
lifetime = child.lifetime
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func on_set_pause():
|
|
|
|
|
for i in range(len(particle_list)):
|
|
|
|
|
var particle: GPUParticles3D = particle_list[i]
|
|
|
|
|
var speed_scale: float = particle_speed_scale_list[i]
|
|
|
|
|
particle.speed_scale = 0 if is_pause else speed_scale
|