Created
June 4, 2017 22:22
-
-
Save CameronVetter/ad091666bc3d5ab52285f902e68c7e07 to your computer and use it in GitHub Desktop.
Version 2 - update to work with occlusion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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