Skip to content

Latest commit

 

History

History
35 lines (30 loc) · 2.22 KB

0004-unity-presentation.md

File metadata and controls

35 lines (30 loc) · 2.22 KB

0004 — The Unity side is a replay, and everything in it is generated

Date: 2026-09-05 · Status: accepted

Decisions

  1. The presentation replays events; it computes no rule. Game.Play returns an ordered event list; BoardView.Present animates it in batches (swap → clears/hits/specials → falls/spawns → next cascade) and then hard-resyncs from the board. If an animation is ever wrong, the board is still right, and the bug is visible rather than silent.
  2. Built-in render pipeline, SpriteRenderers, procedural sprites. The demo ships no textures: gems, rockets, bombs, rainbows, tiles and overlays are drawn into Texture2Ds at start-up with signed-distance functions. Zero import settings to maintain, the smallest possible WebGL payload, and any of them can be swapped for a drawn sprite without touching a view. URP would add packages and build size while contributing nothing to a flat 2D board.
  3. The scene is generated by an editor script (Match3 Lab → Create Demo Scene): one camera, one GameController. The HUD is built in code with legacy UI Text (no font import, no TextMesh Pro essentials). No hand-edited scene or prefab YAML lives in the repository.
  4. Levels reach the build by a sync step, never by editing copies. levels/*.txt in the repository root is what the CLI measures; the editor copies it into Resources/Levels on demand and before every build.
  5. Both input backends are supported through #if ENABLE_INPUT_SYSTEM, and the same press/drag/release logic serves mouse and touch. The event system's input module is chosen the same way.
  6. The bot can drive the UI. "Bot: on" lets the greedy bot play the level with the same animation a player sees — the simulator's numbers become something you can watch.

Consequences

  • A designer who wants prettier pieces edits SpriteFactory or drops in sprites; the views stay as they are.
  • Anything that needs to look different in a cascade (a bigger burst on a rainbow, say) is a change to how an event kind animates, never a change to the rules.
  • WebGL builds run from the command line: Unity -batchmode -quit -projectPath unity -executeMethod Match3Lab.UnityEditor.Builds.WebGL.