コード例 #1
0
    public void Init(ControllersProvider provider)
    {
        matchContoller     = provider.GetController <MatchContoller>();
        unityEvents        = provider.GetController <UnityEventsController>();
        gameModeController = provider.GetController <GameModeController>();

        //AI
        sizeController         = provider.GetController <SceneSizeController>();
        ballMovementController = provider.GetController <BallMovementController>();

        var uiController = provider.GetController <UIController>();

        selfInputHandler  = uiController.SelfInputHandler;
        enemyInputHandler = uiController.EmenyInputHandler;

        matchContoller.StateChanged += MatchStateChanged;
        unityEvents.UpdateAction    += Update;

        gameModeController.GameModeChanged += GameModeChanged;

        var sceneController = provider.GetController <SceneController>();

        var selfRacket = sceneController.GetObject(SceneObjectType.SelfRacket);

        selfRacketController = new RacketMovementController(sizeController, selfRacket.transform, racketSpeed);

        var enemyRacket = sceneController.GetObject(SceneObjectType.EnemyRacket);

        enemyRacketController = new RacketMovementController(sizeController, enemyRacket.transform, racketSpeed);

        ball = sceneController.GetObject(SceneObjectType.Ball);
    }
コード例 #2
0
    public void Init(ControllersProvider controllersProvider)
    {
        gameModeController = controllersProvider.GetController <GameModeController>();
        gameModeController.GameModeChanged += GameModeChanged;

        matchContoller = controllersProvider.GetController <MatchContoller>();
        matchContoller.StateChanged += MatchStateChanged;

        scoreController = controllersProvider.GetController <ScoreController>();
        scoreController.BestPointsChanged += BestPointsChanged;

        var saveController = controllersProvider.GetController <SaveController>();

        BestPointsChanged(saveController.BestScore);

        var ballCustomizeController = controllersProvider.GetController <BallCustomizeController>();

        var mainMenuModel = new MainMenuModel(gameModeController, ballCustomizeController);

        mainMenuWindow.Init(mainMenuModel);

        var pauseMenuModel = new PauseMenuModel(gameModeController, ballCustomizeController);

        pauseWindow.Init(pauseMenuModel);
    }
コード例 #3
0
    public void Init(ControllersProvider controllersProvider)
    {
        matchContoller = controllersProvider.GetController <MatchContoller>();
        matchContoller.StateChanged += MatchStateChanged;

        saveController = controllersProvider.GetController <SaveController>();

        var sceneController = controllersProvider.GetController <SceneController>();

        ball = sceneController.GetObject(SceneObjectType.Ball) as ICustomizeObject;

        SetColor(saveController.BallColor);
    }
コード例 #4
0
    public void Init(ControllersProvider controllersProvider)
    {
        var sizeController = controllersProvider.GetController <SceneSizeController>();

        SetSize(sizeController.SceneWidht, sizeController.SceneHeight);

        gameModeController = controllersProvider.GetController <GameModeController>();
        gameModeController.GameModeChanged += GameModeChanged;

        matchContoller = controllersProvider.GetController <MatchContoller>();
        matchContoller.StateChanged += MatchStateChanged;

        scoreController = controllersProvider.GetController <ScoreController>();
        scoreController.ScoreChanged       += ScoreChanged;
        scoreController.MatchPointsChanged += MatchPointsChanged;
    }