New advertisers: 50% off your first month with code FIRSTMONTHSee slots

Comprehensive Unity expertise covering scripting, rendering, networking, modding, and performance for game developers.

version
1.0.4
GitHub stars
62
View on GitHub

What it does

  • Adds unity-expert agent and skills for C# scripting, editor tooling, modding, networking, performance, shaders, and UI development
  • Covers MonoBehaviour lifecycle, coroutines, async patterns, and UI systems including UGUI and UI Toolkit
  • Spans multiplayer stacks such as Netcode for GameObjects, Mirror, Photon, and Fish-Net, plus Addressables and Harmony patching for mods
  • Designed for Unity developers building gameplay, multiplayer, or moddable games across URP, HDRP, and the Built-in pipeline

Complete Unity game development expertise. Covers C# scripting, MonoBehaviour lifecycle, UI systems (UGUI, UI Toolkit), physics, animation, networking (Netcode, Mirror, Photon), modding support (Addressables, Lua/MoonSharp, Harmony), ECS/DOTS, shader development (ShaderLab, HLSL, Shader Graph), URP/HDRP rendering pipelines, editor scripting, performance optimization, build pipelines, XR/VR/AR, and Unity Gaming Services integration.

Add marketplace

/plugin marketplace add JosiahSiegel/claude-plugin-marketplace

Run it inside Claude Code once, then install the plugin below.

Install

/plugin install unity-master@claude-plugin-marketplace

Run it inside Claude Code after adding the marketplace.

Files

Discovered from source

Unity C# Scripting Patterns

Overview

Core C# scripting reference for Unity development. Covers MonoBehaviour lifecycle, physics and collision APIs, animation scripting, audio, navigation, common design patterns, serialization, and ECS/DOTS coding patterns.

MonoBehaviour Lifecycle

Execution Order

Awake() -> OnEnable() -> Start() -> FixedUpdate() -> Update() -> LateUpdate() -> OnDisable() -> OnDestroy()
MethodWhen CalledUse For
Awake()Once, when object instantiates (before Start)Self-initialization, caching references
OnEnable()Each time object becomes activeSubscribe to events, reset state
Start()Once, before first Update (after all Awake)Cross-object initialization
FixedUpdate()Fixed timestep (default 0.02s)Physics, Rigidbody movement
Update()Every frameInput, non-physics logic
LateUpdate()After all Update callsCamera follow, post-movement adjustments
OnDisable()When object deactivatesUnsubscribe events, save state
OnDestroy()When object is destroyedFinal cleanup, resource release

Key Rules

  • Awake runs even on disabled components (but not disabled GameObjects)
  • Never rely on Awake/Start order between scripts -- use [DefaultExecutionOrder(N)] or Script Execution Order settings
  • Use OnValidate() for editor-time validation of serialized fields

Coroutines and Async

Coroutines

IEnumerator SpawnWaves(int count, float delay)
{
    for (int i = 0; i < count; i++)
    {
        SpawnEnemy();
        yield return new WaitForSeconds(delay);
    }
}
// Start: Coroutine handle = StartCoroutine(SpawnWaves(5, 1f));
// Stop: StopCoroutine(handle); or StopAllCoroutines();
Yield InstructionBehavior
yield return nullWait one frame
yield return new WaitForSeconds(t)Wait t seconds (affected by timeScale)
yield return new WaitForSecondsRealtime(t)Unscaled time
yield return new WaitForFixedUpdate()Wait for next FixedUpdate
yield return new WaitForEndOfFrame()After rendering
yield return new WaitUntil(() => condition)Wait until predicate is true
yield return StartCoroutine(other)Wait for nested coroutine

Async/Await (Unity 6+ / UniTask)

For Unity 2023+/Unity 6, Awaitable is built-in. For older versions, use UniTask.

async Awaitable LoadLevelAsync(string sceneName)
{
    await Awaitable.WaitForSecondsAsync(1f);
    var op = SceneManager.LoadSceneAsync(sceneName);
    while (!op.isDone)
    {
        progressBar.value = op.progress;
        await Awaitable.NextFrameAsync();
    }
}

Events and Delegates

Event Pattern (Recommended)

// Publisher
public class Health : MonoBehaviour
{
    public event System.Action<float> OnDamaged;  // event keyword prevents external invocation
    public event System.Action OnDeath;

    public void TakeDamage(float amount)
    {
        currentHealth -= amount;
        OnDamaged?.Invoke(amount);
        if (currentHealth <= 0) OnDeath?.Invoke();
    }
}

// Subscriber
void OnEnable() => health.OnDamaged += HandleDamage;
void OnDisable() => health.OnDamaged -= HandleDamage;
void HandleDamage(float amount) => /* react */;

ScriptableObject Event Channels

Decouple systems without direct references. Create GameEvent as a ScriptableObject asset, invoke from publishers, and listen from subscribers via GameEventListener MonoBehaviours. See references/design-patterns.md for full implementation.

