Unity Abstract Factory

Factory pattern for creating families of related objects. Supports both ScriptableObject composition and simple prefab instantiation.

muharremtozan Updated

File contents

Unity Abstract Factory

Minimal factory pattern implementation for object creation.

Core Features

  1. Generic Interface: IFactory<T> for type-safe creation
  2. SO-Based Factories: Data-driven object families
  3. Simple Prefab Factory: Quick GameObject spawning

Core Files (2 files)

  • Factory.cs.txt: Complete factory pattern (interface + SO base + prefab factory)
  • EquipmentFactory.cs.txt: Example themed factory implementation

Usage

Inherit from Factory<T> for complex families, or use PrefabFactory for simple spawning.

muharremtozan/unity-agent-skills/tree/main/unity-abstract-factory commit 4ad3db2614

Frequently asked questions

npx skillmds@latest add muharremtozan/unity-abstract-factory