Exemple #1
0
    void Update()
    {
        switch (state)
        {
        case LevelUIState.FADING_IN:
        {
            if (fade_in_timer.ReadTime() > fade_in_time)
            {
            }

            break;
        }

        case LevelUIState.FADING_OUT:
        {
            if (fade_out_timer.ReadTime() > fade_out_time)
            {
                gameObject.SetActive(false);
                state = LevelUIState.FINISHED;
            }

            break;
        }

        case LevelUIState.FINISHED:
            break;
        }
    }
Exemple #2
0
    public void FadeOut()
    {
        gameObject.SetActive(true);

        canvas_group.DOFade(0, fade_out_time);
        fade_out_timer.Start();

        state = LevelUIState.FADING_OUT;
    }
Exemple #3
0
    public void UIBegin(int level_number)
    {
        gameObject.SetActive(true);

        Level level = LevelsManager.Instance.GetCurrentStageLevel(level_number);

        if (level != null)
        {
            level_description_text.text = level.GetLevelDescription();
        }

        canvas_group.alpha = 0.0f;
        canvas_group.DOFade(1, fade_in_time);
        fade_in_timer.Start();

        state = LevelUIState.FADING_IN;
    }