コード例 #1
0
ファイル: spawnPoint.cs プロジェクト: Etheal/The-Hospital
    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);
    }
コード例 #2
0
ファイル: spawnPoint.cs プロジェクト: XXPabloxX/The-Hospital
    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();
    }
コード例 #3
0
    IEnumerator NavGen()
    {
        //Waits a few seconds for the level to generate then bakes a navmesh for the AI to use
        yield return(new WaitForSeconds(0.5f));

        nav.BuildNavMesh();
        f.FadeIn(1);
    }
コード例 #4
0
    IEnumerator AcionarPorta()
    {
        fade.FadeIn();
        yield return(new WaitWhile(() => fade.fume.color.a < 0.9f));

        _PlayerScript.gameObject.SetActive(false);
        switch (escuro)
        {
        case true:
            _PlayerScript.ChangeMaterial(luz2D);
            break;

        case false:
            _PlayerScript.ChangeMaterial(padrao2D);
            break;
        }
        _PlayerScript.transform.position = destino.position;
        yield return(new WaitForSeconds(0.3f));

        _PlayerScript.gameObject.SetActive(true);
        fade.FadeOut();
    }
コード例 #5
0
 // Update is called once per frame
 void Update()
 {
     Flash();
     if (Input.GetMouseButton(0))
     {
         if (!CountFalg)
         {
             TitleAudio.volume *= 0.5f;
             TapAudio.Play();
         }
         CountFalg = true;
     }
     if (CountFalg == true)
     {
         count += 0.1f;
         fade d2 = Fadefnc.GetComponent <fade>();
         d2.FadeIn();
         if (count > 5f)
         {
             SceneManager.LoadScene("Main");
             CountFalg = false;
         }
     }
 }
コード例 #6
0
ファイル: MenuController.cs プロジェクト: longhousedev/adrift
 private void Start()
 {
     f     = GameObject.FindWithTag("Fader").GetComponent <fade>();
     fader = GameObject.FindWithTag("Fader");
     f.FadeIn(0.5f);
 }