ai refactoring

This commit is contained in:
2026-05-22 00:06:23 +02:00
parent b22f219a5e
commit 0c237430ea
10 changed files with 67 additions and 68 deletions

View File

@@ -1,14 +1,11 @@
extends State
const PATROL_STATE_ID: StringName = &"patrol"
@onready var agent: AIBase = owner
@export var wait_time: float = 3.0
var runtime_timer: Timer
func enter() -> void:
agent.run_idle_animation()
run_animation()
runtime_timer = Timer.new()
runtime_timer.name = "IdleTimer"
add_child(runtime_timer)
@@ -25,4 +22,4 @@ func exit() -> void:
runtime_timer = null
func _on_timer_timeout() -> void:
transitioned.emit(self, PATROL_STATE_ID)
transitioned.emit(self, next_state_id)