Exemplo n.º 1
0
        bool LoadChair()
        {
            StaticMeshScript.ClearHintLocators();

            GameObject[] chairs = StaticMeshScript.GetSemanticObjects(SceneUnderstandingObjectType.CHAIR);

            if (chairs.Length == 0)
            {
                return(false);
            }

            for (int i = 0; i < chairs.Length; i++)
            {
                GameObject go = chairs[i];
                ViveSR_Experience_Chair chair             = go.AddComponent <ViveSR_Experience_Chair>();
                ViveSR_SceneUnderstanding.SceneObject obj = ViveSR_SceneUnderstanding.GetCorrespondingSceneObject(go.name);
                if (obj.objTypeID == SceneUnderstandingObjectType.NONE)
                {
                    Debug.Log("[SemanticSegmentation] Cannot find corresponding game object.");
                    return(false);
                }
                chair.CreateChair(obj.positions[0], obj.forward); //move chair
                MR_Chairs.Add(chair);
            }

            return(true);
        }