// Update is called once per frame void Update() { // if the user is not pressing the trigger, highlight it so they know which one to press if (!OVRInput.Get(OVRInput.Button.PrimaryIndexTrigger)) { m_Manager.HighlightButtonOn(m_Manager.GetTriggerButton()); } // See if they are pointing at the ball and pressing any button other than the main trigger if (m_RaycasterScript.GetTarget() != null) { if (m_RaycasterScript.GetTarget().tag.Contains("_Stage3Button_") && OVRInput.GetDown(OVRInput.Button.Any) && !OVRInput.GetDown(OVRInput.Button.PrimaryIndexTrigger)) { IntroSessionManager.s_Instance.Toast("Be sure your clicking the trigger button...", IntroSessionManager.c_TOAST_LONG); } // See if they are clicking on random things that arn't the ball if (!m_RaycasterScript.GetTarget().tag.Contains("_Stage3Button_") && OVRInput.GetDown(OVRInput.Button.Any)) { IntroSessionManager.s_Instance.Toast("You're clicking on the wrong object, try pointing at the button...", IntroSessionManager.c_TOAST_LONG); } } }
// 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); } } }