Architect Unity Helper
Boost productivity using this expert, unity, game, developer. Includes structured workflows, validation checks, and reusable patterns for game development.
Unity Architect Helper
Your agent for Unity game development β covering C# scripting, component architecture, scene management, performance optimization, and Unity-specific design patterns.
When to Use This Agent
Choose Unity Architect Helper when:
- Building games or applications in the Unity engine
- Writing C# scripts for gameplay, UI, and system management
- Designing Unity project architecture (managers, service locators, events)
- Optimizing Unity performance (batching, pooling, profiling)
- Implementing Unity-specific features (Addressables, Input System, Cinemachine)
Consider alternatives when:
- You need Unreal Engine β use an Unreal Engine agent
- You need Godot β use a Godot agent
- You need web-based 3D (Three.js) β use a 3D Navigator agent
Quick Start
# .claude/agents/unity-architect.yml name: Unity Architect Helper model: claude-sonnet tools: - Read - Write - Edit - Bash - Glob - Grep description: Unity game development agent for C# scripting, component architecture, and engine optimization
Example invocation:
claude "Design an inventory system in Unity β scriptable object-based items, UI with drag-and-drop, save/load with JSON serialization, and event-driven updates"
Core Concepts
Unity Architecture Patterns
| Pattern | Purpose | Example |
|---|---|---|
| Singleton Manager | Global services | AudioManager, GameManager |
| Service Locator | Dependency access | ServiceLocator.Get<IAudio>() |
| Scriptable Objects | Data containers | ItemData, EnemyConfig, DialogueData |
| Event System | Decoupled communication | UnityEvent, C# events, ScriptableObject events |
| Object Pooling | Reuse objects | BulletPool, ParticlePool |
| State Machine | Character states | PlayerStateMachine (Idle, Run, Jump) |
Unity Project Structure
Assets/
βββ Scripts/
β βββ Core/ # Managers, singletons, utilities
β βββ Gameplay/ # Player, enemies, items
β βββ UI/ # UI controllers, views
β βββ Data/ # Data models, serialization
β βββ Editor/ # Custom editor scripts
βββ ScriptableObjects/ # SO asset definitions
βββ Prefabs/ # Reusable GameObjects
βββ Scenes/ # Game scenes
βββ Materials/ # Materials and shaders
βββ Textures/ # Image assets
βββ Audio/ # Sound effects and music
βββ Plugins/ # Third-party libraries
Configuration
| Parameter | Description | Default |
|---|---|---|
unity_version | Unity version | 2023.x LTS |
render_pipeline | Render pipeline (built-in, urp, hdrp) | urp |
input_system | Input handling (old, new) | new |
target_platform | Build target (pc, mobile, console, webgl) | pc |
architecture | Code architecture (simple, service-locator, di) | service-locator |
Best Practices
-
Use ScriptableObjects for game data configuration. Items, enemy stats, dialogue, and ability definitions should be ScriptableObjects rather than hardcoded values. This separates data from logic, enables designer editing without code changes, and prevents data duplication.
-
Avoid Find methods in Update loops.
GameObject.Find(),FindObjectOfType(), andGetComponent()are expensive. Cache references inAwake()orStart()and reuse them. In hot loops, evenGetComponentshould be cached. -
Use the new Input System for cross-platform input. The new Input System supports multiple devices (keyboard, gamepad, touch) with a single action map. Define Input Actions as an asset, and bind them in code with
InputAction.performed += callback. -
Implement object pooling for anything created at runtime. Bullets, particles, UI popups, and enemies should be pooled rather than instantiated/destroyed. Unity's
ObjectPool<T>class provides a built-in pooling solution. -
Profile on target hardware, not just in the editor. The Unity Editor adds overhead that masks real performance characteristics. Build and profile on the target device (especially mobile) to identify actual bottlenecks.
Common Issues
Garbage collection causes frame rate spikes. Allocations in Update() (string concatenation, LINQ, foreach on collections) trigger GC. Use StringBuilder for strings, avoid LINQ in hot paths, and cache array/list allocations.
Scene loading causes long freezes. Use SceneManager.LoadSceneAsync() instead of synchronous loading. Show a loading screen and load scenes additively. For large scenes, split into smaller scenes loaded on demand.
Physics interactions are inconsistent between builds. Non-deterministic physics and floating-point differences cause issues. Move physics logic to FixedUpdate(), use Time.fixedDeltaTime, and avoid modifying physics objects in Update().
Reviews
No reviews yet. Be the first to review this template!
Similar Templates
API Endpoint Builder
Agent that scaffolds complete REST API endpoints with controller, service, route, types, and tests. Supports Express, Fastify, and NestJS.
Documentation Auto-Generator
Agent that reads your codebase and generates comprehensive documentation including API docs, architecture guides, and setup instructions.
Ai Ethics Advisor Partner
All-in-one agent covering ethics, responsible, development, specialist. Includes structured workflows, validation checks, and reusable patterns for ai specialists.