Exemple #1
0
    /// <summary>
    /// This coroutine will fade out the view, perform the teleport, and then fade the view
    /// back in.
    /// </summary>
    /// <returns></returns>
    protected IEnumerator BlinkCoroutine()
    {
        LocomotionTeleport.IsTransitioning = true;
        float elapsedTime  = 0;
        var   teleportTime = TransitionDuration * TeleportDelay;
        var   teleported   = false;

        while (elapsedTime < TransitionDuration)
        {
            yield return(null);

            elapsedTime += Time.deltaTime;
            if (!teleported && elapsedTime >= teleportTime)
            {
                teleported = true;
                LocomotionTeleport.DoTeleport();
            }
            float fadeLevel = FadeLevels.Evaluate(elapsedTime / TransitionDuration);
            GetComponent <OVRScreenFade>().SetFadeLevel(fadeLevel);
        }

        GetComponent <OVRScreenFade>().SetFadeLevel(0);

        LocomotionTeleport.IsTransitioning = false;
    }
Exemple #2
0
    /// <summary>
    /// This coroutine will fade out the view, perform the teleport, and then fade the view
    /// back in.
    /// </summary>
    /// <returns></returns>
    protected IEnumerator BlinkCoroutine()
    {
        LocomotionTeleport.IsTransitioning = true;
        float elapsedTime  = 0;
        var   teleportTime = TransitionDuration * TeleportDelay;
        var   teleported   = false;

        while (elapsedTime < TransitionDuration)
        {
            yield return(null);

            elapsedTime += Time.deltaTime;
            if (!teleported && elapsedTime >= teleportTime)
            {
                teleported = true;
                LocomotionTeleport.DoTeleport();
            }
            //float fadeLevel = FadeLevels.Evaluate(elapsedTime / TransitionDuration);
            //OVRInspector.instance.fader.SetFadeLevel(fadeLevel);
        }

        //OVRInspector.instance.fader.SetFadeLevel(0);

        LocomotionTeleport.IsTransitioning = false;
    }
Exemple #3
0
 /// <summary>
 /// When the teleport state is entered, simply move the player to the new location
 /// without any delay or other side effects.
 /// </summary>
 protected override void LocomotionTeleportOnEnterStateTeleporting()
 {
     LocomotionTeleport.DoTeleport();
 }