The Bootstrap Loader Scene and its use

BootstrapLoader: Sequence of object instantiation

Many games need to properly load, instantiate and initialize certain objects before any other. Usually the instantiation and initialization of singleton classes that are crucial through-out the game is done immediately after starting a game, and all other tasks relevant to the game levels are executed afterwards.

A best practice that I learnt to follow is to split this process into one starting scene called 'BootstrapLoader', and the subsequent game scenes that are loaded afterwards.

Note: All objects that are loaded during the bootstrap scene should have their DontDestroyOnLoad property set to True, so as to be kept alive by Unity when switching scenes.

Example:

Load and setup first components for ads, in-app purchases, registration and autorization to other external services that the games needs (e.g. game store, achievements management service, leaderboard management service).

Then, load the game level scene(s), or game starting menu scenes.


Comments