forked from team-sg/hero-mark-2
state chart additions: consumed events export and auto_initialize toggle
This commit is contained in:
parent
941f8f0f09
commit
79cbd62a69
2 changed files with 13 additions and 1 deletions
|
@ -2,6 +2,8 @@ tool
|
|||
class_name StateChart, "state_chart.svg"
|
||||
extends Node
|
||||
|
||||
## whether chart should initialize on its own or be done manually
|
||||
export var auto_initialize: bool = true
|
||||
## whether chart should propagate processing events every frame
|
||||
export var idle_frame_event: bool = false
|
||||
export var physics_frame_event: bool = false
|
||||
|
@ -15,7 +17,10 @@ var _guard_properties: Dictionary = {}
|
|||
func _ready() -> void:
|
||||
if Engine.editor_hint:
|
||||
return
|
||||
|
||||
if auto_initialize:
|
||||
initialize()
|
||||
|
||||
func initialize() -> void:
|
||||
# make sure only one child exists
|
||||
if get_child_count() != 1:
|
||||
push_error("StateChart must have exactly one child")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue