Fades the screen from black after a new scene is loaded.
Inheritance: MonoBehaviour
示例#1
0
    private void Awake()
    {
        main = this;
        DontDestroyOnLoad(this.gameObject);

        OvrScreenFade = transform.Find("TrackingSpace/CenterEyeAnchor").GetComponent <OVRScreenFade>();
    }
示例#2
0
    //bool isTeleporting = false;


    // Use this for initialization
    void Start()
    {
        CheckSingeltonInstance();

        if (player == null)
        {
            player = GameObject.FindGameObjectWithTag(PLAYER_TAG);

            if (player == null)
            {
                throw new Exception("No player has been set in the Game Manager or could be found!");
            }
        }

        if (mainCamera == null)
        {
            mainCamera = Camera.main;
            sF         = mainCamera.transform.GetComponent <OVRScreenFade>();
        }

        InitializeTeleportation();

        if (spawnPoint != null && spawnPoint.GetComponent <RoomInformation>() != null)
        {
            TeleportPlayer(spawnPoint);
        }

        gameState = GameState.Load;
    }
示例#3
0
 private void Start()
 {
     cont         = ovrCamera.GetComponent <CharacterController>();
     fader        = ovrEye.GetComponent <OVRScreenFade>();
     stat         = staticCameras.GetComponent <StaticCamera>();
     offset       = new Vector3(0, 0.05f, 0);
     lastTeleport = Time.time;
 }
示例#4
0
 private void Start()
 {
     screenFader = GameObject.Find(cameraName).GetComponent <OVRScreenFade>();
     if (autoLoad)
     {
         StartCoroutine(AutoLoad());
     }
 }
示例#5
0
    void Start()
    {
        EventBus.Instance.AddListener <BubbleEvent> (OnBubbleEvent);
        EventBus.Instance.AddListener <DataProxyEvent> (OnDataProxyEvent);
        _fader            = Camera.main.GetComponent <OVRScreenFade> ();
        _originalFadeTime = _fader.fadeTime;

        ChangeEnvironment(defaultEnvironmentIndex, null);
    }
 void Start()
 {
     fadeEffect = cameraVR.GetComponent <OVRScreenFade>();
     if (fadeEffect == null)
     {
         Debug.Log("asd");
     }
     fadeTime = 0.4f;
 }
示例#7
0
 // Start is called before the first frame update
 void Start()
 {
     rowNumber                = 0;
     manager                  = codeManager.GetComponent <Manager>();
     lastCorrectPosition      = manager.initialSpawn.transform.position;
     row1FirstTime            = true;
     row2FirstTime            = true;
     row3FirstTime            = true;
     Playr.transform.position = lastCorrectPosition;
     fader = GetComponent <OVRScreenFade>();
 }
示例#8
0
 protected override void Awake()
 {
     //Establecer variables por defecto e inicializar componentes
     base.Awake();
     _visionFade       = GetComponentInChildren <OVRScreenFade>();
     controller        = GetComponent <CharacterController>();
     noiseMaker        = GetComponent <SphereCollider>();
     _allWeapons       = GetComponentsInChildren <Weapon>();
     _IAmDead          = false;
     _busyRightHand    = false;
     _foundFirstWeapon = false;
 }
示例#9
0
    void Start()
    {
        // Get the gameobject references
        var rig = GameObject.Find("OurOVRrig");

        PauseMenu  = rig.transform.Find("PauseCanvas").gameObject;
        Eyetracker = rig.transform.Find("TrackingSpace/CenterEyeAnchor").gameObject;
        HUD        = Eyetracker.transform.Find("HudCanvas").gameObject;
        screenfade = Eyetracker.GetComponent <OVRScreenFade>();

        singleton = this;
        Paused    = false;
    }
示例#10
0
    private IEnumerator TeleportToStart()
    {
        yield return(new WaitForSecondsRealtime(2.0f));

        OVRCameraRig  rig = FindObjectOfType <OVRCameraRig>();
        OVRScreenFade _screenFadeScript = rig.GetComponent <OVRScreenFade>();

        if (_screenFadeScript != null)
        {
            _screenFadeScript.OnLevelFinishedLoading(0);
        }

        Debug.Log($"[OneCellClass] Teleport player back at start. Time = {Time.fixedTime - TheCellGameMgr.instance.GetGameStartTime()}");
        TheCellGameMgr.instance.TeleportToStart();
    }
