com.cupkekgames.statemachines — ScriptableObject-driven state machine framework. States are authored as StateSO assets; transitions are authored on a TransitionTableSO; an editor window provides graph-style authoring + runtime debugging.
A state machine is two assets:
StateSO — a state. Holds a [SerializeReference] List<IStateAction> so each state's behavior is composed from polymorphic action instances authored in the Inspector.TransitionTableSO — the transition graph. Maps (fromState, toState, conditions) triples; condition data is also [SerializeReference].At runtime, the StateMachine MonoBehaviour clones each authored action via IStateAction.Clone() so per-instance state stays isolated, then drives OnStateEnter / OnUpdate / OnStateExit.
Earlier versions used per-action factory ScriptableObjects (StateActionSO, StateConditionSO, StateMachineActionTryTransitionSO, …). Those are gone. Action and condition data is now stored inline on StateSO / TransitionTableSO via [SerializeReference], drawn with a type-picker dropdown.
To author a new action:
[Serializable]
public class PlayAnimationAction : StateAction
{
[SerializeField] private string _kind = AnimationKinds.Idle;
private IAnimationStateController _animations;
public override void Awake(StateMachine sm) =>
_animations = sm.GetComponent<IAnimationStateController>();
public override void OnStateEnter() => _animations?.Play(_kind);
}The action shows up immediately in the StateSO Inspector's + dropdown — no SO asset to create.
Runtime (CupkekGames.StateMachines.asmdef)
StateMachine (MonoBehaviour) — drives state transitionsState / StateAction / StateCondition / StateTransition — runtime building blocks (Clone'd from the authored templates)IStateAction / IStateCondition — pluggable contractsStateSO / TransitionTableSO — authoring assetsStateMachineActionTryTransition — built-in action that triggers transition evaluation on state entryStateMachineUpdateMode — when the FSM ticksEditor (CupkekGames.StateMachines.Editor.asmdef)
StateMachineEditor / StateEditor — Inspector toolingTransitionTableEditor + TransitionTableEditorWindow — graph-style transition authoringScriptTemplates — quick-create templates for new actions / conditionsCupkekGames.StateMachines (runtime), CupkekGames.StateMachines.Editor (editor). Pluralized from the original CupkekGames.StateMachine to avoid the namespace = class collision.
None.
Settings
Theme
Light
Contrast
Material
Dark
Dim
Material Dark
System
Sidebar(Light & Contrast only)
Font Family
DM Sans
Wix
Inclusive Sans
AR One Sans
Direction