Commit 23a51b49 authored by 16서원빈's avatar 16서원빈

Apply Kinect Script

parent 3498ace1
fileFormatVersion: 2
guid: 370ceeb4338949c458d2c4831721adcc
folderAsset: yes
timeCreated: 1502957664
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 8563af7e17548df4db018f658370cf05
folderAsset: yes
timeCreated: 1502957664
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 85bafbe9b14b18b45b445b304b1f3efc
timeCreated: 18446744011573954816
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: b51ad12a45add75438b0b8494a1b5bc0
timeCreated: 18446744011573954816
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 82be2ecc1ba65e94f8d03335c7969a8d
folderAsset: yes
timeCreated: 1502957664
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 1db2dc2b011493340af3c486814773b6
timeCreated: 18446744011573954816
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: b65facb0c9c68b647b8ca7435b5f35c4
timeCreated: 18446744011573954816
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 1c16b6c4f21217940a45b0a7980bbaa4
timeCreated: 18446744011573954816
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 3404b8810d8d9bd40a69b6ddb8d40ec0
folderAsset: yes
timeCreated: 1502958445
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: e64ddea403d2dab41a0b9e06194e24a8
timeCreated: 18446744011573954816
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 3b9258fe0bd5fa44fbb9b84edddc8a80
timeCreated: 18446744011573954816
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: dc48a865720f47745baa454faadba922
folderAsset: yes
timeCreated: 1502957664
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 56fe3b4f6cf934645b95af4f873f5dae
timeCreated: 18446744011573954816
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 82e143d16729051459ae6a54b37e9eab
timeCreated: 18446744011573954816
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: bd1efe6facd8abe48967be99b7e8bb6e
timeCreated: 18446744011573954816
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: dc8b7a4f52179304abb4308e1f5dc486
folderAsset: yes
timeCreated: 1502958445
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 92bd007400232df44a5145238b2ee5f7
timeCreated: 18446744011573954816
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: b23429c6264008d44b3e037dfa9712c4
timeCreated: 18446744011573954816
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
...@@ -38,7 +38,7 @@ RenderSettings: ...@@ -38,7 +38,7 @@ RenderSettings:
m_ReflectionIntensity: 1 m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0} m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0} m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.45120573, g: 0.50094587, b: 0.5736755, a: 1} m_IndirectSpecularColor: {r: 0.45120597, g: 0.5009464, b: 0.5736766, a: 1}
--- !u!157 &3 --- !u!157 &3
LightmapSettings: LightmapSettings:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
...@@ -349,6 +349,7 @@ GameObject: ...@@ -349,6 +349,7 @@ GameObject:
- component: {fileID: 750753104} - component: {fileID: 750753104}
- component: {fileID: 750753105} - component: {fileID: 750753105}
- component: {fileID: 750753106} - component: {fileID: 750753106}
- component: {fileID: 750753107}
m_Layer: 5 m_Layer: 5
m_Name: Managers m_Name: Managers
m_TagString: Untagged m_TagString: Untagged
...@@ -396,6 +397,7 @@ MonoBehaviour: ...@@ -396,6 +397,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 6e697643158480b4ba850d906eac1bc2, type: 3} m_Script: {fileID: 11500000, guid: 6e697643158480b4ba850d906eac1bc2, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
txt: {fileID: 0}
--- !u!114 &750753106 --- !u!114 &750753106
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
...@@ -407,6 +409,17 @@ MonoBehaviour: ...@@ -407,6 +409,17 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: a9d22e7eb4921ca47b18c68e43c0eb6e, type: 3} m_Script: {fileID: 11500000, guid: a9d22e7eb4921ca47b18c68e43c0eb6e, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
--- !u!114 &750753107
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 750753102}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c957a7b7e1e0a87438d12097932a611d, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &754707498 --- !u!1001 &754707498
Prefab: Prefab:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
......
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
using System.IO;
using UnityEngine.UI;
public class InputManager : MonoBehaviour { public class InputManager : MonoBehaviour {
private static InputManager instance; private static InputManager instance;
KinectScript ks;
bool isUpdating = false;
public Text txt;
public static InputManager Instance public static InputManager Instance
{ {
get get
...@@ -20,6 +27,8 @@ public class InputManager : MonoBehaviour { ...@@ -20,6 +27,8 @@ public class InputManager : MonoBehaviour {
private bool IsButtonDown { get; set; } private bool IsButtonDown { get; set; }
public Pair<float, MotionState> CurrentMotionState { get; set; }
public bool IsButtonPressed public bool IsButtonPressed
{ {
get get
...@@ -47,11 +56,25 @@ public class InputManager : MonoBehaviour { ...@@ -47,11 +56,25 @@ public class InputManager : MonoBehaviour {
// Use this for initialization // Use this for initialization
void Start() void Start()
{ {
ks = GameObject.Find("Managers").GetComponent<KinectScript>();
} }
// Update is called once per frame // Update is called once per frame
void Update() void Update()
{ {
IsButtonDown = Input.anyKey; IsButtonDown = Input.anyKey;
if(!isUpdating)
{
isUpdating = true;
ks.StartUpdating();
}
CurrentMotionState = ks.GetState();
if(CurrentMotionState!=null)
Debug.Log(CurrentMotionState.second.ToString());
GameObject.Find("Wall").GetComponent<Renderer>().material.mainTexture = ks.GetImage();
} }
} }
\ No newline at end of file
...@@ -97,6 +97,19 @@ public class JudgeManager : MonoBehaviour ...@@ -97,6 +97,19 @@ public class JudgeManager : MonoBehaviour
} }
} }
if (note is MotionNote)
{
((MotionNote)note).Checkpoint();
if (note.Activated)
{
SetJudge(Judge.TestJudge(note, timing));
DeactivateNote(note);
}
return;
}
Judge judge = Judge.TestJudge(note, timing); Judge judge = Judge.TestJudge(note, timing);
if (Judge.IsNonEmptyMiss(note, timing)) if (Judge.IsNonEmptyMiss(note, timing))
......
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Windows.Kinect;
using System.IO;
public class KinectScript : MonoBehaviour
{
KinectSensor sensor;
MultiSourceFrameReader msfReader;
KinectImage image;
KinectMotion motion = new KinectMotion();
bool isUpdating = false;
// Use this for initialization
void Start()
{
sensor = KinectSensor.GetDefault();
if (sensor == null)
return;
msfReader = sensor.OpenMultiSourceFrameReader(FrameSourceTypes.Color |
FrameSourceTypes.Depth |
FrameSourceTypes.Body);
image = new KinectImage(
sensor.ColorFrameSource.CreateFrameDescription(
ColorImageFormat.Rgba));
if (!sensor.IsOpen)
sensor.Open();
}
// Update is called once per frame
void Update()
{
if (isUpdating)
Update(image);
}
void AccurateUpdate()
{
if (isUpdating)
Update(motion);
}
void Update(KinectData data)
{
if (msfReader == null)
return;
var frame = msfReader.AcquireLatestFrame();
if (frame == null)
return;
data.Update(frame);
}
public void StartUpdating()
{
isUpdating = true;
InvokeRepeating("AccurateUpdate", 0, 0.001f);
}
public void StopUpdating()
{
isUpdating = false;
CancelInvoke("AccurateUpdate");
}
private void OnApplicationQuit()
{
StopUpdating();
if (msfReader == null)
return;
msfReader.Dispose();
msfReader = null;
if (sensor == null)
return;
if (sensor.IsOpen)
sensor.Close();
sensor = null;
}
public Texture2D GetImage()
{
return image.GetImage();
}
public Pair<float, MotionState> GetState()
{
return motion.GetState();
}
}
public abstract class KinectSource
{
public abstract void Update(MultiSourceFrame frame);
}
public class KinectBody : KinectSource
{
Body[] body = null;
public Dictionary<JointType, Windows.Kinect.Joint> joints
{
get;
private set;
}
public KinectBody()
{
joints = null;
}
public override void Update(MultiSourceFrame frame)
{
BodyFrame bFrame = frame.BodyFrameReference.AcquireFrame();
if (body == null)
body = new Body[bFrame.BodyCount];
bFrame.GetAndRefreshBodyData(body);
bFrame.Dispose();
bFrame = null;
UpdateBodyData();
}
private void UpdateBodyData()
{
int idx;
for (idx = 0; idx < body.Length; ++idx)
if (body[idx].IsTracked)
break;
if (idx >= body.Length)
return;
joints = body[idx].Joints;
}
}
public class KinectColor : KinectSource
{
public byte[] texel
{ get; private set; }
public KinectColor(FrameDescription frameDesc)
{
texel = new byte[frameDesc.BytesPerPixel * frameDesc.LengthInPixels];
}
public override void Update(MultiSourceFrame frame)
{
ColorFrame cFrame = frame.ColorFrameReference.AcquireFrame();
cFrame.CopyConvertedFrameDataToArray(texel, ColorImageFormat.Rgba);
cFrame.Dispose();
cFrame = null;
}
}
[System.Flags]
public enum MotionState : uint
{
UNKNOWN = 0,
CLAP_PREPARE = 1,
CLAP_DONE = 2,
HURRAY = 4
}
public abstract class KinectData
{
public abstract void Update(MultiSourceFrame frame);
}
public class KinectImage : KinectData
{
Texture2D image;
KinectColor color;
public KinectImage(FrameDescription frameDesc)
{
image = new Texture2D(frameDesc.Width,
frameDesc.Height,
TextureFormat.RGBA32,
false);
color = new KinectColor(frameDesc);
}
public override void Update(MultiSourceFrame frame)
{
color.Update(frame);
image.LoadRawTextureData(color.texel);
image.Apply();
}
public Texture2D GetImage()
{
return image;
}
}
public class Pair<T1, T2>
{
public T1 first;
public T2 second;
}
public class KinectMotion : KinectData
{
Queue<Pair<float, MotionState>> motions
= new Queue<Pair<float, MotionState>>();
KinectBody body = new KinectBody();
float timeRecent = 0;
public override void Update(MultiSourceFrame frame)
{
body.Update(frame);
const float UNIT_TIME = 0.001f;
timeRecent += UNIT_TIME;
motions.Enqueue(new Pair<float, MotionState>
{
first = timeRecent,
second = DetermineState()
});
}
MotionState DetermineState()
{
MotionState s = MotionState.UNKNOWN;
if (body.joints == null || body.joints.Count == 0)
return s;
CameraSpacePoint head = body.joints[JointType.Head].Position,
leftHand = body.joints[JointType.HandLeft].Position,
rightHand = body.joints[JointType.HandRight].Position;
if (head.Y < leftHand.Y && head.Y < rightHand.Y)
s |= MotionState.HURRAY;
if (Distance(leftHand, rightHand) > 0.3f)
s |= MotionState.CLAP_PREPARE;
if (Distance(leftHand, rightHand) > 0.1f)
s |= MotionState.CLAP_DONE;
return s;
}
float Distance(CameraSpacePoint a, CameraSpacePoint b)
{
return Mathf.Sqrt(Mathf.Pow(a.X - b.X, 2.0f) +
Mathf.Pow(a.Y - b.Y, 2.0f) +
Mathf.Pow(a.Z - b.Z, 2.0f));
}
public Pair<float, MotionState> GetState()
{
return motions.Dequeue();
}
}
fileFormatVersion: 2
guid: c957a7b7e1e0a87438d12097932a611d
timeCreated: 1502957708
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System;
using System.Collections.Generic;
public abstract class MotionNote : Note
{
public MotionNote(float start, float end = 0f) : base(start, end) {}
public abstract IEnumerable<bool> Checkpoint();
}
\ No newline at end of file
fileFormatVersion: 2
guid: eeba9051af8880f41a239955c5efcbba
timeCreated: 1502962272
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 4efccb64927c7ca42b4e8f01d7d25773
folderAsset: yes
timeCreated: 1502962628
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
using System;
using System.Collections.Generic;
public class ClapNote : MotionNote
{
public ClapNote(float timing) : base(timing) {
}
public override IEnumerable<bool> Checkpoint()
{
var motionState = InputManager.Instance.CurrentMotionState;
var motion = motionState.second;
while (motion != MotionState.CLAP_PREPARE)
yield return false;
Activated = true;
yield break;
}
}
fileFormatVersion: 2
guid: 1a97249d2381dcc4492c416a96fde813
timeCreated: 1502962628
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
...@@ -108,7 +108,11 @@ public class TrackInfo ...@@ -108,7 +108,11 @@ public class TrackInfo
float timing = (measure + (float)i / seq) * ms; float timing = (measure + (float)i / seq) * ms;
if (channel[0] == 'S') if (channel == "SMO")
{
notes.Add(new ClapNote(timing));
}
else if (channel[0] == 'S')
{ {
notes.Add(new Note(key, channel, timing)); notes.Add(new Note(key, channel, timing));
} }
......
fileFormatVersion: 2
guid: 97b13591a96f8174d980197f404dcf8d
folderAsset: yes
timeCreated: 1502088321
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 5cf2eeaeb5141e545923973c7d827d6f
folderAsset: yes
timeCreated: 1502957664
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
using RootSystem = System;
using System.Linq;
using System.Collections.Generic;
namespace Windows.Kinect
{
//
// Windows.Kinect.CameraIntrinsics
//
[RootSystem.Runtime.InteropServices.StructLayout(RootSystem.Runtime.InteropServices.LayoutKind.Sequential)]
public struct CameraIntrinsics
{
public float FocalLengthX { get; set; }
public float FocalLengthY { get; set; }
public float PrincipalPointX { get; set; }
public float PrincipalPointY { get; set; }
public float RadialDistortionSecondOrder { get; set; }
public float RadialDistortionFourthOrder { get; set; }
public float RadialDistortionSixthOrder { get; set; }
public override int GetHashCode()
{
return FocalLengthX.GetHashCode() ^ FocalLengthY.GetHashCode() ^
PrincipalPointX.GetHashCode() ^ PrincipalPointY.GetHashCode() ^
RadialDistortionSecondOrder.GetHashCode() ^ RadialDistortionFourthOrder.GetHashCode() ^
RadialDistortionSixthOrder.GetHashCode();
}
public override bool Equals(object obj)
{
if (!(obj is CameraIntrinsics))
{
return false;
}
return this.Equals((CameraIntrinsics)obj);
}
public bool Equals(CameraIntrinsics obj)
{
return FocalLengthX.Equals(obj.FocalLengthX) && FocalLengthY.Equals(obj.FocalLengthY) &&
PrincipalPointX.Equals(obj.PrincipalPointX) && PrincipalPointY.Equals(obj.PrincipalPointY) &&
RadialDistortionSecondOrder.Equals(obj.RadialDistortionSecondOrder) &&
RadialDistortionFourthOrder.Equals(obj.RadialDistortionFourthOrder) &&
RadialDistortionSixthOrder.Equals(obj.RadialDistortionSixthOrder);
}
public static bool operator ==(CameraIntrinsics a, CameraIntrinsics b)
{
return a.Equals(b);
}
public static bool operator !=(CameraIntrinsics a, CameraIntrinsics b)
{
return !(a.Equals(b));
}
}
}
fileFormatVersion: 2
guid: 1d7502d8680f38344a822b04f6589097
timeCreated: 18446744011573954816
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Helper
{
class CollectionMap<TKey, TValue> : Helper.ThreadSafeDictionary<TKey, TValue> where TValue : new()
{
public bool TryAddDefault(TKey key)
{
lock (_impl)
{
if (!_impl.ContainsKey(key))
{
_impl.Add(key, new TValue());
return true;
}
else
{
return false;
}
}
}
}
}
fileFormatVersion: 2
guid: 5af24ef31b79af248965e672735626a3
timeCreated: 18446744011573954816
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: e11228902f41cb242bd8b1f16b364e24
folderAsset: yes
timeCreated: 1502957664
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using UnityEditor;
using System;
using System.Collections.Generic;
using System.IO;
public static class KinectCopyPluginDataHelper
{
private const string DataDirSuffix = "_Data";
private const string PluginsDirName = "Plugins";
private static Dictionary<BuildTarget, string> TargetToDirName = new Dictionary<BuildTarget, string>()
{
{BuildTarget.StandaloneWindows, "x86"},
{BuildTarget.StandaloneWindows64, "x86_64"}
};
public static void CopyPluginData(BuildTarget target, string buildTargetPath, string subDirToCopy)
{
string subDirName;
if (!TargetToDirName.TryGetValue (target, out subDirName))
{
// No work to do
return;
}
// Get Required Paths
var buildName = Path.GetFileNameWithoutExtension(buildTargetPath);
var targetDir = Directory.GetParent(buildTargetPath);
var separator = Path.DirectorySeparatorChar;
var buildDataDir = targetDir.FullName + separator + buildName + DataDirSuffix + separator;
var tgtPluginsDir = buildDataDir + separator + PluginsDirName + separator + subDirToCopy + separator;
var srcPluginsDir = Application.dataPath + separator + PluginsDirName + separator + subDirName + separator + subDirToCopy + separator;
CopyAll (new DirectoryInfo (srcPluginsDir), new DirectoryInfo(tgtPluginsDir));
}
/// <summary>
/// Recursive Copy Directory Method
/// </summary>
private static void CopyAll(DirectoryInfo source, DirectoryInfo target)
{
// Check if the source directory exists, if not, don't do any work.
if (!Directory.Exists(source.FullName))
{
return;
}
// Check if the target directory exists, if not, create it.
if (!Directory.Exists(target.FullName))
{
Directory.CreateDirectory(target.FullName);
}
// Copy each file into it’s new directory.
foreach (var fileInfo in source.GetFiles())
{
fileInfo.CopyTo (Path.Combine (target.ToString (), fileInfo.Name), true);
}
// Copy each subdirectory using recursion.
foreach (var subDirInfo in source.GetDirectories())
{
DirectoryInfo nextTargetSubDir = target.CreateSubdirectory(subDirInfo.Name);
CopyAll(subDirInfo, nextTargetSubDir);
}
}
}
fileFormatVersion: 2
guid: 992490f149d571a4bb003838d2ac33c5
timeCreated: 18446744011573954816
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEditor;
using UnityEditor.Callbacks;
using System;
public static class KinectVisualGestureBuilderPostBuildCopyPluginData
{
[PostProcessBuild]
public static void OnPostProcessBuild(BuildTarget target, string path)
{
KinectCopyPluginDataHelper.CopyPluginData (target, path, "vgbtechs");
}
}
fileFormatVersion: 2
guid: b57003b3c57eec84685a31008f2876e4
timeCreated: 18446744011573954816
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Linq;
namespace Helper
{
internal class EventPump : UnityEngine.MonoBehaviour
{
private static object s_Lock = new object();
private Queue<Action> m_Queue = new Queue<Action>();
public static EventPump Instance
{
get;
private set;
}
public static void EnsureInitialized()
{
try
{
if (EventPump.Instance == null)
{
lock (s_Lock)
{
if (EventPump.Instance == null)
{
UnityEngine.GameObject parent = new UnityEngine.GameObject("Kinect Desktop Event Pump");
EventPump.Instance = parent.AddComponent<Helper.EventPump>();
DontDestroyOnLoad(parent);
}
}
}
}
catch
{
UnityEngine.Debug.LogError("Events must be registered on the main thread.");
return;
}
}
private void Update()
{
lock (m_Queue)
{
while (m_Queue.Count > 0)
{
var action = m_Queue.Dequeue();
try
{
action.Invoke();
}
catch { }
}
}
}
private void OnApplicationQuit()
{
var sensor = Windows.Kinect.KinectSensor.GetDefault();
if (sensor != null && sensor.IsOpen)
{
sensor.Close();
}
NativeObjectCache.Flush();
}
public void Enqueue(Action action)
{
lock (m_Queue)
{
m_Queue.Enqueue(action);
}
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: eb47e8e15bc900141b610bf206931fd3
timeCreated: 18446744011573954816
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System;
using System.Runtime.InteropServices;
namespace Helper
{
public static class ExceptionHelper
{
private const int E_NOTIMPL = unchecked((int)0x80004001);
private const int E_OUTOFMEMORY = unchecked((int)0x8007000E);
private const int E_INVALIDARG = unchecked((int)0x80070057);
private const int E_POINTER = unchecked((int) 0x80004003);
private const int E_PENDING = unchecked((int)0x8000000A);
private const int E_FAIL = unchecked((int)0x80004005);
public static void CheckLastError()
{
int hr = Marshal.GetLastWin32Error();
if ((hr == E_PENDING) || (hr == E_FAIL))
{
// Ignore E_PENDING/E_FAIL - We use this to indicate no pending or missed frames
return;
}
if (hr < 0)
{
Exception exception = Marshal.GetExceptionForHR(hr);
string message = string.Format("This API has returned an exception from an HRESULT: 0x{0:X}", hr);
switch (hr)
{
case E_NOTIMPL:
throw new NotImplementedException(message, exception);
case E_OUTOFMEMORY:
throw new OutOfMemoryException(message, exception);
case E_INVALIDARG:
throw new ArgumentException(message, exception);
case E_POINTER:
throw new ArgumentNullException(message, exception);
default:
throw new InvalidOperationException(message, exception);
}
}
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 2c60ec64b7307604bba5b0cae3bfbdb7
timeCreated: 18446744011573954816
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Linq;
namespace Helper
{
internal interface INativeWrapper
{
System.IntPtr nativePtr { get; }
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 3c63fb408f75ea84a914dde0bedf5db6
timeCreated: 18446744011573954816
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using RootSystem = System;
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
namespace Windows.Kinect
{
// NOTE: This uses an IBuffer under the covers, it is renamed here to give parity to our managed APIs.
public class KinectBuffer : Helper.INativeWrapper, IDisposable
{
internal RootSystem.IntPtr _pNative;
RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
// Constructors and Finalizers
internal KinectBuffer(RootSystem.IntPtr pNative)
{
_pNative = pNative;
Windows_Storage_Streams_IBuffer_AddRefObject(ref _pNative);
}
~KinectBuffer()
{
Dispose(false);
}
[RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl)]
private static extern void Windows_Storage_Streams_IBuffer_ReleaseObject(ref RootSystem.IntPtr pNative);
[RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl)]
private static extern void Windows_Storage_Streams_IBuffer_AddRefObject(ref RootSystem.IntPtr pNative);
private void Dispose(bool disposing)
{
if (_pNative == RootSystem.IntPtr.Zero)
{
return;
}
Helper.NativeObjectCache.RemoveObject<KinectBuffer>(_pNative);
if (disposing)
{
Windows_Storage_Streams_IBuffer_Dispose(_pNative);
}
Windows_Storage_Streams_IBuffer_ReleaseObject(ref _pNative);
_pNative = RootSystem.IntPtr.Zero;
}
// Public Properties
[RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError = true)]
private static extern uint Windows_Storage_Streams_IBuffer_get_Capacity(RootSystem.IntPtr pNative);
public uint Capacity
{
get
{
if (_pNative == RootSystem.IntPtr.Zero)
{
throw new RootSystem.ObjectDisposedException("KinectBuffer");
}
uint capacity = Windows_Storage_Streams_IBuffer_get_Capacity(_pNative);
Helper.ExceptionHelper.CheckLastError();
return capacity;
}
}
[RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError = true)]
private static extern uint Windows_Storage_Streams_IBuffer_get_Length(RootSystem.IntPtr pNative);
[RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError = true)]
private static extern void Windows_Storage_Streams_IBuffer_put_Length(RootSystem.IntPtr pNative, uint value);
public uint Length
{
get
{
if (_pNative == RootSystem.IntPtr.Zero)
{
throw new RootSystem.ObjectDisposedException("KinectBuffer");
}
uint length = Windows_Storage_Streams_IBuffer_get_Length(_pNative);
Helper.ExceptionHelper.CheckLastError();
return length;
}
set
{
if (_pNative == RootSystem.IntPtr.Zero)
{
throw new RootSystem.ObjectDisposedException("KinectBuffer");
}
Windows_Storage_Streams_IBuffer_put_Length(_pNative, value);
Helper.ExceptionHelper.CheckLastError();
}
}
[RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl)]
private static extern void Windows_Storage_Streams_IBuffer_Dispose(RootSystem.IntPtr pNative);
// Constructors and Finalizers
public void Dispose()
{
if (_pNative == RootSystem.IntPtr.Zero)
{
throw new RootSystem.ObjectDisposedException("KinectBuffer");
}
Dispose(true);
RootSystem.GC.SuppressFinalize(this);
}
[RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError = true)]
private static extern RootSystem.IntPtr Windows_Storage_Streams_IBuffer_get_UnderlyingBuffer(RootSystem.IntPtr pNative);
public IntPtr UnderlyingBuffer
{
get
{
if (_pNative == RootSystem.IntPtr.Zero)
{
throw new RootSystem.ObjectDisposedException("KinectBuffer");
}
RootSystem.IntPtr value = Windows_Storage_Streams_IBuffer_get_UnderlyingBuffer(_pNative);
Helper.ExceptionHelper.CheckLastError();
return value;
}
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 041b09b5123e8c04d82d9fadf4e38ea9
timeCreated: 18446744011573954816
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
fileFormatVersion: 2
guid: c59b79770236fae42a76e291570f2447
timeCreated: 18446744011573954816
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using RootSystem = System;
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
namespace Microsoft.Kinect.VisualGestureBuilder
{
public sealed partial class VisualGestureBuilderDatabase
{
[RootSystem.Runtime.InteropServices.DllImport(
"KinectVisualGestureBuilderUnityAddin",
EntryPoint = "Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderDatabase_ctor",
CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl)]
private static extern RootSystem.IntPtr Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderDatabase_ctor([MarshalAs(UnmanagedType.LPWStr)]string path);
public static VisualGestureBuilderDatabase Create(string path)
{
RootSystem.IntPtr objectPointer = Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderDatabase_ctor(path);
Helper.ExceptionHelper.CheckLastError();
if (objectPointer == RootSystem.IntPtr.Zero)
{
return null;
}
return Helper.NativeObjectCache.CreateOrGetObject<Microsoft.Kinect.VisualGestureBuilder.VisualGestureBuilderDatabase>(
objectPointer, n => new Microsoft.Kinect.VisualGestureBuilder.VisualGestureBuilderDatabase(n));
}
}
public sealed partial class VisualGestureBuilderFrameSource
{
[RootSystem.Runtime.InteropServices.DllImport(
"KinectVisualGestureBuilderUnityAddin",
EntryPoint = "Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderFrameSource_ctor",
CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl)]
private static extern RootSystem.IntPtr Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderFrameSource_ctor(RootSystem.IntPtr sensorPtr, ulong initialTrackingId);
public static VisualGestureBuilderFrameSource Create(Windows.Kinect.KinectSensor sensor, ulong initialTrackingId)
{
RootSystem.IntPtr objectPointer = Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderFrameSource_ctor(Helper.NativeWrapper.GetNativePtr(sensor), initialTrackingId);
Helper.ExceptionHelper.CheckLastError();
if (objectPointer == RootSystem.IntPtr.Zero)
{
return null;
}
return Helper.NativeObjectCache.CreateOrGetObject<Microsoft.Kinect.VisualGestureBuilder.VisualGestureBuilderFrameSource>(
objectPointer, n => new Microsoft.Kinect.VisualGestureBuilder.VisualGestureBuilderFrameSource(n));
}
[RootSystem.Runtime.InteropServices.DllImport(
"KinectVisualGestureBuilderUnityAddin",
EntryPoint = "Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderFrameSource_GetIsEnabled",
CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl)]
private static extern bool Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderFrameSource_GetIsEnabled(RootSystem.IntPtr pNative, RootSystem.IntPtr gesturePtr);
public bool GetIsEnabled(Microsoft.Kinect.VisualGestureBuilder.Gesture gesture)
{
if (_pNative == RootSystem.IntPtr.Zero)
{
throw new RootSystem.ObjectDisposedException("VisualGestureBuilderFrameSource");
}
var result = Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderFrameSource_GetIsEnabled(_pNative, Helper.NativeWrapper.GetNativePtr(gesture));
Helper.ExceptionHelper.CheckLastError();
return result;
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 485600beef8b3194a94d471e24181020
timeCreated: 18446744011573954816
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 1205289338cc2a04785ba3d26477b300
folderAsset: yes
timeCreated: 1502958445
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 46e2a41736f788a478d357ee5e6ec601
folderAsset: yes
timeCreated: 1502958445
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 0ef9aefeeafdaac429ef13524278f572
folderAsset: yes
timeCreated: 1502958445
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
using RootSystem = System;
using System.Linq;
using System.Collections.Generic;
namespace Microsoft.Kinect.VisualGestureBuilder
{
//
// Microsoft.Kinect.VisualGestureBuilder.ContinuousGestureResult
//
public sealed partial class ContinuousGestureResult : Helper.INativeWrapper
{
internal RootSystem.IntPtr _pNative;
RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
// Constructors and Finalizers
internal ContinuousGestureResult(RootSystem.IntPtr pNative)
{
_pNative = pNative;
Microsoft_Kinect_VisualGestureBuilder_ContinuousGestureResult_AddRefObject(ref _pNative);
}
~ContinuousGestureResult()
{
Dispose(false);
}
[RootSystem.Runtime.InteropServices.DllImport("KinectVisualGestureBuilderUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern void Microsoft_Kinect_VisualGestureBuilder_ContinuousGestureResult_ReleaseObject(ref RootSystem.IntPtr pNative);
[RootSystem.Runtime.InteropServices.DllImport("KinectVisualGestureBuilderUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern void Microsoft_Kinect_VisualGestureBuilder_ContinuousGestureResult_AddRefObject(ref RootSystem.IntPtr pNative);
private void Dispose(bool disposing)
{
if (_pNative == RootSystem.IntPtr.Zero)
{
return;
}
__EventCleanup();
Helper.NativeObjectCache.RemoveObject<ContinuousGestureResult>(_pNative);
Microsoft_Kinect_VisualGestureBuilder_ContinuousGestureResult_ReleaseObject(ref _pNative);
_pNative = RootSystem.IntPtr.Zero;
}
// Public Properties
[RootSystem.Runtime.InteropServices.DllImport("KinectVisualGestureBuilderUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern float Microsoft_Kinect_VisualGestureBuilder_ContinuousGestureResult_get_Progress(RootSystem.IntPtr pNative);
public float Progress
{
get
{
if (_pNative == RootSystem.IntPtr.Zero)
{
throw new RootSystem.ObjectDisposedException("ContinuousGestureResult");
}
return Microsoft_Kinect_VisualGestureBuilder_ContinuousGestureResult_get_Progress(_pNative);
}
}
private void __EventCleanup()
{
}
}
}
fileFormatVersion: 2
guid: 39ba8f678e5073b44804c65fbbaf302c
timeCreated: 18446744011573954816
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using RootSystem = System;
using System.Linq;
using System.Collections.Generic;
namespace Microsoft.Kinect.VisualGestureBuilder
{
//
// Microsoft.Kinect.VisualGestureBuilder.DiscreteGestureResult
//
public sealed partial class DiscreteGestureResult : Helper.INativeWrapper
{
internal RootSystem.IntPtr _pNative;
RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
// Constructors and Finalizers
internal DiscreteGestureResult(RootSystem.IntPtr pNative)
{
_pNative = pNative;
Microsoft_Kinect_VisualGestureBuilder_DiscreteGestureResult_AddRefObject(ref _pNative);
}
~DiscreteGestureResult()
{
Dispose(false);
}
[RootSystem.Runtime.InteropServices.DllImport("KinectVisualGestureBuilderUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern void Microsoft_Kinect_VisualGestureBuilder_DiscreteGestureResult_ReleaseObject(ref RootSystem.IntPtr pNative);
[RootSystem.Runtime.InteropServices.DllImport("KinectVisualGestureBuilderUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern void Microsoft_Kinect_VisualGestureBuilder_DiscreteGestureResult_AddRefObject(ref RootSystem.IntPtr pNative);
private void Dispose(bool disposing)
{
if (_pNative == RootSystem.IntPtr.Zero)
{
return;
}
__EventCleanup();
Helper.NativeObjectCache.RemoveObject<DiscreteGestureResult>(_pNative);
Microsoft_Kinect_VisualGestureBuilder_DiscreteGestureResult_ReleaseObject(ref _pNative);
_pNative = RootSystem.IntPtr.Zero;
}
// Public Properties
[RootSystem.Runtime.InteropServices.DllImport("KinectVisualGestureBuilderUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern float Microsoft_Kinect_VisualGestureBuilder_DiscreteGestureResult_get_Confidence(RootSystem.IntPtr pNative);
public float Confidence
{
get
{
if (_pNative == RootSystem.IntPtr.Zero)
{
throw new RootSystem.ObjectDisposedException("DiscreteGestureResult");
}
return Microsoft_Kinect_VisualGestureBuilder_DiscreteGestureResult_get_Confidence(_pNative);
}
}
[RootSystem.Runtime.InteropServices.DllImport("KinectVisualGestureBuilderUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern bool Microsoft_Kinect_VisualGestureBuilder_DiscreteGestureResult_get_Detected(RootSystem.IntPtr pNative);
public bool Detected
{
get
{
if (_pNative == RootSystem.IntPtr.Zero)
{
throw new RootSystem.ObjectDisposedException("DiscreteGestureResult");
}
return Microsoft_Kinect_VisualGestureBuilder_DiscreteGestureResult_get_Detected(_pNative);
}
}
[RootSystem.Runtime.InteropServices.DllImport("KinectVisualGestureBuilderUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern bool Microsoft_Kinect_VisualGestureBuilder_DiscreteGestureResult_get_FirstFrameDetected(RootSystem.IntPtr pNative);
public bool FirstFrameDetected
{
get
{
if (_pNative == RootSystem.IntPtr.Zero)
{
throw new RootSystem.ObjectDisposedException("DiscreteGestureResult");
}
return Microsoft_Kinect_VisualGestureBuilder_DiscreteGestureResult_get_FirstFrameDetected(_pNative);
}
}
private void __EventCleanup()
{
}
}
}
fileFormatVersion: 2
guid: 348b878afc4a938499c34b47772438f3
timeCreated: 18446744011573954816
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using RootSystem = System;
using System.Linq;
using System.Collections.Generic;
namespace Microsoft.Kinect.VisualGestureBuilder
{
//
// Microsoft.Kinect.VisualGestureBuilder.Gesture
//
public sealed partial class Gesture : Helper.INativeWrapper
{
internal RootSystem.IntPtr _pNative;
RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
// Constructors and Finalizers
internal Gesture(RootSystem.IntPtr pNative)
{
_pNative = pNative;
Microsoft_Kinect_VisualGestureBuilder_Gesture_AddRefObject(ref _pNative);
}
~Gesture()
{
Dispose(false);
}
[RootSystem.Runtime.InteropServices.DllImport("KinectVisualGestureBuilderUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern void Microsoft_Kinect_VisualGestureBuilder_Gesture_ReleaseObject(ref RootSystem.IntPtr pNative);
[RootSystem.Runtime.InteropServices.DllImport("KinectVisualGestureBuilderUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern void Microsoft_Kinect_VisualGestureBuilder_Gesture_AddRefObject(ref RootSystem.IntPtr pNative);
private void Dispose(bool disposing)
{
if (_pNative == RootSystem.IntPtr.Zero)
{
return;
}
__EventCleanup();
Helper.NativeObjectCache.RemoveObject<Gesture>(_pNative);
Microsoft_Kinect_VisualGestureBuilder_Gesture_ReleaseObject(ref _pNative);
_pNative = RootSystem.IntPtr.Zero;
}
// Public Properties
[RootSystem.Runtime.InteropServices.DllImport("KinectVisualGestureBuilderUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern Microsoft.Kinect.VisualGestureBuilder.GestureType Microsoft_Kinect_VisualGestureBuilder_Gesture_get_GestureType(RootSystem.IntPtr pNative);
public Microsoft.Kinect.VisualGestureBuilder.GestureType GestureType
{
get
{
if (_pNative == RootSystem.IntPtr.Zero)
{
throw new RootSystem.ObjectDisposedException("Gesture");
}
return Microsoft_Kinect_VisualGestureBuilder_Gesture_get_GestureType(_pNative);
}
}
[RootSystem.Runtime.InteropServices.DllImport("KinectVisualGestureBuilderUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern RootSystem.IntPtr Microsoft_Kinect_VisualGestureBuilder_Gesture_get_Name(RootSystem.IntPtr pNative);
public string Name
{
get
{
if (_pNative == RootSystem.IntPtr.Zero)
{
throw new RootSystem.ObjectDisposedException("Gesture");
}
RootSystem.IntPtr objectPointer = Microsoft_Kinect_VisualGestureBuilder_Gesture_get_Name(_pNative);
Helper.ExceptionHelper.CheckLastError();
var managedString = RootSystem.Runtime.InteropServices.Marshal.PtrToStringUni(objectPointer);
RootSystem.Runtime.InteropServices.Marshal.FreeCoTaskMem(objectPointer);
return managedString;
}
}
private void __EventCleanup()
{
}
}
}
fileFormatVersion: 2
guid: a84b2c069de62a14c94940154ec6f7da
timeCreated: 18446744011573954816
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using RootSystem = System;
using System.Linq;
using System.Collections.Generic;
namespace Microsoft.Kinect.VisualGestureBuilder
{
//
// Microsoft.Kinect.VisualGestureBuilder.GestureType
//
public enum GestureType : int
{
None =0,
Discrete =1,
Continuous =2,
}
}
fileFormatVersion: 2
guid: 75c13895e20797f4fadf7ce99a885eb9
timeCreated: 18446744011573954816
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using RootSystem = System;
using System.Linq;
using System.Collections.Generic;
namespace Microsoft.Kinect.VisualGestureBuilder
{
//
// Microsoft.Kinect.VisualGestureBuilder.KinectVisualGestureBuilderUnityAddinUtils
//
public sealed partial class KinectVisualGestureBuilderUnityAddinUtils
{
[RootSystem.Runtime.InteropServices.DllImport("KinectVisualGestureBuilderUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern void KinectVisualGestureBuilderUnityAddin_FreeMemory(RootSystem.IntPtr pToDealloc);
public static void FreeMemory(RootSystem.IntPtr pToDealloc)
{
KinectVisualGestureBuilderUnityAddin_FreeMemory(pToDealloc);
}
}
}
fileFormatVersion: 2
guid: 2d5a0b5ff72c39a4e95865b317bd147d
timeCreated: 18446744011573954816
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using RootSystem = System;
using System.Linq;
using System.Collections.Generic;
namespace Microsoft.Kinect.VisualGestureBuilder
{
//
// Microsoft.Kinect.VisualGestureBuilder.TrackingIdLostEventArgs
//
public sealed partial class TrackingIdLostEventArgs : RootSystem.EventArgs, Helper.INativeWrapper
{
internal RootSystem.IntPtr _pNative;
RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
// Constructors and Finalizers
internal TrackingIdLostEventArgs(RootSystem.IntPtr pNative)
{
_pNative = pNative;
Microsoft_Kinect_VisualGestureBuilder_TrackingIdLostEventArgs_AddRefObject(ref _pNative);
}
~TrackingIdLostEventArgs()
{
Dispose(false);
}
[RootSystem.Runtime.InteropServices.DllImport("KinectVisualGestureBuilderUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern void Microsoft_Kinect_VisualGestureBuilder_TrackingIdLostEventArgs_ReleaseObject(ref RootSystem.IntPtr pNative);
[RootSystem.Runtime.InteropServices.DllImport("KinectVisualGestureBuilderUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern void Microsoft_Kinect_VisualGestureBuilder_TrackingIdLostEventArgs_AddRefObject(ref RootSystem.IntPtr pNative);
private void Dispose(bool disposing)
{
if (_pNative == RootSystem.IntPtr.Zero)
{
return;
}
__EventCleanup();
Helper.NativeObjectCache.RemoveObject<TrackingIdLostEventArgs>(_pNative);
Microsoft_Kinect_VisualGestureBuilder_TrackingIdLostEventArgs_ReleaseObject(ref _pNative);
_pNative = RootSystem.IntPtr.Zero;
}
// Public Properties
[RootSystem.Runtime.InteropServices.DllImport("KinectVisualGestureBuilderUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern ulong Microsoft_Kinect_VisualGestureBuilder_TrackingIdLostEventArgs_get_TrackingId(RootSystem.IntPtr pNative);
public ulong TrackingId
{
get
{
if (_pNative == RootSystem.IntPtr.Zero)
{
throw new RootSystem.ObjectDisposedException("TrackingIdLostEventArgs");
}
return Microsoft_Kinect_VisualGestureBuilder_TrackingIdLostEventArgs_get_TrackingId(_pNative);
}
}
private void __EventCleanup()
{
}
}
}
fileFormatVersion: 2
guid: fa8002d3a67f41f48bfaa702a83320ae
timeCreated: 18446744011573954816
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using RootSystem = System;
using System.Linq;
using System.Collections.Generic;
namespace Microsoft.Kinect.VisualGestureBuilder
{
//
// Microsoft.Kinect.VisualGestureBuilder.VisualGestureBuilderDatabase
//
public sealed partial class VisualGestureBuilderDatabase : RootSystem.IDisposable, Helper.INativeWrapper
{
internal RootSystem.IntPtr _pNative;
RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
// Constructors and Finalizers
internal VisualGestureBuilderDatabase(RootSystem.IntPtr pNative)
{
_pNative = pNative;
Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderDatabase_AddRefObject(ref _pNative);
}
~VisualGestureBuilderDatabase()
{
Dispose(false);
}
[RootSystem.Runtime.InteropServices.DllImport("KinectVisualGestureBuilderUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern void Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderDatabase_ReleaseObject(ref RootSystem.IntPtr pNative);
[RootSystem.Runtime.InteropServices.DllImport("KinectVisualGestureBuilderUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern void Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderDatabase_AddRefObject(ref RootSystem.IntPtr pNative);
private void Dispose(bool disposing)
{
if (_pNative == RootSystem.IntPtr.Zero)
{
return;
}
__EventCleanup();
Helper.NativeObjectCache.RemoveObject<VisualGestureBuilderDatabase>(_pNative);
if (disposing)
{
Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderDatabase_Dispose(_pNative);
}
Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderDatabase_ReleaseObject(ref _pNative);
_pNative = RootSystem.IntPtr.Zero;
}
// Public Properties
[RootSystem.Runtime.InteropServices.DllImport("KinectVisualGestureBuilderUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern int Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderDatabase_get_AvailableGestures(RootSystem.IntPtr pNative, [RootSystem.Runtime.InteropServices.Out] RootSystem.IntPtr[] outCollection, int outCollectionSize);
[RootSystem.Runtime.InteropServices.DllImport("KinectVisualGestureBuilderUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern int Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderDatabase_get_AvailableGestures_Length(RootSystem.IntPtr pNative);
public RootSystem.Collections.Generic.IList<Microsoft.Kinect.VisualGestureBuilder.Gesture> AvailableGestures
{
get
{
if (_pNative == RootSystem.IntPtr.Zero)
{
throw new RootSystem.ObjectDisposedException("VisualGestureBuilderDatabase");
}
int outCollectionSize = Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderDatabase_get_AvailableGestures_Length(_pNative);
var outCollection = new RootSystem.IntPtr[outCollectionSize];
var managedCollection = new Microsoft.Kinect.VisualGestureBuilder.Gesture[outCollectionSize];
outCollectionSize = Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderDatabase_get_AvailableGestures(_pNative, outCollection, outCollectionSize);
Helper.ExceptionHelper.CheckLastError();
for(int i=0;i<outCollectionSize;i++)
{
if(outCollection[i] == RootSystem.IntPtr.Zero)
{
continue;
}
var obj = Helper.NativeObjectCache.CreateOrGetObject<Microsoft.Kinect.VisualGestureBuilder.Gesture>(outCollection[i], n => new Microsoft.Kinect.VisualGestureBuilder.Gesture(n));
managedCollection[i] = obj;
}
return managedCollection;
}
}
// Public Methods
[RootSystem.Runtime.InteropServices.DllImport("KinectVisualGestureBuilderUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern void Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderDatabase_Dispose(RootSystem.IntPtr pNative);
public void Dispose()
{
if (_pNative == RootSystem.IntPtr.Zero)
{
return;
}
Dispose(true);
RootSystem.GC.SuppressFinalize(this);
}
private void __EventCleanup()
{
}
}
}
fileFormatVersion: 2
guid: 9f131b0b4bd823f408e9f36fa0f4b620
timeCreated: 18446744011573954816
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 47c323266c46b964493ab406ea288659
timeCreated: 18446744011573954816
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using RootSystem = System;
using System.Linq;
using System.Collections.Generic;
namespace Microsoft.Kinect.VisualGestureBuilder
{
//
// Microsoft.Kinect.VisualGestureBuilder.VisualGestureBuilderFrameArrivedEventArgs
//
public sealed partial class VisualGestureBuilderFrameArrivedEventArgs : RootSystem.EventArgs, Helper.INativeWrapper
{
internal RootSystem.IntPtr _pNative;
RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
// Constructors and Finalizers
internal VisualGestureBuilderFrameArrivedEventArgs(RootSystem.IntPtr pNative)
{
_pNative = pNative;
Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderFrameArrivedEventArgs_AddRefObject(ref _pNative);
}
~VisualGestureBuilderFrameArrivedEventArgs()
{
Dispose(false);
}
[RootSystem.Runtime.InteropServices.DllImport("KinectVisualGestureBuilderUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern void Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderFrameArrivedEventArgs_ReleaseObject(ref RootSystem.IntPtr pNative);
[RootSystem.Runtime.InteropServices.DllImport("KinectVisualGestureBuilderUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern void Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderFrameArrivedEventArgs_AddRefObject(ref RootSystem.IntPtr pNative);
private void Dispose(bool disposing)
{
if (_pNative == RootSystem.IntPtr.Zero)
{
return;
}
__EventCleanup();
Helper.NativeObjectCache.RemoveObject<VisualGestureBuilderFrameArrivedEventArgs>(_pNative);
Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderFrameArrivedEventArgs_ReleaseObject(ref _pNative);
_pNative = RootSystem.IntPtr.Zero;
}
// Public Properties
[RootSystem.Runtime.InteropServices.DllImport("KinectVisualGestureBuilderUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern RootSystem.IntPtr Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderFrameArrivedEventArgs_get_FrameReference(RootSystem.IntPtr pNative);
public Microsoft.Kinect.VisualGestureBuilder.VisualGestureBuilderFrameReference FrameReference
{
get
{
if (_pNative == RootSystem.IntPtr.Zero)
{
throw new RootSystem.ObjectDisposedException("VisualGestureBuilderFrameArrivedEventArgs");
}
RootSystem.IntPtr objectPointer = Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderFrameArrivedEventArgs_get_FrameReference(_pNative);
Helper.ExceptionHelper.CheckLastError();
if (objectPointer == RootSystem.IntPtr.Zero)
{
return null;
}
return Helper.NativeObjectCache.CreateOrGetObject<Microsoft.Kinect.VisualGestureBuilder.VisualGestureBuilderFrameReference>(objectPointer, n => new Microsoft.Kinect.VisualGestureBuilder.VisualGestureBuilderFrameReference(n));
}
}
private void __EventCleanup()
{
}
}
}
fileFormatVersion: 2
guid: 487a1dbae6735f34695213eaf0e7486b
timeCreated: 18446744011573954816
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 92b159bf1aed2df4986d0398eda39fe7
timeCreated: 18446744011573954816
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using RootSystem = System;
using System.Linq;
using System.Collections.Generic;
namespace Microsoft.Kinect.VisualGestureBuilder
{
//
// Microsoft.Kinect.VisualGestureBuilder.VisualGestureBuilderFrameReference
//
public sealed partial class VisualGestureBuilderFrameReference : Helper.INativeWrapper
{
internal RootSystem.IntPtr _pNative;
RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
// Constructors and Finalizers
internal VisualGestureBuilderFrameReference(RootSystem.IntPtr pNative)
{
_pNative = pNative;
Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderFrameReference_AddRefObject(ref _pNative);
}
~VisualGestureBuilderFrameReference()
{
Dispose(false);
}
[RootSystem.Runtime.InteropServices.DllImport("KinectVisualGestureBuilderUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern void Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderFrameReference_ReleaseObject(ref RootSystem.IntPtr pNative);
[RootSystem.Runtime.InteropServices.DllImport("KinectVisualGestureBuilderUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern void Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderFrameReference_AddRefObject(ref RootSystem.IntPtr pNative);
private void Dispose(bool disposing)
{
if (_pNative == RootSystem.IntPtr.Zero)
{
return;
}
__EventCleanup();
Helper.NativeObjectCache.RemoveObject<VisualGestureBuilderFrameReference>(_pNative);
Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderFrameReference_ReleaseObject(ref _pNative);
_pNative = RootSystem.IntPtr.Zero;
}
// Public Properties
[RootSystem.Runtime.InteropServices.DllImport("KinectVisualGestureBuilderUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern long Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderFrameReference_get_RelativeTime(RootSystem.IntPtr pNative);
public RootSystem.TimeSpan RelativeTime
{
get
{
if (_pNative == RootSystem.IntPtr.Zero)
{
throw new RootSystem.ObjectDisposedException("VisualGestureBuilderFrameReference");
}
return RootSystem.TimeSpan.FromMilliseconds(Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderFrameReference_get_RelativeTime(_pNative));
}
}
// Public Methods
[RootSystem.Runtime.InteropServices.DllImport("KinectVisualGestureBuilderUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern RootSystem.IntPtr Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderFrameReference_AcquireFrame(RootSystem.IntPtr pNative);
public Microsoft.Kinect.VisualGestureBuilder.VisualGestureBuilderFrame AcquireFrame()
{
if (_pNative == RootSystem.IntPtr.Zero)
{
throw new RootSystem.ObjectDisposedException("VisualGestureBuilderFrameReference");
}
RootSystem.IntPtr objectPointer = Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderFrameReference_AcquireFrame(_pNative);
Helper.ExceptionHelper.CheckLastError();
if (objectPointer == RootSystem.IntPtr.Zero)
{
return null;
}
return Helper.NativeObjectCache.CreateOrGetObject<Microsoft.Kinect.VisualGestureBuilder.VisualGestureBuilderFrame>(objectPointer, n => new Microsoft.Kinect.VisualGestureBuilder.VisualGestureBuilderFrame(n));
}
private void __EventCleanup()
{
}
}
}
fileFormatVersion: 2
guid: ba8bac3cd7bf2b841ad9dd3acb0b34e1
timeCreated: 18446744011573954816
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 641d13669aad591478663a1e1aecf37d
timeCreated: 18446744011573954816
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Linq;
namespace Helper
{
public static class NativeObjectCache
{
private static object _lock = new object();
private static Dictionary<Type, Dictionary<IntPtr, WeakReference>> _objectCache = new Dictionary<Type, Dictionary<IntPtr, WeakReference>>();
public static void AddObject<T>(IntPtr nativePtr, T obj) where T : class
{
lock (_lock)
{
Dictionary<IntPtr, WeakReference> objCache = null;
if (!_objectCache.TryGetValue(typeof(T), out objCache) || objCache == null)
{
objCache = new Dictionary<IntPtr, WeakReference>();
_objectCache[typeof(T)] = objCache;
}
objCache[nativePtr] = new WeakReference(obj);
}
}
public static void Flush()
{
lock(_lock)
{
foreach (var byType in _objectCache.ToArray())
{
foreach(var kvp in byType.Value.ToArray())
{
IDisposable disp = kvp.Value.Target as IDisposable;
if(disp != null)
{
disp.Dispose();
}
}
}
}
}
public static void RemoveObject<T>(IntPtr nativePtr)
{
lock (_lock)
{
Dictionary<IntPtr, WeakReference> objCache = null;
if (!_objectCache.TryGetValue(typeof(T), out objCache) || objCache == null)
{
objCache = new Dictionary<IntPtr, WeakReference>();
_objectCache[typeof(T)] = objCache;
}
if (objCache.ContainsKey(nativePtr))
{
objCache.Remove(nativePtr);
}
}
}
public static T GetObject<T>(IntPtr nativePtr) where T : class
{
lock (_lock)
{
Dictionary<IntPtr, WeakReference> objCache = null;
if (!_objectCache.TryGetValue(typeof(T), out objCache) || objCache == null)
{
objCache = new Dictionary<IntPtr, WeakReference>();
_objectCache[typeof(T)] = objCache;
}
WeakReference reference = null;
if (objCache.TryGetValue(nativePtr, out reference))
{
if (reference != null)
{
T obj = reference.Target as T;
if (obj != null)
{
return (T)obj;
}
}
}
return null;
}
}
public static T CreateOrGetObject<T>(IntPtr nativePtr, Func<System.IntPtr,T> create) where T : class
{
T outputValue = null;
lock (_lock)
{
Dictionary<IntPtr, WeakReference> objCache = null;
if (!_objectCache.TryGetValue(typeof(T), out objCache) || objCache == null)
{
objCache = new Dictionary<IntPtr, WeakReference>();
_objectCache[typeof(T)] = objCache;
}
WeakReference reference = null;
if (objCache.TryGetValue(nativePtr, out reference))
{
if ((reference != null) && reference.IsAlive)
{
outputValue = reference.Target as T;
}
}
if (outputValue == null)
{
if (create != null)
{
outputValue = create(nativePtr);
objCache[nativePtr] = new WeakReference(outputValue);
}
else if(typeof(T) == typeof(System.Object))
{
//T is an object, so lets just pass back our IntPtr, which is an object.
outputValue = (T)(System.Object)nativePtr;
}
}
}
return outputValue;
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: d03d0f1305bee2541b8bf6b6aad5ae66
timeCreated: 18446744011573954816
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Linq;
namespace Helper
{
public static class NativeWrapper
{
public static System.IntPtr GetNativePtr(Object obj)
{
if(obj == null)
{
return System.IntPtr.Zero;
}
var nativeWrapperIface = obj as INativeWrapper;
if(nativeWrapperIface != null)
{
return nativeWrapperIface.nativePtr;
}
else
{
throw new ArgumentException("Object must wrap native type");
}
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 6a5563074073a2746adeab572f9254f2
timeCreated: 18446744011573954816
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Linq;
namespace Helper
{
public class SmartGCHandle : IDisposable
{
private GCHandle handle;
public SmartGCHandle(GCHandle handle)
{
this.handle = handle;
}
~SmartGCHandle()
{
Dispose(false);
}
public System.IntPtr AddrOfPinnedObject()
{
return handle.AddrOfPinnedObject();
}
public virtual void Dispose()
{
Dispose(true);
}
protected virtual void Dispose(bool disposing)
{
this.handle.Free();
}
public static implicit operator GCHandle(SmartGCHandle other)
{
return other.handle;
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: b8692c711ef8ca04b8cbc62b7aea656c
timeCreated: 18446744011573954816
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Linq;
namespace Helper
{
public class ThreadSafeDictionary<TKey, TValue>
{
protected readonly Dictionary<TKey, TValue> _impl = new Dictionary<TKey, TValue>();
public TValue this[TKey key]
{
get
{
lock (_impl)
{
return _impl[key];
}
}
set
{
lock (_impl)
{
_impl[key] = value;
}
}
}
public void Add(TKey key, TValue value)
{
lock (_impl)
{
_impl.Add(key, value);
}
}
public bool TryGetValue(TKey key, out TValue value)
{
lock (_impl)
{
return _impl.TryGetValue(key, out value);
}
}
public bool Remove(TKey key)
{
lock (_impl)
{
return _impl.Remove(key);
}
}
public void Clear()
{
lock (_impl)
{
_impl.Clear();
}
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 9e4d8029771f44e45ac2b95f1172e12b
timeCreated: 18446744011573954816
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 2723e673de8807e43ad17c3ba3135b72
folderAsset: yes
timeCreated: 1502957664
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 04e90123037305243906258ff07b4736
folderAsset: yes
timeCreated: 1502957664
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
using RootSystem = System;
using System.Linq;
using System.Collections.Generic;
namespace Windows.Data
{
//
// Windows.Data.PropertyChangedEventArgs
//
public sealed partial class PropertyChangedEventArgs : RootSystem.EventArgs, Helper.INativeWrapper
{
internal RootSystem.IntPtr _pNative;
RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
// Constructors and Finalizers
internal PropertyChangedEventArgs(RootSystem.IntPtr pNative)
{
_pNative = pNative;
Windows_Data_PropertyChangedEventArgs_AddRefObject(ref _pNative);
}
~PropertyChangedEventArgs()
{
Dispose(false);
}
[RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern void Windows_Data_PropertyChangedEventArgs_ReleaseObject(ref RootSystem.IntPtr pNative);
[RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern void Windows_Data_PropertyChangedEventArgs_AddRefObject(ref RootSystem.IntPtr pNative);
private void Dispose(bool disposing)
{
if (_pNative == RootSystem.IntPtr.Zero)
{
return;
}
__EventCleanup();
Helper.NativeObjectCache.RemoveObject<PropertyChangedEventArgs>(_pNative);
Windows_Data_PropertyChangedEventArgs_ReleaseObject(ref _pNative);
_pNative = RootSystem.IntPtr.Zero;
}
// Public Properties
[RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern RootSystem.IntPtr Windows_Data_PropertyChangedEventArgs_get_PropertyName(RootSystem.IntPtr pNative);
public string PropertyName
{
get
{
if (_pNative == RootSystem.IntPtr.Zero)
{
throw new RootSystem.ObjectDisposedException("PropertyChangedEventArgs");
}
RootSystem.IntPtr objectPointer = Windows_Data_PropertyChangedEventArgs_get_PropertyName(_pNative);
Helper.ExceptionHelper.CheckLastError();
var managedString = RootSystem.Runtime.InteropServices.Marshal.PtrToStringUni(objectPointer);
RootSystem.Runtime.InteropServices.Marshal.FreeCoTaskMem(objectPointer);
return managedString;
}
}
private void __EventCleanup()
{
}
}
}
fileFormatVersion: 2
guid: 0f717bd2a5c39cc43a49fc8904889932
timeCreated: 18446744011573954816
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 7eaeb51706298234982d58b7d8469461
folderAsset: yes
timeCreated: 1502957664
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
using RootSystem = System;
using System.Linq;
using System.Collections.Generic;
namespace Windows.Kinect
{
//
// Windows.Kinect.Activity
//
public enum Activity : int
{
EyeLeftClosed =0,
EyeRightClosed =1,
MouthOpen =2,
MouthMoved =3,
LookingAway =4,
}
}
fileFormatVersion: 2
guid: ec6785f19ac6c494a9957fa63f49fcf5
timeCreated: 18446744011573954816
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using RootSystem = System;
using System.Linq;
using System.Collections.Generic;
namespace Windows.Kinect
{
//
// Windows.Kinect.Appearance
//
public enum Appearance : int
{
WearingGlasses =0,
}
}
fileFormatVersion: 2
guid: 00eb0d9c4964c0b4f9e3090704ff7201
timeCreated: 18446744011573954816
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
fileFormatVersion: 2
guid: e64f7eb8de6f72e42874eb2ea7c01be5
timeCreated: 18446744011573954816
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using RootSystem = System;
using System.Linq;
using System.Collections.Generic;
namespace Windows.Kinect
{
//
// Windows.Kinect.AudioBeamFrame
//
public sealed partial class AudioBeamFrame : RootSystem.IDisposable, Helper.INativeWrapper
{
internal RootSystem.IntPtr _pNative;
RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
// Constructors and Finalizers
internal AudioBeamFrame(RootSystem.IntPtr pNative)
{
_pNative = pNative;
Windows_Kinect_AudioBeamFrame_AddRefObject(ref _pNative);
}
~AudioBeamFrame()
{
Dispose(false);
}
[RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern void Windows_Kinect_AudioBeamFrame_ReleaseObject(ref RootSystem.IntPtr pNative);
[RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern void Windows_Kinect_AudioBeamFrame_AddRefObject(ref RootSystem.IntPtr pNative);
// Public Properties
[RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern RootSystem.IntPtr Windows_Kinect_AudioBeamFrame_get_AudioBeam(RootSystem.IntPtr pNative);
public Windows.Kinect.AudioBeam AudioBeam
{
get
{
if (_pNative == RootSystem.IntPtr.Zero)
{
throw new RootSystem.ObjectDisposedException("AudioBeamFrame");
}
RootSystem.IntPtr objectPointer = Windows_Kinect_AudioBeamFrame_get_AudioBeam(_pNative);
Helper.ExceptionHelper.CheckLastError();
if (objectPointer == RootSystem.IntPtr.Zero)
{
return null;
}
return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.AudioBeam>(objectPointer, n => new Windows.Kinect.AudioBeam(n));
}
}
[RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern RootSystem.IntPtr Windows_Kinect_AudioBeamFrame_get_AudioSource(RootSystem.IntPtr pNative);
public Windows.Kinect.AudioSource AudioSource
{
get
{
if (_pNative == RootSystem.IntPtr.Zero)
{
throw new RootSystem.ObjectDisposedException("AudioBeamFrame");
}
RootSystem.IntPtr objectPointer = Windows_Kinect_AudioBeamFrame_get_AudioSource(_pNative);
Helper.ExceptionHelper.CheckLastError();
if (objectPointer == RootSystem.IntPtr.Zero)
{
return null;
}
return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.AudioSource>(objectPointer, n => new Windows.Kinect.AudioSource(n));
}
}
[RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern long Windows_Kinect_AudioBeamFrame_get_Duration(RootSystem.IntPtr pNative);
public RootSystem.TimeSpan Duration
{
get
{
if (_pNative == RootSystem.IntPtr.Zero)
{
throw new RootSystem.ObjectDisposedException("AudioBeamFrame");
}
return RootSystem.TimeSpan.FromMilliseconds(Windows_Kinect_AudioBeamFrame_get_Duration(_pNative));
}
}
[RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern long Windows_Kinect_AudioBeamFrame_get_RelativeTimeStart(RootSystem.IntPtr pNative);
public RootSystem.TimeSpan RelativeTimeStart
{
get
{
if (_pNative == RootSystem.IntPtr.Zero)
{
throw new RootSystem.ObjectDisposedException("AudioBeamFrame");
}
return RootSystem.TimeSpan.FromMilliseconds(Windows_Kinect_AudioBeamFrame_get_RelativeTimeStart(_pNative));
}
}
// Public Methods
private void __EventCleanup()
{
}
}
}
fileFormatVersion: 2
guid: 8ff93fd69396b944ea1e0d067cf5b091
timeCreated: 18446744011573954816
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment