Platformer 2.0
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
extends Resource
|
||||
class_name StateTransition
|
||||
|
||||
const ANY_STATE: StringName = &"*"
|
||||
|
||||
@export var from: StringName = ANY_STATE
|
||||
@export var to: StringName
|
||||
@export var priority: int = 0
|
||||
@export var condition: TransitionCondition
|
||||
|
||||
func matches_current(current_id: StringName) -> bool:
|
||||
return from == ANY_STATE or from == current_id
|
||||
|
||||
func is_satisfied(data: Object) -> bool:
|
||||
return condition == null or condition.evaluate(data)
|
||||
Reference in New Issue
Block a user