FadeIn() private method

Fades alpha from 1.0 to 0.0
private FadeIn ( ) : IEnumerator
return IEnumerator
Esempio n. 1
0
    public void TeleportPlayer(GameObject teleportPoint)
    {
        // Add last active teleport point back to the list of available points
        if (activeTeleportPoint != null)
        {
            teleportPoints.Add(activeTeleportPoint);
        }

        // Set and remove the selected point
        activeTeleportPoint = teleportPoint;
        teleportPoints.Remove(teleportPoint);


        // Move the player transform to the desired location
        Vector3 newPosition = teleportPoint.transform.position;

        if (gameState == GameState.Boot)
        {
            sF.SetFadeLevel(1);
            player.transform.position = newPosition;
            sF.FadeIn();
        }
        else
        {
            StartCoroutine(PlayerTransition(newPosition));
        }

        RefreshDisplays();
    }
Esempio n. 2
0
    public IEnumerator LoadNextGame()
    {
        ovrScreenFade.FadeOut();
        yield return(fadeDelay);

        Star.AddNewStar();
        Goal.SetNewPosition(spawningArea.GetGoalRandomPlace());
        Ball.Self.ResetPosition();
        ovrScreenFade.FadeIn();
    }
Esempio n. 3
0
    private void ClickToMove(Ray pointer)
    {
        // If trigger is released, teleport to that location
        if (OVRInput.Get(OVRInput.Axis1D.SecondaryIndexTrigger) < 0.1f && shouldTeleport)
        {
            fader.FadeOut();
            Teleport(teleportPoint);
            fader.FadeIn();
            lastTeleport   = Time.time;
            shouldTeleport = false;
        }

        // Teleporting up the round tower
        if (OVRInput.Get(OVRInput.Axis1D.SecondaryIndexTrigger) < 0.1f && doorTeleport)
        {
            fader.FadeOut();
            Teleport(new Vector3(-40.22f, 15f, -40.56f));
            fader.FadeIn();
            lastTeleport = Time.time;
            doorTeleport = false;
        }

        RaycastHit laserHit;

        // If the ray hits a teleportable location
        if (Physics.Raycast(pointer, out laserHit, 500.0f))
        {
            if (laserHit.transform.gameObject.layer == LayerMask.NameToLayer("CanTeleport"))
            {
                // Display a reticle at the target.
                reticle.SetActive(true);
                reticle.transform.position = laserHit.point + offset;

                if (Time.time - lastTeleport > teleportDelay)
                {
                    shouldTeleport = true;
                    teleportPoint  = laserHit.point;
                }
            }
            else
            {
                reticle.SetActive(false);
                shouldTeleport = false;
            }

            // The round tower door
            if (laserHit.transform.gameObject.layer == LayerMask.NameToLayer("Door"))
            {
                doorTeleport = true;
            }
        }
    }
Esempio n. 4
0
    public void MoveCamera(string direction)
    {
        fader.FadeOut();
        Transform tran = transform;

        if (direction == "Right")
        {
            tran = stat.NextSpot();
            webvrCamera.transform.parent.position = tran.position + new Vector3(0, -1.5f, 0);
            webvrCamera.transform.parent.rotation = tran.rotation;
        }

        else if (direction == "Left")
        {
            tran = stat.PrevSpot();
            webvrCamera.transform.parent.position = tran.position + new Vector3(0, -1.5f, 0);
            webvrCamera.transform.parent.rotation = tran.rotation;
        }

        // User has selected the hotspot
        else if (direction == "HotSpot")
        {
            tran = currentHotspot.transform;
            webvrCamera.transform.position = tran.position;
            currentHotspot.OpenVRPanel();
            dimmer.SetActive(true);
        }

        fader.FadeIn();
    }
Esempio n. 5
0
    public IEnumerator FadeOutIn()
    {
        //Fade In and Fade Out
        fadeMaster.FadeOut();
        yield return(new WaitForSeconds(fadeSeconds));

        QuestionPanels.SetActive(true);
        _playerRB.Acceleration = 0.0f;
        fadeMaster.FadeIn();
    }
Esempio n. 6
0
    // Update is called once per frame
    void Update()
    {
        if (fadeCountDown > 0)
        {
            if (fadeCountDown == fadeTimer)
            {
                screenFade.FadeOut();
            }

            fadeCountDown -= Time.deltaTime;
        }
        else if (transform.position != nextTransform.position)
        {
            transform.SetPositionAndRotation(nextTransform.position, nextTransform.rotation);

            //transform.position = nextTransform.position;
            screenFade.FadeIn();
            fadeCountDown = 0;
        }
    }
Esempio n. 7
0
    /// <summary>
    /// Fading transition between views.
    /// </summary>
    /// <param name="waitTime">Time spent with screen fully black, in seconds</param>
    /// <param name="test">Test methods are to be ran on.</param>
    /// <param name="method">Method ran after fadeout, but before fadein.</param>
    /// <param name="secondMethod">Method ran after fadein.</param>
    /// <param name="fadeout">True if view should fade out, false if cutting straight to black.</param>
    /// <returns></returns>
    IEnumerator WaitThenActivate(float waitTime, Test test, myMethod method = null, myMethod secondMethod = null, bool fadeout = true)
    {
        transitioning = true;
        if (fadeout)
        {
            screenFade.FadeOut();
        }
        yield return(new WaitForSeconds(screenFade.fadeTime));

        if (method != null)
        {
            method(test);
        }
        yield return(new WaitForSeconds(waitTime));

        screenFade.FadeIn();
        if (secondMethod != null)
        {
            secondMethod(test);
        }
        transitioning = false;
    }
