コード例 #1
0
ファイル: Stage4.cs プロジェクト: connor-roche/Launch-into-VR
    private float m_timer;                                                   // Keep track of time between ball drop fails



    // Use this for initialization
    void Start()
    {
        // Make the script a singleton
        if (s_Instance == null)
        {
            s_Instance        = this;
            m_Manager         = IntroSessionManager.s_Instance;
            m_RaycasterScript = IntroSessionManager.s_RaycasterScript;
            m_timer           = 0;

            // Spawn a ball for the user
            m_Manager.SpawnNewBall();

            // Display text and playback audio for dialogue, then wait for the audio to finish before continuing
            m_Manager.GlobalMessage(m_DialogueInstructions.DialogueElements[0]);

            // Open the trap door and reset the timer
            Debug.Log("STAGE4 CALLING OPENING SLIDING DOORS");
            m_Manager.OpenSlidingDoors();
        }
        else
        {
            Destroy(gameObject);
        }
    }
コード例 #2
0
ファイル: Stage1.cs プロジェクト: connor-roche/Launch-into-VR
    private GameObject m_CenterEyeAnchor;                           // Reference to the CenterEyeAnchor on the OVRCameraRig in Scene0



    // Use this for initialization
    void Start()
    {
        if (s_Instance == null)
        {
            s_Instance        = this;
            m_Manager         = IntroSessionManager.s_Instance;
            m_CenterEyeAnchor = m_Manager.GetCenterEyeAnchor();
            m_RaycasterScript = m_CenterEyeAnchor.GetComponent <RaycasterVR>();
            m_LoadingBar      = m_Manager.GetLoadingBar();
            m_Reticle         = m_Manager.GetReticle();

            m_Manager.GetControllerModel().SetActive(false);                                                // Make sure the controller model is hidden since it is shown after this scene.
            m_ArrowsList = new string[4] {
                "ArrowLeft", "ArrowUp", "ArrowRight", "ArrowDown"
            };                                                                                              // The order in which the user is supposed to look at the arrows.
            i_CurrentArrow = 0;                                                                             // Starts at the left arrow
            m_RaycasterScript.m_OverrideDefaultReticleControls = true;                                      // Override the default controls of the reticle
            FaceArrowsToUser();                                                                             // Face the arrows towards the user

            m_Manager.GlobalMessage(m_DialogueInstructions.DialogueElements[0]);
        }
        else
        {
            Destroy(gameObject);
        }
    }
コード例 #3
0
    /// <summary>
    /// Controls the flow of the scene.
    /// </summary>
    /// <returns>A reference to the coroutine</returns>
    private IEnumerator Run()
    {
        m_Manager.MoveRobotToPosition(m_RobotEndPosition.transform.position);

        m_Manager.GlobalMessage(m_DialogueInstructions.DialogueElements[0]);

        yield return(new WaitForSeconds(m_DialogueInstructions.DialogueElements[0].PlayBackSoundFile.length));

        StartCoroutine(FadingOut());
    }
コード例 #4
0
ファイル: Stage2.cs プロジェクト: connor-roche/Launch-into-VR
    // Update is called once per frame
    void Update()
    {
        // Check if the user has their controller connected
        if (OVRInput.IsControllerConnected(OVRInput.Controller.RTrackedRemote) || OVRInput.IsControllerConnected(OVRInput.Controller.LTrackedRemote))
        {
            if (m_IntroNotStarted)
            {
                // Begin the scene
                m_Manager.HighlightButtonOn(m_Manager.GetHomeButton());
                m_Manager.GlobalMessage(m_DialogueInstructions.DialogueElements[0]);
                m_IntroNotStarted = false;
            }
        }
        else
        {
            m_Manager.GlobalMessage("Please connect your controller!");
        }

        //checks if other buttons are pressed for fail point
        if (OVRInput.GetDown(OVRInput.Button.PrimaryTouchpad) || OVRInput.GetDown(OVRInput.Button.Back) || OVRInput.GetDown(OVRInput.Button.PrimaryIndexTrigger))
        {
            i_ErrorCounter++;
            if (i_ErrorCounter % m_NumberOfTries == 0)
            {
                IntroSessionManager.s_Instance.Toast("Look down at the controller to see what button to press.", IntroSessionManager.c_TOAST_SHORT);
            }
        }

        // Check if the user has recentered correctly
        if (m_CheckRecenter)
        {
            if (OVRInput.GetControllerWasRecentered(OVRInput.Controller.RTrackedRemote) ||
                OVRInput.GetControllerWasRecentered(OVRInput.Controller.LTrackedRemote))
            {
                // End the scene
                m_CheckRecenter = false;
                m_Manager.HighlightButtonOff(m_Manager.GetHomeButton());
                m_Manager.MoveToNextStage(1f);
            }
        }
    }
コード例 #5
0
ファイル: Stage3.cs プロジェクト: connor-roche/Launch-into-VR
    /// <summary>
    /// Controls the flow of the scene.
    /// </summary>
    /// <returns>A reference to the coroutine</returns>
    private IEnumerator Run()
    {
        m_Manager.HighlightButtonOn(m_Manager.GetTriggerButton());
        m_Manager.GlobalMessage(m_DialogueInstructions.DialogueElements[0]);

        // wait for half of the dialogue to play before beginning to open the doors
        yield return(new WaitForSeconds(m_DialogueInstructions.DialogueElements[0].PlayBackSoundFile.length / 2));

        // Open the sliding doors and bring the box into the scene
        m_Manager.OpenSlidingDoors();
        m_Manager.BringBoxIntoScene();

        // Wait until audio finishes playing before moving the robot
        yield return(new WaitForSeconds(m_DialogueInstructions.DialogueElements[0].PlayBackSoundFile.length / 2 + 1f));

        m_Manager.MoveRobotToPosition(c_RobotLocationNearButton);   // Move the robot near the button
    }
コード例 #6
0
ファイル: Stage6.cs プロジェクト: connor-roche/Launch-into-VR
 /// <summary>
 /// Controls the flow of the scene.
 /// </summary>
 /// <returns>A reference to the coroutine</returns>
 private void Run()
 {
     StartCoroutine(ShowTargets());
     m_Manager.GlobalMessage(m_DialogueInstructions.DialogueElements[0]);
 }
コード例 #7
0
ファイル: Stage5.cs プロジェクト: connor-roche/Launch-into-VR
 /// <summary>
 /// Controls the flow of the scene.
 /// </summary>
 private void Run()
 {
     m_Manager.GlobalMessage(m_DialogueInstructions.DialogueElements[0]);
     StartCoroutine(CheckForFails());
 }