コード例 #1
0
    void Start()
    {
        motionBase = GameObject.FindGameObjectWithTag("Player");

        if (motionBase != null)
        {
            guiArrows  = motionBase.GetComponentInChildren <GUIArrows>();
            cameraFade = motionBase.GetComponentInChildren <VRCameraFade>();
            HeadTriggerEventScript ht = motionBase.GetComponentInChildren <HeadTriggerEventScript>();
            if (ht != null)
            {
                ht.OnHeadTriggered += ht_OnHeadTriggered;
            }
        }

        if (guiArrows != null)
        {
            guiArrows.Hide();
        }

        recorder = GetComponent <RecordingServiceBehavior>();

        //Don't destroy the motion tracking base when you load the lobby
        DontDestroyOnLoad(motionBase);
        DontDestroyOnLoad(this.gameObject);

        originalTrafficChangeDelay = trafficLightChangeDelay;

        //load lobby
        SceneManager.LoadScene(1);
    }
コード例 #2
0
        private IEnumerator StartPhase()
        {
            // Make sure the Outro UI is not being shown and the intro UI is.
            StartCoroutine(m_UIController.ShowIntroUI());
            StartCoroutine(m_UIController.HideOutroUI());

            m_CameraContainer.transform.position = new Vector3(0, 0, 0);

            // To make sure the user is facing the right way show the arrows.
            m_GuiArrows.Show();

            // Turn off the fog whilst showing the intro.
            RenderSettings.fog = false;

            // Make sure the game is stopped for the flyer's health.
            m_HealthController.StopGame();

            // Since a selection slider is being used, hide the radial and show the reticle.
            m_SelectionSlider.gameObject.SetActive(true);
            m_SelectionRadial.Hide();
            m_Reticle.Show();
            m_FlyerMovementController.m_Speed = 70f;
            m_flyerPlayership.SetActive(false);



            // The user should hold Fire1 for the selection slider so turn on warnings for tapping.
            m_InputWarnings.TurnOnDoubleTapWarnings();
            m_InputWarnings.TurnOnSingleTapWarnings();

            // In order wait for the selection slider to fill, then the intro UI to hide, then the camera to fade out.
            yield return(StartCoroutine(m_SelectionSlider.WaitForBarToFill()));

            yield return(StartCoroutine(m_UIController.HideIntroUI()));

            yield return(StartCoroutine(m_CameraFade.BeginFadeOut(m_IntroOutroFadeDuration, false)));

            // Once the screen has faded out, we can hide UI elements we don't want to see anymore like the arrows and reticle.
            m_GuiArrows.Hide();
            m_Reticle.Hide();

            // Turn the fog back on so spawned objects won't appear suddenly.
            RenderSettings.fog = true;

            // The user now needs to tap to fire so turn off the warnings.
            m_InputWarnings.TurnOffDoubleTapWarnings();
            m_InputWarnings.TurnOffSingleTapWarnings();

            // Now wait for the screen to fade back in.
            yield return(StartCoroutine(m_CameraFade.BeginFadeIn(m_IntroOutroFadeDuration, false)));
        }
コード例 #3
0
        private IEnumerator StartPhase()
        {
            // Make sure the Outro UI is not being shown and the intro UI is.
            StartCoroutine(m_UIController.ShowIntroUI());
            StartCoroutine(m_UIController.HideOutroUI());

            // To make sure the user is facing the right way show the arrows.
            m_GuiArrows.Show();

            // Turn off the fog whilst showing the intro.
            RenderSettings.fog = false;

            // Make sure the game is stopped for the flyer's health.
            m_HealthController.StopGame();

            // Since a selection slider is being used, hide the radial and show the reticle.
            m_SelectionRadial.Hide();
            m_Reticle.Show();

            // In order wait for the selection slider to fill, then the intro UI to hide, then the camera to fade out.
            yield return(StartCoroutine(m_SelectionSlider.WaitForBarToFill()));

            yield return(StartCoroutine(m_UIController.HideIntroUI()));

            yield return(StartCoroutine(m_CameraFade.BeginFadeOut(m_IntroOutroFadeDuration, false)));

            // Once the screen has faded out, we can hide UI elements we don't want to see anymore like the arrows and reticle.
            m_GuiArrows.Hide();
            m_Reticle.Hide();

            // Turn the fog back on so spawned objects won't appear suddenly.
            RenderSettings.fog = true;

            // Now wait for the screen to fade back in.
            yield return(StartCoroutine(m_CameraFade.BeginFadeIn(m_IntroOutroFadeDuration, false)));
        }
コード例 #4
0
    // Use this for initialization
    void Start()
    {
        guiArrows = GameObject.FindGameObjectWithTag("Player").GetComponentInChildren <GUIArrows>();

        if (guiArrows != null)
        {
            Debug.Log("found gui arrows");
            guiArrows.Hide();
        }

        if (targetOne != null && targetTwo != null)
        {
            targetOneImage = targetOne.GetComponentInChildren <Image>();
            targetTwoImage = targetTwo.GetComponentInChildren <Image>();

            targetOneImage.CrossFadeAlpha(0.0f, 0.1f, true);
            targetTwoImage.CrossFadeAlpha(0.0f, 0.1f, true);

            targetOne.SetActive(false);
            targetTwo.SetActive(false);
        }
    }