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
		
	
	
		
			556 B
		
	
	
	
		
			GDScript
		
	
		
		
			
		
	
	
			30 lines
		
	
	
		
			556 B
		
	
	
	
		
			GDScript
		
	
| 
											2 years ago
										 | extends Node3D | ||
|  | class_name EffectBase | ||
|  | 
 | ||
|  | @export var life_time : float = 1 | ||
|  | var life_time_now : float | ||
|  | var is_pause : bool = false | ||
|  | var rate : float | ||
|  | 
 | ||
|  | func _ready(): | ||
|  | 	life_time_now = life_time | ||
|  | 	on_ready() | ||
|  | 
 | ||
|  | func _process(delta): | ||
|  | 	if is_pause: | ||
|  | 		return | ||
|  | 	life_time_now -= delta | ||
|  | 	if life_time_now <= 0: | ||
|  | 		queue_free() | ||
|  | 		return | ||
|  | 	rate = life_time_now / life_time | ||
|  | 	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 |