本文へスキップ
Kitbay
スキル

data-manager

MIT2026年8月21日 更新40,693GitHubスター

A reference skill published in the Phaser game framework's own repository for Phaser 4's data manager, a key-value store that sends events when values change so game systems can react without being tied together.

スキルの内容

A reference skill published in the Phaser game framework's own repository for Phaser 4's data manager, a key-value store that sends events when values change so game systems can react without being tied together. It covers the three levels, per game object, per scene and the game-wide registry, the methods for setting, reading, incrementing, toggling, querying, merging, resetting and freezing data, the values proxy, the event names and their arguments, and patterns such as sharing state across scenes and saving to local storage. Twelve pitfalls explain, for example, that changing a stored object in place sends no event, that registry listeners outlive a scene restart and that frozen managers fail silently.

できること

  • Store data on game objects, scenes or the registry
  • Listen for data change events
  • Share state across scenes
  • Save and load game state