Ejemplo n.º 1
0
    IEnumerator _CrossDoor(UnityStandardAssets.Characters.ThirdPerson.ThirdPersonCharacter character)
    {
        fade.FadeIn();

        while (fade.IsFading())
        {
            yield return null;
        }

        Vector3 posicionDestino = _spawnPoint.transform.position;
        Vector3 rotacionDestino = _spawnPoint.transform.eulerAngles;

        agent.enabled = false;
        character.transform.position = posicionDestino;
        character.transform.eulerAngles = rotacionDestino;
        agent.enabled = true;

        SceneManager.UnloadSceneAsync(sceneToUnload);
        AsyncOperation ao = SceneManager.LoadSceneAsync(sceneToload, LoadSceneMode.Additive);

        while (!ao.isDone)
        {
            yield return null;
        }

        fade.FadeOut();

        GameObject.Find("Button").GetComponent<Click>().GetPosicionActual(posicion);
        GameObject.Find("Sarah").GetComponent<AICharacterControl>().SetTarget(posicionDestino);
    }
Ejemplo n.º 2
0
    IEnumerator _CrossDoor(UnityStandardAssets.Characters.ThirdPerson.ThirdPersonCharacter character)
    {
        fade.FadeIn();

        while (fade.IsFading())
        {
            yield return(null);
        }

        Vector3 posicionDestino = _spawnPoint.transform.position;
        Vector3 rotacionDestino = _spawnPoint.transform.eulerAngles;

        character.transform.position    = posicionDestino;
        character.transform.eulerAngles = rotacionDestino;

        SceneManager.UnloadSceneAsync(sceneToUnload);
        AsyncOperation ao = SceneManager.LoadSceneAsync(sceneToload, LoadSceneMode.Additive);

        while (!ao.isDone)
        {
            yield return(null);
        }

        fade.FadeOut();
    }