コード例 #1
0
 private void _SetSemanticColliderVisible(bool isVisible)
 {
     foreach (GameObject go in semanticList)
     {
         if (go == null)
         {
             continue;
         }
         ViveSR_StaticColliderPool pool = go.GetComponent <ViveSR_StaticColliderPool>();
         if (isVisible)
         {
             if (pool == null)
             {
                 _WaitForSemanticCldPoolToShow(go);
             }
             else
             {
                 pool.ShowAllColliderWithPropsAndCondition(new uint[] { (uint)ColliderShapeType.MESH_SHAPE });
             }
         }
         else
         {
             if (pool != null)
             {
                 pool.HideAllColliderRenderers();
             }
         }
     }
 }
コード例 #2
0
        IEnumerator _CoroutineWaitForSemanticCldPoolToShow(GameObject go)
        {
            ViveSR_StaticColliderPool pool = go.GetComponent <ViveSR_StaticColliderPool>();

            while (pool == null)
            {
                pool = collisionMesh.GetComponent <ViveSR_StaticColliderPool>();
                yield return(new WaitForEndOfFrame());
            }
            pool.ShowAllColliderWithPropsAndCondition(new uint[] { (uint)ColliderShapeType.MESH_SHAPE });
        }
コード例 #3
0
 public void ShowSemanticColliderByType(SceneUnderstandingObjectType type)
 {
     foreach (GameObject go in semanticList)
     {
         ViveSR_StaticColliderPool pool = go.GetComponent <ViveSR_StaticColliderPool>();
         if (type != SceneUnderstandingObjectType.NONE && pool.GetSemanticType() == type)
         {
             if (pool == null)
             {
                 _WaitForSemanticCldPoolToShow(go);
             }
             else
             {
                 pool.ShowAllColliderWithPropsAndCondition(new uint[] { (uint)ColliderShapeType.MESH_SHAPE });
             }
         }
     }
 }
コード例 #4
0
        public void ShowSemanticColliderByType(SceneUnderstandingObjectType type)
        {
            if (type == SceneUnderstandingObjectType.NONE)
            {
                return;
            }

            foreach (GameObject go in semanticList)
            {
                WaitForSemanticCldPool(go, () => {
                    ViveSR_StaticColliderPool pool = go.GetComponent <ViveSR_StaticColliderPool>();
                    {
                        if (pool.GetSemanticType() == type)
                        {
                            pool.ShowAllColliderWithPropsAndCondition(new uint[] { (uint)ColliderShapeType.MESH_SHAPE });
                        }
                    }
                });
            }
        }