Skip to content

MuharremTozan/Agentic-Duel / .agent/skills/unity-abstract-factory

unity-abstract-factory

Verified

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

FileKindSize
SKILL.mdskill md741 B
assets/code/EquipmentFactory.cs.txtmarkdown1.1 KB
assets/code/Factory.cs.txtmarkdown1.0 KB
references/guide.mdmarkdown1.6 KB

assets/code/EquipmentFactory.cs.txt

View on GitHub
using UnityEngine;

namespace Platformer.Factory {
    // 1. Define the abstract factory for Equipment (Weapon + Shield)
    // This allows you to hot-swap entire "Kits" (e.g., HeavyKit, LightKit, MagicKit) in the inspector.
    [CreateAssetMenu(fileName = "EquipmentFactory", menuName = "Factories/Equipment")]
    public class EquipmentFactory : ScriptableObject, IFactory<IEquipment> {
        // Here we reference OTHER factories. This is the abstract part - composing others.
        [SerializeField] private AbstractFactory<IWeapon> weaponFactory;
        [SerializeField] private AbstractFactory<IShield> shieldFactory;

        public IEquipment Create() { // Just returning void/null for example structure
             IWeapon w = weaponFactory.Create();
             IShield s = shieldFactory.Create();
             // In a real implementation, you might return a Kit struct or configure a character directly.
             return null; 
        }
        
        // Or specific methods if consumers need pieces
        public IWeapon CreateWeapon() => weaponFactory.Create();
        public IShield CreateShield() => shieldFactory.Create();
    }
}
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall