Meta

Game Flow

Genre-agnostic boot -> connect -> auth -> character -> world lifecycle FSM (IGameFlow); the game binds its screens to StateChanged. Client-only, Core-only.

Unity package
com.crossplay.gameflow
Depends on
core
Shape
client-only · no server half

Unity services you inject 1

Crossplay binds these in the client context. Inject and call them from your own MonoBehaviours and presenters.

IGameFlow

The game-flow state machine (C9): a genre-agnostic FSM over GameFlowState that a game binds its screens to (subscribe to Changed) and drives (call the triggers for the steps it initiates — login, character select). The framework driver observes the connection and fires the connect/disconnect transitions automatically. Depends on nothing spatial — it holds only the state, never game rules.

  • GameFlowState Current

    The current lifecycle state.

  • event Action<GameFlowState, GameFlowState> Changed

    Raised on every state change, with (from, to).

  • bool BeginConnect()

    Boot/Disconnected → Connecting. Returns false if not a legal transition.

  • bool NotifyConnected()

    Connecting → Authenticating (the transport came up).

  • bool NotifyAuthenticated()

    Authenticating → SelectingCharacter (login succeeded).

  • bool NotifyCharacterSelected()

    SelectingCharacter → EnteringWorld (a character was chosen).

  • bool EnterWorld()

    Authenticating/SelectingCharacter/EnteringWorld → InWorld (playable). Games without Characters/World jump here directly from an earlier step.

  • bool NotifyDisconnected()

    Any connected state → Disconnected (the transport dropped).

  • void Reset()

    Forces back to Boot (e.g. a full logout / return to the title screen).