using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Sample07 : MonoBehaviour {
  NtUnity.Kinect nt;
  bool onSave;
  void Start () {
    nt = new NtUnity.Kinect();
    onSave = false;
  }
  void Update () {
    nt.setRGB();
    nt.setSkeleton();
    nt.setFace();
    nt.imshowBlack();
    if (Input.GetMouseButtonDown(0)) {
      if (onSave) {
	nt.closeVideo();
	onSave = false;
      } else {
	nt.openVideo("myvideo.avi");
	onSave = true;
      }
    }
    if (onSave) {
      nt.writeVideo();
    }
  }
  void OnApplicationQuit() {
    nt.stopKinect();
  }
}
