PlaySpaceManager.cs 脚本,在 SpatialProcessing预制件上面绑定着:
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Windows.Speech;
using HoloToolkit.Unity;
/// <summary>
/// The SurfaceManager class allows applications to scan the environment for a specified amount of time SurfaceManager类允许应用程序扫描环境指定的时间
/// and then process the Spatial Mapping Mesh (find planes, remove vertices) after that time has expired. 然后时间过后开始处理空间映射网格(找到平面,删除顶点)
/// </summary>
public class PlaySpaceManager : Singleton<PlaySpaceManager>
{
[Tooltip("When checked, the SurfaceObserver will stop running after a specified amount of time.")]
//检查时,SurfaceObserver将在指定的时间后停止运行
public bool limitScanningByTime = true;
[Tooltip("How much time (in seconds) that the SurfaceObserver will run after being started; used when 'Limit Scanning By Time' is checked.")]
//多少时间(以秒为单位),开始后多少秒之后SurfaceObserver将运行,初始设置为30秒
public float scanTime = 30.0f;
[Tooltip("Material to use when rendering Spatial Mapping meshes while the is running.")]
//当observer正在运行时呈现空间映射网格使用的材料
public Material defaultMaterial;
[Tooltip("Optional Material to use when rendering Spatial Mapping meshes after the observer has been stopped.")]
//在observer已经停止后的使用渲染空间映射网格的可选材料
public Material secondaryMaterial;
[Tooltip("Minimum number of floor planes required in order to exit scanning/processing mode.")]
//为了退出扫描/处理模式所需要地板面的最小数量
public uint minimumFloors = 1;
[Tooltip("Minimum number of wall planes required in order to exit scanning/processing mode.")]
//为了退出扫描/处理模式所需要墙面的最小数量
public uint minimumWalls = 1;
/// <summary>
/// Indicates if processing of the surface meshes is complete.
/// </summary>
//用来判断如果表面网格的处理完成。