unity-abstract-factory

Creates configurable object families in Unity using ScriptableObject factories.

Updated Feb 13, 2026
One-click install
npx skills add https://github.com/MuharremTozan/Ohm-Yura --skill unity-abstract-factory
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: unity-abstract-factory
Source: https://github.com/MuharremTozan/Ohm-Yura/tree/main/.agents/skills/unity-abstract-factory
Command: npx skills add https://github.com/MuharremTozan/Ohm-Yura --skill unity-abstract-factory

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires UnityEngine, and includes references (resource) and assets (resource) components.

What problem does it solve?

This tool provides a clean pattern to create and manage families of Unity objects by decoupling their instantiation from usage, enabling easier theme swapping and reuse across scenes.

Core Features & Use Cases

  • Generic Interface: IFactory<T> for type-safe creation.
  • SO-Based Factories: Data-driven object families via ScriptableObjects.
  • Simple Prefab Factory: Quick GameObject spawning for straightforward assets.
  • Usage Scenario: Create kits (e.g., HeavyKit, LightKit) by composing factories and wiring them into your spawner.

Quick Start

Create a ScriptableObject-based factory by subclassing Factory<T> and wire it into your scene to start generating themed object kits.

Frequently Asked Questions about unity-abstract-factory

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create families of related Unity objects without hardcoding prefab instantiation?▼

You can decouple instantiation from usage by implementing a ScriptableObject-based abstract factory pattern, allowing you to define data-driven object families like HeavyKit and LightKit for consistent themed spawning across scenes.

What is the best way to swap themed GameObject kits in Unity at runtime?▼

Swapping themed GameObject kits in Unity is best handled by composing ScriptableObject factories that satisfy a typed IFactory<T> interface, enabling you to seamlessly switch between related object families without modifying spawning logic.

Does this abstract factory pattern work with standard UnityEngine prefabs?▼

Yes, the abstract factory pattern works with standard UnityEngine prefabs by providing a lightweight prefab factory alongside ScriptableObject options, allowing quick GameObject spawning for straightforward assets.

How do I set up a ScriptableObject factory in Unity to manage related prefabs?▼

To set up a ScriptableObject factory in Unity, subclass the generic Factory<T> component to establish type-safe creation, then wire the resulting asset references into your spawner to generate themed object kits.

When should I use a ScriptableObject factory versus a simple prefab factory in gamedev?▼

Use a ScriptableObject factory when managing complex, data-driven object families requiring theme consistency, and rely on a simple prefab factory for quick, straightforward GameObject spawning without the overhead of architectural kits.