Esempio n. 1
0
            internal void AddPlayerModel()
            {
                m_PlayerBody = ObjectUtils.Instantiate(evr.m_PlayerModelPrefab, CameraUtils.GetMainCamera().transform, false).GetComponent <PlayerBody>();
                var renderer = m_PlayerBody.GetComponent <Renderer>();

                evr.GetModule <SpatialHashModule>().spatialHash.AddObject(renderer, renderer.bounds);
                var playerObjects = m_PlayerBody.GetComponentsInChildren <Renderer>(true);

                foreach (var playerObject in playerObjects)
                {
                    m_VRPlayerObjects.Add(playerObject.gameObject);
                }

                evr.GetModule <IntersectionModule>().standardIgnoreList.AddRange(m_VRPlayerObjects);
            }
        void AddPlayerModel()
        {
            m_PlayerBody = EditorXRUtils.Instantiate(m_PlayerModelPrefab, CameraUtils.GetMainCamera().transform, false).GetComponent <PlayerBody>();
            this.InjectFunctionalitySingle(m_PlayerBody);
            if (this.HasProvider <IProvidesSpatialHash>())
            {
                this.AddRendererToSpatialHash(m_PlayerBody.GetComponent <Renderer>());
            }

            var playerObjects = m_PlayerBody.GetComponentsInChildren <Renderer>(true);

            foreach (var playerObject in playerObjects)
            {
                m_VRPlayerObjects.Add(playerObject.gameObject);
            }

            var selectionModule = ModuleLoaderCore.instance.GetModule <SelectionModule>();

            if (selectionModule != null)
            {
                selectionModule.standardIgnoreList.AddRange(m_VRPlayerObjects);
            }
        }