Physics API Quick Reference

Rigidbody Movement (3D)

TaskMethodWhere
Continuous forcerb.AddForce(dir * force)FixedUpdate
Instant impulserb.AddForce(dir * force, ForceMode.Impulse)FixedUpdate
Direct velocityrb.linearVelocity = dir * speedFixedUpdate
Kinematic moverb.MovePosition(target)FixedUpdate
Rotationrb.MoveRotation(targetRot)FixedUpdate

Note: In Unity 6, Rigidbody.velocity is renamed to Rigidbody.linearVelocity.

Raycasting

if (Physics.Raycast(origin, direction, out RaycastHit hit, maxDistance, layerMask))
{
    Debug.Log($"Hit {hit.collider.name} at {hit.point}");
}
// Use Physics.RaycastAll or Physics.RaycastNonAlloc for multiple hits
// 2D: Physics2D.Raycast, Physics2D.OverlapCircle, etc.

Collision vs Trigger

CallbackRequiresUse For
OnCollisionEnter/Stay/ExitBoth have colliders, at least one Rigidbody, isTrigger=falsePhysical impacts
OnTriggerEnter/Stay/ExitOne collider has isTrigger=true, at least one RigidbodyZones, pickups, detection

Always use CompareTag("Enemy") instead of other.tag == "Enemy" (avoids GC allocation).

Animation Scripting

[RequireComponent(typeof(Animator))]
public class CharacterAnimation : MonoBehaviour
{
    static readonly int SpeedHash = Animator.StringToHash("Speed");
    static readonly int JumpTrigger = Animator.StringToHash("Jump");
    Animator _anim;

    void Awake() => _anim = GetComponent<Animator>();
    void Update()
    {
        _anim.SetFloat(SpeedHash, moveSpeed);
        if (jumped) _anim.SetTrigger(JumpTrigger);
    }
}

Cache Animator.StringToHash results as static readonly fields to avoid per-frame hashing. Use Animation Events for gameplay-timed callbacks (footsteps, hit frames). For IK, implement OnAnimatorIK(int layerIndex) with SetIKPosition/Rotation/Weight.

Audio Quick Reference

[RequireComponent(typeof(AudioSource))]
public class SFXPlayer : MonoBehaviour
{
    [SerializeField] AudioClip[] clips;
    AudioSource _source;
    void Awake() => _source = GetComponent<AudioSource>();
    public void PlayRandom() => _source.PlayOneShot(clips[Random.Range(0, clips.Length)]);
}

Use AudioSource.PlayOneShot() for overlapping SFX. Use AudioMixer with exposed parameters for volume control. Use snapshots for state transitions (combat vs. exploration).

Serialization

TypeSerializedNotes
public fieldsYesVisible in Inspector
[SerializeField] privateYesPreferred -- maintains encapsulation
[HideInInspector] publicYes, hiddenSerialized but not shown
[NonSerialized] publicNoOpt-out of serialization
PropertiesNoNever serialized by Unity
DictionariesNoUse serialized list + rebuild, or Odin/SerializedDictionary
InterfacesNoUse abstract ScriptableObject or SerializeReference

Use [SerializeReference] for polymorphic serialization of interfaces and abstract types.

Common Design Patterns

PatternWhen to UseApproach
SingletonGlobal managers (Audio, GameState)ScriptableObject-based or lazy MonoBehaviour
ObserverDecoupled communicationC# events or SO event channels
CommandInput/undo systemsCommand interface + history stack
State MachineAI, player statesEnum + switch, or class-based states
Object PoolBullets, particles, enemiesQueue with pre-instantiation
Service LocatorTestable global accessStatic registry with interface keys

For detailed implementations and code examples, see references/design-patterns.md.

ECS/DOTS Quick Reference

ConceptRole
EntityLightweight ID (no MonoBehaviour)
IComponentDataPure data struct on entities
SystemBase / ISystemLogic operating on component queries
EntityQueryFilter entities by component sets
Jobs (IJobEntity)Multithreaded systems
Burst CompilerSIMD-optimized native code

For ECS architecture patterns and migration guidance, see references/design-patterns.md.

Additional Resources

Reference Files

  • references/design-patterns.md -- Full implementations of singleton, observer, command, state machine, object pool, service locator, and ECS patterns
  • references/physics-animation-audio.md -- Detailed physics setup (2D and 3D), advanced animation (blend trees, IK, root motion, Animation Rigging), and audio architecture

From the JosiahSiegel/claude-plugin-marketplace README

Claude Plugin Marketplace

A curated collection of Claude Code plugins for plugin development, context optimization, cloud infrastructure, DevOps automation, and productivity tools.

Quick start

1. Add this marketplace:

/plugin marketplace add JosiahSiegel/claude-plugin-marketplace

2. Install any plugin:

/plugin install <plugin-name>@claude-plugin-marketplace

3. Browse the plugin catalog and install what you need.

