本トピックスの内容は、NtUnity.cs version 1.2 以降に対応します。
目次へ
UnityDLL07/Assets/Plugins/x86_64/NtKinectDLL.dll
UnityDLL07/Assets/Scripts/NtUnity.cs
File -> New Scene
File -> Save Scene as ... -> Sample07.unity
上部のメニューから「Assets」-> 「Create」 -> 「C# Script」 -> ファイル名は 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();
}
}
|
上のメニューから -> GameObject -> Create Empty



UnityDLL07/myvideo.avi