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 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.abs().angle_to(Vector3.RIGHT) < 0.01: | 
					
						
							|  |  |  | 		direction.z = 0.1 | 
					
						
							|  |  |  | 	if direction.angle_to(Vector3.UP) > 0.01 and (-direction).angle_to(Vector3.UP) > 0.01: | 
					
						
							|  |  |  | 		new_particle.look_at(pos - direction) | 
					
						
							|  |  |  | 	else: | 
					
						
							|  |  |  | 		new_particle.rotation.x = deg_to_rad(-90) |