Skip to content

Instantly share code, notes, and snippets.

@CameronVetter
Created June 4, 2017 22:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CameronVetter/ad091666bc3d5ab52285f902e68c7e07 to your computer and use it in GitHub Desktop.
Save CameronVetter/ad091666bc3d5ab52285f902e68c7e07 to your computer and use it in GitHub Desktop.
Version 2 - update to work with occlusion
using HoloToolkit.Unity;
using UnityEngine;
public class Speech : MonoBehaviour
{
public SpatialUnderstandingCustomMesh SpatialUnderstandingMesh;
private Material _swapMaterial;
public void Start()
{
_swapMaterial = SpatialUnderstandingMesh.MeshMaterial;
}
public void ToggleMesh()
{
if (SpatialUnderstanding.Instance.ScanState != SpatialUnderstanding.ScanStates.Done) return;
var otherMaterial = SpatialUnderstandingMesh.MeshMaterial;
SpatialUnderstandingMesh.MeshMaterial = _swapMaterial;
_swapMaterial = otherMaterial;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment