public void Fade(float time, FadeInfo fadeInfo, FadeLayout state)
        {
            state.CanvasGrouup.alpha = TPMath.PingPong(time * 2, 1f);

            if (time >= 0.5f && !string.IsNullOrEmpty(fadeInfo.FadeToScene))
            {
                SceneManager.LoadScene(fadeInfo.FadeToScene);
            }
        }
Beispiel #2
0
 public void Fade(float time, FadeInfo fadeInfo, FadeLayout state)
 {
     if (!asyncLoad.isDone)
     {
         SetProgress(asyncLoad.progress);
         if (asyncLoad.progress >= 0.9f)
         {
             SetProgress(1f);
             if (TryLoadScene())
             {
                 fadeInfo.FadeAnim.AllowBreak = true;
             }
         }
     }
 }
Beispiel #3
0
        public void InitializeFade(FadeInfo fadeInfo, FadeLayout state)
        {
            if (!layout)
            {
                layout = Object.Instantiate(ProgressPrefab);

                LoadingBar          = Object.Instantiate(LoadingBar, layout.transform);
                LoadingImage        = Object.Instantiate(LoadingImage, layout.transform);
                LoadingProgressText = Object.Instantiate(LoadingProgressText, layout.transform);
                LoadingText         = Object.Instantiate(LoadingText, layout.transform);

                asyncLoad = SceneManager.LoadSceneAsync(fadeInfo.FadeToScene);
                asyncLoad.allowSceneActivation = false;
            }
            layout.SetActive(true);
        }
Beispiel #4
0
 public void CleanUp(FadeInfo fadeInfo, FadeLayout state)
 {
     layout.SetActive(false);
 }
 public void CleanUp(FadeInfo fadeInfo, FadeLayout state)
 {
 }
 public void InitializeFade(FadeInfo fadeInfo, FadeLayout state)
 {
     state.Image.sprite = FadeTexture;
     state.Image.color  = FadeColor;
 }