コード例 #1
0
ファイル: SceneController.cs プロジェクト: sommen01/Seega
    public IEnumerator LoadLevel()
    {
        yield return(StartCoroutine(_screenFader.FadeSceneOut()));

        SceneManager.LoadSceneAsync("Game");
        yield return(StartCoroutine(_screenFader.FadeSceneIn()));
    }
コード例 #2
0
    protected IEnumerator Transition(GameObject transitioningGameObject, bool releaseControl, bool resetInputValues, Vector3 destinationPosition, bool fade, System.Action callback = null)
    {
        m_Transitioning = true;

        if (releaseControl)
        {
            //if (m_PlayerInput == null)
            //    m_PlayerInput = FindObjectOfType<PlayerInput>();
            //m_PlayerInput.ReleaseControl(resetInputValues);
        }

        if (fade)
        {
            yield return(StartCoroutine(ScreenFader.FadeSceneOut()));
        }

        transitioningGameObject.transform.position = destinationPosition;

        if (fade)
        {
            yield return(StartCoroutine(ScreenFader.FadeSceneIn()));
        }

        if (releaseControl)
        {
            //m_PlayerInput.GainControl();
        }

        m_Transitioning = false;

        if (callback != null)
        {
            callback();
        }
    }
コード例 #3
0
    protected IEnumerator Transition(GameObject transitioningGameObject, Vector3 destinationPosition, bool fade = false, System.Action beforTeleport = null, System.Action InTelePort = null, System.Action afterTeleport = null)
    {
        m_Transitioning = true;

        if (beforTeleport != null)
        {
            beforTeleport();
        }

        if (fade)
        {
            yield return(StartCoroutine(ScreenFader.FadeSceneOut()));
        }

        transitioningGameObject.transform.position = destinationPosition;
        if (InTelePort != null)
        {
            InTelePort();
        }

        if (fade)
        {
            yield return(StartCoroutine(ScreenFader.FadeSceneIn()));
        }

        m_Transitioning = false;

        if (afterTeleport != null)
        {
            afterTeleport();
        }
    }
コード例 #4
0
    protected IEnumerator Transition(string newSceneName)
    {
        mTransitioning = true;

        yield return(StartCoroutine(ScreenFader.FadeSceneOut(ScreenFader.FadeType.Loading)));

        yield return(SceneManager.LoadSceneAsync(newSceneName));

        // SetupNewScene(transitionType, entrance);
        yield return(StartCoroutine(ScreenFader.FadeSceneIn()));

        mTransitioning = false;
    }
コード例 #5
0
    IEnumerator DieRespawnCoroutine(bool resetHealth, bool useCheckPoint, float waitTime) // Release user control. Fade out. Respawn. Fade in. Regain control. Currently set up to respawn player on a "gameover" death. Can be set up to pause of gameover canvas and offer choices.
    {
        PlayerInput.Instance.ReleaseControl(true);
        yield return(new WaitForSeconds(waitTime));

        yield return(StartCoroutine(ScreenFader.FadeSceneOut(useCheckPoint ? ScreenFader.FadeType.Black : ScreenFader.FadeType.GameOver)));

        if (!useCheckPoint)
        {
            yield return(new WaitForSeconds(2.0f));
        }

        Respawn(resetHealth, useCheckPoint); // Triggers actual respawn.

        yield return(new WaitForEndOfFrame());

        yield return(StartCoroutine(ScreenFader.FadeSceneIn()));

        PlayerInput.Instance.GainControl();
    }
コード例 #6
0
    public IEnumerator GameOver()
    {
        yield return(new WaitForSeconds(2f));

        SendGameCommand sendGameCommand = new SendGameCommand();

        sendGameCommand.interactionType   = GameCommandType.Open;
        sendGameCommand.interactiveObject = hugeDoor;
        sendGameCommand.coolDown          = 1;
        sendGameCommand.oneShot           = true;
        sendGameCommand.Send();

        yield return(new WaitForSeconds(9f));

        Destroy(boss);
        cameraMain.enabled     = false;
        cameraGameOver.enabled = true;
        Ellen.SetActive(false);
        OnDialogShow.Invoke();
        OnDialogClose.Invoke();

        for (int i = 0; i < 5; i++)
        {
            GameObject person01 = Resources.Load <GameObject>("Prefabs/TT_demo_female");
            Instantiate(person01, spawnPointPerson01.transform.position, spawnPointPerson01.transform.rotation, this.transform);
            yield return(new WaitForSeconds(1f));

            GameObject person02 = Resources.Load <GameObject>("Prefabs/TT_demo_male_A");
            person02.transform.SetPositionAndRotation(spawnPointPerson02.transform.position, spawnPointPerson02.transform.rotation);
            Instantiate(person02, spawnPointPerson02.transform.position, spawnPointPerson02.transform.rotation, this.transform);
            yield return(new WaitForSeconds(1f));

            GameObject person03 = Resources.Load <GameObject>("Prefabs/TT_demo_male_B");
            Instantiate(person03, spawnPointPerson03.transform.position, spawnPointPerson03.transform.rotation, this.transform);
            yield return(new WaitForSeconds(1f));
        }

        ScreenFader.SetAlpha(1f);
        StartCoroutine(ScreenFader.FadeSceneOut(ScreenFader.FadeType.GameOver));
        finishGame = true;
    }
コード例 #7
0
    public IEnumerator DoPlot()
    {
        yield return(StartCoroutine(ScreenFader.FadeSceneOut()));

        HasDone = true;
    }