Ejemplo n.º 1
0
        public static void ShowScreen()
        {
            LoadingScreenManager instance      = Instance;
            GameObject           loadingScreen = instance.loadingScreen;
            CanvasGroup          cg            = instance.loadingScreen.GetComponent <CanvasGroup>();

            if (instance.transitions != null)
            {
                LeanTween.cancel(instance.transitions.uniqueId);
            }

            instance.transitions =
                LeanTween.alphaCanvas(cg, 0f, 0.5f).setOnComplete(_ => loadingScreen.SetActive(false));
        }
Ejemplo n.º 2
0
        public static void HideScreen()
        {
            LoadingScreenManager instance      = Instance;
            GameObject           loadingScreen = instance.loadingScreen;
            CanvasGroup          cg            = instance.loadingScreen.GetComponent <CanvasGroup>();

            loadingScreen.SetActive(true);
            if (instance.transitions != null)
            {
                LeanTween.cancel(instance.transitions.uniqueId);
            }

            instance.transitions =
                LeanTween.alphaCanvas(cg, 1f, 0.5f);
        }
        IEnumerator GetLoadingProgress(Action onCompleteCallBack = null)
        {
            LoadingScreenManager.HideScreen();
            yield return(new WaitForEndOfFrame());

            foreach (var i in loadingProgressList)
            {
                while (!i.isDone)
                {
                    yield return(null);
                }
            }

            LoadingScreenManager.ShowScreen();
            OnEndSceneChange?.Invoke(CurrentScene);
            onCompleteCallBack?.Invoke();
        }
Ejemplo n.º 4
0
 private void Awake() => Instance = this;