示例#11
0
    bool TriggerAction()
    {
        // Do whatever you need to do when trap is opening
        Debug.Log($"Exit trap is open now = {transform.position} at {Time.fixedTime}");

        OVRCameraRig  rig = FindObjectOfType <OVRCameraRig>();
        OVRScreenFade _screenFadeScript = rig.GetComponent <OVRScreenFade>();

        if (_screenFadeScript != null)
        {
            //_screenFadeScript.SetFadeLevel(fadeLevel * MaxFade);
            _screenFadeScript.FadeOut();
        }

        return(true);
    }
    // Use this for initialization
    void Start()
    {
        if (character == null)
        {
            character = FindObjectOfType <CharacterController>();
        }
        prePosition = character.transform.position;


        gameState = GameState.WAIT_TO_START;
        if (character != null)
        {
            initialPosition    = character.transform.position;
            initialOrientation = character.transform.rotation;
            screenFade         = character.GetComponentInChildren <OVRScreenFade>();
            Debug.Log(initialPosition);
        }


        // Spwan barriers
        spwanPoints = new Transform[spwanPointGroup.childCount];
        for (int i = 0; i < spwanPointGroup.childCount; i++)
        {
            // spwanPoints[i] = spwanPointGroup.GetChild(i);
            int difficultyRandomNum = Random.Range(0, 100);

            Vector3 spwanPosition = spwanPointGroup.GetChild(i).position;


            var spwanRotation = spwanPointGroup.GetChild(i).rotation;
            if (randomPosition)
            {
                spwanPosition.x = Random.Range(spwanPosition.x - randomPositionRange, spwanPosition.x + randomPositionRange);
                spwanPosition.z = Random.Range(spwanPosition.z - randomPositionRange, spwanPosition.z + randomPositionRange);
                spwanRotation   = Quaternion.Euler(0, Random.Range(0, 360), 0);
            }



            if (difficultyRandomNum < difficulty)
            {
                Instantiate(barriers[Random.Range(0, barriers.Length)], spwanPosition, spwanRotation);
            }
        }
    }
示例#13
0
    private IEnumerator DelayedDeath()
    {
        AudioSource snd = TheCellGameMgr.instance.Audio_DeathScream[0];

        snd.Play();

        yield return(new WaitForSecondsRealtime(3.0f));

        Debug.Log($"[OneCellClass] Kill the player sub {cellSubType}, go back at start. DeathTime = {Time.fixedTime - TheCellGameMgr.instance.GetGameStartTime()}");

        OVRCameraRig  rig = FindObjectOfType <OVRCameraRig>();
        OVRScreenFade _screenFadeScript = rig.GetComponent <OVRScreenFade>();

        if (_screenFadeScript != null)
        {
            _screenFadeScript.fadeColor = new Color(0.5f, 0.0f, 0.0f);
            _screenFadeScript.FadeOut();
        }

        StartCoroutine(TeleportToStart());
    }
示例#14
0
 // Start is called before the first frame update
 void Start()
 {
     logger         = GetComponent <Logger>();
     Time.timeScale = 1.0f;
     testPass       = new TestPass();
     creator        = GameObject.FindObjectOfType <RunTimeTestCreator>();
     //SetUpTests();
     SetUpTutorialTests();
     logger.Log("tutorialActive: " + tutorialActive);
     logger.Log("tutorials count: " + tutorialTests.Count);
     DisableAllTests(GetAllTestsInScene());
     screenFade        = FindObjectOfType <OVRScreenFade>();
     selectionHandler  = gameObject.GetComponent <SelectionHandler>();
     cameraRig         = FindObjectOfType <OVRCameraRig>();
     playerController  = GameObject.Find("OVRPlayerController");
     A_Button_Tooltip  = GameObject.Find("A_Button_Tooltip");
     X_Button_Tooltip  = GameObject.Find("X_Button_Tooltip");
     R2_Button_Tooltip = GameObject.Find("R2_Button_Tooltip");
     DisableTooltips(R2: false, A: false);
     UpdateInfoText();
 }
 // Use this for initialization
 void Start()
 {
     scenefade = FindObjectOfType <OVRScreenFade>();
     scenefade.fade(Color.white, 1, 0, 2.0f);
 }
示例#16
0
 void Start()
 {
     fade = FindObjectOfType <OVRScreenFade>();
     Debug.Log(fade);
 }
示例#17
0
 void Start()
 {
     fader = Camera.main.transform.GetComponent <OVRScreenFade>();
 }
示例#18
0
 private void Start()
 {
     fader  = webvrEye.GetComponent <OVRScreenFade>();
     stat   = staticCameras.GetComponent <StaticCamera>();
     offset = new Vector3(0, 0.05f, 0);
 }
 private void Awake()
 {
     mainSkybox = FindObjectOfType <Skybox>();
     screenFade = FindObjectOfType <OVRScreenFade>();
 }
示例#20
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;
    }
示例#21
0
 // Start is called before the first frame update
 void Start()
 {
     nextTransform = transform;
     screenFade    = GetComponentInChildren <OVRScreenFade>();
     fadeTimer     = screenFade.fadeTime;
 }