-
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 was entirely undocumented for the vast majority of its history. A library like this lives or dies based on the thoroughness and quality of its documentation. To assist with the massive task of building a detailed foundation for documentation with full coverage, AI was utilized in generating this wiki, as well as the XML code documentation. Both were iterated on and heavily reviewed by a human author for accuracy and clarity, and will continue to be. AI usage for Bootstrap's documentation will be temporary, as once documentation reaches full coverage, and the quality and coverage bars have been established, further upkeep by human authors will become vastly easier.
AI was not used to generate any code in the Bootstrap repository, nor any part of this disclaimer.
Bootstrap is an application lifecycle framework for Unity. Time and time again, developers hit the same architectural issues in their Unity projects:
- 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 scenes you were working on in edit mode.
Bootstrap addresses both of these directly:
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. Services are defined in project-wide assets which can be edited anywhere easily. The consistent bootstrapping mechanisms ensure that your game code doesn't have to deal with service null checks, guessing at initialization order, or defensive workarounds for "is this ready?" It also ensures that your player build experience is consistent with your editor play mode experience.
This library prioritizes features being documented in code, rather than on this wiki. This prevents information from getting out of sync with code changes.
- Quick Start: set up a new project and get your first service running.
- Glossary: a quick reference for the vocabulary used throughout this wiki.
- Philosophy: the core tenets Bootstrap is designed around.
- Services: how to write a service, accessing services, and how Service List assets are created and used.
- Environments: what an environment is, how it's created, and how one gets chosen for play mode or a build.
-
App and AppInstance: the static
Appentry point and the per-sessionAppInstancebehind it. - Bootstrap Flow: what happens from pressing Play through full game bootstrap, and back.
-
Source Generation: the
[GenerateSingleton]and[GenerateLogger]attributes. - Bootstrap Settings: the Project and User setting scopes, and how overrides resolve.
- Bootstrap Handlers: hooking into pre/post bootstrap, and the built-in handlers for Play mode, builds, and Addressables.
- Editor Windows: the Bootstrap Wizard, Settings window, main toolbar dropdown, and Status window.
MIT License.