refactoring ai and add new animations
This commit is contained in:
@@ -1,25 +0,0 @@
|
||||
extends State
|
||||
|
||||
@export var wait_time: float = 3.0
|
||||
|
||||
var runtime_timer: Timer
|
||||
|
||||
func enter() -> void:
|
||||
run_animation()
|
||||
runtime_timer = Timer.new()
|
||||
runtime_timer.name = "IdleTimer"
|
||||
add_child(runtime_timer)
|
||||
runtime_timer.one_shot = true
|
||||
runtime_timer.timeout.connect(_on_timer_timeout)
|
||||
runtime_timer.start(wait_time)
|
||||
|
||||
func exit() -> void:
|
||||
if runtime_timer:
|
||||
if runtime_timer.is_connected("timeout", _on_timer_timeout):
|
||||
runtime_timer.timeout.disconnect(_on_timer_timeout)
|
||||
|
||||
runtime_timer.queue_free()
|
||||
runtime_timer = null
|
||||
|
||||
func _on_timer_timeout() -> void:
|
||||
transitioned.emit(self, next_state_id)
|
||||
@@ -1 +0,0 @@
|
||||
uid://nga8qx56iwgu
|
||||
@@ -1,9 +0,0 @@
|
||||
extends State
|
||||
|
||||
func enter() -> void:
|
||||
run_animation()
|
||||
agent.navigate_to_random_point()
|
||||
|
||||
func physics_update(_delta) -> void:
|
||||
if agent.nav_agent.is_navigation_finished():
|
||||
transitioned.emit(self, next_state_id)
|
||||
@@ -1 +0,0 @@
|
||||
uid://bngfthvt04ivv
|
||||
Reference in New Issue
Block a user