Load() public method

Loads the SpatialMapping mesh from the specified room object.
public Load ( GameObject roomModel ) : void
roomModel UnityEngine.GameObject The room model to load meshes from.
return void
示例#1
0
        // Use for initialization.
        private void Start()
        {
#if !UNITY_EDITOR
            StartObserver();
#endif

#if UNITY_EDITOR
            objectSurfaceObserver = GetComponent <ObjectSurfaceObserver>();

            if (objectSurfaceObserver != null)
            {
                // In the Unity editor, try loading saved meshes from a model.
                objectSurfaceObserver.Load(objectSurfaceObserver.roomModel);

                if (objectSurfaceObserver.GetMeshFilters().Count > 0)
                {
                    SetSpatialMappingSource(objectSurfaceObserver);
                }
            }
#endif
        }
示例#2
0
        // Use for initialization.
        public void Start()
        {
            /// if not UNITY_EDITOR send a test message
            /// look for a mesh model
            /// load the mesh model
            ///
#if !UNITY_EDITOR
            StartObserver(); // this will switch on the scanning

            /*TestObserver();
             * objectSurfaceObserver = GetComponent<ObjectSurfaceObserver>();
             *
             * if (objectSurfaceObserver != null)
             * {
             *  // In the Unity editor, try loading saved meshes from a model.
             *  objectSurfaceObserver.Load(objectSurfaceObserver.roomModel);
             *
             *  if (objectSurfaceObserver.GetMeshFilters().Count > 0)
             *  {
             *      SetSpatialMappingSource(objectSurfaceObserver);
             *  }
             * }*/
#endif

#if UNITY_EDITOR
            objectSurfaceObserver = GetComponent <ObjectSurfaceObserver>();

            if (objectSurfaceObserver != null)
            {
                // In the Unity editor, try loading saved meshes from a model.
                objectSurfaceObserver.Load(objectSurfaceObserver.roomModel);

                if (objectSurfaceObserver.GetMeshFilters().Count > 0)
                {
                    SetSpatialMappingSource(objectSurfaceObserver);
                }
            }
#endif
        }