Ejemplo 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);
        }
Ejemplo 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);
        }
Ejemplo n.º 3
0
        private void Start()
        {
            m_BlinkVisualsGO       = ObjectUtils.Instantiate(m_BlinkVisualsPrefab, rayOrigin);
            m_BlinkVisuals         = m_BlinkVisualsGO.GetComponentInChildren <BlinkVisuals>();
            m_BlinkVisuals.enabled = false;
            m_BlinkVisuals.showValidTargetIndicator  = false;            // We don't define valid targets, so always show green
            m_BlinkVisualsGO.transform.parent        = rayOrigin;
            m_BlinkVisualsGO.transform.localPosition = Vector3.zero;
            m_BlinkVisualsGO.transform.localRotation = Quaternion.identity;

            Shader.SetGlobalFloat(k_WorldScaleProperty, 1);
        }