-
Notifications
You must be signed in to change notification settings - Fork 0
Home
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:
- Their game code attempts to use services before they've been created (i.e. during
Awake/Start). - 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.
- Bootstrap Wizard: one-time project setup for scaffolding the bootstrap scene, environment, and service lists
- 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
Appentry point and the per-sessionAppInstancebehind it
MIT License.