Beispiel #1
0
    public LTDescr LoadScene(string sceneName)
    {
        LTSeq seq = LeanTween.sequence();

        if (string.IsNullOrEmpty(loadedScene) == false && loadedScene != "App")
        {
            seq.append(canvasFader.FadeIn());
            seq.append(() => StartCoroutine(UnloadAsync()));
        }

        seq.append(() => StartCoroutine(LoadAsync(sceneName)));
        seq.append(canvasFader.FadeOut());

        return(seq.tween);
    }
    void ActivateInGameUI()
    {
        mouseCursor.gameObject.SetActive(true);

        leftUIFader.GlitchIn();
        RightUIFader.GlitchIn();
        startGameFader.FadeOut();
    }
        private IEnumerator loadingLoadScene(string sceneName)
        {
            Manager_System.Instance.ResetPlayerPosition();
            Manager_System.Instance.HideFloorMenu();


            //	canvasToFade = GameObject.FindGameObjectWithTag("FadingCanvas").GetComponent<CanvasFader>();
            if (canvasToFade != null)
            {
                canvasToFade.gameObject.SetActive(true);
                // *** FADE TO LOADING SCREEN ***

                // check to see if canvasToFade is ready
                while (!canvasToFade.IsReady)
                {
                    // hold until it is...
                    yield return(null);
                }

                // Fade-To-Black Coroutine (Current Scene --> Black)
                yield return(StartCoroutine(canvasToFade.FadeIn()));
            }

            // Now Load the Loading Screen as a NEW SCENE
            yield return(SceneManager.LoadSceneAsync(LoadingScene));

            findLoadingBar();

            // Fade-To-Clear Coroutine, (Black --> Loading Screen)
            yield return(StartCoroutine(canvasToFade.FadeOut()));

            // Minimum DELAY
            delayTime = Time.time + minDuration;
            while (Time.time < delayTime)
            {
                yield return(null);
            }

            //	canvasToFade = null;
            Start_LoadCoreScene(sceneName);
            Stop_LoadingScene();
        }
Beispiel #4
0
    /// <summary>
    /// Überprüft pro Frame, ob der Spieler noch lebt.
    /// Falls nein, lade vom letzten bekannten Speicherpunkt.
    /// </summary>
    private IEnumerator HandlePlayerAliveStatus()
    {
        player = FindObjectOfType <PlayerBehaviour>();
        if (player == null || player.IsPlayerAlive())
        {
            yield break;
        }
        player.enabled   = false;
        revertToSaveGame = true;
        canvasFader.FadeOut(3f);
        yield return(new WaitUntil(() => Input.GetAxis("Continue Game") > 0f));

        RevertToSaveGame(revertToSaveGame);
    }
Beispiel #5
0
 void Update()
 {
     if (Input.GetButtonDown("Skip"))
     {
         if (fader != null)
         {
             fader.FadeOut();
             Invoke("gotoScene", fader.fadeOutTime);
         }
         else
         {
             gotoScene();
         }
     }
 }