ai refactoring
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user