This content corresponds to NtUnity.cs version 1.2 or later.
To Table of Contents
UnityDLL07/Assets/Plugins/x86_64/NtKinectDLL.dll
UnityDLL07/Assets/Scripts/NtUnity.cs
File -> New Scene
File -> Save Scene as ... -> Sample07.unity
from above menu -> "Assets" -> "Create" -> "C# Script" -> Rename as "Sample07"
| Sample07.cs |
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();
}
}
|
above Menu -> GameObject -> Create Empty



UnityDLL07/myvideo.avi