challenge-editor/class/state_machine/state_base.gd
2024-09-24 11:59:54 +08:00

30 lines
543 B
GDScript

extends Node
class_name State
@onready var timer=Timer.new()
@onready var root=get_node("..") as StateMachine
func _ready():
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