Esempio n. 1
0
        void Start()
        {
            if (this.IsSharedUpdater(this) && m_Preferences == null)
            {
                m_Preferences = new Preferences();

                // Share one preferences object across all instances
                foreach (var linkedObject in linkedObjects)
                {
                    ((LocomotionTool)linkedObject).m_Preferences = m_Preferences;
                }

                var instance = ObjectUtils.Instantiate(m_RingPrefab, cameraRig, false);
                m_Ring = instance.GetComponent <Ring>();
            }

            m_BlinkVisualsGO          = ObjectUtils.Instantiate(m_BlinkVisualsPrefab, rayOrigin);
            m_BlinkVisuals            = m_BlinkVisualsGO.GetComponentInChildren <BlinkVisuals>();
            m_BlinkVisuals.ignoreList = this.GetVRPlayerObjects();
            m_BlinkVisualsGO.SetActive(false);
            m_BlinkVisualsGO.transform.parent        = rayOrigin;
            m_BlinkVisualsGO.transform.localPosition = Vector3.zero;
            m_BlinkVisualsGO.transform.localRotation = Quaternion.identity;

            var viewerScaleObject = ObjectUtils.Instantiate(m_ViewerScaleVisualsPrefab, cameraRig, false);

            m_ViewerScaleVisuals = viewerScaleObject.GetComponent <ViewerScaleVisuals>();
            viewerScaleObject.SetActive(false);

            InputUtils.GetBindingDictionaryFromActionMap(m_ActionMap, m_Controls);
        }
Esempio n. 2
0
        void Start()
        {
            if (this.IsSharedUpdater(this) && m_Preferences == null)
            {
                m_Preferences = new Preferences();

                // Share one preferences object across all instances
                foreach (var linkedObject in linkedObjects)
                {
                    ((LocomotionTool)linkedObject).m_Preferences = m_Preferences;
                }
            }

            m_BlinkVisualsGO          = ObjectUtils.Instantiate(m_BlinkVisualsPrefab, rayOrigin);
            m_BlinkVisuals            = m_BlinkVisualsGO.GetComponentInChildren <BlinkVisuals>();
            m_BlinkVisuals.ignoreList = this.GetVRPlayerObjects();
            m_BlinkVisualsGO.SetActive(false);
            m_BlinkVisualsGO.transform.parent        = rayOrigin;
            m_BlinkVisualsGO.transform.localPosition = Vector3.zero;
            m_BlinkVisualsGO.transform.localRotation = Quaternion.identity;

            m_MainCamera            = CameraUtils.GetMainCamera();
            m_OriginalNearClipPlane = m_MainCamera.nearClipPlane;
            m_OriginalFarClipPlane  = m_MainCamera.farClipPlane;

            Shader.SetGlobalFloat(k_WorldScaleProperty, 1);

            var viewerScaleObject = ObjectUtils.Instantiate(m_ViewerScaleVisualsPrefab, cameraRig, false);

            m_ViewerScaleVisuals = viewerScaleObject.GetComponent <ViewerScaleVisuals>();
            viewerScaleObject.SetActive(false);

            InputUtils.GetBindingDictionaryFromActionMap(m_ActionMap, m_Controls);
        }
Esempio n. 3
0
 void CreateViewerScaleVisuals(Transform leftHand, Transform rightHand)
 {
     m_ViewerScaleVisuals           = ObjectUtils.Instantiate(m_ViewerScaleVisualsPrefab, cameraRig, false).GetComponent <ViewerScaleVisuals>();
     m_ViewerScaleVisuals.leftHand  = leftHand;
     m_ViewerScaleVisuals.rightHand = rightHand;
 }