示例#1
0
    private IEnumerator movementTransition()                        // fade to black and unfade for transition
    {
        sceneFader.StartFade();
        yield return(new WaitForSeconds(1));

        windParticles.SetActive(!windParticles.activeSelf);
        isFlying = !isFlying;

        if (isFlying == false)                                       // fade out sound
        {
            float startVolume = windSound.volume;
            while (windSound.volume > 0)
            {
                windSound.volume -= startVolume * Time.deltaTime / 1;
                yield return(null);
            }
        }
        else                                                        // fade in sound
        {
            while (windSound.volume < 1)
            {
                windSound.volume += 1 * Time.deltaTime / 1;
                yield return(null);
            }
        }
    }
示例#2
0
 private void Update()
 {
     if (Vector3.Distance(gameObject.transform.position, headset.transform.position) <= requiredDistance)
     {
         sceneFader.StartFade();
     }
 }
示例#3
0
    private IEnumerator BackToHive()                        // fade to black and unfade for transition
    {
        sceneFader.StartFade();
        yield return(new WaitForSeconds(1));

        progress = 1.0f;
        player.transform.position = startLocation;
        StartCoroutine(updateHealth());
    }
示例#4
0
    private IEnumerator MoveToScene()                        // fade to black and unfade for transition
    {
        sceneFader.StartFade();
        yield return(new WaitForSeconds(1));

        buttonXHighlight.SetActive(false);
        gameObject.GetComponent <MeshRenderer>().enabled = false;
        beeLeftControls.SetActive(true);
        SceneManager.LoadScene("BeeScene");
    }
    void Update()
    {
        // Get the distance between the headset and the goggles
        float dist = Vector3.Distance(gameObject.transform.position, centerEyeAnchor.transform.position);

        // If the distance is within the threshold, and a fade has not yet been initialized, initialize a fade
        if (dist <= threshold && !sceneFader.IsFading())
        {
            sceneFader.StartFade();
        }
    }