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 AI | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | @onready var character: Character = (get_owner() as Character) | 
					
						
							|  |  |  | @onready var status: Status = (%Status as Status) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | var ai: BeehaveTree | 
					
						
							|  |  |  | var is_init: bool = false | 
					
						
							|  |  |  | var has_ai: bool  = false | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | func _process(delta) -> void: | 
					
						
							|  |  |  |     if is_init: | 
					
						
							|  |  |  |         if has_ai: on_process(delta) | 
					
						
							|  |  |  |         return | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     if not status.cfg: | 
					
						
							|  |  |  |         return | 
					
						
							|  |  |  |     is_init = true | 
					
						
							|  |  |  |     var ai_scene: PackedScene = status.cfg.get_ai() | 
					
						
							|  |  |  |     if not ai_scene: | 
					
						
							|  |  |  |         return | 
					
						
							|  |  |  |     ai = ai_scene.instantiate() as BeehaveTree | 
					
						
							|  |  |  |     add_child(ai) | 
					
						
							|  |  |  |     has_ai = true | 
					
						
							|  |  |  |     on_init() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | func on_init() -> void: | 
					
						
							|  |  |  |     pass | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | func on_process(delta): | 
					
						
							|  |  |  |     pass |