Currently, unity-renderer entry point is segregated between a few MonoBehaviour objects present on the InitialScene unity scene.
Main object
All bridges
Player object, that contains CameraController
TutorialController in charge of Explorer's tutorial.
SettingsController with a few objects used by the Settings menu.
NavMap in charge of the minimap
HUDAudioHandler in charge of the audio system.
A few minor objects, like SceneReferences, MouseCatcher and Environment
This has a few design issues:
By having some systems scattered over the scene, we encourage singletons and unmanaged global access.
More global access leads us to unreliable tests, as we don't have a clear lifecycle of some parts of the project.
As we don't have a clear system lifecycle, integration tests have to rely on loading the entire scene, and this make the tests slower over time as new systems are added to the InitialScene.
We don't have control over the loading order, and all the MonoBehaviour drawbacks stated in #14
Actionables
[ ] Clean up InitialScene by removing all the systems initialized via MonoBehaviour. Setting components can still be left on the scene if this makes sense and they are directly tied to Main initialization.
[ ] The application lifecycle starts and ends on Main only.
[ ] All systems are moved to Environment, HudController or some kind of feature controller using SOLID.
Problem Statement
Currently,
unity-renderer
entry point is segregated between a fewMonoBehaviour
objects present on theInitialScene
unity scene.Main
objectPlayer
object, that containsCameraController
TutorialController
in charge of Explorer's tutorial.SettingsController
with a few objects used by theSettings
menu.NavMap
in charge of the minimapHUDAudioHandler
in charge of the audio system.SceneReferences
,MouseCatcher
andEnvironment
This has a few design issues:
By having some systems scattered over the scene, we encourage singletons and unmanaged global access.
More global access leads us to unreliable tests, as we don't have a clear lifecycle of some parts of the project.
As we don't have a clear system lifecycle, integration tests have to rely on loading the entire scene, and this make the tests slower over time as new systems are added to the InitialScene.
We don't have control over the loading order, and all the
MonoBehaviour
drawbacks stated in #14Actionables
[ ] Clean up
InitialScene
by removing all the systems initialized viaMonoBehaviour
. Setting components can still be left on the scene if this makes sense and they are directly tied toMain
initialization.[ ] The application lifecycle starts and ends on
Main
only.[ ] All systems are moved to
Environment
,HudController
or some kind of feature controller using SOLID.