Skip to content
Mika Notarnicola edited this page Jul 19, 2026 · 13 revisions

Bootstrap

A rock-solid mechanism for consistent, testable, and configurable application bootstrapping for Unity.

github.com/thebeardphantom/Bootstrap · MIT License · C#


Bootstrap is a dependency injection and service locator framework for Unity. Time and time again developers hit the same issues in the Unity projects core architecture:

  1. Their game code attempts to use services before they've been created (i.e. during Awake/Start).
  2. Entering play mode isn't as simple as hitting Play. Most projects either require opening a dedicated bootstrap scene before entering play mode, or have their own custom "enter playmode" menu item which does that for you. Even with such a mechanism, you then have to navigate (in play mode) to whatever scene you were working on in edit mode.

Bootstrap addresses both of these directly:

Services are defined as assets, so game code never has to care whether one exists yet: it can be used the moment it's referenced, with no null checks, no guessing at initialization order, and no defensive workarounds for "is this ready." You can hit Play from whatever scenes you're editing and Bootstrap will run its consistent initialization flow before automatically loading the scenes you had open in edit mode.

Guides

  • Quick Start: set up a new project and get your first service running
  • Services: how Service List assets are created and used, how to write a service, and every way to access one
  • Bootstrap Flow: what happens from pressing Play through full game bootstrap, and back
  • Source Generation: the [GenerateSingleton] and [GenerateLogger] attributes
  • App and AppInstance: the static App entry point and the per-session AppInstance behind it
  • Bootstrap Settings: the Project Settings window, and how Project/User overrides work

License

MIT License.

Links

AI Usage Disclaimer

AI was used to assist in generating this wiki and the codebase's code documentation. Both were iterated on by hand and reviewed for accuracy.

Clone this wiki locally