public void EnterState(GameSceneManager _owner) { EchoLog.Print("----------------------"); EchoLog.Print("Load Menu scene"); _owner.LoadPrefabs(); GameEventHandlers.FadeOut(); }
public IEnumerator FadeTo(float alpha, float duration) { var startAlpha = GetComponent <CanvasGroup>().alpha; for (var dt = 0.0f; dt <= 1.0; dt += Time.deltaTime / duration) { GetComponent <CanvasGroup>().alpha = Mathf.Lerp(startAlpha, alpha, dt); yield return(null); } GetComponent <CanvasGroup>().alpha = alpha; GameEventHandlers.FadeEnded(); if (alpha == 0.0f) { gameObject.SetActive(false); } yield return(null); }
public void ChangeSceneWithFade(GameScene nextScene) { sceneForLoad = nextScene; GameEventHandlers.FadeIn(); GameEventHandlers.OnFadeEnded += FadeInEnded; }