.claude/skills/gamestate-module/SKILL.md
GameStateModule reference — game state machine with reactive properties, time scale management, and pause/resume events. Use when working with game states, pausing, or game flow control.
npx skillsauth add punkfuncgames/tetris-clone gamestate-moduleInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Package: com.punkfuncgames.gamestate | Define: PUNKFUNC_GAME_STATE
Location: Packages/com.punkfuncgames.gamestate/Runtime/PunkFuncGames.GameState/
Namespace: PunkFuncGames.GameState
None, Initializing, MainMenu, Loading, Playing, Paused, GameOver, Victory
ReadOnlyReactiveProperty<GameState> CurrentStateGameState PreviousStateReadOnlyReactiveProperty<bool> IsPlayable — true only when PlayingObservable<(GameState previous, GameState current)> OnStateChangedChangeState(GameState newState)RevertToPreviousState()Dependencies: IPublisher<GameStateChangedEvent>, IPublisher<GamePausedEvent>, IPublisher<GameResumedEvent>
ChangeState() behavior:
Time.timeScale: Paused/GameOver → 0f, everything else → 1fGamePausedEventGameResumedEvent| Event | Key Fields |
|-------|------------|
| GameStateChangedEvent | PreviousState, NewState |
| GamePausedEvent | (empty marker) |
| GameResumedEvent | (empty marker) |
| GameStartedEvent | IsNewGame, StartLevel |
| GameEndedEvent | IsVictory, FinalScore, PlayTime |
GameStateInstaller.Install(builder, options);
// Registers: GameStateService (Singleton) as IGameStateService
// Events: all 5 event brokers
// Toggle pause
if (_gameState.CurrentState.CurrentValue == GameState.Playing)
_gameState.ChangeState(GameState.Paused);
else
_gameState.RevertToPreviousState();
// React to state changes
_gameState.OnStateChanged
.Subscribe(change => HandleStateChange(change.previous, change.current))
.AddTo(_disposables);
// Only execute when playing
_gameState.IsPlayable
.Where(playable => playable)
.Subscribe(_ => EnableGameplay())
.AddTo(_disposables);
development
WalletModule reference — currency management with BigDouble support, reactive properties, caps, lifetime stats, and persistence. Use when working with currencies, wallets, or financial systems.
development
UnlockConditionModule reference — composable unlock conditions using ScriptableObjects with AND/OR/NOT logic, stat/currency/upgrade/prestige/gamestate/boolean checks, reactive service layer with progress tracking. Use when implementing unlock systems, gating, or progression requirements.
development
UndoModule reference — command pattern with undo/redo stacks, command merging, and reactive state. Use when implementing undo/redo, undoable actions, or command patterns.
tools
Unity UI Toolkit reference — UXML documents, USS styling, MVVM pattern (ViewModel + Presenter), custom VisualElements, responsive layout, animations, performance guidelines, and complete Figma-to-UI-Toolkit property mapping. Use when building or modifying UI with UI Toolkit, creating UXML/USS files, writing ViewModels or Presenters, designing screens/panels/components, or converting Figma designs to UI Toolkit.