Пример #1
0
    private void Awake()
    {
        startGame.ShowInGameEvent += () => {
            inGame.Show();
            inGame.ShowSelect();
        };

        inGame.SelectLevelEvent += level => {
            if (level == -1)
            {
                this.level++;
                level = this.level;
            }
            this.level = level;
            inGame.HideSelect();
            inGame.ShowSlider();
            itemManager.StartLevel(level);
        };

        inGame.ReturnEvent += () =>
        {
            inGame.ShowSelect();
        };

        itemManager.LoseEvent += () => {
            inGame.slider.value--;
            if (inGame.slider.value <= 0)
            {
                endGame.Show();
            }
            ShowNectLevel();
        };

        inputManager.NextLevelEvent += () => {
            if (inGame.IsShowNext())
            {
                if (!IsShowEndGame())
                {
                    inGame.HideNextLevel();
                    inGame.NextLevel();
                }
            }
        };

        inputManager.CompleteWordEvent += () => {
            ShowNectLevel();
        };
    }