otherworldly_simulation/tool/state_machine/state_root.gd

33 lines
594 B
GDScript3
Raw Normal View History

2024-10-25 15:41:39 +08:00
extends Node
class_name State
var timer
@onready var root=get_node("..") as StateMachine
@export var need_timer:bool=false
func _ready():
if need_timer:
timer=Timer.new()
timer.set_one_shot(true)
self.add_child(timer)
timer.timeout.connect(Callable(self,"time_out"))
func enter_state(n):
pass
func update_state(delta):
pass
func update_state_phy(delta):
pass
func exit_state():
pass
func change_to_state(state_name:String,s=0):
root.change_state(state_name,s)
pass
func time_out():
pass
func get_player():
return root.player
func process_message(type:String,n):
pass