示例#1
0
    public override void InstallBindings()
    {
        var obj = new GameObject("AsyncProcessor");

        Container.Bind <AsyncProcessor>().FromNewComponentOnNewPrefab(obj).AsSingle();
        VbcmInstaller.Install(Container);
        Container.Bind(typeof(IInputManager), typeof(ITickable)).To <InputManager>().AsSingle();
        Container.Bind(typeof(IScreenSize), typeof(ITickable)).To <ScreenSize>().AsSingle();
        Container.BindInstance(_camera);
        Pools();
        Factory();
        Events();
        //Infrastructure===========================================
        Container.Bind <IBottom>().To <Bottom>().AsSingle();
        Container.Bind <GameRessetEvent.IHandler>().To <BottomPresenter>().AsSingle().NonLazy();
        Container.BindInstance(_settings.BottomSettings);

        Container.Bind <IBorder>().To <Border>().AsSingle();
        Container.Bind <BorderPresenter>().AsSingle().NonLazy();

        Container.Bind <GameRessetEvent.IHandler>().To <BallPresenter>().AsSingle().NonLazy();
        //Enemy
        Container.BindInstance(_settings.EnemySpawnerSettings).AsSingle();
        Container.Bind(typeof(IEnemySpawner), typeof(GameRessetEvent.IHandler)).To <EnemySpawner>().AsSingle();
        Container.Bind <EnemyMediator>().AsSingle().NonLazy();
        Container.Bind <IElementSize>().To <ElementSize>().AsSingle();
        Container.BindInstance(_settings.EnemySizeSettings).AsSingle();
        //Logyc
        Container.Bind(typeof(IPointController), typeof(ChangePointEvent.IHandler),
                       typeof(GameRessetEvent.IHandler)).To <PointController>()
        .AsSingle();
        Container.Bind(typeof(IPointModel), typeof(ChangePointEvent.IValidated), typeof(ChangePointEvent.IEventSource))
        .To <PointModel>().AsSingle();
    }
示例#2
0
 public override void InstallBindings()
 {
     Container.BindInstance(camera);
     Container.BindInstance(windowSettings.WindowCanvasSettings);
     Container.BindInstance(windowSettings.WindowFadeData);
     VbcmInstaller.Install(Container);
     EventAggregatorInstaller.Install(Container);
     UiScenarioInstaller.Install(Container);
     Container.BindInstance(windowPrefabs).AsSingle();
     Container.Bind <UnityEnumPool <WindowType, Contractor.View> .Factory>().AsSingle();
     Container.Bind <UnityEnumPool <WindowType, Contractor.View> >().AsSingle();
     Container.Bind <IWindowInfrastructure>().To <WindowInfrastructure>().AsSingle();
     Container.Bind(typeof(IWindowScenarioFactory), typeof(IWindowControllerFactory)).FromInstance(this)
     .AsSingle();
     //========================================
     BindViews();
     Container.BindInstance(_bindTypes);
     BindControllers();
     BindScenarios();
     BindEvents();
     Container.Bind <LobbyLoader>().AsSingle().NonLazy();
 }