예제 #1
0
        // INIT

        void Start()
        {
            canvasGroup = GetComponent <CanvasGroup>();

            galleryStartPosition = transform.position;

            vrGestureUI = transform.parent.GetComponent <VRGestureUI>();

            galleryRB = GetComponent <Rigidbody>();

            galleryState = GestureGalleryState.NotVisible;
            //frameOffset = new Vector3(gridUnitSize / 4, gridUnitSize / 4, -(gridUnitSize / 2));
            frameOffset = new Vector3(0, gridUnitSize / 6, -(gridUnitSize / 2));
            GetHands();
        }
예제 #2
0
 void PanelFocusChanged(string panelName)
 {
     if (panelName == "Editing Menu")
     {
         VRGestureUI.ToggleCanvasGroup(canvasGroup, true);
         currentGesture   = VRGestureManager.Instance.gestureToRecord;
         currentNeuralNet = VRGestureManager.Instance.currentNeuralNet;
         RefreshGestureExamples();
         PositionGestureGallery();
         GenerateGestureGallery();
     }
     else if (panelName == "Edit Menu")
     {
         VRGestureUI.ToggleCanvasGroup(canvasGroup, false);
         DestroyGestureGallery();
     }
 }
예제 #3
0
        // INIT
        void Start()
        {
            gestureSettings = Utils.GetGestureSettings();

            galleryPosition = new Vector3(0, 90, 0);

            canvasGroup = GetComponent <CanvasGroup>();

            galleryStartPosition = transform.position;

            vrGestureUI = transform.parent.GetComponent <VRGestureUI>();

            galleryRB = GetComponent <Rigidbody>();

            galleryState = GestureGalleryState.NotVisible;

            GetHands();
        }
예제 #4
0
        public void FocusPanel(string panelName)
        {
            currentPanel = panelName;

            if (OnPanelFocusChanged != null)
            {
                OnPanelFocusChanged(panelName);
            }

            foreach (CanvasGroup panel in panels)
            {
                if (panel.gameObject.name == panelName)
                {
                    VRGestureUI.ToggleCanvasGroup(panel, true);
                }
                else
                {
                    VRGestureUI.ToggleCanvasGroup(panel, false);
                }
            }
        }
        public void SwitchTutorialState(TutorialState state)
        {
            switch (state)
            {
            case TutorialState.SetupVR:
            {
                CameraUI.enabled = true;
                GetComponent <EventSystem>().enabled = true;
                Canvas.worldCamera = transform.GetComponentInChildren <Camera>();
                        #if UNITY_EDITOR
                PlayerSettings.virtualRealitySupported = false;
                        #endif
                GestureSettings.showVRUI = false;
                if (GestureSettings.Rig != null)
                {
                            #if EDWON_VR_OCULUS
                    GestureSettings.Rig.GetComponent <OVRCameraRig>().enabled = false;
                    GestureSettings.Rig.GetComponent <OVRManager>().enabled   = false;
                            #endif
                    CameraUI.tag = "MainCamera";
                    GestureSettings.Rig.head.GetComponent <Camera>().tag     = "Untagged";
                    GestureSettings.Rig.head.GetComponent <Camera>().enabled = false;
                    GestureSettings.Rig.enabled = false;
                }
            }
            break;

            case TutorialState.InVR:
            {
                CameraUI.enabled = false;
                GetComponent <EventSystem>().enabled = false;
                // set the tutorial canvas UI camera to the VR ui camera
                if (FindObjectOfType <VRGestureUI>() != null)
                {
                    VRGestureUI             ui = FindObjectOfType <VRGestureUI>();
                    LaserPointerInputModule laserPointerInput = ui.GetComponent <LaserPointerInputModule>();
                    Canvas.worldCamera = laserPointerInput.UICamera;
                }
                        #if UNITY_EDITOR
                PlayerSettings.virtualRealitySupported = true;
                        #endif
                GestureSettings.showVRUI = true;
                if (GestureSettings.Rig != null)
                {
                            #if EDWON_VR_OCULUS
                    GestureSettings.Rig.GetComponent <OVRCameraRig>().enabled = true;
                    GestureSettings.Rig.GetComponent <OVRManager>().enabled   = true;
                            #endif
                            #if EDWON_VR_STEAM
                    GestureSettings.Rig.transform.position = new Vector3(0, -1.25f, 1.25f);
                    GestureSettings.Rig.transform.rotation = Quaternion.identity;
                            #endif
                    CameraUI.tag = "Untagged";
                    GestureSettings.Rig.head.GetComponent <Camera>().tag     = "MainCamera";
                    GestureSettings.Rig.head.GetComponent <Camera>().enabled = true;
                    GestureSettings.Rig.enabled = true;
                }
            }
            break;
            }

            TutorialSettings.tutorialState = state;
            SaveTutorialSettings(TutorialSettings);
        }
 public void OnPointerExit()
 {
     VRGestureUI.ToggleCanvasGroup(trash, false, 0);
 }