Esempio n. 8
0
 //when this function is called the screen fades out, the player is teleported to the last correct steppingstone and then the screen fades back in
 public void LastCorrectRespawn()
 {
     fader.FadeOut();
     Playr.transform.position = lastCorrectPosition + new Vector3(0f, 4.5f, 0f);
     fader.FadeIn();
 }
Esempio n. 9
0
    public IEnumerator UpdateView(string msg)
    {
        //don't allow another action while this is running
        transition = true;

        //reset teleported
        teleported = false;

        SetLabel(msg);

        GameObject textObj = viewLabel;

        textObj.SetActive(true);

        //set text properties
        TextMeshPro text     = textObj.GetComponent <TextMeshPro>();
        Color32     clr      = text.faceColor;
        Color32     otln     = text.outlineColor;
        Color32     underlay = text.fontSharedMaterial.GetColor("_UnderlayColor");

        OVRScreenFade Fader = null;

        if (isLocalPlayer && trackingSpace.transform.Find("CenterEyeAnchor").gameObject.activeSelf)
        {
            Fader = trackingSpace.transform.Find("CenterEyeAnchor").gameObject.GetComponent <OVRScreenFade>();
        }

        if (Fader)
        {
            //fade out
            Fader.fadeTime = 1f;
            Fader.FadeOut();
        }

        //invoke action and short pause
        Invoke("SetView", 1.0f);

        //wait before text fade out
        yield return(new WaitForSeconds(1f));

        if (Fader)
        {
            //fade in
            Fader.fadeTime = 2f;
            Fader.FadeIn();
        }

        //wait before text fade out
        yield return(new WaitForSeconds(1f));

        //fade text out
        float aTime = 0.5f;

        for (float t = 0.0f; t < 1.0f; t += Time.deltaTime / aTime)
        {
            clr.a             = (byte)Mathf.Lerp(255, 0, t);
            text.faceColor    = clr;
            otln.a            = (byte)Mathf.Lerp(255, 0, t);
            text.outlineColor = otln;
            underlay.a        = (byte)Mathf.Lerp(255, 0, t);
            text.fontSharedMaterial.SetColor("_UnderlayColor", underlay);
            yield return(null);
        }

        textObj.SetActive(false);

        //reset text color
        clr.a             = 255;
        text.faceColor    = clr;
        otln.a            = 255;
        text.outlineColor = otln;
        underlay.a        = 255;
        text.fontSharedMaterial.SetColor("_UnderlayColor", underlay);

        //allow another action
        transition = false;
    }
 public static void StartGame()
 {
     FindObjectOfType <WebsocketUploadData>().sendSummary = false;
     screenFade.FadeIn();
 }
Esempio n. 11
0
 private void FadeToNormal()
 {
     ovrsf.FadeIn();
 }
Esempio n. 12
0
    private void ClickToMove(Ray pointer)
    {
        if (Controller.GetPress(SteamVR_Controller.ButtonMask.Touchpad))
        {
            lineRenderer.enabled = true;
            reticle.SetActive(true);

            // Create and draw ray
            lineRenderer.enabled = true;
            lineRenderer.SetPosition(0, pointer.origin);
            lineRenderer.SetPosition(1, pointer.origin + pointer.direction * 500.0f);
            RaycastHit laserHit;


            // If the ray hits a teleportable location
            if (Physics.Raycast(pointer, out laserHit, 500.0f))
            {
                if (laserHit.transform.gameObject.layer == LayerMask.NameToLayer("CanTeleport"))
                {
                    // Display a reticle at the target.
                    reticle.SetActive(true);
                    reticle.transform.position = laserHit.point + offset;

                    if (Time.time - lastTeleport > teleportDelay)
                    {
                        shouldTeleport = true;
                        teleportPoint  = laserHit.point;
                    }
                }
                else
                {
                    reticle.SetActive(false);
                }

                // The round tower door
                if (laserHit.transform.gameObject.layer == LayerMask.NameToLayer("Door"))
                {
                    doorTeleport = true;
                }
            }
        }
        else
        {
            reticle.SetActive(false);
            lineRenderer.enabled = false;
        }

        // If trigger is pressed, teleport to that location
        if (Controller.GetPressUp(SteamVR_Controller.ButtonMask.Touchpad) && shouldTeleport)
        {
            fader.FadeOut();
            Teleport(teleportPoint);
            fader.FadeIn();
            lastTeleport   = Time.time;
            shouldTeleport = false;
        }

        // Teleporting up the round tower
        if (Controller.GetPressUp(SteamVR_Controller.ButtonMask.Touchpad) && doorTeleport)
        {
            fader.FadeOut();
            Teleport(doorTeleportLocation.transform.position);
            fader.FadeIn();
            lastTeleport = Time.time;
            doorTeleport = false;
        }
    }