MuharremTozan/Agentic-Duel / .agent/skills/unity-builder-pattern
unity-builder-pattern
VerifiedStep-by-step object construction using fluent interfaces. Simplifies complex GameObject setup.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 665 B |
| assets/code/Builder.cs.txt | markdown | 1.3 KB |
| references/guide.md | markdown | 1.7 KB |
assets/code/Builder.cs.txt
View on GitHubusing 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;
}
}
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| 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: 197k | Updated | Claude CodeCodex | Verified | Install |
| 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: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| 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: 194k | Updated | Claude CodeCodex | Verified | Install |