Esempio n. 1
0
        public void SetTargetTransform(VRController.VRDevice vrDevice, VRController.VRInput vrInput)
        {
            if (vrDevice == VRController.VRDevice.LeftController)
            {
                floatTowards.target2 = tutorialScriptableObject.vrController.leftController;
            }
            else
            {
                floatTowards.target2 = tutorialScriptableObject.vrController.rightController;
            }

            ResetInputHighlightMeshRenderer();

            if (vrDevice != VRController.VRDevice.None && vrInput != VRController.VRInput.None)
            {
                Transform newTarget = tutorialScriptableObject.vrController.VRInputToTransform(vrDevice, vrInput);

                tutorialScriptableObject.FlashObject(newTarget);

                if (newTarget != null)
                {
                    tutorialLine.enabled = true;
                    tutorialLine.object1 = newTarget;
                }
                else
                {
                    tutorialLine.enabled = false;
                    tutorialLine.object1 = null;
                }
            }
            else
            {
                tutorialLine.enabled = false;
            }
        }
 void SetVerticalJoystickArrowVisibility(VRController.VRDevice vrDevice, bool visible)
 {
     if (vrDevice == VRController.VRDevice.LeftController)
     {
         if (leftJoystickUpArrow != null)
         {
             leftJoystickUpArrow.gameObject.SetActive(visible);
         }
         if (leftJoystickDownArrow != null)
         {
             leftJoystickDownArrow.gameObject.SetActive(visible);
         }
     }
     else
     {
         if (rightJoystickUpArrow != null)
         {
             rightJoystickUpArrow.gameObject.SetActive(visible);
         }
         if (rightJoystickDownArrow != null)
         {
             rightJoystickDownArrow.gameObject.SetActive(visible);
         }
     }
 }
Esempio n. 3
0
        public void Next(int completions, int maxCompletions)
        {
            if (currentStep < tutorialSteps.Length)
            {
                tutorialScriptableObject.vrController.Vibrate(tutorialSteps[currentStep].vrDeviceToHighlight, .03f, 1f, .5f);

                if (completions >= maxCompletions)
                {
                    ResetInputHighlightMeshRenderer();

                    currentStep++;

                    if (currentStep < tutorialSteps.Length)
                    {
                        tutorialScriptableObject.vrController.Vibrate(tutorialSteps[currentStep].vrDeviceToHighlight, .03f, 1f, .5f);
                        VRController.VRDevice vrDevice = tutorialSteps[currentStep].vrDeviceToHighlight;
                        VRController.VRInput  vrInput  = tutorialSteps[currentStep].vrInputToHighlight;
                        SetTargetTransform(vrDevice, vrInput);
                    }
                    else
                    {
                        tutorialScriptableObject.HideAllJoystickArrows();

                        tutorialScriptableObject.SetTutorialOpen(null);

                        if (tutorialActivator.reoccuring)
                        {
                            currentStep = 0;
                        }
                        else
                        {
                            tutorialActivator.enabled = false;
                        }

                        gameObject.SetActive(false);
                    }
                }
                else
                {
                    audioSource.PlayOneShot(subObjectiveCompleteSoundEffect);
                }

                EnableCurrentTutorialStep(completions, maxCompletions);
            }
        }
        public void ShowJoystickArrows(VRController.VRDevice vrDevice, VRController.VRInput vrInputToHighlight)
        {
            HideAllJoystickArrows();

            switch (vrInputToHighlight)
            {
            case VRController.VRInput.JoystickHorizontal:
                SetHorizontalJoystickArrowVisibility(vrDevice, true);
                break;

            case VRController.VRInput.JoystickVertical:
                SetVerticalJoystickArrowVisibility(vrDevice, true);
                break;

            case VRController.VRInput.JoystickClick:
                SetJoystickClickArrowVisibility(vrDevice, true);
                break;
            }
        }