Unity Builder Pattern

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

muharremtozan 4f43e60 3 files · 3.6 KB Updated

File contents

Unity Builder Pattern

Minimal builder pattern for GameObject construction.

Core Features

  1. Fluent API: Chainable methods for readable setup
  2. Generic Interface: IBuilder<T> for any object type
  3. Component Management: Easy component addition

Core Files (1 file)

  • Builder.cs.txt: Complete builder pattern (interface + fluent implementation)

Usage

var player = new GameObjectBuilder( "Player" )
    .WithPosition( Vector3.zero )
    .AddComponent<Rigidbody>()
    .Build();

muharremtozan/unity-agent-skills/tree/main/unity-builder-pattern commit 4f43e601fb

Frequently asked questions

npx skillmds@latest add muharremtozan/unity-builder-pattern