Plugin versions are defined in .claude-plugin/marketplace.json and mirrored in each plugin's .claude-plugin/plugin.json. Treat the marketplace manifest as the source for the full, current catalog; the list below highlights commonly used plugins.

Available plugins

Core development tools

  • plugin-master (Docs) - Claude Code plugin development with skills, commands, agents, hooks, MCP integration, testing, and marketplace publishing guidance.
  • context-master (Docs) - Context management for complex multi-file tasks, planning, delegation, token budgeting, and long-running sessions.
  • doc-master (Docs) - Documentation diagnostic, Markdown style, and ADR expert that routes docs to the right form before drafting.

Cloud and infrastructure

  • azure-master (Docs) - Azure resource provisioning, AI Foundry, networking, deployment stacks, debugging, and cost optimization.
  • azure-to-docker-master (Docs) - Azure-to-Docker migration for local development, Compose generation, emulators, and dev-to-prod parity.
  • terraform-master (Docs) - Terraform and OpenTofu guidance for IaC design, state management, imports, providers, validation, and CI/CD.

DevOps and CI/CD

  • docker-master (Docs) - Docker build, run, debug, optimization, Compose, container security, networking, and registry workflows.
  • ado-master (Docs) - Azure DevOps and Azure Pipelines YAML, identity, security, templates, analytics, and troubleshooting.
  • git-master (Docs) - Git and GitHub workflows, history recovery, signed commits, worktrees, sparse checkouts, and repository operations.

Scripting and automation

  • bash-master (Docs) - Bash and shell scripting, ShellCheck guidance, POSIX portability, security-first patterns, and cross-platform execution.
  • powershell-master (Docs) - PowerShell scripting, modules, CI/CD automation, cloud administration, debugging, and cross-platform patterns.

Testing and quality

  • test-master (Docs) - Vitest, Playwright, MSW, unit/integration/E2E testing, debugging, coverage, and CI test setup.

Backend and microservices

Languages and frameworks

  • python-master (Docs) - Python, asyncio, typing, FastAPI, testing, packaging, performance, security, and deployment.
  • react-master (Docs) - React components, hooks, state management, TypeScript, forms, performance, and testing.
  • nextjs-master (Docs) - Next.js App Router, Server Components, Server Actions, caching, middleware, auth, and deployment.
  • tailwindcss-master (Docs) - Tailwind CSS configuration, utilities, responsive design, dark mode, performance, and framework integration.
  • ffmpeg-master (Docs) - FFmpeg meta-bundle for encoding, effects, platform deployment, Python integrations, and social-video workflows.

Database and data

  • ssdt-master (Docs) - SQL Server Data Tools, SqlPackage, DACPAC/BACPAC workflows, schema comparison, and database CI/CD.
  • adf-master (Docs) - Azure Data Factory pipeline JSON, activities, linked services, datasets, triggers, expressions, and deployment.
  • tsql-master (Docs) - T-SQL query optimization, execution plans, indexing, Query Store, window functions, and Azure SQL tuning.

Platform-specific

  • salesforce-master (Docs) - Salesforce API, Apex, Lightning, Flow, data model, integrations, deployment, and security patterns.
  • windows-path-master (Docs) - Windows path resolution and Git Bash compatibility for Claude Code file operations.
  • cloudflare-master (Docs) - Cloudflare Workers, Pages, AI, storage primitives, Zero Trust, MCP, observability, and CI/CD.

🤝 Contributing

Want to add a plugin to this marketplace? See CONTRIBUTING.md for guidelines.

📊 Marketplace Info

📄 License

MIT - See LICENSE for details.

Details

Marketplace
JosiahSiegel/claude-plugin-marketplace
Source
plugins/unity-master
Author
Josiah Siegel
Category
Community
Keywords
unity, unity3d, game-development, gamedev, csharp, c-sharp, monobehaviour, scriptableobject, prefab, scene, gameobject, component, ugui, ui-toolkit, canvas, physics, rigidbody, collider, raycast, animation, animator, blend-tree, shader, shader-graph, hlsl, shaderlab, urp, hdrp, rendering, lighting, particles, vfx-graph, networking, multiplayer, netcode, mirror, photon, fish-net, modding, mod-support, addressables, asset-bundles, lua, moonsharp, harmony, ecs, dots, burst-compiler, jobs-system, entities, editor-scripting, custom-inspector, editor-window, build-pipeline, performance, profiler, object-pooling, lod, navmesh, pathfinding, terrain, probuilder, audio, audiomixer, coroutine, async-await, unity-testing, assembly-definition, package-manager, unity-gaming-services, firebase, playfab, cicd, gameci, webgl, xr, vr, ar, steam-workshop, scriptable-render-pipeline, 2d, 3d, mobile, console
Listed since
Apr 7, 2026

More from JosiahSiegel/claude-plugin-marketplace

All 43

Similar to unity-master

More Game Development