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; } }
public void FadeOut() { gameObject.SetActive(true); canvas_group.DOFade(0, fade_out_time); fade_out_timer.Start(); state = LevelUIState.FADING_OUT; }
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; }