Skip to content

MuharremTozan/Agentic-Duel / .agent/skills/unity-builder-pattern

unity-builder-pattern

Verified

Step-by-step object construction using fluent interfaces. Simplifies complex GameObject setup.

FileKindSize
SKILL.mdskill md665 B
assets/code/Builder.cs.txtmarkdown1.3 KB
references/guide.mdmarkdown1.7 KB

assets/code/Builder.cs.txt

View on GitHub
using UnityEngine;

namespace Standard.Patterns {
    /// <summary>
    /// Generic builder interface for step-by-step object construction.
    /// </summary>
    public interface IBuilder<T> {
        T Build();
    }

    /// <summary>
    /// Fluent builder base class for GameObject construction.
    /// Provides chainable methods for setting up objects.
    /// </summary>
    public class GameObjectBuilder : IBuilder<GameObject> {
        private GameObject _gameObject;
        private Vector3 _position = Vector3.zero;
        private Quaternion _rotation = Quaternion.identity;

        public GameObjectBuilder(string name) {
            _gameObject = new GameObject(name);
        }

        public GameObjectBuilder WithPosition(Vector3 position) {
            _position = position;
            return this;
        }

        public GameObjectBuilder WithRotation(Quaternion rotation) {
            _rotation = rotation;
            return this;
        }

        public GameObjectBuilder AddComponent<T>() where T : Component {
            _gameObject.AddComponent<T>();
            return this;
        }

        public GameObject Build() {
            _gameObject.transform.position = _position;
            _gameObject.transform.rotation = _rotation;
            return _gameObject;
        }
    }
}
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: 197kUpdated 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