33 lines
594 B
GDScript
33 lines
594 B
GDScript
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
|