Scene Architecture and Zenject Setup
Path to scenes: Assets/StaticAssets/Scenes...
Bootstrap

SceneContext is the entry point for Zenject in the Bootstrap scene. Even if it doesn’t install anything itself, its presence is necessary to:
Initialize the scene with dependencies;
Enable injection through the
Contextinto objects of this scene;Synchronize operation with
ProjectContext;Ensure the
DiContainerworks within the scene.
Bootstrapper is a component that performs the key function of launching the entire system through a State Machine.
In addition, the ProjectContext is created.
ProjectContext is a global (singleton) container that:
initializes once at project start (in the Bootstrap scene);
persists between scenes (is not destroyed on scene change);
contains global dependencies accessible in all scenes (e.g., GameManager, AudioManager, Config, etc.);
is created from a prefab located in the
Assets/Resources/…folder.

The source code and documentation for Extenject can be found here:
Level

The
SceneContextobject in theLevelscene serves as the main integration point for Zenject within the context of that scene. The MonoInstaller (GameplayInstaller.cs) is added to the SceneContext.

What GameplayInstaller does:
Registers game services and managers required within the
Levelscene.Serves as the sole (or primary) place for configuring level dependencies.

GameplayBootstrapper is a component that launches the gameplay state machine in the Level scene. It serves as a local entry point for the state management system specifically related to gameplay (as opposed to the
Bootstrapper, which operates during the project's initialization phase).The CameraContext object groups all cameras used in the
Levelscene. Note the MainCamera object containing thePhysicsRaycastercomponent. The MainCamera inside CameraContext has aPhysicsRaycastercomponent, which is necessary for UI interaction with 3D objects via events (e.g., OnPointerClick, OnDrag, etc.).
For the player upgrade system using drag'n'drop to work properly, the Event Mask field of the
PhysicsRaycastercomponent must include the layers:PlayerandPart.

The HUD object collects and provides access to visual interface elements during gameplay. It is used by other systems (e.g., shooting, upgrading, balancing) to display the current state.

Screens is a pre-created container where all window objects are added as child elements. These objects are not initially in the scene hierarchy but are created dynamically upon first access.
[Global] AudioManager is a global sound manager designed for centralized audio playback in the
Levelscene. When the scene starts, it is registered in the Zenject container, allowing any services and components to access it via dependency injection (DI).
Last updated