Пример #1
0
    private void Awake()
    {
        InGameItem.all.Clear();

        maxScoreLabel.SetFormatedText(gameManager.MaxScore);

        bricksManager.Setup(OnGameOver, item =>
        {
            if (item is InGameItemBall)
            {
                score++;
                if (score.Current > gameManager.MaxScore)
                {
                    gameManager.MaxScore = score.Current;
                }

                ballsManager.AddExtraBall(item.transform.position);
            }
        });

        controller.Setup(direction => ballsManager.Shoot(direction, () => StartCoroutine(TakeReady())));

        score.SetOnValueChanged((lv, cv) => scoreLabel.SetFormatedText(cv));
        score.Current = 0;
    }