Example #1
0
        void Register()
        {
            if (Installers.IsEmpty())
            {
                Debug.LogError("No installers found while initializing CompositionRoot");
                return;
            }

            foreach (var installer in Installers)
            {
                // The installers that are part of the scene are monobehaviours
                // and therefore were not created via Zenject and therefore do
                // not have their members injected
                // At the very least they will need the container injected but
                // they might also have some configuration passed from another
                // scene
                FieldsInjecter.Inject(_container, installer);
                _container.Bind <IInstaller>().To(installer);
            }

            ZenUtil.InstallInstallers(_container);
        }