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.
21 lines
574 B
GDScript
21 lines
574 B
GDScript
extends Node3D
|
|
class_name EffectManager
|
|
|
|
func _ready():
|
|
Global.effect_mgr = self
|
|
SignalManager.effect_create.connect(on_effect_create)
|
|
|
|
|
|
func on_effect_create(effect: Node3D):
|
|
add_child(effect)
|
|
|
|
|
|
func cast_particle(resource: Resource, pos: Vector3, direction = Vector3.UP) -> void:
|
|
var new_particle: Particle = resource.instantiate() as Particle
|
|
add_child(new_particle)
|
|
new_particle.position = pos
|
|
if direction.angle_to(Vector3.UP) > 0.01:
|
|
new_particle.look_at(pos + direction)
|
|
else:
|
|
new_particle.rotation.x = deg_to_rad(-90)
|