示例#1
0
 public void EnterState(GameSceneManager _owner)
 {
     EchoLog.Print("----------------------");
     EchoLog.Print("Load Menu scene");
     _owner.LoadPrefabs();
     GameEventHandlers.FadeOut();
 }
示例#2
0
    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);
    }
示例#3
0
 public void ChangeSceneWithFade(GameScene nextScene)
 {
     sceneForLoad = nextScene;
     GameEventHandlers.FadeIn();
     GameEventHandlers.OnFadeEnded += FadeInEnded;
 }