Unity architect

From TheArcForge/UniClaude · View interactive version

Unity architect is an AI agent skill from the GitHub repository TheArcForge/UniClaude. Use when making Unity architecture decisions — system design, scope analysis, feature planning. Covers prefab strategy, scene structure, component design, data modeling, and performance considerations.

How to use this skill

Skill file

Unity Architecture Decisions

Load this skill when designing a Unity feature or system. It contains condensed decision frameworks for the most common architectural choices. For deeper detail on any domain, reference files are available in references/.

Before You Design

Ask these questions for every non-trivial feature:

  1. Scale: How many instances? (1, tens, hundreds, thousands?)
  2. Lifetime: Persistent across scenes? Created/destroyed at runtime? Pooled?
  3. Variance: How do instances differ? (data only? behavior? visuals?)
  4. Ownership: Who spawns it? Who configures it? Who destroys it?
  5. Dependencies: What other systems does it talk to? (input, networking, UI, save system, audio?)
  6. Performance budget: Is this in a hot path? Per-frame? Event-driven?

DECISION: Object Representation

When this applies: You need reusable objects in the game (enemies, weapons, pickups, UI panels, level pieces).

Options:

  1. Prefab — self-contained GameObject template with components and children.
  1. Prefab Variant — inherits from a base prefab, overrides specific properties.
  1. ScriptableObject config + single prefab — one prefab reads data from a SO asset.

Questions to ask:

DECISION: Spawning Strategy

When this applies: Objects are created at runtime (projectiles, enemies, effects, UI elements).

Options:

  1. Direct Instantiate — Instantiate(prefab) when needed.
  1. Object Pool — pre-allocate, deactivate instead of destroy, reuse.
  1. Factory pattern — abstraction layer that decides pooling vs instantiate internally.

Questions to ask:

DECISION: Scene Architecture

When this applies: Structuring game scenes, loading, transitions.

Options:

  1. Single scene — everything in one scene, swap content at runtime.
  1. Additive loading — base scene (managers) + content scenes loaded additively.
  1. Scene-per-screen — each major UI/game state is its own scene (Menu, Game, Results).

Questions to ask:

DECISION: Component Design

When this applies: Designing MonoBehaviour structure for a GameObject.

Options:

  1. Single MonoBehaviour — one component handles all behavior.
  1. Composition (multiple focused components) — each component handles one concern.
  1. Controller + data split — one controller MonoBehaviour + ScriptableObject for config.

Questions to ask:

DECISION: Data Architecture

When this applies: Storing and accessing game data (stats, config, progression, inventory).

Options:

  1. ScriptableObject assets — data lives in .asset files, referenced by components.
  1. MonoBehaviour with [SerializeField] — data lives on the GameObject.
  1. Static/singleton config — loaded once, available globally.
  1. Serialized JSON/binary — runtime save/load to disk.

Questions to ask:

DECISION: Performance Strategy

When this applies: Any system that runs per-frame or handles many objects.

Key cost model:

Options by concern:

Spawning: Pool when > 10/s or on mobile. Instantiate otherwise.

Rendering: Static batching (non-moving objects), GPU instancing (many identical meshes), SRP batcher (different materials, same shader). Set objects static when they never move.

Physics: Simple colliders over mesh colliders. Reduce FixedUpdate frequency if possible. Layer-based collision matrix to skip irrelevant pairs.

Materials: Share materials to enable batching. Texture atlases for sprites. Avoid runtime material instantiation (creates unique materials that break batching).

Lighting: Bake everything that does not move. Mixed lighting for mostly-static scenes. Realtime only for fully dynamic scenes. Light probes for dynamic objects in baked scenes.

Questions to ask:

Cross-Cutting Concerns

Before finalizing any design, verify these:

After Designing

Once the user approves the architecture:

  1. Load the relevant workflow skill (uniclaude:scene-authoring, uniclaude:prefab-workflow, uniclaude:animation-workflow) for efficient tool sequences.
  2. Implement using MCP tools for authoring, C# for runtime behavior.
  3. After implementation, load uniclaude:unity-reviewer to check for anti-patterns.

Related Skills (Deep-Dives)

For detailed decision trees beyond this summary, see references/:

Also available as standalone skills for on-demand loading:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.