김다솜

kinect avatar tracking

Showing 142 changed files with 17808 additions and 0 deletions
1 +%YAML 1.1
2 +%TAG !u! tag:unity3d.com,2011:
3 +--- !u!29 &1
4 +OcclusionCullingSettings:
5 + m_ObjectHideFlags: 0
6 + serializedVersion: 2
7 + m_OcclusionBakeSettings:
8 + smallestOccluder: 5
9 + smallestHole: 0.25
10 + backfaceThreshold: 100
11 + m_SceneGUID: 00000000000000000000000000000000
12 + m_OcclusionCullingData: {fileID: 0}
13 +--- !u!104 &2
14 +RenderSettings:
15 + m_ObjectHideFlags: 0
16 + serializedVersion: 9
17 + m_Fog: 0
18 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
19 + m_FogMode: 3
20 + m_FogDensity: 0.01
21 + m_LinearFogStart: 0
22 + m_LinearFogEnd: 300
23 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
24 + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
25 + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
26 + m_AmbientIntensity: 1
27 + m_AmbientMode: 0
28 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
29 + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
30 + m_HaloStrength: 0.5
31 + m_FlareStrength: 1
32 + m_FlareFadeSpeed: 3
33 + m_HaloTexture: {fileID: 0}
34 + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
35 + m_DefaultReflectionMode: 0
36 + m_DefaultReflectionResolution: 128
37 + m_ReflectionBounces: 1
38 + m_ReflectionIntensity: 1
39 + m_CustomReflection: {fileID: 0}
40 + m_Sun: {fileID: 0}
41 + m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
42 + m_UseRadianceAmbientProbe: 0
43 +--- !u!157 &3
44 +LightmapSettings:
45 + m_ObjectHideFlags: 0
46 + serializedVersion: 11
47 + m_GIWorkflowMode: 1
48 + m_GISettings:
49 + serializedVersion: 2
50 + m_BounceScale: 1
51 + m_IndirectOutputScale: 1
52 + m_AlbedoBoost: 1
53 + m_EnvironmentLightingMode: 0
54 + m_EnableBakedLightmaps: 1
55 + m_EnableRealtimeLightmaps: 0
56 + m_LightmapEditorSettings:
57 + serializedVersion: 12
58 + m_Resolution: 2
59 + m_BakeResolution: 40
60 + m_AtlasSize: 1024
61 + m_AO: 0
62 + m_AOMaxDistance: 1
63 + m_CompAOExponent: 1
64 + m_CompAOExponentDirect: 0
65 + m_ExtractAmbientOcclusion: 0
66 + m_Padding: 2
67 + m_LightmapParameters: {fileID: 0}
68 + m_LightmapsBakeMode: 1
69 + m_TextureCompression: 1
70 + m_FinalGather: 0
71 + m_FinalGatherFiltering: 1
72 + m_FinalGatherRayCount: 256
73 + m_ReflectionCompression: 2
74 + m_MixedBakeMode: 2
75 + m_BakeBackend: 1
76 + m_PVRSampling: 1
77 + m_PVRDirectSampleCount: 32
78 + m_PVRSampleCount: 512
79 + m_PVRBounces: 2
80 + m_PVREnvironmentSampleCount: 256
81 + m_PVREnvironmentReferencePointCount: 2048
82 + m_PVRFilteringMode: 1
83 + m_PVRDenoiserTypeDirect: 1
84 + m_PVRDenoiserTypeIndirect: 1
85 + m_PVRDenoiserTypeAO: 1
86 + m_PVRFilterTypeDirect: 0
87 + m_PVRFilterTypeIndirect: 0
88 + m_PVRFilterTypeAO: 0
89 + m_PVREnvironmentMIS: 1
90 + m_PVRCulling: 1
91 + m_PVRFilteringGaussRadiusDirect: 1
92 + m_PVRFilteringGaussRadiusIndirect: 5
93 + m_PVRFilteringGaussRadiusAO: 2
94 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5
95 + m_PVRFilteringAtrousPositionSigmaIndirect: 2
96 + m_PVRFilteringAtrousPositionSigmaAO: 1
97 + m_ExportTrainingData: 0
98 + m_TrainingDataDestination: TrainingData
99 + m_LightProbeSampleCountMultiplier: 4
100 + m_LightingDataAsset: {fileID: 0}
101 + m_UseShadowmask: 1
102 +--- !u!196 &4
103 +NavMeshSettings:
104 + serializedVersion: 2
105 + m_ObjectHideFlags: 0
106 + m_BuildSettings:
107 + serializedVersion: 2
108 + agentTypeID: 0
109 + agentRadius: 0.5
110 + agentHeight: 2
111 + agentSlope: 45
112 + agentClimb: 0.4
113 + ledgeDropHeight: 0
114 + maxJumpAcrossDistance: 0
115 + minRegionArea: 2
116 + manualCellSize: 0
117 + cellSize: 0.16666667
118 + manualTileSize: 0
119 + tileSize: 256
120 + accuratePlacement: 0
121 + debug:
122 + m_Flags: 0
123 + m_NavMeshData: {fileID: 0}
124 +--- !u!1 &116372581
125 +GameObject:
126 + m_ObjectHideFlags: 0
127 + m_CorrespondingSourceObject: {fileID: 0}
128 + m_PrefabInstance: {fileID: 762874939}
129 + m_PrefabAsset: {fileID: 0}
130 + serializedVersion: 6
131 + m_Component:
132 + - component: {fileID: 116372582}
133 + m_Layer: 0
134 + m_Name: Yuna Prefab (Missing Prefab)
135 + m_TagString: Untagged
136 + m_Icon: {fileID: 0}
137 + m_NavMeshLayer: 0
138 + m_StaticEditorFlags: 0
139 + m_IsActive: 1
140 +--- !u!4 &116372582
141 +Transform:
142 + m_ObjectHideFlags: 0
143 + m_CorrespondingSourceObject: {fileID: 0}
144 + m_PrefabInstance: {fileID: 762874939}
145 + m_PrefabAsset: {fileID: 0}
146 + m_GameObject: {fileID: 116372581}
147 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
148 + m_LocalPosition: {x: 0, y: 0, z: 0}
149 + m_LocalScale: {x: 1, y: 1, z: 1}
150 + m_Children:
151 + - {fileID: 1862774072}
152 + - {fileID: 1862774071}
153 + m_Father: {fileID: 1135918022}
154 + m_RootOrder: 1
155 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
156 +--- !u!1 &713465048
157 +GameObject:
158 + m_ObjectHideFlags: 0
159 + m_CorrespondingSourceObject: {fileID: 0}
160 + m_PrefabInstance: {fileID: 0}
161 + m_PrefabAsset: {fileID: 0}
162 + serializedVersion: 6
163 + m_Component:
164 + - component: {fileID: 713465051}
165 + - component: {fileID: 713465050}
166 + - component: {fileID: 713465049}
167 + m_Layer: 0
168 + m_Name: Main Camera
169 + m_TagString: MainCamera
170 + m_Icon: {fileID: 0}
171 + m_NavMeshLayer: 0
172 + m_StaticEditorFlags: 0
173 + m_IsActive: 1
174 +--- !u!81 &713465049
175 +AudioListener:
176 + m_ObjectHideFlags: 0
177 + m_CorrespondingSourceObject: {fileID: 0}
178 + m_PrefabInstance: {fileID: 0}
179 + m_PrefabAsset: {fileID: 0}
180 + m_GameObject: {fileID: 713465048}
181 + m_Enabled: 1
182 +--- !u!20 &713465050
183 +Camera:
184 + m_ObjectHideFlags: 0
185 + m_CorrespondingSourceObject: {fileID: 0}
186 + m_PrefabInstance: {fileID: 0}
187 + m_PrefabAsset: {fileID: 0}
188 + m_GameObject: {fileID: 713465048}
189 + m_Enabled: 1
190 + serializedVersion: 2
191 + m_ClearFlags: 1
192 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
193 + m_projectionMatrixMode: 1
194 + m_GateFitMode: 2
195 + m_FOVAxisMode: 0
196 + m_SensorSize: {x: 36, y: 24}
197 + m_LensShift: {x: 0, y: 0}
198 + m_FocalLength: 50
199 + m_NormalizedViewPortRect:
200 + serializedVersion: 2
201 + x: 0
202 + y: 0
203 + width: 1
204 + height: 1
205 + near clip plane: 0.3
206 + far clip plane: 1000
207 + field of view: 60
208 + orthographic: 0
209 + orthographic size: 5
210 + m_Depth: -1
211 + m_CullingMask:
212 + serializedVersion: 2
213 + m_Bits: 4294967295
214 + m_RenderingPath: -1
215 + m_TargetTexture: {fileID: 0}
216 + m_TargetDisplay: 0
217 + m_TargetEye: 3
218 + m_HDR: 1
219 + m_AllowMSAA: 1
220 + m_AllowDynamicResolution: 0
221 + m_ForceIntoRT: 0
222 + m_OcclusionCulling: 1
223 + m_StereoConvergence: 10
224 + m_StereoSeparation: 0.022
225 +--- !u!4 &713465051
226 +Transform:
227 + m_ObjectHideFlags: 0
228 + m_CorrespondingSourceObject: {fileID: 0}
229 + m_PrefabInstance: {fileID: 0}
230 + m_PrefabAsset: {fileID: 0}
231 + m_GameObject: {fileID: 713465048}
232 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
233 + m_LocalPosition: {x: 0, y: 1, z: -10}
234 + m_LocalScale: {x: 1, y: 1, z: 1}
235 + m_Children: []
236 + m_Father: {fileID: 0}
237 + m_RootOrder: 0
238 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
239 +--- !u!1 &726638625
240 +GameObject:
241 + m_ObjectHideFlags: 0
242 + m_CorrespondingSourceObject: {fileID: 0}
243 + m_PrefabInstance: {fileID: 0}
244 + m_PrefabAsset: {fileID: 0}
245 + serializedVersion: 6
246 + m_Component:
247 + - component: {fileID: 726638627}
248 + - component: {fileID: 726638626}
249 + m_Layer: 0
250 + m_Name: BodySourceView
251 + m_TagString: Untagged
252 + m_Icon: {fileID: 0}
253 + m_NavMeshLayer: 0
254 + m_StaticEditorFlags: 0
255 + m_IsActive: 1
256 +--- !u!114 &726638626
257 +MonoBehaviour:
258 + m_ObjectHideFlags: 0
259 + m_CorrespondingSourceObject: {fileID: 0}
260 + m_PrefabInstance: {fileID: 0}
261 + m_PrefabAsset: {fileID: 0}
262 + m_GameObject: {fileID: 726638625}
263 + m_Enabled: 1
264 + m_EditorHideFlags: 0
265 + m_Script: {fileID: 11500000, guid: 8821130411451d343a1488e2a9db134e, type: 3}
266 + m_Name:
267 + m_EditorClassIdentifier:
268 + BoneMaterial: {fileID: 2100000, guid: f2ea145c63353784985576f08398a815, type: 2}
269 + BodySourceManager: {fileID: 726638625}
270 +--- !u!4 &726638627
271 +Transform:
272 + m_ObjectHideFlags: 0
273 + m_CorrespondingSourceObject: {fileID: 0}
274 + m_PrefabInstance: {fileID: 0}
275 + m_PrefabAsset: {fileID: 0}
276 + m_GameObject: {fileID: 726638625}
277 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
278 + m_LocalPosition: {x: -2.9802324e-10, y: 0.13996428, z: -0.0018711961}
279 + m_LocalScale: {x: 1, y: 1, z: 1}
280 + m_Children: []
281 + m_Father: {fileID: 0}
282 + m_RootOrder: 4
283 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
284 +--- !u!1001 &762874939
285 +PrefabInstance:
286 + m_ObjectHideFlags: 0
287 + serializedVersion: 2
288 + m_Modification:
289 + m_TransformParent: {fileID: 1135918022}
290 + m_Modifications:
291 + - target: {fileID: 1797305983796964, guid: 2629a30b7c43aa94d914368a76b45918, type: 3}
292 + propertyPath: m_Name
293 + value: Yuna Prefab
294 + objectReference: {fileID: 0}
295 + - target: {fileID: 4708503561146946, guid: 2629a30b7c43aa94d914368a76b45918, type: 3}
296 + propertyPath: m_LocalPosition.x
297 + value: 0
298 + objectReference: {fileID: 0}
299 + - target: {fileID: 4708503561146946, guid: 2629a30b7c43aa94d914368a76b45918, type: 3}
300 + propertyPath: m_LocalPosition.y
301 + value: 0
302 + objectReference: {fileID: 0}
303 + - target: {fileID: 4708503561146946, guid: 2629a30b7c43aa94d914368a76b45918, type: 3}
304 + propertyPath: m_LocalPosition.z
305 + value: 0
306 + objectReference: {fileID: 0}
307 + - target: {fileID: 4708503561146946, guid: 2629a30b7c43aa94d914368a76b45918, type: 3}
308 + propertyPath: m_LocalRotation.x
309 + value: 0
310 + objectReference: {fileID: 0}
311 + - target: {fileID: 4708503561146946, guid: 2629a30b7c43aa94d914368a76b45918, type: 3}
312 + propertyPath: m_LocalRotation.y
313 + value: 0
314 + objectReference: {fileID: 0}
315 + - target: {fileID: 4708503561146946, guid: 2629a30b7c43aa94d914368a76b45918, type: 3}
316 + propertyPath: m_LocalRotation.z
317 + value: 0
318 + objectReference: {fileID: 0}
319 + - target: {fileID: 4708503561146946, guid: 2629a30b7c43aa94d914368a76b45918, type: 3}
320 + propertyPath: m_LocalRotation.w
321 + value: 1
322 + objectReference: {fileID: 0}
323 + - target: {fileID: 4708503561146946, guid: 2629a30b7c43aa94d914368a76b45918, type: 3}
324 + propertyPath: m_RootOrder
325 + value: 1
326 + objectReference: {fileID: 0}
327 + - target: {fileID: 4708503561146946, guid: 2629a30b7c43aa94d914368a76b45918, type: 3}
328 + propertyPath: m_LocalEulerAnglesHint.x
329 + value: 0
330 + objectReference: {fileID: 0}
331 + - target: {fileID: 4708503561146946, guid: 2629a30b7c43aa94d914368a76b45918, type: 3}
332 + propertyPath: m_LocalEulerAnglesHint.y
333 + value: 0
334 + objectReference: {fileID: 0}
335 + - target: {fileID: 4708503561146946, guid: 2629a30b7c43aa94d914368a76b45918, type: 3}
336 + propertyPath: m_LocalEulerAnglesHint.z
337 + value: 0
338 + objectReference: {fileID: 0}
339 + - target: {fileID: 95420946213149514, guid: 2629a30b7c43aa94d914368a76b45918,
340 + type: 3}
341 + propertyPath: m_Controller
342 + value:
343 + objectReference: {fileID: 9100000, guid: 24bc9a48ffd1bec46885c34c849e1d21, type: 2}
344 + - target: {fileID: 95420946213149514, guid: 2629a30b7c43aa94d914368a76b45918,
345 + type: 3}
346 + propertyPath: m_UpdateMode
347 + value: 1
348 + objectReference: {fileID: 0}
349 + m_RemovedComponents: []
350 + m_SourcePrefab: {fileID: 100100000, guid: 2629a30b7c43aa94d914368a76b45918, type: 3}
351 +--- !u!1 &819216515
352 +GameObject:
353 + m_ObjectHideFlags: 0
354 + m_CorrespondingSourceObject: {fileID: 0}
355 + m_PrefabInstance: {fileID: 762874939}
356 + m_PrefabAsset: {fileID: 0}
357 + serializedVersion: 6
358 + m_Component:
359 + - component: {fileID: 1862774071}
360 + m_Layer: 0
361 + m_Name: Missing Prefab (Dummy)
362 + m_TagString: Untagged
363 + m_Icon: {fileID: 0}
364 + m_NavMeshLayer: 0
365 + m_StaticEditorFlags: 0
366 + m_IsActive: 1
367 +--- !u!1 &983073246
368 +GameObject:
369 + m_ObjectHideFlags: 0
370 + m_CorrespondingSourceObject: {fileID: 0}
371 + m_PrefabInstance: {fileID: 0}
372 + m_PrefabAsset: {fileID: 0}
373 + serializedVersion: 6
374 + m_Component:
375 + - component: {fileID: 983073248}
376 + - component: {fileID: 983073247}
377 + m_Layer: 0
378 + m_Name: Directional Light
379 + m_TagString: Untagged
380 + m_Icon: {fileID: 0}
381 + m_NavMeshLayer: 0
382 + m_StaticEditorFlags: 0
383 + m_IsActive: 1
384 +--- !u!108 &983073247
385 +Light:
386 + m_ObjectHideFlags: 0
387 + m_CorrespondingSourceObject: {fileID: 0}
388 + m_PrefabInstance: {fileID: 0}
389 + m_PrefabAsset: {fileID: 0}
390 + m_GameObject: {fileID: 983073246}
391 + m_Enabled: 1
392 + serializedVersion: 10
393 + m_Type: 1
394 + m_Shape: 0
395 + m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
396 + m_Intensity: 1
397 + m_Range: 10
398 + m_SpotAngle: 30
399 + m_InnerSpotAngle: 21.80208
400 + m_CookieSize: 10
401 + m_Shadows:
402 + m_Type: 2
403 + m_Resolution: -1
404 + m_CustomResolution: -1
405 + m_Strength: 1
406 + m_Bias: 0.05
407 + m_NormalBias: 0.4
408 + m_NearPlane: 0.2
409 + m_CullingMatrixOverride:
410 + e00: 1
411 + e01: 0
412 + e02: 0
413 + e03: 0
414 + e10: 0
415 + e11: 1
416 + e12: 0
417 + e13: 0
418 + e20: 0
419 + e21: 0
420 + e22: 1
421 + e23: 0
422 + e30: 0
423 + e31: 0
424 + e32: 0
425 + e33: 1
426 + m_UseCullingMatrixOverride: 0
427 + m_Cookie: {fileID: 0}
428 + m_DrawHalo: 0
429 + m_Flare: {fileID: 0}
430 + m_RenderMode: 0
431 + m_CullingMask:
432 + serializedVersion: 2
433 + m_Bits: 4294967295
434 + m_RenderingLayerMask: 1
435 + m_Lightmapping: 4
436 + m_LightShadowCasterMode: 0
437 + m_AreaSize: {x: 1, y: 1}
438 + m_BounceIntensity: 1
439 + m_ColorTemperature: 6570
440 + m_UseColorTemperature: 0
441 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
442 + m_UseBoundingSphereOverride: 0
443 + m_ShadowRadius: 0
444 + m_ShadowAngle: 0
445 +--- !u!4 &983073248
446 +Transform:
447 + m_ObjectHideFlags: 0
448 + m_CorrespondingSourceObject: {fileID: 0}
449 + m_PrefabInstance: {fileID: 0}
450 + m_PrefabAsset: {fileID: 0}
451 + m_GameObject: {fileID: 983073246}
452 + m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
453 + m_LocalPosition: {x: 0, y: 3, z: 0}
454 + m_LocalScale: {x: 1, y: 1, z: 1}
455 + m_Children: []
456 + m_Father: {fileID: 0}
457 + m_RootOrder: 1
458 + m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
459 +--- !u!1 &1135918020
460 +GameObject:
461 + m_ObjectHideFlags: 0
462 + m_CorrespondingSourceObject: {fileID: 0}
463 + m_PrefabInstance: {fileID: 0}
464 + m_PrefabAsset: {fileID: 0}
465 + serializedVersion: 6
466 + m_Component:
467 + - component: {fileID: 1135918022}
468 + - component: {fileID: 1135918021}
469 + - component: {fileID: 1135918023}
470 + m_Layer: 0
471 + m_Name: GameObject
472 + m_TagString: Untagged
473 + m_Icon: {fileID: 0}
474 + m_NavMeshLayer: 0
475 + m_StaticEditorFlags: 0
476 + m_IsActive: 1
477 +--- !u!114 &1135918021
478 +MonoBehaviour:
479 + m_ObjectHideFlags: 0
480 + m_CorrespondingSourceObject: {fileID: 0}
481 + m_PrefabInstance: {fileID: 0}
482 + m_PrefabAsset: {fileID: 0}
483 + m_GameObject: {fileID: 1135918020}
484 + m_Enabled: 0
485 + m_EditorHideFlags: 0
486 + m_Script: {fileID: 11500000, guid: 8821130411451d343a1488e2a9db134e, type: 3}
487 + m_Name:
488 + m_EditorClassIdentifier:
489 + BoneMaterial: {fileID: 2100000, guid: f2ea145c63353784985576f08398a815, type: 2}
490 + BodySourceManager: {fileID: 2061180373}
491 +--- !u!4 &1135918022
492 +Transform:
493 + m_ObjectHideFlags: 0
494 + m_CorrespondingSourceObject: {fileID: 0}
495 + m_PrefabInstance: {fileID: 0}
496 + m_PrefabAsset: {fileID: 0}
497 + m_GameObject: {fileID: 1135918020}
498 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
499 + m_LocalPosition: {x: -2.9802324e-10, y: 0.13996428, z: -0.0018711961}
500 + m_LocalScale: {x: 1, y: 1, z: 1}
501 + m_Children:
502 + - {fileID: 1520274719}
503 + - {fileID: 116372582}
504 + m_Father: {fileID: 0}
505 + m_RootOrder: 3
506 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
507 +--- !u!114 &1135918023
508 +MonoBehaviour:
509 + m_ObjectHideFlags: 0
510 + m_CorrespondingSourceObject: {fileID: 0}
511 + m_PrefabInstance: {fileID: 0}
512 + m_PrefabAsset: {fileID: 0}
513 + m_GameObject: {fileID: 1135918020}
514 + m_Enabled: 1
515 + m_EditorHideFlags: 0
516 + m_Script: {fileID: 11500000, guid: 819eb0cfd2d3e7c439a730d87e92e292, type: 3}
517 + m_Name:
518 + m_EditorClassIdentifier:
519 + BoneMaterial: {fileID: 2100000, guid: f2ea145c63353784985576f08398a815, type: 2}
520 + BodySourceManager: {fileID: 2061180373}
521 + humanoid: {fileID: 0}
522 + mirror: 1
523 + move: 1
524 +--- !u!1 &1520274718
525 +GameObject:
526 + m_ObjectHideFlags: 0
527 + m_CorrespondingSourceObject: {fileID: 0}
528 + m_PrefabInstance: {fileID: 0}
529 + m_PrefabAsset: {fileID: 0}
530 + serializedVersion: 6
531 + m_Component:
532 + - component: {fileID: 1520274719}
533 + - component: {fileID: 1520274722}
534 + - component: {fileID: 1520274721}
535 + - component: {fileID: 1520274720}
536 + m_Layer: 0
537 + m_Name: Cube
538 + m_TagString: Untagged
539 + m_Icon: {fileID: 0}
540 + m_NavMeshLayer: 0
541 + m_StaticEditorFlags: 0
542 + m_IsActive: 0
543 +--- !u!4 &1520274719
544 +Transform:
545 + m_ObjectHideFlags: 0
546 + m_CorrespondingSourceObject: {fileID: 0}
547 + m_PrefabInstance: {fileID: 0}
548 + m_PrefabAsset: {fileID: 0}
549 + m_GameObject: {fileID: 1520274718}
550 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
551 + m_LocalPosition: {x: 0, y: 0, z: 0}
552 + m_LocalScale: {x: 1, y: 1, z: 1}
553 + m_Children: []
554 + m_Father: {fileID: 1135918022}
555 + m_RootOrder: 0
556 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
557 +--- !u!65 &1520274720
558 +BoxCollider:
559 + m_ObjectHideFlags: 0
560 + m_CorrespondingSourceObject: {fileID: 0}
561 + m_PrefabInstance: {fileID: 0}
562 + m_PrefabAsset: {fileID: 0}
563 + m_GameObject: {fileID: 1520274718}
564 + m_Material: {fileID: 0}
565 + m_IsTrigger: 0
566 + m_Enabled: 1
567 + serializedVersion: 2
568 + m_Size: {x: 1, y: 1, z: 1}
569 + m_Center: {x: 0, y: 0, z: 0}
570 +--- !u!23 &1520274721
571 +MeshRenderer:
572 + m_ObjectHideFlags: 0
573 + m_CorrespondingSourceObject: {fileID: 0}
574 + m_PrefabInstance: {fileID: 0}
575 + m_PrefabAsset: {fileID: 0}
576 + m_GameObject: {fileID: 1520274718}
577 + m_Enabled: 1
578 + m_CastShadows: 1
579 + m_ReceiveShadows: 1
580 + m_DynamicOccludee: 1
581 + m_MotionVectors: 1
582 + m_LightProbeUsage: 1
583 + m_ReflectionProbeUsage: 1
584 + m_RayTracingMode: 2
585 + m_RenderingLayerMask: 1
586 + m_RendererPriority: 0
587 + m_Materials:
588 + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
589 + m_StaticBatchInfo:
590 + firstSubMesh: 0
591 + subMeshCount: 0
592 + m_StaticBatchRoot: {fileID: 0}
593 + m_ProbeAnchor: {fileID: 0}
594 + m_LightProbeVolumeOverride: {fileID: 0}
595 + m_ScaleInLightmap: 1
596 + m_ReceiveGI: 1
597 + m_PreserveUVs: 0
598 + m_IgnoreNormalsForChartDetection: 0
599 + m_ImportantGI: 0
600 + m_StitchLightmapSeams: 1
601 + m_SelectedEditorRenderState: 3
602 + m_MinimumChartSize: 4
603 + m_AutoUVMaxDistance: 0.5
604 + m_AutoUVMaxAngle: 89
605 + m_LightmapParameters: {fileID: 0}
606 + m_SortingLayerID: 0
607 + m_SortingLayer: 0
608 + m_SortingOrder: 0
609 +--- !u!33 &1520274722
610 +MeshFilter:
611 + m_ObjectHideFlags: 0
612 + m_CorrespondingSourceObject: {fileID: 0}
613 + m_PrefabInstance: {fileID: 0}
614 + m_PrefabAsset: {fileID: 0}
615 + m_GameObject: {fileID: 1520274718}
616 + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
617 +--- !u!1 &1862774070
618 +GameObject:
619 + m_ObjectHideFlags: 0
620 + m_CorrespondingSourceObject: {fileID: 1797305983796964, guid: 2629a30b7c43aa94d914368a76b45918,
621 + type: 3}
622 + m_PrefabInstance: {fileID: 762874939}
623 + m_PrefabAsset: {fileID: 0}
624 + serializedVersion: 6
625 + m_Component:
626 + - component: {fileID: 1862774072}
627 + - component: {fileID: 1862774074}
628 + - component: {fileID: 1862774073}
629 + m_Layer: 0
630 + m_Name: Missing Prefab (Dummy)
631 + m_TagString: Untagged
632 + m_Icon: {fileID: 0}
633 + m_NavMeshLayer: 0
634 + m_StaticEditorFlags: 0
635 + m_IsActive: 0
636 +--- !u!4 &1862774071
637 +Transform:
638 + m_ObjectHideFlags: 0
639 + m_CorrespondingSourceObject: {fileID: 4708503561146946, guid: 2629a30b7c43aa94d914368a76b45918,
640 + type: 3}
641 + m_PrefabInstance: {fileID: 762874939}
642 + m_PrefabAsset: {fileID: 0}
643 + m_GameObject: {fileID: 819216515}
644 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
645 + m_LocalPosition: {x: 0, y: 0, z: 0}
646 + m_LocalScale: {x: 1, y: 1, z: 1}
647 + m_Children: []
648 + m_Father: {fileID: 116372582}
649 + m_RootOrder: 1
650 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
651 +--- !u!4 &1862774072
652 +Transform:
653 + m_ObjectHideFlags: 0
654 + m_CorrespondingSourceObject: {fileID: 0}
655 + m_PrefabInstance: {fileID: 762874939}
656 + m_PrefabAsset: {fileID: 0}
657 + m_GameObject: {fileID: 1862774070}
658 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
659 + m_LocalPosition: {x: 0, y: 0, z: 0}
660 + m_LocalScale: {x: 1, y: 1, z: 1}
661 + m_Children: []
662 + m_Father: {fileID: 116372582}
663 + m_RootOrder: 0
664 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
665 +--- !u!144 &1862774073
666 +CharacterJoint:
667 + m_ObjectHideFlags: 0
668 + m_CorrespondingSourceObject: {fileID: 0}
669 + m_PrefabInstance: {fileID: 0}
670 + m_PrefabAsset: {fileID: 0}
671 + m_GameObject: {fileID: 1862774070}
672 + m_ConnectedBody: {fileID: 0}
673 + m_Anchor: {x: 0, y: 0, z: 0}
674 + m_Axis: {x: 1, y: 0, z: 0}
675 + m_AutoConfigureConnectedAnchor: 1
676 + m_ConnectedAnchor: {x: -2.9802324e-10, y: 0.13996428, z: -0.0018711961}
677 + serializedVersion: 2
678 + m_SwingAxis: {x: 0, y: 1, z: 0}
679 + m_TwistLimitSpring:
680 + spring: 0
681 + damper: 0
682 + m_LowTwistLimit:
683 + limit: -20
684 + bounciness: 0
685 + contactDistance: 0
686 + m_HighTwistLimit:
687 + limit: 70
688 + bounciness: 0
689 + contactDistance: 0
690 + m_SwingLimitSpring:
691 + spring: 0
692 + damper: 0
693 + m_Swing1Limit:
694 + limit: 40
695 + bounciness: 0
696 + contactDistance: 0
697 + m_Swing2Limit:
698 + limit: 40
699 + bounciness: 0
700 + contactDistance: 0
701 + m_EnableProjection: 0
702 + m_ProjectionDistance: 0.1
703 + m_ProjectionAngle: 180
704 + m_BreakForce: Infinity
705 + m_BreakTorque: Infinity
706 + m_EnableCollision: 0
707 + m_EnablePreprocessing: 1
708 + m_MassScale: 1
709 + m_ConnectedMassScale: 1
710 +--- !u!54 &1862774074
711 +Rigidbody:
712 + m_ObjectHideFlags: 0
713 + m_CorrespondingSourceObject: {fileID: 0}
714 + m_PrefabInstance: {fileID: 0}
715 + m_PrefabAsset: {fileID: 0}
716 + m_GameObject: {fileID: 1862774070}
717 + serializedVersion: 2
718 + m_Mass: 1
719 + m_Drag: 0
720 + m_AngularDrag: 0.05
721 + m_UseGravity: 1
722 + m_IsKinematic: 0
723 + m_Interpolate: 0
724 + m_Constraints: 0
725 + m_CollisionDetection: 0
726 +--- !u!1 &2061180373
727 +GameObject:
728 + m_ObjectHideFlags: 0
729 + m_CorrespondingSourceObject: {fileID: 0}
730 + m_PrefabInstance: {fileID: 0}
731 + m_PrefabAsset: {fileID: 0}
732 + serializedVersion: 6
733 + m_Component:
734 + - component: {fileID: 2061180375}
735 + - component: {fileID: 2061180374}
736 + m_Layer: 0
737 + m_Name: BodySourceManager
738 + m_TagString: Untagged
739 + m_Icon: {fileID: 0}
740 + m_NavMeshLayer: 0
741 + m_StaticEditorFlags: 0
742 + m_IsActive: 1
743 +--- !u!114 &2061180374
744 +MonoBehaviour:
745 + m_ObjectHideFlags: 0
746 + m_CorrespondingSourceObject: {fileID: 0}
747 + m_PrefabInstance: {fileID: 0}
748 + m_PrefabAsset: {fileID: 0}
749 + m_GameObject: {fileID: 2061180373}
750 + m_Enabled: 1
751 + m_EditorHideFlags: 0
752 + m_Script: {fileID: 11500000, guid: 2e74aed0503c9d24290a1ae5438fddc3, type: 3}
753 + m_Name:
754 + m_EditorClassIdentifier:
755 +--- !u!4 &2061180375
756 +Transform:
757 + m_ObjectHideFlags: 0
758 + m_CorrespondingSourceObject: {fileID: 0}
759 + m_PrefabInstance: {fileID: 0}
760 + m_PrefabAsset: {fileID: 0}
761 + m_GameObject: {fileID: 2061180373}
762 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
763 + m_LocalPosition: {x: 0, y: 0.5453696, z: -0.0044015795}
764 + m_LocalScale: {x: 1, y: 1, z: 1}
765 + m_Children: []
766 + m_Father: {fileID: 0}
767 + m_RootOrder: 2
768 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
1 +%YAML 1.1
2 +%TAG !u! tag:unity3d.com,2011:
3 +--- !u!29 &1
4 +OcclusionCullingSettings:
5 + m_ObjectHideFlags: 0
6 + serializedVersion: 2
7 + m_OcclusionBakeSettings:
8 + smallestOccluder: 5
9 + smallestHole: 0.25
10 + backfaceThreshold: 100
11 + m_SceneGUID: 00000000000000000000000000000000
12 + m_OcclusionCullingData: {fileID: 0}
13 +--- !u!104 &2
14 +RenderSettings:
15 + m_ObjectHideFlags: 0
16 + serializedVersion: 9
17 + m_Fog: 0
18 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
19 + m_FogMode: 3
20 + m_FogDensity: 0.01
21 + m_LinearFogStart: 0
22 + m_LinearFogEnd: 300
23 + m_AmbientSkyColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}
24 + m_AmbientEquatorColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}
25 + m_AmbientGroundColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}
26 + m_AmbientIntensity: 1
27 + m_AmbientMode: 3
28 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
29 + m_SkyboxMaterial: {fileID: 0}
30 + m_HaloStrength: 0.5
31 + m_FlareStrength: 1
32 + m_FlareFadeSpeed: 3
33 + m_HaloTexture: {fileID: 0}
34 + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
35 + m_DefaultReflectionMode: 0
36 + m_DefaultReflectionResolution: 128
37 + m_ReflectionBounces: 1
38 + m_ReflectionIntensity: 1
39 + m_CustomReflection: {fileID: 0}
40 + m_Sun: {fileID: 0}
41 + m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
42 + m_UseRadianceAmbientProbe: 0
43 +--- !u!157 &4
44 +LightmapSettings:
45 + m_ObjectHideFlags: 0
46 + serializedVersion: 11
47 + m_GIWorkflowMode: 1
48 + m_GISettings:
49 + serializedVersion: 2
50 + m_BounceScale: 1
51 + m_IndirectOutputScale: 1
52 + m_AlbedoBoost: 1
53 + m_EnvironmentLightingMode: 0
54 + m_EnableBakedLightmaps: 1
55 + m_EnableRealtimeLightmaps: 0
56 + m_LightmapEditorSettings:
57 + serializedVersion: 12
58 + m_Resolution: 1
59 + m_BakeResolution: 50
60 + m_AtlasSize: 1024
61 + m_AO: 1
62 + m_AOMaxDistance: 1
63 + m_CompAOExponent: 1
64 + m_CompAOExponentDirect: 0
65 + m_ExtractAmbientOcclusion: 0
66 + m_Padding: 2
67 + m_LightmapParameters: {fileID: 0}
68 + m_LightmapsBakeMode: 1
69 + m_TextureCompression: 0
70 + m_FinalGather: 0
71 + m_FinalGatherFiltering: 1
72 + m_FinalGatherRayCount: 256
73 + m_ReflectionCompression: 2
74 + m_MixedBakeMode: 1
75 + m_BakeBackend: 0
76 + m_PVRSampling: 1
77 + m_PVRDirectSampleCount: 32
78 + m_PVRSampleCount: 512
79 + m_PVRBounces: 2
80 + m_PVREnvironmentSampleCount: 512
81 + m_PVREnvironmentReferencePointCount: 2048
82 + m_PVRFilteringMode: 0
83 + m_PVRDenoiserTypeDirect: 0
84 + m_PVRDenoiserTypeIndirect: 0
85 + m_PVRDenoiserTypeAO: 0
86 + m_PVRFilterTypeDirect: 0
87 + m_PVRFilterTypeIndirect: 0
88 + m_PVRFilterTypeAO: 0
89 + m_PVREnvironmentMIS: 0
90 + m_PVRCulling: 1
91 + m_PVRFilteringGaussRadiusDirect: 1
92 + m_PVRFilteringGaussRadiusIndirect: 5
93 + m_PVRFilteringGaussRadiusAO: 2
94 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5
95 + m_PVRFilteringAtrousPositionSigmaIndirect: 2
96 + m_PVRFilteringAtrousPositionSigmaAO: 1
97 + m_ExportTrainingData: 0
98 + m_TrainingDataDestination: TrainingData
99 + m_LightProbeSampleCountMultiplier: 4
100 + m_LightingDataAsset: {fileID: 0}
101 + m_UseShadowmask: 0
102 +--- !u!196 &5
103 +NavMeshSettings:
104 + serializedVersion: 2
105 + m_ObjectHideFlags: 0
106 + m_BuildSettings:
107 + serializedVersion: 2
108 + agentTypeID: 0
109 + agentRadius: 0.5
110 + agentHeight: 2
111 + agentSlope: 45
112 + agentClimb: 0.4
113 + ledgeDropHeight: 0
114 + maxJumpAcrossDistance: 0
115 + minRegionArea: 2
116 + manualCellSize: 0
117 + cellSize: 0.16666666
118 + manualTileSize: 0
119 + tileSize: 256
120 + accuratePlacement: 0
121 + debug:
122 + m_Flags: 0
123 + m_NavMeshData: {fileID: 0}
124 +--- !u!1 &112136118
125 +GameObject:
126 + m_ObjectHideFlags: 0
127 + m_CorrespondingSourceObject: {fileID: 0}
128 + m_PrefabInstance: {fileID: 0}
129 + m_PrefabAsset: {fileID: 0}
130 + serializedVersion: 6
131 + m_Component:
132 + - component: {fileID: 112136119}
133 + - component: {fileID: 112136120}
134 + m_Layer: 0
135 + m_Name: BodyView
136 + m_TagString: Untagged
137 + m_Icon: {fileID: 0}
138 + m_NavMeshLayer: 0
139 + m_StaticEditorFlags: 0
140 + m_IsActive: 1
141 +--- !u!4 &112136119
142 +Transform:
143 + m_ObjectHideFlags: 0
144 + m_CorrespondingSourceObject: {fileID: 0}
145 + m_PrefabInstance: {fileID: 0}
146 + m_PrefabAsset: {fileID: 0}
147 + m_GameObject: {fileID: 112136118}
148 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
149 + m_LocalPosition: {x: 0, y: 0, z: 0}
150 + m_LocalScale: {x: 1, y: 1, z: 1}
151 + m_Children:
152 + - {fileID: 716011534}
153 + m_Father: {fileID: 0}
154 + m_RootOrder: 1
155 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
156 +--- !u!114 &112136120
157 +MonoBehaviour:
158 + m_ObjectHideFlags: 0
159 + m_CorrespondingSourceObject: {fileID: 0}
160 + m_PrefabInstance: {fileID: 0}
161 + m_PrefabAsset: {fileID: 0}
162 + m_GameObject: {fileID: 112136118}
163 + m_Enabled: 1
164 + m_EditorHideFlags: 0
165 + m_Script: {fileID: 11500000, guid: 8821130411451d343a1488e2a9db134e, type: 3}
166 + m_Name:
167 + m_EditorClassIdentifier:
168 + BoneMaterial: {fileID: 2100000, guid: f2ea145c63353784985576f08398a815, type: 2}
169 + BodySourceManager: {fileID: 1698423884}
170 +--- !u!1 &252019523
171 +GameObject:
172 + m_ObjectHideFlags: 0
173 + m_CorrespondingSourceObject: {fileID: 0}
174 + m_PrefabInstance: {fileID: 0}
175 + m_PrefabAsset: {fileID: 0}
176 + serializedVersion: 6
177 + m_Component:
178 + - component: {fileID: 252019524}
179 + - component: {fileID: 252019527}
180 + - component: {fileID: 252019526}
181 + - component: {fileID: 252019525}
182 + - component: {fileID: 252019528}
183 + m_Layer: 0
184 + m_Name: DesignerOnlyView
185 + m_TagString: Untagged
186 + m_Icon: {fileID: 0}
187 + m_NavMeshLayer: 0
188 + m_StaticEditorFlags: 0
189 + m_IsActive: 1
190 +--- !u!4 &252019524
191 +Transform:
192 + m_ObjectHideFlags: 0
193 + m_CorrespondingSourceObject: {fileID: 0}
194 + m_PrefabInstance: {fileID: 0}
195 + m_PrefabAsset: {fileID: 0}
196 + m_GameObject: {fileID: 252019523}
197 + m_LocalRotation: {x: -0.7071069, y: 0, z: 0, w: 0.70710677}
198 + m_LocalPosition: {x: 60, y: -45, z: 50}
199 + m_LocalScale: {x: 13, y: 1, z: 10}
200 + m_Children: []
201 + m_Father: {fileID: 1988608401}
202 + m_RootOrder: 1
203 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
204 +--- !u!23 &252019525
205 +MeshRenderer:
206 + m_ObjectHideFlags: 0
207 + m_CorrespondingSourceObject: {fileID: 0}
208 + m_PrefabInstance: {fileID: 0}
209 + m_PrefabAsset: {fileID: 0}
210 + m_GameObject: {fileID: 252019523}
211 + m_Enabled: 1
212 + m_CastShadows: 1
213 + m_ReceiveShadows: 1
214 + m_DynamicOccludee: 1
215 + m_MotionVectors: 1
216 + m_LightProbeUsage: 0
217 + m_ReflectionProbeUsage: 1
218 + m_RayTracingMode: 2
219 + m_RenderingLayerMask: 1
220 + m_RendererPriority: 0
221 + m_Materials:
222 + - {fileID: 10302, guid: 0000000000000000f000000000000000, type: 0}
223 + m_StaticBatchInfo:
224 + firstSubMesh: 0
225 + subMeshCount: 0
226 + m_StaticBatchRoot: {fileID: 0}
227 + m_ProbeAnchor: {fileID: 0}
228 + m_LightProbeVolumeOverride: {fileID: 0}
229 + m_ScaleInLightmap: 1
230 + m_ReceiveGI: 1
231 + m_PreserveUVs: 0
232 + m_IgnoreNormalsForChartDetection: 0
233 + m_ImportantGI: 0
234 + m_StitchLightmapSeams: 1
235 + m_SelectedEditorRenderState: 3
236 + m_MinimumChartSize: 4
237 + m_AutoUVMaxDistance: 0.5
238 + m_AutoUVMaxAngle: 89
239 + m_LightmapParameters: {fileID: 0}
240 + m_SortingLayerID: 0
241 + m_SortingLayer: 0
242 + m_SortingOrder: 0
243 +--- !u!64 &252019526
244 +MeshCollider:
245 + m_ObjectHideFlags: 0
246 + m_CorrespondingSourceObject: {fileID: 0}
247 + m_PrefabInstance: {fileID: 0}
248 + m_PrefabAsset: {fileID: 0}
249 + m_GameObject: {fileID: 252019523}
250 + m_Material: {fileID: 0}
251 + m_IsTrigger: 0
252 + m_Enabled: 1
253 + serializedVersion: 4
254 + m_Convex: 0
255 + m_CookingOptions: 30
256 + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
257 +--- !u!33 &252019527
258 +MeshFilter:
259 + m_ObjectHideFlags: 0
260 + m_CorrespondingSourceObject: {fileID: 0}
261 + m_PrefabInstance: {fileID: 0}
262 + m_PrefabAsset: {fileID: 0}
263 + m_GameObject: {fileID: 252019523}
264 + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
265 +--- !u!114 &252019528
266 +MonoBehaviour:
267 + m_ObjectHideFlags: 0
268 + m_CorrespondingSourceObject: {fileID: 0}
269 + m_PrefabInstance: {fileID: 0}
270 + m_PrefabAsset: {fileID: 0}
271 + m_GameObject: {fileID: 252019523}
272 + m_Enabled: 1
273 + m_EditorHideFlags: 0
274 + m_Script: {fileID: 11500000, guid: 61e5c93f5da1e324aa7fd9671db875bc, type: 3}
275 + m_Name:
276 + m_EditorClassIdentifier:
277 +--- !u!1 &257076396
278 +GameObject:
279 + m_ObjectHideFlags: 0
280 + m_CorrespondingSourceObject: {fileID: 0}
281 + m_PrefabInstance: {fileID: 0}
282 + m_PrefabAsset: {fileID: 0}
283 + serializedVersion: 6
284 + m_Component:
285 + - component: {fileID: 257076398}
286 + - component: {fileID: 257076397}
287 + - component: {fileID: 257076399}
288 + - component: {fileID: 257076400}
289 + m_Layer: 0
290 + m_Name: DepthView
291 + m_TagString: Untagged
292 + m_Icon: {fileID: 0}
293 + m_NavMeshLayer: 0
294 + m_StaticEditorFlags: 0
295 + m_IsActive: 1
296 +--- !u!114 &257076397
297 +MonoBehaviour:
298 + m_ObjectHideFlags: 0
299 + m_CorrespondingSourceObject: {fileID: 0}
300 + m_PrefabInstance: {fileID: 0}
301 + m_PrefabAsset: {fileID: 0}
302 + m_GameObject: {fileID: 257076396}
303 + m_Enabled: 1
304 + m_EditorHideFlags: 0
305 + m_Script: {fileID: 11500000, guid: 383e102cbe3bfb34d94c98ea3c2479b4, type: 3}
306 + m_Name:
307 + m_EditorClassIdentifier:
308 + ViewMode: 1
309 + ColorSourceManager: {fileID: 679549941}
310 + DepthSourceManager: {fileID: 1022827879}
311 + MultiSourceManager: {fileID: 1736670513}
312 +--- !u!4 &257076398
313 +Transform:
314 + m_ObjectHideFlags: 0
315 + m_CorrespondingSourceObject: {fileID: 0}
316 + m_PrefabInstance: {fileID: 0}
317 + m_PrefabAsset: {fileID: 0}
318 + m_GameObject: {fileID: 257076396}
319 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
320 + m_LocalPosition: {x: 0, y: -0, z: 0}
321 + m_LocalScale: {x: 1, y: 1, z: 1}
322 + m_Children: []
323 + m_Father: {fileID: 1988608401}
324 + m_RootOrder: 0
325 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
326 +--- !u!23 &257076399
327 +MeshRenderer:
328 + m_ObjectHideFlags: 0
329 + m_CorrespondingSourceObject: {fileID: 0}
330 + m_PrefabInstance: {fileID: 0}
331 + m_PrefabAsset: {fileID: 0}
332 + m_GameObject: {fileID: 257076396}
333 + m_Enabled: 1
334 + m_CastShadows: 1
335 + m_ReceiveShadows: 1
336 + m_DynamicOccludee: 1
337 + m_MotionVectors: 1
338 + m_LightProbeUsage: 0
339 + m_ReflectionProbeUsage: 1
340 + m_RayTracingMode: 2
341 + m_RenderingLayerMask: 1
342 + m_RendererPriority: 0
343 + m_Materials:
344 + - {fileID: 10302, guid: 0000000000000000f000000000000000, type: 0}
345 + m_StaticBatchInfo:
346 + firstSubMesh: 0
347 + subMeshCount: 0
348 + m_StaticBatchRoot: {fileID: 0}
349 + m_ProbeAnchor: {fileID: 0}
350 + m_LightProbeVolumeOverride: {fileID: 0}
351 + m_ScaleInLightmap: 1
352 + m_ReceiveGI: 1
353 + m_PreserveUVs: 0
354 + m_IgnoreNormalsForChartDetection: 0
355 + m_ImportantGI: 0
356 + m_StitchLightmapSeams: 1
357 + m_SelectedEditorRenderState: 3
358 + m_MinimumChartSize: 4
359 + m_AutoUVMaxDistance: 0.5
360 + m_AutoUVMaxAngle: 89
361 + m_LightmapParameters: {fileID: 0}
362 + m_SortingLayerID: 0
363 + m_SortingLayer: 0
364 + m_SortingOrder: 0
365 +--- !u!33 &257076400
366 +MeshFilter:
367 + m_ObjectHideFlags: 0
368 + m_CorrespondingSourceObject: {fileID: 0}
369 + m_PrefabInstance: {fileID: 0}
370 + m_PrefabAsset: {fileID: 0}
371 + m_GameObject: {fileID: 257076396}
372 + m_Mesh: {fileID: 0}
373 +--- !u!1 &660022884
374 +GameObject:
375 + m_ObjectHideFlags: 0
376 + m_CorrespondingSourceObject: {fileID: 0}
377 + m_PrefabInstance: {fileID: 0}
378 + m_PrefabAsset: {fileID: 0}
379 + serializedVersion: 6
380 + m_Component:
381 + - component: {fileID: 660022886}
382 + - component: {fileID: 660022885}
383 + m_Layer: 0
384 + m_Name: Directional light
385 + m_TagString: Untagged
386 + m_Icon: {fileID: 0}
387 + m_NavMeshLayer: 0
388 + m_StaticEditorFlags: 0
389 + m_IsActive: 1
390 +--- !u!108 &660022885
391 +Light:
392 + m_ObjectHideFlags: 0
393 + m_CorrespondingSourceObject: {fileID: 0}
394 + m_PrefabInstance: {fileID: 0}
395 + m_PrefabAsset: {fileID: 0}
396 + m_GameObject: {fileID: 660022884}
397 + m_Enabled: 1
398 + serializedVersion: 10
399 + m_Type: 1
400 + m_Shape: 0
401 + m_Color: {r: 1, g: 1, b: 1, a: 1}
402 + m_Intensity: 1
403 + m_Range: 10
404 + m_SpotAngle: 30
405 + m_InnerSpotAngle: 21.80208
406 + m_CookieSize: 10
407 + m_Shadows:
408 + m_Type: 0
409 + m_Resolution: -1
410 + m_CustomResolution: -1
411 + m_Strength: 1
412 + m_Bias: 0.05
413 + m_NormalBias: 0.4
414 + m_NearPlane: 0.2
415 + m_CullingMatrixOverride:
416 + e00: 1
417 + e01: 0
418 + e02: 0
419 + e03: 0
420 + e10: 0
421 + e11: 1
422 + e12: 0
423 + e13: 0
424 + e20: 0
425 + e21: 0
426 + e22: 1
427 + e23: 0
428 + e30: 0
429 + e31: 0
430 + e32: 0
431 + e33: 1
432 + m_UseCullingMatrixOverride: 0
433 + m_Cookie: {fileID: 0}
434 + m_DrawHalo: 0
435 + m_Flare: {fileID: 0}
436 + m_RenderMode: 0
437 + m_CullingMask:
438 + serializedVersion: 2
439 + m_Bits: 4294967295
440 + m_RenderingLayerMask: 1
441 + m_Lightmapping: 1
442 + m_LightShadowCasterMode: 0
443 + m_AreaSize: {x: 1, y: 1}
444 + m_BounceIntensity: 1
445 + m_ColorTemperature: 6570
446 + m_UseColorTemperature: 0
447 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
448 + m_UseBoundingSphereOverride: 0
449 + m_ShadowRadius: 0
450 + m_ShadowAngle: 0
451 +--- !u!4 &660022886
452 +Transform:
453 + m_ObjectHideFlags: 0
454 + m_CorrespondingSourceObject: {fileID: 0}
455 + m_PrefabInstance: {fileID: 0}
456 + m_PrefabAsset: {fileID: 0}
457 + m_GameObject: {fileID: 660022884}
458 + m_LocalRotation: {x: 0.30909714, y: -0.24520965, z: 0.08282233, w: 0.9151348}
459 + m_LocalPosition: {x: -13.278711, y: 5.633033, z: 4.732221}
460 + m_LocalScale: {x: 1, y: 1, z: 1}
461 + m_Children: []
462 + m_Father: {fileID: 0}
463 + m_RootOrder: 6
464 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
465 +--- !u!1 &679549941
466 +GameObject:
467 + m_ObjectHideFlags: 0
468 + m_CorrespondingSourceObject: {fileID: 0}
469 + m_PrefabInstance: {fileID: 0}
470 + m_PrefabAsset: {fileID: 0}
471 + serializedVersion: 6
472 + m_Component:
473 + - component: {fileID: 679549942}
474 + - component: {fileID: 679549943}
475 + m_Layer: 0
476 + m_Name: ColorManager
477 + m_TagString: Untagged
478 + m_Icon: {fileID: 0}
479 + m_NavMeshLayer: 0
480 + m_StaticEditorFlags: 0
481 + m_IsActive: 1
482 +--- !u!4 &679549942
483 +Transform:
484 + m_ObjectHideFlags: 0
485 + m_CorrespondingSourceObject: {fileID: 0}
486 + m_PrefabInstance: {fileID: 0}
487 + m_PrefabAsset: {fileID: 0}
488 + m_GameObject: {fileID: 679549941}
489 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
490 + m_LocalPosition: {x: -208.42621, y: 330.08652, z: 342.24237}
491 + m_LocalScale: {x: 1, y: 1, z: 1}
492 + m_Children: []
493 + m_Father: {fileID: 0}
494 + m_RootOrder: 2
495 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
496 +--- !u!114 &679549943
497 +MonoBehaviour:
498 + m_ObjectHideFlags: 0
499 + m_CorrespondingSourceObject: {fileID: 0}
500 + m_PrefabInstance: {fileID: 0}
501 + m_PrefabAsset: {fileID: 0}
502 + m_GameObject: {fileID: 679549941}
503 + m_Enabled: 1
504 + m_EditorHideFlags: 0
505 + m_Script: {fileID: 11500000, guid: 92ab5bea6110edb4081e490c0982748d, type: 3}
506 + m_Name:
507 + m_EditorClassIdentifier:
508 +--- !u!1 &716011529
509 +GameObject:
510 + m_ObjectHideFlags: 0
511 + m_CorrespondingSourceObject: {fileID: 0}
512 + m_PrefabInstance: {fileID: 0}
513 + m_PrefabAsset: {fileID: 0}
514 + serializedVersion: 6
515 + m_Component:
516 + - component: {fileID: 716011534}
517 + - component: {fileID: 716011533}
518 + - component: {fileID: 716011532}
519 + - component: {fileID: 716011531}
520 + - component: {fileID: 716011530}
521 + m_Layer: 0
522 + m_Name: Cube
523 + m_TagString: Untagged
524 + m_Icon: {fileID: 0}
525 + m_NavMeshLayer: 0
526 + m_StaticEditorFlags: 0
527 + m_IsActive: 1
528 +--- !u!114 &716011530
529 +MonoBehaviour:
530 + m_ObjectHideFlags: 0
531 + m_CorrespondingSourceObject: {fileID: 0}
532 + m_PrefabInstance: {fileID: 0}
533 + m_PrefabAsset: {fileID: 0}
534 + m_GameObject: {fileID: 716011529}
535 + m_Enabled: 1
536 + m_EditorHideFlags: 0
537 + m_Script: {fileID: 11500000, guid: 61e5c93f5da1e324aa7fd9671db875bc, type: 3}
538 + m_Name:
539 + m_EditorClassIdentifier:
540 +--- !u!23 &716011531
541 +MeshRenderer:
542 + m_ObjectHideFlags: 0
543 + m_CorrespondingSourceObject: {fileID: 0}
544 + m_PrefabInstance: {fileID: 0}
545 + m_PrefabAsset: {fileID: 0}
546 + m_GameObject: {fileID: 716011529}
547 + m_Enabled: 1
548 + m_CastShadows: 1
549 + m_ReceiveShadows: 1
550 + m_DynamicOccludee: 1
551 + m_MotionVectors: 1
552 + m_LightProbeUsage: 0
553 + m_ReflectionProbeUsage: 1
554 + m_RayTracingMode: 2
555 + m_RenderingLayerMask: 1
556 + m_RendererPriority: 0
557 + m_Materials:
558 + - {fileID: 10302, guid: 0000000000000000f000000000000000, type: 0}
559 + m_StaticBatchInfo:
560 + firstSubMesh: 0
561 + subMeshCount: 0
562 + m_StaticBatchRoot: {fileID: 0}
563 + m_ProbeAnchor: {fileID: 0}
564 + m_LightProbeVolumeOverride: {fileID: 0}
565 + m_ScaleInLightmap: 1
566 + m_ReceiveGI: 1
567 + m_PreserveUVs: 0
568 + m_IgnoreNormalsForChartDetection: 0
569 + m_ImportantGI: 0
570 + m_StitchLightmapSeams: 1
571 + m_SelectedEditorRenderState: 3
572 + m_MinimumChartSize: 4
573 + m_AutoUVMaxDistance: 0.5
574 + m_AutoUVMaxAngle: 89
575 + m_LightmapParameters: {fileID: 0}
576 + m_SortingLayerID: 0
577 + m_SortingLayer: 0
578 + m_SortingOrder: 0
579 +--- !u!65 &716011532
580 +BoxCollider:
581 + m_ObjectHideFlags: 0
582 + m_CorrespondingSourceObject: {fileID: 0}
583 + m_PrefabInstance: {fileID: 0}
584 + m_PrefabAsset: {fileID: 0}
585 + m_GameObject: {fileID: 716011529}
586 + m_Material: {fileID: 0}
587 + m_IsTrigger: 0
588 + m_Enabled: 1
589 + serializedVersion: 2
590 + m_Size: {x: 1, y: 1, z: 1}
591 + m_Center: {x: 0, y: 0, z: 0}
592 +--- !u!33 &716011533
593 +MeshFilter:
594 + m_ObjectHideFlags: 0
595 + m_CorrespondingSourceObject: {fileID: 0}
596 + m_PrefabInstance: {fileID: 0}
597 + m_PrefabAsset: {fileID: 0}
598 + m_GameObject: {fileID: 716011529}
599 + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
600 +--- !u!4 &716011534
601 +Transform:
602 + m_ObjectHideFlags: 0
603 + m_CorrespondingSourceObject: {fileID: 0}
604 + m_PrefabInstance: {fileID: 0}
605 + m_PrefabAsset: {fileID: 0}
606 + m_GameObject: {fileID: 716011529}
607 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
608 + m_LocalPosition: {x: 0, y: 0, z: 0}
609 + m_LocalScale: {x: 3, y: 8, z: 0.01}
610 + m_Children: []
611 + m_Father: {fileID: 112136119}
612 + m_RootOrder: 0
613 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
614 +--- !u!1 &934010673
615 +GameObject:
616 + m_ObjectHideFlags: 0
617 + m_CorrespondingSourceObject: {fileID: 0}
618 + m_PrefabInstance: {fileID: 0}
619 + m_PrefabAsset: {fileID: 0}
620 + serializedVersion: 6
621 + m_Component:
622 + - component: {fileID: 934010678}
623 + - component: {fileID: 934010677}
624 + - component: {fileID: 934010676}
625 + - component: {fileID: 934010675}
626 + - component: {fileID: 934010674}
627 + m_Layer: 0
628 + m_Name: ColorView
629 + m_TagString: Untagged
630 + m_Icon: {fileID: 0}
631 + m_NavMeshLayer: 0
632 + m_StaticEditorFlags: 0
633 + m_IsActive: 1
634 +--- !u!114 &934010674
635 +MonoBehaviour:
636 + m_ObjectHideFlags: 0
637 + m_CorrespondingSourceObject: {fileID: 0}
638 + m_PrefabInstance: {fileID: 0}
639 + m_PrefabAsset: {fileID: 0}
640 + m_GameObject: {fileID: 934010673}
641 + m_Enabled: 1
642 + m_EditorHideFlags: 0
643 + m_Script: {fileID: 11500000, guid: ee5302fdf7d10e74fbbbe1a2f7503f46, type: 3}
644 + m_Name:
645 + m_EditorClassIdentifier:
646 + ColorSourceManager: {fileID: 679549941}
647 +--- !u!23 &934010675
648 +MeshRenderer:
649 + m_ObjectHideFlags: 0
650 + m_CorrespondingSourceObject: {fileID: 0}
651 + m_PrefabInstance: {fileID: 0}
652 + m_PrefabAsset: {fileID: 0}
653 + m_GameObject: {fileID: 934010673}
654 + m_Enabled: 1
655 + m_CastShadows: 1
656 + m_ReceiveShadows: 1
657 + m_DynamicOccludee: 1
658 + m_MotionVectors: 1
659 + m_LightProbeUsage: 0
660 + m_ReflectionProbeUsage: 1
661 + m_RayTracingMode: 2
662 + m_RenderingLayerMask: 1
663 + m_RendererPriority: 0
664 + m_Materials:
665 + - {fileID: 10302, guid: 0000000000000000f000000000000000, type: 0}
666 + m_StaticBatchInfo:
667 + firstSubMesh: 0
668 + subMeshCount: 0
669 + m_StaticBatchRoot: {fileID: 0}
670 + m_ProbeAnchor: {fileID: 0}
671 + m_LightProbeVolumeOverride: {fileID: 0}
672 + m_ScaleInLightmap: 1
673 + m_ReceiveGI: 1
674 + m_PreserveUVs: 0
675 + m_IgnoreNormalsForChartDetection: 0
676 + m_ImportantGI: 0
677 + m_StitchLightmapSeams: 1
678 + m_SelectedEditorRenderState: 3
679 + m_MinimumChartSize: 4
680 + m_AutoUVMaxDistance: 0.5
681 + m_AutoUVMaxAngle: 89
682 + m_LightmapParameters: {fileID: 0}
683 + m_SortingLayerID: 0
684 + m_SortingLayer: 0
685 + m_SortingOrder: 0
686 +--- !u!65 &934010676
687 +BoxCollider:
688 + m_ObjectHideFlags: 0
689 + m_CorrespondingSourceObject: {fileID: 0}
690 + m_PrefabInstance: {fileID: 0}
691 + m_PrefabAsset: {fileID: 0}
692 + m_GameObject: {fileID: 934010673}
693 + m_Material: {fileID: 0}
694 + m_IsTrigger: 0
695 + m_Enabled: 1
696 + serializedVersion: 2
697 + m_Size: {x: 1, y: 1, z: 1}
698 + m_Center: {x: 0, y: 0, z: 0}
699 +--- !u!33 &934010677
700 +MeshFilter:
701 + m_ObjectHideFlags: 0
702 + m_CorrespondingSourceObject: {fileID: 0}
703 + m_PrefabInstance: {fileID: 0}
704 + m_PrefabAsset: {fileID: 0}
705 + m_GameObject: {fileID: 934010673}
706 + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
707 +--- !u!4 &934010678
708 +Transform:
709 + m_ObjectHideFlags: 0
710 + m_CorrespondingSourceObject: {fileID: 0}
711 + m_PrefabInstance: {fileID: 0}
712 + m_PrefabAsset: {fileID: 0}
713 + m_GameObject: {fileID: 934010673}
714 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
715 + m_LocalPosition: {x: -118, y: 64.30853, z: 150.01746}
716 + m_LocalScale: {x: 96, y: 54, z: 1}
717 + m_Children: []
718 + m_Father: {fileID: 0}
719 + m_RootOrder: 3
720 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
721 +--- !u!1 &1022827879
722 +GameObject:
723 + m_ObjectHideFlags: 0
724 + m_CorrespondingSourceObject: {fileID: 0}
725 + m_PrefabInstance: {fileID: 0}
726 + m_PrefabAsset: {fileID: 0}
727 + serializedVersion: 6
728 + m_Component:
729 + - component: {fileID: 1022827881}
730 + - component: {fileID: 1022827880}
731 + m_Layer: 0
732 + m_Name: DepthManager
733 + m_TagString: Untagged
734 + m_Icon: {fileID: 0}
735 + m_NavMeshLayer: 0
736 + m_StaticEditorFlags: 0
737 + m_IsActive: 1
738 +--- !u!114 &1022827880
739 +MonoBehaviour:
740 + m_ObjectHideFlags: 0
741 + m_CorrespondingSourceObject: {fileID: 0}
742 + m_PrefabInstance: {fileID: 0}
743 + m_PrefabAsset: {fileID: 0}
744 + m_GameObject: {fileID: 1022827879}
745 + m_Enabled: 1
746 + m_EditorHideFlags: 0
747 + m_Script: {fileID: 11500000, guid: 1cd019cdd7a54604b9ae8091d242d8a4, type: 3}
748 + m_Name:
749 + m_EditorClassIdentifier:
750 +--- !u!4 &1022827881
751 +Transform:
752 + m_ObjectHideFlags: 0
753 + m_CorrespondingSourceObject: {fileID: 0}
754 + m_PrefabInstance: {fileID: 0}
755 + m_PrefabAsset: {fileID: 0}
756 + m_GameObject: {fileID: 1022827879}
757 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
758 + m_LocalPosition: {x: 5.873085, y: 0, z: 182.0674}
759 + m_LocalScale: {x: 1, y: 1, z: 1}
760 + m_Children: []
761 + m_Father: {fileID: 0}
762 + m_RootOrder: 5
763 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
764 +--- !u!1 &1464340100
765 +GameObject:
766 + m_ObjectHideFlags: 0
767 + m_CorrespondingSourceObject: {fileID: 0}
768 + m_PrefabInstance: {fileID: 0}
769 + m_PrefabAsset: {fileID: 0}
770 + serializedVersion: 6
771 + m_Component:
772 + - component: {fileID: 1464340102}
773 + - component: {fileID: 1464340101}
774 + m_Layer: 0
775 + m_Name: InfraredManager
776 + m_TagString: Untagged
777 + m_Icon: {fileID: 0}
778 + m_NavMeshLayer: 0
779 + m_StaticEditorFlags: 0
780 + m_IsActive: 1
781 +--- !u!114 &1464340101
782 +MonoBehaviour:
783 + m_ObjectHideFlags: 0
784 + m_CorrespondingSourceObject: {fileID: 0}
785 + m_PrefabInstance: {fileID: 0}
786 + m_PrefabAsset: {fileID: 0}
787 + m_GameObject: {fileID: 1464340100}
788 + m_Enabled: 1
789 + m_EditorHideFlags: 0
790 + m_Script: {fileID: 11500000, guid: 63eff7f54e54aa049a2331755f3cb99c, type: 3}
791 + m_Name:
792 + m_EditorClassIdentifier:
793 +--- !u!4 &1464340102
794 +Transform:
795 + m_ObjectHideFlags: 0
796 + m_CorrespondingSourceObject: {fileID: 0}
797 + m_PrefabInstance: {fileID: 0}
798 + m_PrefabAsset: {fileID: 0}
799 + m_GameObject: {fileID: 1464340100}
800 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
801 + m_LocalPosition: {x: 0, y: 1, z: -17}
802 + m_LocalScale: {x: 1, y: 1, z: 1}
803 + m_Children: []
804 + m_Father: {fileID: 0}
805 + m_RootOrder: 7
806 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
807 +--- !u!1 &1608503454
808 +GameObject:
809 + m_ObjectHideFlags: 0
810 + m_CorrespondingSourceObject: {fileID: 0}
811 + m_PrefabInstance: {fileID: 0}
812 + m_PrefabAsset: {fileID: 0}
813 + serializedVersion: 6
814 + m_Component:
815 + - component: {fileID: 1608503459}
816 + - component: {fileID: 1608503458}
817 + - component: {fileID: 1608503457}
818 + - component: {fileID: 1608503456}
819 + - component: {fileID: 1608503455}
820 + m_Layer: 0
821 + m_Name: InfraredView
822 + m_TagString: Untagged
823 + m_Icon: {fileID: 0}
824 + m_NavMeshLayer: 0
825 + m_StaticEditorFlags: 0
826 + m_IsActive: 1
827 +--- !u!114 &1608503455
828 +MonoBehaviour:
829 + m_ObjectHideFlags: 0
830 + m_CorrespondingSourceObject: {fileID: 0}
831 + m_PrefabInstance: {fileID: 0}
832 + m_PrefabAsset: {fileID: 0}
833 + m_GameObject: {fileID: 1608503454}
834 + m_Enabled: 1
835 + m_EditorHideFlags: 0
836 + m_Script: {fileID: 11500000, guid: 98f8736f9d8c8e44592c96e57d57c5d4, type: 3}
837 + m_Name:
838 + m_EditorClassIdentifier:
839 + InfraredSourceManager: {fileID: 1464340100}
840 +--- !u!23 &1608503456
841 +MeshRenderer:
842 + m_ObjectHideFlags: 0
843 + m_CorrespondingSourceObject: {fileID: 0}
844 + m_PrefabInstance: {fileID: 0}
845 + m_PrefabAsset: {fileID: 0}
846 + m_GameObject: {fileID: 1608503454}
847 + m_Enabled: 1
848 + m_CastShadows: 1
849 + m_ReceiveShadows: 1
850 + m_DynamicOccludee: 1
851 + m_MotionVectors: 1
852 + m_LightProbeUsage: 0
853 + m_ReflectionProbeUsage: 1
854 + m_RayTracingMode: 2
855 + m_RenderingLayerMask: 1
856 + m_RendererPriority: 0
857 + m_Materials:
858 + - {fileID: 10302, guid: 0000000000000000f000000000000000, type: 0}
859 + m_StaticBatchInfo:
860 + firstSubMesh: 0
861 + subMeshCount: 0
862 + m_StaticBatchRoot: {fileID: 0}
863 + m_ProbeAnchor: {fileID: 0}
864 + m_LightProbeVolumeOverride: {fileID: 0}
865 + m_ScaleInLightmap: 1
866 + m_ReceiveGI: 1
867 + m_PreserveUVs: 0
868 + m_IgnoreNormalsForChartDetection: 0
869 + m_ImportantGI: 0
870 + m_StitchLightmapSeams: 1
871 + m_SelectedEditorRenderState: 3
872 + m_MinimumChartSize: 4
873 + m_AutoUVMaxDistance: 0.5
874 + m_AutoUVMaxAngle: 89
875 + m_LightmapParameters: {fileID: 0}
876 + m_SortingLayerID: 0
877 + m_SortingLayer: 0
878 + m_SortingOrder: 0
879 +--- !u!65 &1608503457
880 +BoxCollider:
881 + m_ObjectHideFlags: 0
882 + m_CorrespondingSourceObject: {fileID: 0}
883 + m_PrefabInstance: {fileID: 0}
884 + m_PrefabAsset: {fileID: 0}
885 + m_GameObject: {fileID: 1608503454}
886 + m_Material: {fileID: 0}
887 + m_IsTrigger: 0
888 + m_Enabled: 1
889 + serializedVersion: 2
890 + m_Size: {x: 1, y: 1, z: 1}
891 + m_Center: {x: 0, y: 0, z: 0}
892 +--- !u!33 &1608503458
893 +MeshFilter:
894 + m_ObjectHideFlags: 0
895 + m_CorrespondingSourceObject: {fileID: 0}
896 + m_PrefabInstance: {fileID: 0}
897 + m_PrefabAsset: {fileID: 0}
898 + m_GameObject: {fileID: 1608503454}
899 + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
900 +--- !u!4 &1608503459
901 +Transform:
902 + m_ObjectHideFlags: 0
903 + m_CorrespondingSourceObject: {fileID: 0}
904 + m_PrefabInstance: {fileID: 0}
905 + m_PrefabAsset: {fileID: 0}
906 + m_GameObject: {fileID: 1608503454}
907 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
908 + m_LocalPosition: {x: -118, y: -6.0306396, z: 150.01746}
909 + m_LocalScale: {x: 96, y: 79.5, z: 1}
910 + m_Children: []
911 + m_Father: {fileID: 0}
912 + m_RootOrder: 8
913 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
914 +--- !u!1 &1698423884
915 +GameObject:
916 + m_ObjectHideFlags: 0
917 + m_CorrespondingSourceObject: {fileID: 0}
918 + m_PrefabInstance: {fileID: 0}
919 + m_PrefabAsset: {fileID: 0}
920 + serializedVersion: 6
921 + m_Component:
922 + - component: {fileID: 1698423886}
923 + - component: {fileID: 1698423885}
924 + m_Layer: 0
925 + m_Name: BodyManager
926 + m_TagString: Untagged
927 + m_Icon: {fileID: 0}
928 + m_NavMeshLayer: 0
929 + m_StaticEditorFlags: 0
930 + m_IsActive: 1
931 +--- !u!114 &1698423885
932 +MonoBehaviour:
933 + m_ObjectHideFlags: 0
934 + m_CorrespondingSourceObject: {fileID: 0}
935 + m_PrefabInstance: {fileID: 0}
936 + m_PrefabAsset: {fileID: 0}
937 + m_GameObject: {fileID: 1698423884}
938 + m_Enabled: 1
939 + m_EditorHideFlags: 0
940 + m_Script: {fileID: 11500000, guid: 2e74aed0503c9d24290a1ae5438fddc3, type: 3}
941 + m_Name:
942 + m_EditorClassIdentifier:
943 +--- !u!4 &1698423886
944 +Transform:
945 + m_ObjectHideFlags: 0
946 + m_CorrespondingSourceObject: {fileID: 0}
947 + m_PrefabInstance: {fileID: 0}
948 + m_PrefabAsset: {fileID: 0}
949 + m_GameObject: {fileID: 1698423884}
950 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
951 + m_LocalPosition: {x: 5.873085, y: 0, z: 182.0674}
952 + m_LocalScale: {x: 1, y: 1, z: 1}
953 + m_Children: []
954 + m_Father: {fileID: 0}
955 + m_RootOrder: 0
956 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
957 +--- !u!1 &1736670513
958 +GameObject:
959 + m_ObjectHideFlags: 0
960 + m_CorrespondingSourceObject: {fileID: 0}
961 + m_PrefabInstance: {fileID: 0}
962 + m_PrefabAsset: {fileID: 0}
963 + serializedVersion: 6
964 + m_Component:
965 + - component: {fileID: 1736670515}
966 + - component: {fileID: 1736670514}
967 + m_Layer: 0
968 + m_Name: MultiFrameManager
969 + m_TagString: Untagged
970 + m_Icon: {fileID: 0}
971 + m_NavMeshLayer: 0
972 + m_StaticEditorFlags: 0
973 + m_IsActive: 1
974 +--- !u!114 &1736670514
975 +MonoBehaviour:
976 + m_ObjectHideFlags: 0
977 + m_CorrespondingSourceObject: {fileID: 0}
978 + m_PrefabInstance: {fileID: 0}
979 + m_PrefabAsset: {fileID: 0}
980 + m_GameObject: {fileID: 1736670513}
981 + m_Enabled: 1
982 + m_EditorHideFlags: 0
983 + m_Script: {fileID: 11500000, guid: f752c4e07617d8d4eb21d4975a2d7c61, type: 3}
984 + m_Name:
985 + m_EditorClassIdentifier:
986 +--- !u!4 &1736670515
987 +Transform:
988 + m_ObjectHideFlags: 0
989 + m_CorrespondingSourceObject: {fileID: 0}
990 + m_PrefabInstance: {fileID: 0}
991 + m_PrefabAsset: {fileID: 0}
992 + m_GameObject: {fileID: 1736670513}
993 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
994 + m_LocalPosition: {x: -208.42621, y: 330.08652, z: 342.24237}
995 + m_LocalScale: {x: 1, y: 1, z: 1}
996 + m_Children: []
997 + m_Father: {fileID: 0}
998 + m_RootOrder: 10
999 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
1000 +--- !u!1 &1747301860
1001 +GameObject:
1002 + m_ObjectHideFlags: 0
1003 + m_CorrespondingSourceObject: {fileID: 0}
1004 + m_PrefabInstance: {fileID: 0}
1005 + m_PrefabAsset: {fileID: 0}
1006 + serializedVersion: 6
1007 + m_Component:
1008 + - component: {fileID: 1747301865}
1009 + - component: {fileID: 1747301864}
1010 + - component: {fileID: 1747301862}
1011 + - component: {fileID: 1747301861}
1012 + m_Layer: 0
1013 + m_Name: Main Camera
1014 + m_TagString: MainCamera
1015 + m_Icon: {fileID: 0}
1016 + m_NavMeshLayer: 0
1017 + m_StaticEditorFlags: 0
1018 + m_IsActive: 1
1019 +--- !u!81 &1747301861
1020 +AudioListener:
1021 + m_ObjectHideFlags: 0
1022 + m_CorrespondingSourceObject: {fileID: 0}
1023 + m_PrefabInstance: {fileID: 0}
1024 + m_PrefabAsset: {fileID: 0}
1025 + m_GameObject: {fileID: 1747301860}
1026 + m_Enabled: 1
1027 +--- !u!124 &1747301862
1028 +Behaviour:
1029 + m_ObjectHideFlags: 0
1030 + m_CorrespondingSourceObject: {fileID: 0}
1031 + m_PrefabInstance: {fileID: 0}
1032 + m_PrefabAsset: {fileID: 0}
1033 + m_GameObject: {fileID: 1747301860}
1034 + m_Enabled: 1
1035 +--- !u!20 &1747301864
1036 +Camera:
1037 + m_ObjectHideFlags: 0
1038 + m_CorrespondingSourceObject: {fileID: 0}
1039 + m_PrefabInstance: {fileID: 0}
1040 + m_PrefabAsset: {fileID: 0}
1041 + m_GameObject: {fileID: 1747301860}
1042 + m_Enabled: 1
1043 + serializedVersion: 2
1044 + m_ClearFlags: 1
1045 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0.019607844}
1046 + m_projectionMatrixMode: 1
1047 + m_GateFitMode: 2
1048 + m_FOVAxisMode: 0
1049 + m_SensorSize: {x: 36, y: 24}
1050 + m_LensShift: {x: 0, y: 0}
1051 + m_FocalLength: 50
1052 + m_NormalizedViewPortRect:
1053 + serializedVersion: 2
1054 + x: 0
1055 + y: 0
1056 + width: 1
1057 + height: 1
1058 + near clip plane: 0.3
1059 + far clip plane: 400
1060 + field of view: 60
1061 + orthographic: 0
1062 + orthographic size: 5
1063 + m_Depth: -1
1064 + m_CullingMask:
1065 + serializedVersion: 2
1066 + m_Bits: 4294967295
1067 + m_RenderingPath: -1
1068 + m_TargetTexture: {fileID: 0}
1069 + m_TargetDisplay: 0
1070 + m_TargetEye: 3
1071 + m_HDR: 0
1072 + m_AllowMSAA: 1
1073 + m_AllowDynamicResolution: 0
1074 + m_ForceIntoRT: 0
1075 + m_OcclusionCulling: 1
1076 + m_StereoConvergence: 10
1077 + m_StereoSeparation: 0.022
1078 +--- !u!4 &1747301865
1079 +Transform:
1080 + m_ObjectHideFlags: 0
1081 + m_CorrespondingSourceObject: {fileID: 0}
1082 + m_PrefabInstance: {fileID: 0}
1083 + m_PrefabAsset: {fileID: 0}
1084 + m_GameObject: {fileID: 1747301860}
1085 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
1086 + m_LocalPosition: {x: 0, y: 1, z: -17}
1087 + m_LocalScale: {x: 1, y: 1, z: 1}
1088 + m_Children: []
1089 + m_Father: {fileID: 0}
1090 + m_RootOrder: 9
1091 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
1092 +--- !u!1 &1988608400
1093 +GameObject:
1094 + m_ObjectHideFlags: 0
1095 + m_CorrespondingSourceObject: {fileID: 0}
1096 + m_PrefabInstance: {fileID: 0}
1097 + m_PrefabAsset: {fileID: 0}
1098 + serializedVersion: 6
1099 + m_Component:
1100 + - component: {fileID: 1988608401}
1101 + m_Layer: 0
1102 + m_Name: DepthBase
1103 + m_TagString: Untagged
1104 + m_Icon: {fileID: 0}
1105 + m_NavMeshLayer: 0
1106 + m_StaticEditorFlags: 0
1107 + m_IsActive: 1
1108 +--- !u!4 &1988608401
1109 +Transform:
1110 + m_ObjectHideFlags: 0
1111 + m_CorrespondingSourceObject: {fileID: 0}
1112 + m_PrefabInstance: {fileID: 0}
1113 + m_PrefabAsset: {fileID: 0}
1114 + m_GameObject: {fileID: 1988608400}
1115 + m_LocalRotation: {x: 0.16042967, y: -0.37686968, z: -0.06645215, w: -0.9098438}
1116 + m_LocalPosition: {x: 5.873085, y: 0, z: 182.0674}
1117 + m_LocalScale: {x: 1, y: 1, z: 1}
1118 + m_Children:
1119 + - {fileID: 257076398}
1120 + - {fileID: 252019524}
1121 + m_Father: {fileID: 0}
1122 + m_RootOrder: 4
1123 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
1 +%YAML 1.1
2 +%TAG !u! tag:unity3d.com,2011:
3 +--- !u!21 &2100000
4 +Material:
5 + serializedVersion: 6
6 + m_ObjectHideFlags: 0
7 + m_CorrespondingSourceObject: {fileID: 0}
8 + m_PrefabInstance: {fileID: 0}
9 + m_PrefabAsset: {fileID: 0}
10 + m_Name: BoneMaterial
11 + m_Shader: {fileID: 200, guid: 0000000000000000f000000000000000, type: 0}
12 + m_ShaderKeywords:
13 + m_LightmapFlags: 4
14 + m_EnableInstancingVariants: 0
15 + m_DoubleSidedGI: 0
16 + m_CustomRenderQueue: -1
17 + stringTagMap: {}
18 + disabledShaderPasses: []
19 + m_SavedProperties:
20 + serializedVersion: 3
21 + m_TexEnvs:
22 + - _MainTex:
23 + m_Texture: {fileID: 0}
24 + m_Scale: {x: 1, y: 1}
25 + m_Offset: {x: 0, y: 0}
26 + m_Floats:
27 + - _InvFade: 1
28 + m_Colors:
29 + - _Color: {r: 1, g: 1, b: 1, a: 1}
30 + - _TintColor: {r: 0.5, g: 0.5, b: 0.5, a: 0.5}
1 +using UnityEngine;
2 +using System.Collections;
3 +using Windows.Kinect;
4 +
5 +public class BodySourceManager : MonoBehaviour
6 +{
7 + private KinectSensor _Sensor;
8 + private BodyFrameReader _Reader;
9 + private Body[] _Data = null;
10 +
11 + public Body[] GetData()
12 + {
13 + return _Data;
14 + }
15 +
16 +
17 + void Start ()
18 + {
19 + _Sensor = KinectSensor.GetDefault();
20 +
21 + if (_Sensor != null)
22 + {
23 + _Reader = _Sensor.BodyFrameSource.OpenReader();
24 +
25 + if (!_Sensor.IsOpen)
26 + {
27 + _Sensor.Open();
28 + }
29 + }
30 + }
31 +
32 + void Update ()
33 + {
34 + if (_Reader != null)
35 + {
36 + var frame = _Reader.AcquireLatestFrame();
37 + if (frame != null)
38 + {
39 + if (_Data == null)
40 + {
41 + _Data = new Body[_Sensor.BodyFrameSource.BodyCount];
42 + }
43 +
44 + frame.GetAndRefreshBodyData(_Data);
45 +
46 + frame.Dispose();
47 + frame = null;
48 + }
49 + }
50 + }
51 +
52 + void OnApplicationQuit()
53 + {
54 + if (_Reader != null)
55 + {
56 + _Reader.Dispose();
57 + _Reader = null;
58 + }
59 +
60 + if (_Sensor != null)
61 + {
62 + if (_Sensor.IsOpen)
63 + {
64 + _Sensor.Close();
65 + }
66 +
67 + _Sensor = null;
68 + }
69 + }
70 +}
1 +using UnityEngine;
2 +using System.Collections;
3 +using System.Collections.Generic;
4 +using Kinect = Windows.Kinect;
5 +
6 +public class BodySourceView : MonoBehaviour
7 +{
8 + public Material BoneMaterial;
9 + public GameObject BodySourceManager;
10 +
11 + private Dictionary<ulong, GameObject> _Bodies = new Dictionary<ulong, GameObject>();
12 + private BodySourceManager _BodyManager;
13 +
14 + private Dictionary<Kinect.JointType, Kinect.JointType> _BoneMap = new Dictionary<Kinect.JointType, Kinect.JointType>()
15 + {
16 + { Kinect.JointType.FootLeft, Kinect.JointType.AnkleLeft },
17 + { Kinect.JointType.AnkleLeft, Kinect.JointType.KneeLeft },
18 + { Kinect.JointType.KneeLeft, Kinect.JointType.HipLeft },
19 + { Kinect.JointType.HipLeft, Kinect.JointType.SpineBase },
20 +
21 + { Kinect.JointType.FootRight, Kinect.JointType.AnkleRight },
22 + { Kinect.JointType.AnkleRight, Kinect.JointType.KneeRight },
23 + { Kinect.JointType.KneeRight, Kinect.JointType.HipRight },
24 + { Kinect.JointType.HipRight, Kinect.JointType.SpineBase },
25 +
26 + { Kinect.JointType.HandTipLeft, Kinect.JointType.HandLeft },
27 + { Kinect.JointType.ThumbLeft, Kinect.JointType.HandLeft },
28 + { Kinect.JointType.HandLeft, Kinect.JointType.WristLeft },
29 + { Kinect.JointType.WristLeft, Kinect.JointType.ElbowLeft },
30 + { Kinect.JointType.ElbowLeft, Kinect.JointType.ShoulderLeft },
31 + { Kinect.JointType.ShoulderLeft, Kinect.JointType.SpineShoulder },
32 +
33 + { Kinect.JointType.HandTipRight, Kinect.JointType.HandRight },
34 + { Kinect.JointType.ThumbRight, Kinect.JointType.HandRight },
35 + { Kinect.JointType.HandRight, Kinect.JointType.WristRight },
36 + { Kinect.JointType.WristRight, Kinect.JointType.ElbowRight },
37 + { Kinect.JointType.ElbowRight, Kinect.JointType.ShoulderRight },
38 + { Kinect.JointType.ShoulderRight, Kinect.JointType.SpineShoulder },
39 +
40 + { Kinect.JointType.SpineBase, Kinect.JointType.SpineMid },
41 + { Kinect.JointType.SpineMid, Kinect.JointType.SpineShoulder },
42 + { Kinect.JointType.SpineShoulder, Kinect.JointType.Neck },
43 + { Kinect.JointType.Neck, Kinect.JointType.Head },
44 + };
45 +
46 + void Update ()
47 + {
48 + if (BodySourceManager == null)
49 + {
50 + return;
51 + }
52 +
53 + _BodyManager = BodySourceManager.GetComponent<BodySourceManager>();
54 + if (_BodyManager == null)
55 + {
56 + return;
57 + }
58 +
59 + Kinect.Body[] data = _BodyManager.GetData();
60 + if (data == null)
61 + {
62 + return;
63 + }
64 +
65 + List<ulong> trackedIds = new List<ulong>();
66 + foreach(var body in data)
67 + {
68 + if (body == null)
69 + {
70 + continue;
71 + }
72 +
73 + if(body.IsTracked)
74 + {
75 + trackedIds.Add (body.TrackingId);
76 + }
77 + }
78 +
79 + List<ulong> knownIds = new List<ulong>(_Bodies.Keys);
80 +
81 + // First delete untracked bodies
82 + foreach(ulong trackingId in knownIds)
83 + {
84 + if(!trackedIds.Contains(trackingId))
85 + {
86 + Destroy(_Bodies[trackingId]);
87 + _Bodies.Remove(trackingId);
88 + }
89 + }
90 +
91 + foreach(var body in data)
92 + {
93 + if (body == null)
94 + {
95 + continue;
96 + }
97 +
98 + if(body.IsTracked)
99 + {
100 + if(!_Bodies.ContainsKey(body.TrackingId))
101 + {
102 + _Bodies[body.TrackingId] = CreateBodyObject(body.TrackingId);
103 +
104 + }
105 + RefreshBodyObject(body, _Bodies[body.TrackingId]);
106 + }
107 + }
108 + }
109 +
110 + private GameObject CreateBodyObject(ulong id)
111 + {
112 + GameObject body = new GameObject("Body:" + id);
113 +
114 + for (Kinect.JointType jt = Kinect.JointType.SpineBase; jt <= Kinect.JointType.ThumbRight; jt++)
115 + {
116 + GameObject jointObj = GameObject.CreatePrimitive(PrimitiveType.Cube);
117 +
118 + LineRenderer lr = jointObj.AddComponent<LineRenderer>();
119 + lr.SetVertexCount(2);
120 + lr.material = BoneMaterial;
121 + lr.SetWidth(0.05f, 0.05f);
122 +
123 + jointObj.transform.localScale = new Vector3(0.3f, 0.3f, 0.3f);
124 + jointObj.name = jt.ToString();
125 + jointObj.transform.parent = body.transform;
126 + }
127 +
128 + return body;
129 + }
130 +
131 + private void RefreshBodyObject(Kinect.Body body, GameObject bodyObject)
132 + {
133 +
134 + for (Kinect.JointType jt = Kinect.JointType.SpineBase; jt <= Kinect.JointType.ThumbRight; jt++)
135 + {
136 + Kinect.Joint sourceJoint = body.Joints[jt];
137 + Debug.Log(body.Joints[jt].JointType);
138 + Debug.Log(sourceJoint.Position.X * 10);
139 + Debug.Log(sourceJoint.Position.Y * 10);
140 + Debug.Log(sourceJoint.Position.Z * 10);
141 + Kinect.Joint? targetJoint = null;
142 +
143 + if(_BoneMap.ContainsKey(jt))
144 + {
145 + targetJoint = body.Joints[_BoneMap[jt]];
146 + }
147 + Transform jointObj = bodyObject.transform.Find(jt.ToString());
148 + jointObj.localPosition = GetVector3FromJoint(sourceJoint);
149 +
150 + LineRenderer lr = jointObj.GetComponent<LineRenderer>();
151 + if(targetJoint.HasValue)
152 + {
153 + lr.SetPosition(0, jointObj.localPosition);
154 + lr.SetPosition(1, GetVector3FromJoint(targetJoint.Value));
155 + lr.SetColors(GetColorForState (sourceJoint.TrackingState), GetColorForState(targetJoint.Value.TrackingState));
156 + }
157 + else
158 + {
159 + lr.enabled = false;
160 + }
161 + }
162 + }
163 +
164 + private static Color GetColorForState(Kinect.TrackingState state)
165 + {
166 + switch (state)
167 + {
168 + case Kinect.TrackingState.Tracked:
169 + return Color.green;
170 +
171 + case Kinect.TrackingState.Inferred:
172 + return Color.red;
173 +
174 + default:
175 + return Color.black;
176 + }
177 + }
178 +
179 + private static Vector3 GetVector3FromJoint(Kinect.Joint joint)
180 + {
181 + return new Vector3(joint.Position.X * 10, joint.Position.Y * 10, joint.Position.Z * 10);
182 + }
183 +}
1 +using UnityEngine;
2 +using System.Collections;
3 +using Windows.Kinect;
4 +
5 +public class ColorSourceManager : MonoBehaviour
6 +{
7 + public int ColorWidth { get; private set; }
8 + public int ColorHeight { get; private set; }
9 +
10 + private KinectSensor _Sensor;
11 + private ColorFrameReader _Reader;
12 + private Texture2D _Texture;
13 + private byte[] _Data;
14 +
15 + public Texture2D GetColorTexture()
16 + {
17 + return _Texture;
18 + }
19 +
20 + void Start()
21 + {
22 + _Sensor = KinectSensor.GetDefault();
23 +
24 + if (_Sensor != null)
25 + {
26 + _Reader = _Sensor.ColorFrameSource.OpenReader();
27 +
28 + var frameDesc = _Sensor.ColorFrameSource.CreateFrameDescription(ColorImageFormat.Rgba);
29 + ColorWidth = frameDesc.Width;
30 + ColorHeight = frameDesc.Height;
31 +
32 + _Texture = new Texture2D(frameDesc.Width, frameDesc.Height, TextureFormat.RGBA32, false);
33 + _Data = new byte[frameDesc.BytesPerPixel * frameDesc.LengthInPixels];
34 +
35 + if (!_Sensor.IsOpen)
36 + {
37 + _Sensor.Open();
38 + }
39 + }
40 + }
41 +
42 + void Update ()
43 + {
44 + if (_Reader != null)
45 + {
46 + var frame = _Reader.AcquireLatestFrame();
47 +
48 + if (frame != null)
49 + {
50 + frame.CopyConvertedFrameDataToArray(_Data, ColorImageFormat.Rgba);
51 + _Texture.LoadRawTextureData(_Data);
52 + _Texture.Apply();
53 +
54 + frame.Dispose();
55 + frame = null;
56 + }
57 + }
58 + }
59 +
60 + void OnApplicationQuit()
61 + {
62 + if (_Reader != null)
63 + {
64 + _Reader.Dispose();
65 + _Reader = null;
66 + }
67 +
68 + if (_Sensor != null)
69 + {
70 + if (_Sensor.IsOpen)
71 + {
72 + _Sensor.Close();
73 + }
74 +
75 + _Sensor = null;
76 + }
77 + }
78 +}
1 +using UnityEngine;
2 +using System.Collections;
3 +using Windows.Kinect;
4 +
5 +public class ColorSourceView : MonoBehaviour
6 +{
7 + public GameObject ColorSourceManager;
8 + private ColorSourceManager _ColorManager;
9 +
10 + void Start ()
11 + {
12 + gameObject.GetComponent<Renderer>().material.SetTextureScale("_MainTex", new Vector2(-1, 1));
13 + }
14 +
15 + void Update()
16 + {
17 + if (ColorSourceManager == null)
18 + {
19 + return;
20 + }
21 +
22 + _ColorManager = ColorSourceManager.GetComponent<ColorSourceManager>();
23 + if (_ColorManager == null)
24 + {
25 + return;
26 + }
27 +
28 + gameObject.GetComponent<Renderer>().material.mainTexture = _ColorManager.GetColorTexture();
29 + }
30 +}
1 +using UnityEngine;
2 +using System.Collections;
3 +using Windows.Kinect;
4 +
5 +public class DepthSourceManager : MonoBehaviour
6 +{
7 + private KinectSensor _Sensor;
8 + private DepthFrameReader _Reader;
9 + private ushort[] _Data;
10 +
11 + public ushort[] GetData()
12 + {
13 + return _Data;
14 + }
15 +
16 + void Start ()
17 + {
18 + _Sensor = KinectSensor.GetDefault();
19 +
20 + if (_Sensor != null)
21 + {
22 + _Reader = _Sensor.DepthFrameSource.OpenReader();
23 + _Data = new ushort[_Sensor.DepthFrameSource.FrameDescription.LengthInPixels];
24 + }
25 + }
26 +
27 + void Update ()
28 + {
29 + if (_Reader != null)
30 + {
31 + var frame = _Reader.AcquireLatestFrame();
32 + if (frame != null)
33 + {
34 + frame.CopyFrameDataToArray(_Data);
35 + frame.Dispose();
36 + frame = null;
37 + }
38 + }
39 + }
40 +
41 + void OnApplicationQuit()
42 + {
43 + if (_Reader != null)
44 + {
45 + _Reader.Dispose();
46 + _Reader = null;
47 + }
48 +
49 + if (_Sensor != null)
50 + {
51 + if (_Sensor.IsOpen)
52 + {
53 + _Sensor.Close();
54 + }
55 +
56 + _Sensor = null;
57 + }
58 + }
59 +}
1 +using UnityEngine;
2 +using System.Collections;
3 +using Windows.Kinect;
4 +
5 +public enum DepthViewMode
6 +{
7 + SeparateSourceReaders,
8 + MultiSourceReader,
9 +}
10 +
11 +public class DepthSourceView : MonoBehaviour
12 +{
13 + public DepthViewMode ViewMode = DepthViewMode.SeparateSourceReaders;
14 +
15 + public GameObject ColorSourceManager;
16 + public GameObject DepthSourceManager;
17 + public GameObject MultiSourceManager;
18 +
19 + private KinectSensor _Sensor;
20 + private CoordinateMapper _Mapper;
21 + private Mesh _Mesh;
22 + private Vector3[] _Vertices;
23 + private Vector2[] _UV;
24 + private int[] _Triangles;
25 +
26 + // Only works at 4 right now
27 + private const int _DownsampleSize = 4;
28 + private const double _DepthScale = 0.1f;
29 + private const int _Speed = 50;
30 +
31 + private MultiSourceManager _MultiManager;
32 + private ColorSourceManager _ColorManager;
33 + private DepthSourceManager _DepthManager;
34 +
35 + void Start()
36 + {
37 + _Sensor = KinectSensor.GetDefault();
38 + if (_Sensor != null)
39 + {
40 + _Mapper = _Sensor.CoordinateMapper;
41 + var frameDesc = _Sensor.DepthFrameSource.FrameDescription;
42 +
43 + // Downsample to lower resolution
44 + CreateMesh(frameDesc.Width / _DownsampleSize, frameDesc.Height / _DownsampleSize);
45 +
46 + if (!_Sensor.IsOpen)
47 + {
48 + _Sensor.Open();
49 + }
50 + }
51 + }
52 +
53 + void CreateMesh(int width, int height)
54 + {
55 + _Mesh = new Mesh();
56 + GetComponent<MeshFilter>().mesh = _Mesh;
57 +
58 + _Vertices = new Vector3[width * height];
59 + _UV = new Vector2[width * height];
60 + _Triangles = new int[6 * ((width - 1) * (height - 1))];
61 +
62 + int triangleIndex = 0;
63 + for (int y = 0; y < height; y++)
64 + {
65 + for (int x = 0; x < width; x++)
66 + {
67 + int index = (y * width) + x;
68 +
69 + _Vertices[index] = new Vector3(x, -y, 0);
70 + _UV[index] = new Vector2(((float)x / (float)width), ((float)y / (float)height));
71 +
72 + // Skip the last row/col
73 + if (x != (width - 1) && y != (height - 1))
74 + {
75 + int topLeft = index;
76 + int topRight = topLeft + 1;
77 + int bottomLeft = topLeft + width;
78 + int bottomRight = bottomLeft + 1;
79 +
80 + _Triangles[triangleIndex++] = topLeft;
81 + _Triangles[triangleIndex++] = topRight;
82 + _Triangles[triangleIndex++] = bottomLeft;
83 + _Triangles[triangleIndex++] = bottomLeft;
84 + _Triangles[triangleIndex++] = topRight;
85 + _Triangles[triangleIndex++] = bottomRight;
86 + }
87 + }
88 + }
89 +
90 + _Mesh.vertices = _Vertices;
91 + _Mesh.uv = _UV;
92 + _Mesh.triangles = _Triangles;
93 + _Mesh.RecalculateNormals();
94 + }
95 +
96 + void OnGUI()
97 + {
98 + GUI.BeginGroup(new Rect(0, 0, Screen.width, Screen.height));
99 + GUI.TextField(new Rect(Screen.width - 250 , 10, 250, 20), "DepthMode: " + ViewMode.ToString());
100 + GUI.EndGroup();
101 + }
102 +
103 + void Update()
104 + {
105 + if (_Sensor == null)
106 + {
107 + return;
108 + }
109 +
110 + if (Input.GetButtonDown("Fire1"))
111 + {
112 + if(ViewMode == DepthViewMode.MultiSourceReader)
113 + {
114 + ViewMode = DepthViewMode.SeparateSourceReaders;
115 + }
116 + else
117 + {
118 + ViewMode = DepthViewMode.MultiSourceReader;
119 + }
120 + }
121 +
122 + float yVal = Input.GetAxis("Horizontal");
123 + float xVal = -Input.GetAxis("Vertical");
124 +
125 + transform.Rotate(
126 + (xVal * Time.deltaTime * _Speed),
127 + (yVal * Time.deltaTime * _Speed),
128 + 0,
129 + Space.Self);
130 +
131 + if (ViewMode == DepthViewMode.SeparateSourceReaders)
132 + {
133 + if (ColorSourceManager == null)
134 + {
135 + return;
136 + }
137 +
138 + _ColorManager = ColorSourceManager.GetComponent<ColorSourceManager>();
139 + if (_ColorManager == null)
140 + {
141 + return;
142 + }
143 +
144 + if (DepthSourceManager == null)
145 + {
146 + return;
147 + }
148 +
149 + _DepthManager = DepthSourceManager.GetComponent<DepthSourceManager>();
150 + if (_DepthManager == null)
151 + {
152 + return;
153 + }
154 +
155 + gameObject.GetComponent<Renderer>().material.mainTexture = _ColorManager.GetColorTexture();
156 + RefreshData(_DepthManager.GetData(),
157 + _ColorManager.ColorWidth,
158 + _ColorManager.ColorHeight);
159 + }
160 + else
161 + {
162 + if (MultiSourceManager == null)
163 + {
164 + return;
165 + }
166 +
167 + _MultiManager = MultiSourceManager.GetComponent<MultiSourceManager>();
168 + if (_MultiManager == null)
169 + {
170 + return;
171 + }
172 +
173 + gameObject.GetComponent<Renderer>().material.mainTexture = _MultiManager.GetColorTexture();
174 +
175 + RefreshData(_MultiManager.GetDepthData(),
176 + _MultiManager.ColorWidth,
177 + _MultiManager.ColorHeight);
178 + }
179 + }
180 +
181 + private void RefreshData(ushort[] depthData, int colorWidth, int colorHeight)
182 + {
183 + var frameDesc = _Sensor.DepthFrameSource.FrameDescription;
184 +
185 + ColorSpacePoint[] colorSpace = new ColorSpacePoint[depthData.Length];
186 + _Mapper.MapDepthFrameToColorSpace(depthData, colorSpace);
187 +
188 + for (int y = 0; y < frameDesc.Height; y += _DownsampleSize)
189 + {
190 + for (int x = 0; x < frameDesc.Width; x += _DownsampleSize)
191 + {
192 + int indexX = x / _DownsampleSize;
193 + int indexY = y / _DownsampleSize;
194 + int smallIndex = (indexY * (frameDesc.Width / _DownsampleSize)) + indexX;
195 +
196 + double avg = GetAvg(depthData, x, y, frameDesc.Width, frameDesc.Height);
197 +
198 + avg = avg * _DepthScale;
199 +
200 + _Vertices[smallIndex].z = (float)avg;
201 +
202 + // Update UV mapping with CDRP
203 + var colorSpacePoint = colorSpace[(y * frameDesc.Width) + x];
204 + _UV[smallIndex] = new Vector2(colorSpacePoint.X / colorWidth, colorSpacePoint.Y / colorHeight);
205 + }
206 + }
207 +
208 + _Mesh.vertices = _Vertices;
209 + _Mesh.uv = _UV;
210 + _Mesh.triangles = _Triangles;
211 + _Mesh.RecalculateNormals();
212 + }
213 +
214 + private double GetAvg(ushort[] depthData, int x, int y, int width, int height)
215 + {
216 + double sum = 0.0;
217 +
218 + for (int y1 = y; y1 < y + 4; y1++)
219 + {
220 + for (int x1 = x; x1 < x + 4; x1++)
221 + {
222 + int fullIndex = (y1 * width) + x1;
223 +
224 + if (depthData[fullIndex] == 0)
225 + sum += 4500;
226 + else
227 + sum += depthData[fullIndex];
228 +
229 + }
230 + }
231 +
232 + return sum / 16;
233 + }
234 +
235 + void OnApplicationQuit()
236 + {
237 + if (_Mapper != null)
238 + {
239 + _Mapper = null;
240 + }
241 +
242 + if (_Sensor != null)
243 + {
244 + if (_Sensor.IsOpen)
245 + {
246 + _Sensor.Close();
247 + }
248 +
249 + _Sensor = null;
250 + }
251 + }
252 +}
1 +using UnityEngine;
2 +using System.Collections;
3 +
4 +public class DisableOnStart : MonoBehaviour {
5 +
6 + // Use this for initialization
7 + void Start ()
8 + {
9 + gameObject.SetActive (false);
10 + }
11 +}
1 +using UnityEngine;
2 +using System.Collections;
3 +using Windows.Kinect;
4 +
5 +public class InfraredSourceManager : MonoBehaviour
6 +{
7 + private KinectSensor _Sensor;
8 + private InfraredFrameReader _Reader;
9 + private ushort[] _Data;
10 + private byte[] _RawData;
11 +
12 + // I'm not sure this makes sense for the Kinect APIs
13 + // Instead, this logic should be in the VIEW
14 + private Texture2D _Texture;
15 +
16 + public Texture2D GetInfraredTexture()
17 + {
18 + return _Texture;
19 + }
20 +
21 + void Start()
22 + {
23 + _Sensor = KinectSensor.GetDefault();
24 + if (_Sensor != null)
25 + {
26 + _Reader = _Sensor.InfraredFrameSource.OpenReader();
27 + var frameDesc = _Sensor.InfraredFrameSource.FrameDescription;
28 + _Data = new ushort[frameDesc.LengthInPixels];
29 + _RawData = new byte[frameDesc.LengthInPixels * 4];
30 + _Texture = new Texture2D(frameDesc.Width, frameDesc.Height, TextureFormat.BGRA32, false);
31 +
32 + if (!_Sensor.IsOpen)
33 + {
34 + _Sensor.Open();
35 + }
36 + }
37 + }
38 +
39 + void Update ()
40 + {
41 + if (_Reader != null)
42 + {
43 + var frame = _Reader.AcquireLatestFrame();
44 + if (frame != null)
45 + {
46 + frame.CopyFrameDataToArray(_Data);
47 +
48 + int index = 0;
49 + foreach(var ir in _Data)
50 + {
51 + byte intensity = (byte)(ir >> 8);
52 + _RawData[index++] = intensity;
53 + _RawData[index++] = intensity;
54 + _RawData[index++] = intensity;
55 + _RawData[index++] = 255; // Alpha
56 + }
57 +
58 + _Texture.LoadRawTextureData(_RawData);
59 + _Texture.Apply();
60 +
61 + frame.Dispose();
62 + frame = null;
63 + }
64 + }
65 + }
66 +
67 + void OnApplicationQuit()
68 + {
69 + if (_Reader != null)
70 + {
71 + _Reader.Dispose();
72 + _Reader = null;
73 + }
74 +
75 + if (_Sensor != null)
76 + {
77 + if (_Sensor.IsOpen)
78 + {
79 + _Sensor.Close();
80 + }
81 +
82 + _Sensor = null;
83 + }
84 + }
85 +}
1 +using UnityEngine;
2 +using System.Collections;
3 +
4 +public class InfraredSourceView : MonoBehaviour
5 +{
6 + public GameObject InfraredSourceManager;
7 + private InfraredSourceManager _InfraredManager;
8 +
9 + void Start ()
10 + {
11 + gameObject.GetComponent<Renderer>().material.SetTextureScale("_MainTex", new Vector2(-1, 1));
12 + }
13 +
14 + void Update()
15 + {
16 + if (InfraredSourceManager == null)
17 + {
18 + return;
19 + }
20 +
21 + _InfraredManager = InfraredSourceManager.GetComponent<InfraredSourceManager>();
22 + if (_InfraredManager == null)
23 + {
24 + return;
25 + }
26 +
27 + gameObject.GetComponent<Renderer>().material.mainTexture = _InfraredManager.GetInfraredTexture();
28 + }
29 +}
1 +using UnityEngine;
2 +using System.Collections;
3 +using Windows.Kinect;
4 +
5 +public class MultiSourceManager : MonoBehaviour {
6 + public int ColorWidth { get; private set; }
7 + public int ColorHeight { get; private set; }
8 +
9 + private KinectSensor _Sensor;
10 + private MultiSourceFrameReader _Reader;
11 + private Texture2D _ColorTexture;
12 + private ushort[] _DepthData;
13 + private byte[] _ColorData;
14 +
15 + public Texture2D GetColorTexture()
16 + {
17 + return _ColorTexture;
18 + }
19 +
20 + public ushort[] GetDepthData()
21 + {
22 + return _DepthData;
23 + }
24 +
25 + void Start ()
26 + {
27 + _Sensor = KinectSensor.GetDefault();
28 +
29 + if (_Sensor != null)
30 + {
31 + _Reader = _Sensor.OpenMultiSourceFrameReader(FrameSourceTypes.Color | FrameSourceTypes.Depth);
32 +
33 + var colorFrameDesc = _Sensor.ColorFrameSource.CreateFrameDescription(ColorImageFormat.Rgba);
34 + ColorWidth = colorFrameDesc.Width;
35 + ColorHeight = colorFrameDesc.Height;
36 +
37 + _ColorTexture = new Texture2D(colorFrameDesc.Width, colorFrameDesc.Height, TextureFormat.RGBA32, false);
38 + _ColorData = new byte[colorFrameDesc.BytesPerPixel * colorFrameDesc.LengthInPixels];
39 +
40 + var depthFrameDesc = _Sensor.DepthFrameSource.FrameDescription;
41 + _DepthData = new ushort[depthFrameDesc.LengthInPixels];
42 +
43 + if (!_Sensor.IsOpen)
44 + {
45 + _Sensor.Open();
46 + }
47 + }
48 + }
49 +
50 + void Update ()
51 + {
52 + if (_Reader != null)
53 + {
54 + var frame = _Reader.AcquireLatestFrame();
55 + if (frame != null)
56 + {
57 + var colorFrame = frame.ColorFrameReference.AcquireFrame();
58 + if (colorFrame != null)
59 + {
60 + var depthFrame = frame.DepthFrameReference.AcquireFrame();
61 + if (depthFrame != null)
62 + {
63 + colorFrame.CopyConvertedFrameDataToArray(_ColorData, ColorImageFormat.Rgba);
64 + _ColorTexture.LoadRawTextureData(_ColorData);
65 + _ColorTexture.Apply();
66 +
67 + depthFrame.CopyFrameDataToArray(_DepthData);
68 +
69 + depthFrame.Dispose();
70 + depthFrame = null;
71 + }
72 +
73 + colorFrame.Dispose();
74 + colorFrame = null;
75 + }
76 +
77 + frame = null;
78 + }
79 + }
80 + }
81 +
82 + void OnApplicationQuit()
83 + {
84 + if (_Reader != null)
85 + {
86 + _Reader.Dispose();
87 + _Reader = null;
88 + }
89 +
90 + if (_Sensor != null)
91 + {
92 + if (_Sensor.IsOpen)
93 + {
94 + _Sensor.Close();
95 + }
96 +
97 + _Sensor = null;
98 + }
99 + }
100 +}
No preview for this file type
1 +%YAML 1.1
2 +%TAG !u! tag:unity3d.com,2011:
3 +--- !u!29 &1
4 +OcclusionCullingSettings:
5 + m_ObjectHideFlags: 0
6 + serializedVersion: 2
7 + m_OcclusionBakeSettings:
8 + smallestOccluder: 5
9 + smallestHole: 0.25
10 + backfaceThreshold: 100
11 + m_SceneGUID: 00000000000000000000000000000000
12 + m_OcclusionCullingData: {fileID: 0}
13 +--- !u!104 &2
14 +RenderSettings:
15 + m_ObjectHideFlags: 0
16 + serializedVersion: 9
17 + m_Fog: 0
18 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
19 + m_FogMode: 3
20 + m_FogDensity: 0.01
21 + m_LinearFogStart: 0
22 + m_LinearFogEnd: 300
23 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
24 + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
25 + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
26 + m_AmbientIntensity: 1
27 + m_AmbientMode: 0
28 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
29 + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
30 + m_HaloStrength: 0.5
31 + m_FlareStrength: 1
32 + m_FlareFadeSpeed: 3
33 + m_HaloTexture: {fileID: 0}
34 + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
35 + m_DefaultReflectionMode: 0
36 + m_DefaultReflectionResolution: 128
37 + m_ReflectionBounces: 1
38 + m_ReflectionIntensity: 1
39 + m_CustomReflection: {fileID: 0}
40 + m_Sun: {fileID: 0}
41 + m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
42 + m_UseRadianceAmbientProbe: 0
43 +--- !u!157 &3
44 +LightmapSettings:
45 + m_ObjectHideFlags: 0
46 + serializedVersion: 11
47 + m_GIWorkflowMode: 1
48 + m_GISettings:
49 + serializedVersion: 2
50 + m_BounceScale: 1
51 + m_IndirectOutputScale: 1
52 + m_AlbedoBoost: 1
53 + m_EnvironmentLightingMode: 0
54 + m_EnableBakedLightmaps: 1
55 + m_EnableRealtimeLightmaps: 0
56 + m_LightmapEditorSettings:
57 + serializedVersion: 12
58 + m_Resolution: 2
59 + m_BakeResolution: 40
60 + m_AtlasSize: 1024
61 + m_AO: 0
62 + m_AOMaxDistance: 1
63 + m_CompAOExponent: 1
64 + m_CompAOExponentDirect: 0
65 + m_ExtractAmbientOcclusion: 0
66 + m_Padding: 2
67 + m_LightmapParameters: {fileID: 0}
68 + m_LightmapsBakeMode: 1
69 + m_TextureCompression: 1
70 + m_FinalGather: 0
71 + m_FinalGatherFiltering: 1
72 + m_FinalGatherRayCount: 256
73 + m_ReflectionCompression: 2
74 + m_MixedBakeMode: 2
75 + m_BakeBackend: 1
76 + m_PVRSampling: 1
77 + m_PVRDirectSampleCount: 32
78 + m_PVRSampleCount: 512
79 + m_PVRBounces: 2
80 + m_PVREnvironmentSampleCount: 256
81 + m_PVREnvironmentReferencePointCount: 2048
82 + m_PVRFilteringMode: 1
83 + m_PVRDenoiserTypeDirect: 1
84 + m_PVRDenoiserTypeIndirect: 1
85 + m_PVRDenoiserTypeAO: 1
86 + m_PVRFilterTypeDirect: 0
87 + m_PVRFilterTypeIndirect: 0
88 + m_PVRFilterTypeAO: 0
89 + m_PVREnvironmentMIS: 1
90 + m_PVRCulling: 1
91 + m_PVRFilteringGaussRadiusDirect: 1
92 + m_PVRFilteringGaussRadiusIndirect: 5
93 + m_PVRFilteringGaussRadiusAO: 2
94 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5
95 + m_PVRFilteringAtrousPositionSigmaIndirect: 2
96 + m_PVRFilteringAtrousPositionSigmaAO: 1
97 + m_ExportTrainingData: 0
98 + m_TrainingDataDestination: TrainingData
99 + m_LightProbeSampleCountMultiplier: 4
100 + m_LightingDataAsset: {fileID: 0}
101 + m_UseShadowmask: 1
102 +--- !u!196 &4
103 +NavMeshSettings:
104 + serializedVersion: 2
105 + m_ObjectHideFlags: 0
106 + m_BuildSettings:
107 + serializedVersion: 2
108 + agentTypeID: 0
109 + agentRadius: 0.5
110 + agentHeight: 2
111 + agentSlope: 45
112 + agentClimb: 0.4
113 + ledgeDropHeight: 0
114 + maxJumpAcrossDistance: 0
115 + minRegionArea: 2
116 + manualCellSize: 0
117 + cellSize: 0.16666667
118 + manualTileSize: 0
119 + tileSize: 256
120 + accuratePlacement: 0
121 + debug:
122 + m_Flags: 0
123 + m_NavMeshData: {fileID: 0}
124 +--- !u!1 &72268619
125 +GameObject:
126 + m_ObjectHideFlags: 0
127 + m_CorrespondingSourceObject: {fileID: 0}
128 + m_PrefabInstance: {fileID: 0}
129 + m_PrefabAsset: {fileID: 0}
130 + serializedVersion: 6
131 + m_Component:
132 + - component: {fileID: 72268621}
133 + - component: {fileID: 72268620}
134 + m_Layer: 0
135 + m_Name: Directional Light
136 + m_TagString: Untagged
137 + m_Icon: {fileID: 0}
138 + m_NavMeshLayer: 0
139 + m_StaticEditorFlags: 0
140 + m_IsActive: 1
141 +--- !u!108 &72268620
142 +Light:
143 + m_ObjectHideFlags: 0
144 + m_CorrespondingSourceObject: {fileID: 0}
145 + m_PrefabInstance: {fileID: 0}
146 + m_PrefabAsset: {fileID: 0}
147 + m_GameObject: {fileID: 72268619}
148 + m_Enabled: 1
149 + serializedVersion: 10
150 + m_Type: 1
151 + m_Shape: 0
152 + m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
153 + m_Intensity: 1
154 + m_Range: 10
155 + m_SpotAngle: 30
156 + m_InnerSpotAngle: 21.80208
157 + m_CookieSize: 10
158 + m_Shadows:
159 + m_Type: 2
160 + m_Resolution: -1
161 + m_CustomResolution: -1
162 + m_Strength: 1
163 + m_Bias: 0.05
164 + m_NormalBias: 0.4
165 + m_NearPlane: 0.2
166 + m_CullingMatrixOverride:
167 + e00: 1
168 + e01: 0
169 + e02: 0
170 + e03: 0
171 + e10: 0
172 + e11: 1
173 + e12: 0
174 + e13: 0
175 + e20: 0
176 + e21: 0
177 + e22: 1
178 + e23: 0
179 + e30: 0
180 + e31: 0
181 + e32: 0
182 + e33: 1
183 + m_UseCullingMatrixOverride: 0
184 + m_Cookie: {fileID: 0}
185 + m_DrawHalo: 0
186 + m_Flare: {fileID: 0}
187 + m_RenderMode: 0
188 + m_CullingMask:
189 + serializedVersion: 2
190 + m_Bits: 4294967295
191 + m_RenderingLayerMask: 1
192 + m_Lightmapping: 4
193 + m_LightShadowCasterMode: 0
194 + m_AreaSize: {x: 1, y: 1}
195 + m_BounceIntensity: 1
196 + m_ColorTemperature: 6570
197 + m_UseColorTemperature: 0
198 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
199 + m_UseBoundingSphereOverride: 0
200 + m_ShadowRadius: 0
201 + m_ShadowAngle: 0
202 +--- !u!4 &72268621
203 +Transform:
204 + m_ObjectHideFlags: 0
205 + m_CorrespondingSourceObject: {fileID: 0}
206 + m_PrefabInstance: {fileID: 0}
207 + m_PrefabAsset: {fileID: 0}
208 + m_GameObject: {fileID: 72268619}
209 + m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
210 + m_LocalPosition: {x: 0, y: 3, z: 0}
211 + m_LocalScale: {x: 1, y: 1, z: 1}
212 + m_Children: []
213 + m_Father: {fileID: 0}
214 + m_RootOrder: 1
215 + m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
216 +--- !u!1 &241038935
217 +GameObject:
218 + m_ObjectHideFlags: 0
219 + m_CorrespondingSourceObject: {fileID: 0}
220 + m_PrefabInstance: {fileID: 0}
221 + m_PrefabAsset: {fileID: 0}
222 + serializedVersion: 6
223 + m_Component:
224 + - component: {fileID: 241038938}
225 + - component: {fileID: 241038937}
226 + - component: {fileID: 241038936}
227 + m_Layer: 0
228 + m_Name: Main Camera
229 + m_TagString: MainCamera
230 + m_Icon: {fileID: 0}
231 + m_NavMeshLayer: 0
232 + m_StaticEditorFlags: 0
233 + m_IsActive: 1
234 +--- !u!81 &241038936
235 +AudioListener:
236 + m_ObjectHideFlags: 0
237 + m_CorrespondingSourceObject: {fileID: 0}
238 + m_PrefabInstance: {fileID: 0}
239 + m_PrefabAsset: {fileID: 0}
240 + m_GameObject: {fileID: 241038935}
241 + m_Enabled: 1
242 +--- !u!20 &241038937
243 +Camera:
244 + m_ObjectHideFlags: 0
245 + m_CorrespondingSourceObject: {fileID: 0}
246 + m_PrefabInstance: {fileID: 0}
247 + m_PrefabAsset: {fileID: 0}
248 + m_GameObject: {fileID: 241038935}
249 + m_Enabled: 1
250 + serializedVersion: 2
251 + m_ClearFlags: 1
252 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
253 + m_projectionMatrixMode: 1
254 + m_GateFitMode: 2
255 + m_FOVAxisMode: 0
256 + m_SensorSize: {x: 36, y: 24}
257 + m_LensShift: {x: 0, y: 0}
258 + m_FocalLength: 50
259 + m_NormalizedViewPortRect:
260 + serializedVersion: 2
261 + x: 0
262 + y: 0
263 + width: 1
264 + height: 1
265 + near clip plane: 0.3
266 + far clip plane: 1000
267 + field of view: 60
268 + orthographic: 0
269 + orthographic size: 5
270 + m_Depth: -1
271 + m_CullingMask:
272 + serializedVersion: 2
273 + m_Bits: 4294967295
274 + m_RenderingPath: -1
275 + m_TargetTexture: {fileID: 0}
276 + m_TargetDisplay: 0
277 + m_TargetEye: 3
278 + m_HDR: 1
279 + m_AllowMSAA: 1
280 + m_AllowDynamicResolution: 0
281 + m_ForceIntoRT: 0
282 + m_OcclusionCulling: 1
283 + m_StereoConvergence: 10
284 + m_StereoSeparation: 0.022
285 +--- !u!4 &241038938
286 +Transform:
287 + m_ObjectHideFlags: 0
288 + m_CorrespondingSourceObject: {fileID: 0}
289 + m_PrefabInstance: {fileID: 0}
290 + m_PrefabAsset: {fileID: 0}
291 + m_GameObject: {fileID: 241038935}
292 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
293 + m_LocalPosition: {x: 0, y: 1, z: -2}
294 + m_LocalScale: {x: 1, y: 1, z: 1}
295 + m_Children: []
296 + m_Father: {fileID: 0}
297 + m_RootOrder: 0
298 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
299 +--- !u!1 &339505467 stripped
300 +GameObject:
301 + m_CorrespondingSourceObject: {fileID: -927199367670048503, guid: 2fabf5256d4e0f64183020c8a537dc3f,
302 + type: 3}
303 + m_PrefabInstance: {fileID: 1406767318}
304 + m_PrefabAsset: {fileID: 0}
305 +--- !u!1 &1391846999
306 +GameObject:
307 + m_ObjectHideFlags: 0
308 + m_CorrespondingSourceObject: {fileID: 0}
309 + m_PrefabInstance: {fileID: 0}
310 + m_PrefabAsset: {fileID: 0}
311 + serializedVersion: 6
312 + m_Component:
313 + - component: {fileID: 1391847003}
314 + - component: {fileID: 1391847002}
315 + - component: {fileID: 1391847001}
316 + - component: {fileID: 1391847000}
317 + m_Layer: 0
318 + m_Name: Background
319 + m_TagString: Untagged
320 + m_Icon: {fileID: 0}
321 + m_NavMeshLayer: 0
322 + m_StaticEditorFlags: 0
323 + m_IsActive: 1
324 +--- !u!64 &1391847000
325 +MeshCollider:
326 + m_ObjectHideFlags: 0
327 + m_CorrespondingSourceObject: {fileID: 0}
328 + m_PrefabInstance: {fileID: 0}
329 + m_PrefabAsset: {fileID: 0}
330 + m_GameObject: {fileID: 1391846999}
331 + m_Material: {fileID: 0}
332 + m_IsTrigger: 0
333 + m_Enabled: 1
334 + serializedVersion: 4
335 + m_Convex: 0
336 + m_CookingOptions: 30
337 + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
338 +--- !u!23 &1391847001
339 +MeshRenderer:
340 + m_ObjectHideFlags: 0
341 + m_CorrespondingSourceObject: {fileID: 0}
342 + m_PrefabInstance: {fileID: 0}
343 + m_PrefabAsset: {fileID: 0}
344 + m_GameObject: {fileID: 1391846999}
345 + m_Enabled: 1
346 + m_CastShadows: 1
347 + m_ReceiveShadows: 1
348 + m_DynamicOccludee: 1
349 + m_MotionVectors: 1
350 + m_LightProbeUsage: 1
351 + m_ReflectionProbeUsage: 1
352 + m_RayTracingMode: 2
353 + m_RenderingLayerMask: 1
354 + m_RendererPriority: 0
355 + m_Materials:
356 + - {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
357 + m_StaticBatchInfo:
358 + firstSubMesh: 0
359 + subMeshCount: 0
360 + m_StaticBatchRoot: {fileID: 0}
361 + m_ProbeAnchor: {fileID: 0}
362 + m_LightProbeVolumeOverride: {fileID: 0}
363 + m_ScaleInLightmap: 1
364 + m_ReceiveGI: 1
365 + m_PreserveUVs: 0
366 + m_IgnoreNormalsForChartDetection: 0
367 + m_ImportantGI: 0
368 + m_StitchLightmapSeams: 1
369 + m_SelectedEditorRenderState: 3
370 + m_MinimumChartSize: 4
371 + m_AutoUVMaxDistance: 0.5
372 + m_AutoUVMaxAngle: 89
373 + m_LightmapParameters: {fileID: 0}
374 + m_SortingLayerID: 0
375 + m_SortingLayer: 0
376 + m_SortingOrder: 0
377 +--- !u!33 &1391847002
378 +MeshFilter:
379 + m_ObjectHideFlags: 0
380 + m_CorrespondingSourceObject: {fileID: 0}
381 + m_PrefabInstance: {fileID: 0}
382 + m_PrefabAsset: {fileID: 0}
383 + m_GameObject: {fileID: 1391846999}
384 + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
385 +--- !u!4 &1391847003
386 +Transform:
387 + m_ObjectHideFlags: 0
388 + m_CorrespondingSourceObject: {fileID: 0}
389 + m_PrefabInstance: {fileID: 0}
390 + m_PrefabAsset: {fileID: 0}
391 + m_GameObject: {fileID: 1391846999}
392 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
393 + m_LocalPosition: {x: -0.7337067, y: 1.5634074, z: 4.575219}
394 + m_LocalScale: {x: 1, y: 1, z: 1}
395 + m_Children: []
396 + m_Father: {fileID: 0}
397 + m_RootOrder: 5
398 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
399 +--- !u!1001 &1406767318
400 +PrefabInstance:
401 + m_ObjectHideFlags: 0
402 + serializedVersion: 2
403 + m_Modification:
404 + m_TransformParent: {fileID: 0}
405 + m_Modifications:
406 + - target: {fileID: -4216859302048453862, guid: 2fabf5256d4e0f64183020c8a537dc3f,
407 + type: 3}
408 + propertyPath: m_LocalPosition.x
409 + value: 1
410 + objectReference: {fileID: 0}
411 + - target: {fileID: -4216859302048453862, guid: 2fabf5256d4e0f64183020c8a537dc3f,
412 + type: 3}
413 + propertyPath: m_LocalPosition.y
414 + value: 0
415 + objectReference: {fileID: 0}
416 + - target: {fileID: -4216859302048453862, guid: 2fabf5256d4e0f64183020c8a537dc3f,
417 + type: 3}
418 + propertyPath: m_LocalPosition.z
419 + value: 0
420 + objectReference: {fileID: 0}
421 + - target: {fileID: -4216859302048453862, guid: 2fabf5256d4e0f64183020c8a537dc3f,
422 + type: 3}
423 + propertyPath: m_LocalRotation.x
424 + value: 0
425 + objectReference: {fileID: 0}
426 + - target: {fileID: -4216859302048453862, guid: 2fabf5256d4e0f64183020c8a537dc3f,
427 + type: 3}
428 + propertyPath: m_LocalRotation.y
429 + value: 0
430 + objectReference: {fileID: 0}
431 + - target: {fileID: -4216859302048453862, guid: 2fabf5256d4e0f64183020c8a537dc3f,
432 + type: 3}
433 + propertyPath: m_LocalRotation.z
434 + value: 0
435 + objectReference: {fileID: 0}
436 + - target: {fileID: -4216859302048453862, guid: 2fabf5256d4e0f64183020c8a537dc3f,
437 + type: 3}
438 + propertyPath: m_LocalRotation.w
439 + value: 1
440 + objectReference: {fileID: 0}
441 + - target: {fileID: -4216859302048453862, guid: 2fabf5256d4e0f64183020c8a537dc3f,
442 + type: 3}
443 + propertyPath: m_RootOrder
444 + value: 6
445 + objectReference: {fileID: 0}
446 + - target: {fileID: -4216859302048453862, guid: 2fabf5256d4e0f64183020c8a537dc3f,
447 + type: 3}
448 + propertyPath: m_LocalEulerAnglesHint.x
449 + value: 0
450 + objectReference: {fileID: 0}
451 + - target: {fileID: -4216859302048453862, guid: 2fabf5256d4e0f64183020c8a537dc3f,
452 + type: 3}
453 + propertyPath: m_LocalEulerAnglesHint.y
454 + value: 0
455 + objectReference: {fileID: 0}
456 + - target: {fileID: -4216859302048453862, guid: 2fabf5256d4e0f64183020c8a537dc3f,
457 + type: 3}
458 + propertyPath: m_LocalEulerAnglesHint.z
459 + value: 0
460 + objectReference: {fileID: 0}
461 + - target: {fileID: -927199367670048503, guid: 2fabf5256d4e0f64183020c8a537dc3f,
462 + type: 3}
463 + propertyPath: m_Name
464 + value: Trainee
465 + objectReference: {fileID: 0}
466 + m_RemovedComponents: []
467 + m_SourcePrefab: {fileID: 100100000, guid: 2fabf5256d4e0f64183020c8a537dc3f, type: 3}
468 +--- !u!1 &1437275810
469 +GameObject:
470 + m_ObjectHideFlags: 0
471 + m_CorrespondingSourceObject: {fileID: 0}
472 + m_PrefabInstance: {fileID: 0}
473 + m_PrefabAsset: {fileID: 0}
474 + serializedVersion: 6
475 + m_Component:
476 + - component: {fileID: 1437275812}
477 + - component: {fileID: 1437275811}
478 + m_Layer: 0
479 + m_Name: BodySourceManager
480 + m_TagString: Untagged
481 + m_Icon: {fileID: 0}
482 + m_NavMeshLayer: 0
483 + m_StaticEditorFlags: 0
484 + m_IsActive: 1
485 +--- !u!114 &1437275811
486 +MonoBehaviour:
487 + m_ObjectHideFlags: 0
488 + m_CorrespondingSourceObject: {fileID: 0}
489 + m_PrefabInstance: {fileID: 0}
490 + m_PrefabAsset: {fileID: 0}
491 + m_GameObject: {fileID: 1437275810}
492 + m_Enabled: 1
493 + m_EditorHideFlags: 0
494 + m_Script: {fileID: 11500000, guid: 2e74aed0503c9d24290a1ae5438fddc3, type: 3}
495 + m_Name:
496 + m_EditorClassIdentifier:
497 +--- !u!4 &1437275812
498 +Transform:
499 + m_ObjectHideFlags: 0
500 + m_CorrespondingSourceObject: {fileID: 0}
501 + m_PrefabInstance: {fileID: 0}
502 + m_PrefabAsset: {fileID: 0}
503 + m_GameObject: {fileID: 1437275810}
504 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
505 + m_LocalPosition: {x: 0, y: 0, z: 0}
506 + m_LocalScale: {x: 1, y: 1, z: 1}
507 + m_Children: []
508 + m_Father: {fileID: 0}
509 + m_RootOrder: 4
510 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
511 +--- !u!1 &1853264981
512 +GameObject:
513 + m_ObjectHideFlags: 0
514 + m_CorrespondingSourceObject: {fileID: 0}
515 + m_PrefabInstance: {fileID: 0}
516 + m_PrefabAsset: {fileID: 0}
517 + serializedVersion: 6
518 + m_Component:
519 + - component: {fileID: 1853264984}
520 + - component: {fileID: 1853264983}
521 + - component: {fileID: 1853264982}
522 + m_Layer: 0
523 + m_Name: TrainnerController
524 + m_TagString: Untagged
525 + m_Icon: {fileID: 0}
526 + m_NavMeshLayer: 0
527 + m_StaticEditorFlags: 0
528 + m_IsActive: 1
529 +--- !u!114 &1853264982
530 +MonoBehaviour:
531 + m_ObjectHideFlags: 0
532 + m_CorrespondingSourceObject: {fileID: 0}
533 + m_PrefabInstance: {fileID: 0}
534 + m_PrefabAsset: {fileID: 0}
535 + m_GameObject: {fileID: 1853264981}
536 + m_Enabled: 1
537 + m_EditorHideFlags: 0
538 + m_Script: {fileID: 11500000, guid: 819eb0cfd2d3e7c439a730d87e92e292, type: 3}
539 + m_Name:
540 + m_EditorClassIdentifier:
541 + BoneMaterial: {fileID: 2100000, guid: f2ea145c63353784985576f08398a815, type: 2}
542 + BodySourceManager: {fileID: 1437275810}
543 + humanoid: {fileID: 1930240349}
544 + mirror: 1
545 + move: 1
546 +--- !u!114 &1853264983
547 +MonoBehaviour:
548 + m_ObjectHideFlags: 0
549 + m_CorrespondingSourceObject: {fileID: 0}
550 + m_PrefabInstance: {fileID: 0}
551 + m_PrefabAsset: {fileID: 0}
552 + m_GameObject: {fileID: 1853264981}
553 + m_Enabled: 0
554 + m_EditorHideFlags: 0
555 + m_Script: {fileID: 11500000, guid: 0214f610d24b4ad4f8bc1e78eae65cdb, type: 3}
556 + m_Name:
557 + m_EditorClassIdentifier:
558 + humanoid: {fileID: 1930240349}
559 + mirror: 1
560 + move: 1
561 +--- !u!4 &1853264984
562 +Transform:
563 + m_ObjectHideFlags: 0
564 + m_CorrespondingSourceObject: {fileID: 0}
565 + m_PrefabInstance: {fileID: 0}
566 + m_PrefabAsset: {fileID: 0}
567 + m_GameObject: {fileID: 1853264981}
568 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
569 + m_LocalPosition: {x: 0, y: 0, z: 0}
570 + m_LocalScale: {x: 1, y: 1, z: 1}
571 + m_Children: []
572 + m_Father: {fileID: 0}
573 + m_RootOrder: 7
574 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
575 +--- !u!1 &1871814803
576 +GameObject:
577 + m_ObjectHideFlags: 0
578 + m_CorrespondingSourceObject: {fileID: 0}
579 + m_PrefabInstance: {fileID: 0}
580 + m_PrefabAsset: {fileID: 0}
581 + serializedVersion: 6
582 + m_Component:
583 + - component: {fileID: 1871814805}
584 + - component: {fileID: 1871814804}
585 + - component: {fileID: 1871814806}
586 + - component: {fileID: 1871814807}
587 + m_Layer: 0
588 + m_Name: TraineeController
589 + m_TagString: Untagged
590 + m_Icon: {fileID: 0}
591 + m_NavMeshLayer: 0
592 + m_StaticEditorFlags: 0
593 + m_IsActive: 1
594 +--- !u!114 &1871814804
595 +MonoBehaviour:
596 + m_ObjectHideFlags: 0
597 + m_CorrespondingSourceObject: {fileID: 0}
598 + m_PrefabInstance: {fileID: 0}
599 + m_PrefabAsset: {fileID: 0}
600 + m_GameObject: {fileID: 1871814803}
601 + m_Enabled: 0
602 + m_EditorHideFlags: 0
603 + m_Script: {fileID: 11500000, guid: 0214f610d24b4ad4f8bc1e78eae65cdb, type: 3}
604 + m_Name:
605 + m_EditorClassIdentifier:
606 + humanoid: {fileID: 1930240349}
607 + mirror: 1
608 + move: 1
609 +--- !u!4 &1871814805
610 +Transform:
611 + m_ObjectHideFlags: 0
612 + m_CorrespondingSourceObject: {fileID: 0}
613 + m_PrefabInstance: {fileID: 0}
614 + m_PrefabAsset: {fileID: 0}
615 + m_GameObject: {fileID: 1871814803}
616 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
617 + m_LocalPosition: {x: 0, y: 0, z: 0}
618 + m_LocalScale: {x: 1, y: 1, z: 1}
619 + m_Children: []
620 + m_Father: {fileID: 0}
621 + m_RootOrder: 3
622 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
623 +--- !u!114 &1871814806
624 +MonoBehaviour:
625 + m_ObjectHideFlags: 0
626 + m_CorrespondingSourceObject: {fileID: 0}
627 + m_PrefabInstance: {fileID: 0}
628 + m_PrefabAsset: {fileID: 0}
629 + m_GameObject: {fileID: 1871814803}
630 + m_Enabled: 0
631 + m_EditorHideFlags: 0
632 + m_Script: {fileID: 11500000, guid: 819eb0cfd2d3e7c439a730d87e92e292, type: 3}
633 + m_Name:
634 + m_EditorClassIdentifier:
635 + BoneMaterial: {fileID: 2100000, guid: f2ea145c63353784985576f08398a815, type: 2}
636 + BodySourceManager: {fileID: 1437275810}
637 + humanoid: {fileID: 339505467}
638 + mirror: 1
639 + move: 1
640 +--- !u!114 &1871814807
641 +MonoBehaviour:
642 + m_ObjectHideFlags: 0
643 + m_CorrespondingSourceObject: {fileID: 0}
644 + m_PrefabInstance: {fileID: 0}
645 + m_PrefabAsset: {fileID: 0}
646 + m_GameObject: {fileID: 1871814803}
647 + m_Enabled: 1
648 + m_EditorHideFlags: 0
649 + m_Script: {fileID: 11500000, guid: 2341915180881ed45986d94e953d5297, type: 3}
650 + m_Name:
651 + m_EditorClassIdentifier:
652 + BodySourceManager: {fileID: 1437275810}
653 + humanoid: {fileID: 339505467}
654 + mirror: 1
655 + move: 1
656 +--- !u!1001 &1930240348
657 +PrefabInstance:
658 + m_ObjectHideFlags: 0
659 + serializedVersion: 2
660 + m_Modification:
661 + m_TransformParent: {fileID: 0}
662 + m_Modifications:
663 + - target: {fileID: -4216859302048453862, guid: 2fabf5256d4e0f64183020c8a537dc3f,
664 + type: 3}
665 + propertyPath: m_LocalPosition.x
666 + value: -1
667 + objectReference: {fileID: 0}
668 + - target: {fileID: -4216859302048453862, guid: 2fabf5256d4e0f64183020c8a537dc3f,
669 + type: 3}
670 + propertyPath: m_LocalPosition.y
671 + value: 0
672 + objectReference: {fileID: 0}
673 + - target: {fileID: -4216859302048453862, guid: 2fabf5256d4e0f64183020c8a537dc3f,
674 + type: 3}
675 + propertyPath: m_LocalPosition.z
676 + value: 0
677 + objectReference: {fileID: 0}
678 + - target: {fileID: -4216859302048453862, guid: 2fabf5256d4e0f64183020c8a537dc3f,
679 + type: 3}
680 + propertyPath: m_LocalRotation.x
681 + value: 0
682 + objectReference: {fileID: 0}
683 + - target: {fileID: -4216859302048453862, guid: 2fabf5256d4e0f64183020c8a537dc3f,
684 + type: 3}
685 + propertyPath: m_LocalRotation.y
686 + value: 0
687 + objectReference: {fileID: 0}
688 + - target: {fileID: -4216859302048453862, guid: 2fabf5256d4e0f64183020c8a537dc3f,
689 + type: 3}
690 + propertyPath: m_LocalRotation.z
691 + value: 0
692 + objectReference: {fileID: 0}
693 + - target: {fileID: -4216859302048453862, guid: 2fabf5256d4e0f64183020c8a537dc3f,
694 + type: 3}
695 + propertyPath: m_LocalRotation.w
696 + value: 1
697 + objectReference: {fileID: 0}
698 + - target: {fileID: -4216859302048453862, guid: 2fabf5256d4e0f64183020c8a537dc3f,
699 + type: 3}
700 + propertyPath: m_RootOrder
701 + value: 2
702 + objectReference: {fileID: 0}
703 + - target: {fileID: -4216859302048453862, guid: 2fabf5256d4e0f64183020c8a537dc3f,
704 + type: 3}
705 + propertyPath: m_LocalEulerAnglesHint.x
706 + value: 0
707 + objectReference: {fileID: 0}
708 + - target: {fileID: -4216859302048453862, guid: 2fabf5256d4e0f64183020c8a537dc3f,
709 + type: 3}
710 + propertyPath: m_LocalEulerAnglesHint.y
711 + value: 0
712 + objectReference: {fileID: 0}
713 + - target: {fileID: -4216859302048453862, guid: 2fabf5256d4e0f64183020c8a537dc3f,
714 + type: 3}
715 + propertyPath: m_LocalEulerAnglesHint.z
716 + value: 0
717 + objectReference: {fileID: 0}
718 + - target: {fileID: -927199367670048503, guid: 2fabf5256d4e0f64183020c8a537dc3f,
719 + type: 3}
720 + propertyPath: m_Name
721 + value: Trainner
722 + objectReference: {fileID: 0}
723 + m_RemovedComponents: []
724 + m_SourcePrefab: {fileID: 100100000, guid: 2fabf5256d4e0f64183020c8a537dc3f, type: 3}
725 +--- !u!1 &1930240349 stripped
726 +GameObject:
727 + m_CorrespondingSourceObject: {fileID: -927199367670048503, guid: 2fabf5256d4e0f64183020c8a537dc3f,
728 + type: 3}
729 + m_PrefabInstance: {fileID: 1930240348}
730 + m_PrefabAsset: {fileID: 0}
1 +using UnityEngine;
2 +using System.Collections;
3 +using System.Collections.Generic;
4 +using Kinect = Windows.Kinect;
5 +
6 +class CharacterSkeleton
7 +{
8 + public const int
9 + // JointType
10 + JointType_SpineBase = 0,
11 + JointType_SpineMid = 1,
12 + JointType_Neck = 2,
13 + JointType_Head = 3,
14 + JointType_ShoulderLeft = 4,
15 + JointType_ElbowLeft = 5,
16 + JointType_WristLeft = 6,
17 + JointType_HandLeft = 7,
18 + JointType_ShoulderRight = 8,
19 + JointType_ElbowRight = 9,
20 + JointType_WristRight = 10,
21 + JointType_HandRight = 11,
22 + JointType_HipLeft = 12,
23 + JointType_KneeLeft = 13,
24 + JointType_AnkleLeft = 14,
25 + JointType_FootLeft = 15,
26 + JointType_HipRight = 16,
27 + JointType_KneeRight = 17,
28 + JointType_AnkleRight = 18,
29 + JointType_FootRight = 19,
30 + JointType_SpineShoulder = 20,
31 + JointType_HandTipLeft = 21,
32 + JointType_ThumbLeft = 22,
33 + JointType_HandTipRight = 23,
34 + JointType_ThumbRight = 24,
35 + // TrackingState
36 + TrackingState_NotTracked = 0,
37 + TrackingState_Inferred = 1,
38 + TrackingState_Tracked = 2,
39 + // Number
40 + bodyCount = 6,
41 + jointCount = 25;
42 +
43 + private static int[] jointSegment = new int[] {
44 + JointType_SpineBase, JointType_SpineMid, // Spine
45 + JointType_Neck, JointType_Head, // Neck
46 + // left
47 + JointType_ShoulderLeft, JointType_ElbowLeft, // LeftUpperArm
48 + JointType_ElbowLeft, JointType_WristLeft, // LeftLowerArm
49 + JointType_WristLeft, JointType_HandLeft, // LeftHand
50 + JointType_HipLeft, JointType_KneeLeft, // LeftUpperLeg
51 + JointType_KneeLeft, JointType_AnkleLeft, // LeftLowerLeg6
52 + JointType_AnkleLeft, JointType_FootLeft, // LeftFoot
53 + // right
54 + JointType_ShoulderRight, JointType_ElbowRight, // RightUpperArm
55 + JointType_ElbowRight, JointType_WristRight, // RightLowerArm
56 + JointType_WristRight, JointType_HandRight, // RightHand
57 + JointType_HipRight, JointType_KneeRight, // RightUpperLeg
58 + JointType_KneeRight, JointType_AnkleRight, // RightLowerLeg
59 + JointType_AnkleRight, JointType_FootRight, // RightFoot
60 + };
61 + public Vector3[] joint = new Vector3[jointCount];
62 + public int[] jointState = new int[jointCount];
63 +
64 + Dictionary<HumanBodyBones, Vector3> trackingSegment = null;
65 + Dictionary<HumanBodyBones, int> trackingState = null;
66 +
67 + private static HumanBodyBones[] humanBone = new HumanBodyBones[] {
68 + HumanBodyBones.Hips,
69 + HumanBodyBones.Spine,
70 + HumanBodyBones.UpperChest,
71 + HumanBodyBones.Neck,
72 + HumanBodyBones.Head,
73 + HumanBodyBones.LeftUpperArm,
74 + HumanBodyBones.LeftLowerArm,
75 + HumanBodyBones.LeftHand,
76 + HumanBodyBones.LeftUpperLeg,
77 + HumanBodyBones.LeftLowerLeg,
78 + HumanBodyBones.LeftFoot,
79 + HumanBodyBones.RightUpperArm,
80 + HumanBodyBones.RightLowerArm,
81 + HumanBodyBones.RightHand,
82 + HumanBodyBones.RightUpperLeg,
83 + HumanBodyBones.RightLowerLeg,
84 + HumanBodyBones.RightFoot,
85 + };
86 +
87 + private static HumanBodyBones[] targetBone = new HumanBodyBones[] {
88 + HumanBodyBones.Spine,
89 + HumanBodyBones.Neck,
90 + HumanBodyBones.LeftUpperArm,
91 + HumanBodyBones.LeftLowerArm,
92 + HumanBodyBones.LeftHand,
93 + HumanBodyBones.LeftUpperLeg,
94 + HumanBodyBones.LeftLowerLeg,
95 + HumanBodyBones.LeftFoot,
96 + HumanBodyBones.RightUpperArm,
97 + HumanBodyBones.RightLowerArm,
98 + HumanBodyBones.RightHand,
99 + HumanBodyBones.RightUpperLeg,
100 + HumanBodyBones.RightLowerLeg,
101 + HumanBodyBones.RightFoot,
102 + };
103 +
104 + public GameObject humanoid;
105 + private Dictionary<HumanBodyBones, RigBone> rigBone = null;
106 + private bool isSavedPosition = false;
107 + private Vector3 savedPosition;
108 + private Quaternion savedHumanoidRotation;
109 +
110 + public CharacterSkeleton(GameObject h)
111 + {
112 + humanoid = h;
113 + rigBone = new Dictionary<HumanBodyBones, RigBone>();
114 + foreach (HumanBodyBones bone in humanBone)
115 + {
116 + rigBone[bone] = new RigBone(humanoid, bone);
117 + }
118 + savedHumanoidRotation = humanoid.transform.rotation;
119 + trackingSegment = new Dictionary<HumanBodyBones, Vector3>(targetBone.Length);
120 + trackingState = new Dictionary<HumanBodyBones, int>(targetBone.Length);
121 + }
122 + private void swapJoint(int a, int b)
123 + {
124 + Vector3 tmp = joint[a]; joint[a] = joint[b]; joint[b] = tmp;
125 + int t = jointState[a]; jointState[a] = jointState[b]; jointState[b] = t;
126 + }
127 + public void set(float[] jt, int[] st, int offset, bool mirrored, bool move)
128 + {
129 + if (isSavedPosition == false && jointState[JointType_SpineBase] != TrackingState_NotTracked)
130 + {
131 + isSavedPosition = true;
132 + int j = offset * jointCount + JointType_SpineBase;
133 + savedPosition = new Vector3(jt[j * 3], jt[j * 3 + 1], jt[j * 3 + 2]);
134 + }
135 + for (int i = 0; i < jointCount; i++)
136 + {
137 + int j = offset * jointCount + i;
138 + if (mirrored)
139 + {
140 + joint[i] = new Vector3(-jt[j * 3], jt[j * 3 + 1], -jt[j * 3 + 2]);
141 + }
142 + else
143 + {
144 + joint[i] = new Vector3(jt[j * 3], jt[j * 3 + 1], savedPosition.z * 2 - jt[j * 3 + 2]);
145 + }
146 + jointState[i] = st[j];
147 + }
148 + if (mirrored)
149 + {
150 + swapJoint(JointType_ShoulderLeft, JointType_ShoulderRight);
151 + swapJoint(JointType_ElbowLeft, JointType_ElbowRight);
152 + swapJoint(JointType_WristLeft, JointType_WristRight);
153 + swapJoint(JointType_HandLeft, JointType_HandRight);
154 + swapJoint(JointType_HipLeft, JointType_HipRight);
155 + swapJoint(JointType_KneeLeft, JointType_KneeRight);
156 + swapJoint(JointType_AnkleLeft, JointType_AnkleRight);
157 + swapJoint(JointType_FootLeft, JointType_FootRight);
158 + swapJoint(JointType_HandTipLeft, JointType_HandTipRight);
159 + swapJoint(JointType_ThumbLeft, JointType_ThumbRight);
160 + }
161 + for (int i = 0; i < targetBone.Length; i++)
162 + {
163 + int s = jointSegment[2 * i], e = jointSegment[2 * i + 1];
164 + trackingSegment[targetBone[i]] = joint[e] - joint[s];
165 + trackingState[targetBone[i]] = System.Math.Min(jointState[e], jointState[s]);
166 + }
167 +
168 + Vector3 waist = joint[JointType_HipRight] - joint[JointType_HipLeft];
169 + waist = new Vector3(waist.x, 0, waist.z);
170 + Quaternion rot = Quaternion.FromToRotation(Vector3.right, waist);
171 + Quaternion rotInv = Quaternion.Inverse(rot);
172 +
173 + Vector3 shoulder = joint[JointType_ShoulderRight] - joint[JointType_ShoulderLeft];
174 + shoulder = new Vector3(shoulder.x, 0, shoulder.z);
175 + Quaternion srot = Quaternion.FromToRotation(Vector3.right, shoulder);
176 + Quaternion srotInv = Quaternion.Inverse(srot);
177 +
178 + humanoid.transform.rotation = Quaternion.identity;
179 + foreach (HumanBodyBones bone in targetBone)
180 + {
181 + rigBone[bone].transform.rotation = rotInv * Quaternion.FromToRotation(Vector3.up, trackingSegment[bone]);
182 + }
183 + rigBone[HumanBodyBones.UpperChest].offset(srot);
184 + Quaternion bodyRot = rot;
185 + if (mirrored)
186 + {
187 + bodyRot = Quaternion.AngleAxis(180, Vector3.up) * bodyRot;
188 + }
189 + humanoid.transform.rotation = bodyRot;
190 + if (move == true)
191 + {
192 + Vector3 m = joint[JointType_SpineBase];
193 + if (mirrored) m = new Vector3(-m.x, m.y, -m.z);
194 + humanoid.transform.position = m;
195 + }
196 + }
197 +
198 + public void dasomset(float[] jt, int[] st, int offset, bool mirrored, bool move, Kinect.Joint sourceJoint, Transform jointObj)
199 + {
200 + if (isSavedPosition == false && jointState[JointType_SpineBase] != TrackingState_NotTracked)
201 + {
202 + isSavedPosition = true;
203 + int j = offset * jointCount + JointType_SpineBase;
204 + savedPosition = new Vector3(jt[j * 3], jt[j * 3 + 1], jt[j * 3 + 2]);
205 + }
206 + for (int i = 0; i < jointCount; i++)
207 + {
208 + int j = offset * jointCount + i;
209 + if (mirrored)
210 + {
211 + joint[i] = new Vector3(-jt[j * 3], jt[j * 3 + 1], -jt[j * 3 + 2]);
212 + }
213 + else
214 + {
215 + joint[i] = new Vector3(jt[j * 3], jt[j * 3 + 1], savedPosition.z * 2 - jt[j * 3 + 2]);
216 + }
217 + jointState[i] = st[j];
218 + }
219 + if (mirrored)
220 + {
221 + swapJoint(JointType_ShoulderLeft, JointType_ShoulderRight);
222 + swapJoint(JointType_ElbowLeft, JointType_ElbowRight);
223 + swapJoint(JointType_WristLeft, JointType_WristRight);
224 + swapJoint(JointType_HandLeft, JointType_HandRight);
225 + swapJoint(JointType_HipLeft, JointType_HipRight);
226 + swapJoint(JointType_KneeLeft, JointType_KneeRight);
227 + swapJoint(JointType_AnkleLeft, JointType_AnkleRight);
228 + swapJoint(JointType_FootLeft, JointType_FootRight);
229 + swapJoint(JointType_HandTipLeft, JointType_HandTipRight);
230 + swapJoint(JointType_ThumbLeft, JointType_ThumbRight);
231 + }
232 + for (int i = 0; i < targetBone.Length; i++)
233 + {
234 + int s = jointSegment[2 * i], e = jointSegment[2 * i + 1];
235 + trackingSegment[targetBone[i]] = joint[e] - joint[s];
236 + trackingState[targetBone[i]] = System.Math.Min(jointState[e], jointState[s]);
237 + }
238 +
239 + Vector3 waist = joint[JointType_HipRight] - joint[JointType_HipLeft];
240 + waist = new Vector3(waist.x, 0, waist.z);
241 + Quaternion rot = Quaternion.FromToRotation(Vector3.right, waist);
242 + Quaternion rotInv = Quaternion.Inverse(rot);
243 +
244 + Vector3 shoulder = joint[JointType_ShoulderRight] - joint[JointType_ShoulderLeft];
245 + shoulder = new Vector3(shoulder.x, 0, shoulder.z);
246 + Quaternion srot = Quaternion.FromToRotation(Vector3.right, shoulder);
247 + Quaternion srotInv = Quaternion.Inverse(srot);
248 +
249 + humanoid.transform.rotation = Quaternion.identity;
250 + foreach (HumanBodyBones bone in targetBone)
251 + {
252 + rigBone[bone].transform.rotation = rotInv * Quaternion.FromToRotation(Vector3.up, trackingSegment[bone]);
253 + }
254 + rigBone[HumanBodyBones.UpperChest].offset(srot);
255 + Quaternion bodyRot = rot;
256 + if (mirrored)
257 + {
258 + bodyRot = Quaternion.AngleAxis(180, Vector3.up) * bodyRot;
259 + }
260 + humanoid.transform.rotation = bodyRot;
261 + if (move == true)
262 + {
263 + Vector3 m = joint[JointType_SpineBase];
264 + if (mirrored) m = new Vector3(-m.x, m.y, -m.z);
265 + humanoid.transform.position = m;
266 + }
267 + }
268 +
269 +}
1 +using System.Collections;
2 +using System.Collections.Generic;
3 +using UnityEngine;
4 +using Windows.Kinect;
5 +
6 +public class DetectJoints : MonoBehaviour
7 +{
8 + public GameObject BodySrcManager;
9 + public JointType TrackedJoint;
10 + private BodySourceManager bodyManager;
11 + private Body[] bodies;
12 + public float multiplier = 10f;
13 + // Start is called before the first frame update
14 + void Start()
15 + {
16 + if (BodySrcManager == null)
17 + {
18 + Debug.Log("Assign Game Object with Body Source Manger");
19 + }
20 + else
21 + {
22 + bodyManager = BodySrcManager.GetComponent<BodySourceManager>();
23 + }
24 + }
25 +
26 + // Update is called once per frame
27 + void Update()
28 + {
29 + if (bodyManager == null)
30 + {
31 + return;
32 + }
33 + bodies = bodyManager.GetData();
34 +
35 + if (bodies == null)
36 + {
37 + return;
38 + }
39 +
40 + foreach (var body in bodies)
41 + {
42 + if (body == null)
43 + {
44 + continue;
45 +
46 + }
47 + if (body.IsTracked)
48 + {
49 + var pos = body.Joints[TrackedJoint].Position;
50 + gameObject.transform.position = new Vector3(pos.X*multiplier, pos.Y*multiplier);
51 + }
52 + }
53 +
54 + }
55 +}
1 +using UnityEngine;
2 +using System.Collections;
3 +using System.Collections.Generic;
4 +using Kinect = Windows.Kinect;
5 +using System.Runtime.InteropServices;
6 +
7 +
8 +
9 +
10 +public class Move : MonoBehaviour
11 +{
12 +// [DllImport("NtKinectDll")]
13 +// private static extern System.IntPtr getKinect();
14 +// [DllImport("NtKinectDll")]
15 +// private static extern int setSkeleton(System.IntPtr kinect, System.IntPtr data, System.IntPtr state, System.IntPtr id);
16 +
17 + int bodyCount = 6;
18 + int jointCount = 25;
19 +
20 + public Material BoneMaterial;
21 + public GameObject BodySourceManager;
22 + private Dictionary<ulong, GameObject> _Bodies = new Dictionary<ulong, GameObject>();
23 + private BodySourceManager _BodyManager;
24 +
25 + public GameObject humanoid;
26 + CharacterSkeleton skeleton;
27 + public bool mirror = true;
28 + public bool move = true;
29 + private System.IntPtr kinect;
30 +
31 + void Start()
32 + {
33 + skeleton = new CharacterSkeleton(humanoid);
34 + }
35 +
36 + private Dictionary<Kinect.JointType, Kinect.JointType> _BoneMap = new Dictionary<Kinect.JointType, Kinect.JointType>()
37 + {
38 + { Kinect.JointType.FootLeft, Kinect.JointType.AnkleLeft },
39 + { Kinect.JointType.AnkleLeft, Kinect.JointType.KneeLeft },
40 + { Kinect.JointType.KneeLeft, Kinect.JointType.HipLeft },
41 + { Kinect.JointType.HipLeft, Kinect.JointType.SpineBase },
42 +
43 + { Kinect.JointType.FootRight, Kinect.JointType.AnkleRight },
44 + { Kinect.JointType.AnkleRight, Kinect.JointType.KneeRight },
45 + { Kinect.JointType.KneeRight, Kinect.JointType.HipRight },
46 + { Kinect.JointType.HipRight, Kinect.JointType.SpineBase },
47 +
48 + { Kinect.JointType.HandTipLeft, Kinect.JointType.HandLeft },
49 + { Kinect.JointType.ThumbLeft, Kinect.JointType.HandLeft },
50 + { Kinect.JointType.HandLeft, Kinect.JointType.WristLeft },
51 + { Kinect.JointType.WristLeft, Kinect.JointType.ElbowLeft },
52 + { Kinect.JointType.ElbowLeft, Kinect.JointType.ShoulderLeft },
53 + { Kinect.JointType.ShoulderLeft, Kinect.JointType.SpineShoulder },
54 +
55 + { Kinect.JointType.HandTipRight, Kinect.JointType.HandRight },
56 + { Kinect.JointType.ThumbRight, Kinect.JointType.HandRight },
57 + { Kinect.JointType.HandRight, Kinect.JointType.WristRight },
58 + { Kinect.JointType.WristRight, Kinect.JointType.ElbowRight },
59 + { Kinect.JointType.ElbowRight, Kinect.JointType.ShoulderRight },
60 + { Kinect.JointType.ShoulderRight, Kinect.JointType.SpineShoulder },
61 +
62 + { Kinect.JointType.SpineBase, Kinect.JointType.SpineMid },
63 + { Kinect.JointType.SpineMid, Kinect.JointType.SpineShoulder },
64 + { Kinect.JointType.SpineShoulder, Kinect.JointType.Neck },
65 + { Kinect.JointType.Neck, Kinect.JointType.Head },
66 + };
67 +
68 + void Update()
69 + {
70 + float[] data1 = new float[bodyCount * jointCount * 3];
71 + int[] state = new int[bodyCount * jointCount];
72 + int[] id = new int[bodyCount];
73 + GCHandle gch = GCHandle.Alloc(data1, GCHandleType.Pinned);
74 + GCHandle gch2 = GCHandle.Alloc(state, GCHandleType.Pinned);
75 + GCHandle gch3 = GCHandle.Alloc(id, GCHandleType.Pinned);
76 +
77 + if (BodySourceManager == null)
78 + {
79 + return;
80 + }
81 +
82 + _BodyManager = BodySourceManager.GetComponent<BodySourceManager>();
83 + if (_BodyManager == null)
84 + {
85 + return;
86 + }
87 +
88 + Kinect.Body[] data = _BodyManager.GetData();
89 + if (data == null)
90 + {
91 + return;
92 + }
93 +
94 + List<ulong> trackedIds = new List<ulong>();
95 + foreach (var body in data)
96 + {
97 + if (body == null)
98 + {
99 + continue;
100 + }
101 +
102 + if (body.IsTracked)
103 + {
104 +
105 + trackedIds.Add(body.TrackingId);
106 + }
107 + }
108 +
109 + List<ulong> knownIds = new List<ulong>(_Bodies.Keys);
110 +
111 + // First delete untracked bodies
112 + foreach (ulong trackingId in knownIds)
113 + {
114 + if (!trackedIds.Contains(trackingId))
115 + {
116 + Destroy(_Bodies[trackingId]);
117 + _Bodies.Remove(trackingId);
118 + }
119 + }
120 +
121 + foreach (var body in data)
122 + {
123 + if (body == null)
124 + {
125 + continue;
126 + }
127 +
128 + if (body.IsTracked)
129 + {
130 + if (!_Bodies.ContainsKey(body.TrackingId))
131 + {
132 +
133 + _Bodies[body.TrackingId] = CreateBodyObject(body.TrackingId);
134 +
135 + }
136 + RefreshBodyObject(body, _Bodies[body.TrackingId]);
137 + }
138 + }
139 + }
140 +
141 + private GameObject CreateBodyObject(ulong id)
142 + {
143 +
144 + GameObject body = new GameObject("Body:" + id);
145 +
146 + for (Kinect.JointType jt = Kinect.JointType.SpineBase; jt <= Kinect.JointType.ThumbRight; jt++)
147 + {
148 + GameObject jointObj = GameObject.CreatePrimitive(PrimitiveType.Cube);
149 + LineRenderer lr = jointObj.AddComponent<LineRenderer>();
150 + lr.SetVertexCount(2);
151 + lr.material = BoneMaterial;
152 + lr.SetWidth(0.05f, 0.05f);
153 +
154 + jointObj.transform.localScale = new Vector3(0.3f, 0.3f, 0.3f);
155 + jointObj.name = jt.ToString();
156 + jointObj.transform.parent = body.transform;
157 + }
158 +
159 + return body;
160 + }
161 +
162 + private void RefreshBodyObject(Kinect.Body body, GameObject bodyObject)
163 + {
164 + float[] data1 = new float[bodyCount * jointCount * 3];
165 + int[] state = new int[bodyCount * jointCount];
166 + int[] id1 = new int[bodyCount];
167 + GCHandle gch = GCHandle.Alloc(data1, GCHandleType.Pinned);
168 + GCHandle gch2 = GCHandle.Alloc(state, GCHandleType.Pinned);
169 + GCHandle gch3 = GCHandle.Alloc(id1, GCHandleType.Pinned);
170 +
171 + int i = -1;
172 +
173 + for (Kinect.JointType jt = Kinect.JointType.SpineBase; jt <= Kinect.JointType.ThumbRight; jt++)
174 + {
175 + Kinect.Joint sourceJoint = body.Joints[jt];
176 +
177 + //Debug.Log("body.Joints[jt]");
178 + //Debug.Log(body.Joints[jt]);
179 + //Debug.Log("jt");
180 + //Debug.Log(jt);
181 + //Debug.Log(body.Joints[jt].JointType);
182 + //Debug.Log(sourceJoint.Position.X * 10);
183 + //Debug.Log(sourceJoint.Position.Y * 10);
184 + //Debug.Log(sourceJoint.Position.Z * 10);
185 + Kinect.Joint? targetJoint = null;
186 +
187 + if (_BoneMap.ContainsKey(jt))
188 + {
189 + targetJoint = body.Joints[_BoneMap[jt]];
190 + }
191 + Transform jointObj = bodyObject.transform.Find(jt.ToString());
192 + jointObj.localPosition = GetVector3FromJoint(sourceJoint);
193 +
194 + //Debug.Log(i);
195 +
196 + i++;
197 + data1[i] = sourceJoint.Position.X;
198 + i++;
199 + data1[i] = sourceJoint.Position.Y;
200 + i++;
201 + data1[i] = sourceJoint.Position.Z;
202 + if ((sourceJoint.Position.X + sourceJoint.Position.Y + sourceJoint.Position.Z) != 0)
203 + {
204 + state[i - 2] = 1;
205 + }
206 + skeleton.dasomset(data1, state, 0, true, true, body.Joints[jt], jointObj);
207 +
208 + LineRenderer lr = jointObj.GetComponent<LineRenderer>();
209 + if (targetJoint.HasValue)
210 + {
211 + //Debug.Log(jointObj.localPosition);
212 + //Debug.Log(GetVector3FromJoint(targetJoint.Value));
213 + lr.SetPosition(0, jointObj.localPosition);
214 + lr.SetPosition(1, GetVector3FromJoint(targetJoint.Value));
215 + lr.SetColors(GetColorForState(sourceJoint.TrackingState), GetColorForState(targetJoint.Value.TrackingState));
216 + }
217 + else
218 + {
219 + lr.enabled = false;
220 + }
221 + }
222 + }
223 +
224 + private static Color GetColorForState(Kinect.TrackingState state)
225 + {
226 + switch (state)
227 + {
228 + case Kinect.TrackingState.Tracked:
229 + return Color.green;
230 +
231 + case Kinect.TrackingState.Inferred:
232 + return Color.red;
233 +
234 + default:
235 + return Color.black;
236 + }
237 + }
238 +
239 + private static Vector3 GetVector3FromJoint(Kinect.Joint joint)
240 + {
241 + return new Vector3(joint.Position.X * 10, joint.Position.Y * 10, joint.Position.Z * 10);
242 + }
243 +}
1 +using UnityEngine;
2 +using System.Collections;
3 +using System.Collections.Generic;
4 +using Kinect = Windows.Kinect;
5 +using System.Runtime.InteropServices;
6 +
7 +public class MoveTrainee : MonoBehaviour
8 +{
9 + // [DllImport("NtKinectDll")]
10 + // private static extern System.IntPtr getKinect();
11 + // [DllImport("NtKinectDll")]
12 + // private static extern int setSkeleton(System.IntPtr kinect, System.IntPtr data, System.IntPtr state, System.IntPtr id);
13 +
14 + int bodyCount = 6;
15 + int jointCount = 25;
16 +
17 + //public Material BoneMaterial;
18 + public GameObject BodySourceManager;
19 + private Dictionary<ulong, GameObject> _Bodies = new Dictionary<ulong, GameObject>();
20 + private BodySourceManager _BodyManager;
21 +
22 + public GameObject humanoid;
23 + CharacterSkeleton skeleton;
24 + public bool mirror = true;
25 + public bool move = true;
26 + private System.IntPtr kinect;
27 +
28 + void Start()
29 + {
30 + skeleton = new CharacterSkeleton(humanoid);
31 + }
32 +
33 + private Dictionary<Kinect.JointType, Kinect.JointType> _BoneMap = new Dictionary<Kinect.JointType, Kinect.JointType>()
34 + {
35 + { Kinect.JointType.FootLeft, Kinect.JointType.AnkleLeft },
36 + { Kinect.JointType.AnkleLeft, Kinect.JointType.KneeLeft },
37 + { Kinect.JointType.KneeLeft, Kinect.JointType.HipLeft },
38 + { Kinect.JointType.HipLeft, Kinect.JointType.SpineBase },
39 +
40 + { Kinect.JointType.FootRight, Kinect.JointType.AnkleRight },
41 + { Kinect.JointType.AnkleRight, Kinect.JointType.KneeRight },
42 + { Kinect.JointType.KneeRight, Kinect.JointType.HipRight },
43 + { Kinect.JointType.HipRight, Kinect.JointType.SpineBase },
44 +
45 + { Kinect.JointType.HandTipLeft, Kinect.JointType.HandLeft },
46 + { Kinect.JointType.ThumbLeft, Kinect.JointType.HandLeft },
47 + { Kinect.JointType.HandLeft, Kinect.JointType.WristLeft },
48 + { Kinect.JointType.WristLeft, Kinect.JointType.ElbowLeft },
49 + { Kinect.JointType.ElbowLeft, Kinect.JointType.ShoulderLeft },
50 + { Kinect.JointType.ShoulderLeft, Kinect.JointType.SpineShoulder },
51 +
52 + { Kinect.JointType.HandTipRight, Kinect.JointType.HandRight },
53 + { Kinect.JointType.ThumbRight, Kinect.JointType.HandRight },
54 + { Kinect.JointType.HandRight, Kinect.JointType.WristRight },
55 + { Kinect.JointType.WristRight, Kinect.JointType.ElbowRight },
56 + { Kinect.JointType.ElbowRight, Kinect.JointType.ShoulderRight },
57 + { Kinect.JointType.ShoulderRight, Kinect.JointType.SpineShoulder },
58 +
59 + { Kinect.JointType.SpineBase, Kinect.JointType.SpineMid },
60 + { Kinect.JointType.SpineMid, Kinect.JointType.SpineShoulder },
61 + { Kinect.JointType.SpineShoulder, Kinect.JointType.Neck },
62 + { Kinect.JointType.Neck, Kinect.JointType.Head },
63 + };
64 +
65 + void Update()
66 + {
67 + float[] data1 = new float[bodyCount * jointCount * 3];
68 + int[] state = new int[bodyCount * jointCount];
69 + int[] id = new int[bodyCount];
70 + GCHandle gch = GCHandle.Alloc(data1, GCHandleType.Pinned);
71 + GCHandle gch2 = GCHandle.Alloc(state, GCHandleType.Pinned);
72 + GCHandle gch3 = GCHandle.Alloc(id, GCHandleType.Pinned);
73 +
74 + if (BodySourceManager == null)
75 + {
76 + return;
77 + }
78 +
79 + _BodyManager = BodySourceManager.GetComponent<BodySourceManager>();
80 + if (_BodyManager == null)
81 + {
82 + return;
83 + }
84 +
85 + Kinect.Body[] data = _BodyManager.GetData();
86 + if (data == null)
87 + {
88 + return;
89 + }
90 +
91 + List<ulong> trackedIds = new List<ulong>();
92 + foreach (var body in data)
93 + {
94 + if (body == null)
95 + {
96 + continue;
97 + }
98 +
99 + if (body.IsTracked)
100 + {
101 +
102 + trackedIds.Add(body.TrackingId);
103 + }
104 + }
105 +
106 + List<ulong> knownIds = new List<ulong>(_Bodies.Keys);
107 +
108 + // First delete untracked bodies
109 + foreach (ulong trackingId in knownIds)
110 + {
111 + if (!trackedIds.Contains(trackingId))
112 + {
113 + Destroy(_Bodies[trackingId]);
114 + _Bodies.Remove(trackingId);
115 + }
116 + }
117 +
118 + foreach (var body in data)
119 + {
120 + if (body == null)
121 + {
122 + continue;
123 + }
124 +
125 + if (body.IsTracked)
126 + {
127 + if (!_Bodies.ContainsKey(body.TrackingId))
128 + {
129 +
130 + _Bodies[body.TrackingId] = CreateBodyObject(body.TrackingId);
131 +
132 + }
133 + RefreshBodyObject(body, _Bodies[body.TrackingId]);
134 + }
135 + }
136 + }
137 +
138 + private GameObject CreateBodyObject(ulong id)
139 + {
140 +
141 + GameObject body = new GameObject("Body:" + id);
142 +
143 + for (Kinect.JointType jt = Kinect.JointType.SpineBase; jt <= Kinect.JointType.ThumbRight; jt++)
144 + {
145 + GameObject jointObj = GameObject.CreatePrimitive(PrimitiveType.Cube);
146 + //LineRenderer lr = jointObj.AddComponent<LineRenderer>();
147 + //lr.SetVertexCount(2);
148 + //lr.material = BoneMaterial;
149 + //lr.SetWidth(0.05f, 0.05f);
150 +
151 + jointObj.transform.localScale = new Vector3(0.3f, 0.3f, 0.3f);
152 + jointObj.name = jt.ToString();
153 + jointObj.transform.parent = body.transform;
154 + }
155 +
156 + return body;
157 + }
158 +
159 + private void RefreshBodyObject(Kinect.Body body, GameObject bodyObject)
160 + {
161 + float[] data1 = new float[bodyCount * jointCount * 3];
162 + int[] state = new int[bodyCount * jointCount];
163 + int[] id1 = new int[bodyCount];
164 + GCHandle gch = GCHandle.Alloc(data1, GCHandleType.Pinned);
165 + GCHandle gch2 = GCHandle.Alloc(state, GCHandleType.Pinned);
166 + GCHandle gch3 = GCHandle.Alloc(id1, GCHandleType.Pinned);
167 +
168 + int i = -1;
169 +
170 + for (Kinect.JointType jt = Kinect.JointType.SpineBase; jt <= Kinect.JointType.ThumbRight; jt++)
171 + {
172 + Kinect.Joint sourceJoint = body.Joints[jt];
173 +
174 + //Debug.Log("body.Joints[jt]");
175 + //Debug.Log(body.Joints[jt]);
176 + //Debug.Log("jt");
177 + //Debug.Log(jt);
178 + //Debug.Log(body.Joints[jt].JointType);
179 + //Debug.Log(sourceJoint.Position.X * 10);
180 + //Debug.Log(sourceJoint.Position.Y * 10);
181 + //Debug.Log(sourceJoint.Position.Z * 10);
182 + Kinect.Joint? targetJoint = null;
183 +
184 + if (_BoneMap.ContainsKey(jt))
185 + {
186 + targetJoint = body.Joints[_BoneMap[jt]];
187 + }
188 + Transform jointObj = bodyObject.transform.Find(jt.ToString());
189 + jointObj.localPosition = GetVector3FromJoint(sourceJoint);
190 +
191 + //Debug.Log(i);
192 +
193 + i++;
194 + data1[i] = sourceJoint.Position.X;
195 + i++;
196 + data1[i] = sourceJoint.Position.Y;
197 + i++;
198 + data1[i] = sourceJoint.Position.Z;
199 + if ((sourceJoint.Position.X + sourceJoint.Position.Y + sourceJoint.Position.Z) != 0)
200 + {
201 + state[i - 2] = 1;
202 + }
203 + skeleton.dasomset(data1, state, 0, true, true, body.Joints[jt], jointObj);
204 +
205 + /*
206 + LineRenderer lr = jointObj.GetComponent<LineRenderer>();
207 + if (targetJoint.HasValue)
208 + {
209 + //Debug.Log(jointObj.localPosition);
210 + //Debug.Log(GetVector3FromJoint(targetJoint.Value));
211 + lr.SetPosition(0, jointObj.localPosition);
212 + lr.SetPosition(1, GetVector3FromJoint(targetJoint.Value));
213 + lr.SetColors(GetColorForState(sourceJoint.TrackingState), GetColorForState(targetJoint.Value.TrackingState));
214 + }
215 + else
216 + {
217 + lr.enabled = false;
218 + }
219 + */
220 + }
221 + }
222 +
223 + private static Color GetColorForState(Kinect.TrackingState state)
224 + {
225 + switch (state)
226 + {
227 + case Kinect.TrackingState.Tracked:
228 + return Color.green;
229 +
230 + case Kinect.TrackingState.Inferred:
231 + return Color.red;
232 +
233 + default:
234 + return Color.black;
235 + }
236 + }
237 +
238 + private static Vector3 GetVector3FromJoint(Kinect.Joint joint)
239 + {
240 + return new Vector3(joint.Position.X * 10, joint.Position.Y * 10, joint.Position.Z * 10);
241 + }
242 +}
1 +using UnityEngine;
2 +using System.Collections;
3 +using System.Collections.Generic;
4 +using Kinect = Windows.Kinect;
5 +using System.Runtime.InteropServices;
6 +
7 +public class MoveTraineer : MonoBehaviour
8 +{
9 + int bodyCount = 6;
10 + int jointCount = 25;
11 +
12 + //public Material BoneMaterial;
13 + public GameObject BodySourceManager;
14 + private Dictionary<ulong, GameObject> _Bodies = new Dictionary<ulong, GameObject>();
15 + private BodySourceManager _BodyManager;
16 +
17 + public GameObject humanoid;
18 + CharacterSkeleton skeleton;
19 + public bool mirror = true;
20 + public bool move = true;
21 + private System.IntPtr kinect;
22 +
23 + void Start()
24 + {
25 + skeleton = new CharacterSkeleton(humanoid);
26 + }
27 +
28 + private Dictionary<Kinect.JointType, Kinect.JointType> _BoneMap = new Dictionary<Kinect.JointType, Kinect.JointType>()
29 + {
30 + { Kinect.JointType.FootLeft, Kinect.JointType.AnkleLeft },
31 + { Kinect.JointType.AnkleLeft, Kinect.JointType.KneeLeft },
32 + { Kinect.JointType.KneeLeft, Kinect.JointType.HipLeft },
33 + { Kinect.JointType.HipLeft, Kinect.JointType.SpineBase },
34 +
35 + { Kinect.JointType.FootRight, Kinect.JointType.AnkleRight },
36 + { Kinect.JointType.AnkleRight, Kinect.JointType.KneeRight },
37 + { Kinect.JointType.KneeRight, Kinect.JointType.HipRight },
38 + { Kinect.JointType.HipRight, Kinect.JointType.SpineBase },
39 +
40 + { Kinect.JointType.HandTipLeft, Kinect.JointType.HandLeft },
41 + { Kinect.JointType.ThumbLeft, Kinect.JointType.HandLeft },
42 + { Kinect.JointType.HandLeft, Kinect.JointType.WristLeft },
43 + { Kinect.JointType.WristLeft, Kinect.JointType.ElbowLeft },
44 + { Kinect.JointType.ElbowLeft, Kinect.JointType.ShoulderLeft },
45 + { Kinect.JointType.ShoulderLeft, Kinect.JointType.SpineShoulder },
46 +
47 + { Kinect.JointType.HandTipRight, Kinect.JointType.HandRight },
48 + { Kinect.JointType.ThumbRight, Kinect.JointType.HandRight },
49 + { Kinect.JointType.HandRight, Kinect.JointType.WristRight },
50 + { Kinect.JointType.WristRight, Kinect.JointType.ElbowRight },
51 + { Kinect.JointType.ElbowRight, Kinect.JointType.ShoulderRight },
52 + { Kinect.JointType.ShoulderRight, Kinect.JointType.SpineShoulder },
53 +
54 + { Kinect.JointType.SpineBase, Kinect.JointType.SpineMid },
55 + { Kinect.JointType.SpineMid, Kinect.JointType.SpineShoulder },
56 + { Kinect.JointType.SpineShoulder, Kinect.JointType.Neck },
57 + { Kinect.JointType.Neck, Kinect.JointType.Head },
58 + };
59 +
60 + void Update()
61 + {
62 + float[] data1 = new float[bodyCount * jointCount * 3];
63 + int[] state = new int[bodyCount * jointCount];
64 + int[] id = new int[bodyCount];
65 + GCHandle gch = GCHandle.Alloc(data1, GCHandleType.Pinned);
66 + GCHandle gch2 = GCHandle.Alloc(state, GCHandleType.Pinned);
67 + GCHandle gch3 = GCHandle.Alloc(id, GCHandleType.Pinned);
68 +
69 + if (BodySourceManager == null)
70 + {
71 + return;
72 + }
73 +
74 + _BodyManager = BodySourceManager.GetComponent<BodySourceManager>();
75 + if (_BodyManager == null)
76 + {
77 + return;
78 + }
79 +
80 + Kinect.Body[] data = _BodyManager.GetData();
81 + if (data == null)
82 + {
83 + return;
84 + }
85 +
86 + List<ulong> trackedIds = new List<ulong>();
87 + foreach (var body in data)
88 + {
89 + if (body == null)
90 + {
91 + continue;
92 + }
93 +
94 + if (body.IsTracked)
95 + {
96 +
97 + trackedIds.Add(body.TrackingId);
98 + }
99 + }
100 +
101 + List<ulong> knownIds = new List<ulong>(_Bodies.Keys);
102 +
103 + // First delete untracked bodies
104 + foreach (ulong trackingId in knownIds)
105 + {
106 + if (!trackedIds.Contains(trackingId))
107 + {
108 + Destroy(_Bodies[trackingId]);
109 + _Bodies.Remove(trackingId);
110 + }
111 + }
112 +
113 + foreach (var body in data)
114 + {
115 + if (body == null)
116 + {
117 + continue;
118 + }
119 +
120 + if (body.IsTracked)
121 + {
122 + if (!_Bodies.ContainsKey(body.TrackingId))
123 + {
124 +
125 + _Bodies[body.TrackingId] = CreateBodyObject(body.TrackingId);
126 +
127 + }
128 + RefreshBodyObject(body, _Bodies[body.TrackingId]);
129 + }
130 + }
131 + }
132 +
133 + private GameObject CreateBodyObject(ulong id)
134 + {
135 +
136 + GameObject body = new GameObject("Body:" + id);
137 +
138 + for (Kinect.JointType jt = Kinect.JointType.SpineBase; jt <= Kinect.JointType.ThumbRight; jt++)
139 + {
140 + GameObject jointObj = GameObject.CreatePrimitive(PrimitiveType.Cube);
141 + //LineRenderer lr = jointObj.AddComponent<LineRenderer>();
142 + //lr.SetVertexCount(2);
143 + //lr.material = BoneMaterial;
144 + //lr.SetWidth(0.05f, 0.05f);
145 +
146 + jointObj.transform.localScale = new Vector3(0.3f, 0.3f, 0.3f);
147 + jointObj.name = jt.ToString();
148 + jointObj.transform.parent = body.transform;
149 + }
150 +
151 + return body;
152 + }
153 +
154 + private void RefreshBodyObject(Kinect.Body body, GameObject bodyObject)
155 + {
156 + float[] data1 = new float[bodyCount * jointCount * 3];
157 + int[] state = new int[bodyCount * jointCount];
158 + int[] id1 = new int[bodyCount];
159 + GCHandle gch = GCHandle.Alloc(data1, GCHandleType.Pinned);
160 + GCHandle gch2 = GCHandle.Alloc(state, GCHandleType.Pinned);
161 + GCHandle gch3 = GCHandle.Alloc(id1, GCHandleType.Pinned);
162 +
163 + int i = -1;
164 +
165 + for (Kinect.JointType jt = Kinect.JointType.SpineBase; jt <= Kinect.JointType.ThumbRight; jt++)
166 + {
167 + Kinect.Joint sourceJoint = body.Joints[jt];
168 +
169 + //Debug.Log("body.Joints[jt]");
170 + //Debug.Log(body.Joints[jt]);
171 + //Debug.Log("jt");
172 + //Debug.Log(jt);
173 + //Debug.Log(body.Joints[jt].JointType);
174 + //Debug.Log(sourceJoint.Position.X * 10);
175 + //Debug.Log(sourceJoint.Position.Y * 10);
176 + //Debug.Log(sourceJoint.Position.Z * 10);
177 + Kinect.Joint? targetJoint = null;
178 +
179 + if (_BoneMap.ContainsKey(jt))
180 + {
181 + targetJoint = body.Joints[_BoneMap[jt]];
182 + }
183 + Transform jointObj = bodyObject.transform.Find(jt.ToString());
184 + jointObj.localPosition = GetVector3FromJoint(sourceJoint);
185 +
186 + //Debug.Log(i);
187 +
188 + i++;
189 + data1[i] = sourceJoint.Position.X;
190 + i++;
191 + data1[i] = sourceJoint.Position.Y;
192 + i++;
193 + data1[i] = sourceJoint.Position.Z;
194 + if ((sourceJoint.Position.X + sourceJoint.Position.Y + sourceJoint.Position.Z) != 0)
195 + {
196 + state[i - 2] = 1;
197 + }
198 + skeleton.dasomset(data1, state, 0, true, true, body.Joints[jt], jointObj);
199 +
200 + /*
201 + LineRenderer lr = jointObj.GetComponent<LineRenderer>();
202 + if (targetJoint.HasValue)
203 + {
204 + //Debug.Log(jointObj.localPosition);
205 + //Debug.Log(GetVector3FromJoint(targetJoint.Value));
206 + lr.SetPosition(0, jointObj.localPosition);
207 + lr.SetPosition(1, GetVector3FromJoint(targetJoint.Value));
208 + lr.SetColors(GetColorForState(sourceJoint.TrackingState), GetColorForState(targetJoint.Value.TrackingState));
209 + }
210 + else
211 + {
212 + lr.enabled = false;
213 + }
214 + */
215 + }
216 + }
217 +
218 + private static Color GetColorForState(Kinect.TrackingState state)
219 + {
220 + switch (state)
221 + {
222 + case Kinect.TrackingState.Tracked:
223 + return Color.green;
224 +
225 + case Kinect.TrackingState.Inferred:
226 + return Color.red;
227 +
228 + default:
229 + return Color.black;
230 + }
231 + }
232 +
233 + private static Vector3 GetVector3FromJoint(Kinect.Joint joint)
234 + {
235 + return new Vector3(joint.Position.X * 10, joint.Position.Y * 10, joint.Position.Z * 10);
236 + }
237 +}
1 +using System.Collections;
2 +using System.Collections.Generic;
3 +using UnityEngine;
4 +
5 +public class RigBone
6 +{
7 + public GameObject gameObject;
8 + public HumanBodyBones bone;
9 + public bool isValid;
10 + public Transform transform
11 + {
12 + get { return animator.GetBoneTransform(bone); }
13 + }
14 + Animator animator;
15 + Quaternion savedValue;
16 + public RigBone(GameObject g, HumanBodyBones b)
17 + {
18 + gameObject = g;
19 + bone = b;
20 + isValid = false;
21 + animator = gameObject.GetComponent<Animator>();
22 + if (animator == null)
23 + {
24 + Debug.Log("no Animator Component");
25 + return;
26 + }
27 + Avatar avatar = animator.avatar;
28 + if (avatar == null || !avatar.isHuman || !avatar.isValid)
29 + {
30 + Debug.Log("Avatar is not Humanoid or it is not valid");
31 + return;
32 + }
33 + isValid = true;
34 + savedValue = animator.GetBoneTransform(bone).localRotation;
35 + }
36 + public void set(float a, float x, float y, float z)
37 + {
38 + set(Quaternion.AngleAxis(a, new Vector3(x, y, z)));
39 + }
40 + public void set(Quaternion q)
41 + {
42 + animator.GetBoneTransform(bone).localRotation = q;
43 + savedValue = q;
44 + }
45 + public void mul(float a, float x, float y, float z)
46 + {
47 + mul(Quaternion.AngleAxis(a, new Vector3(x, y, z)));
48 + }
49 + public void mul(Quaternion q)
50 + {
51 + Transform tr = animator.GetBoneTransform(bone);
52 + tr.localRotation = q * tr.localRotation;
53 + }
54 + public void offset(float a, float x, float y, float z)
55 + {
56 + offset(Quaternion.AngleAxis(a, new Vector3(x, y, z)));
57 + }
58 + public void offset(Quaternion q)
59 + {
60 + animator.GetBoneTransform(bone).localRotation = q * savedValue;
61 + }
62 + public void changeBone(HumanBodyBones b)
63 + {
64 + bone = b;
65 + savedValue = animator.GetBoneTransform(bone).localRotation;
66 + }
67 +}
1 +using System.Runtime.InteropServices;
2 +using System.Collections;
3 +using System.Collections.Generic;
4 +using UnityEngine;
5 +using RootSystem = System;
6 +using System;
7 +
8 +public class RigControl : MonoBehaviour
9 +{
10 +
11 + //[RootSystem.Runtime.InteropServices.DllImport("NtKinectDll")]
12 + [DllImport("NtKinectDll", CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl)]
13 + public static extern System.IntPtr getKinect();
14 +
15 + [DllImport("NtKinectDll", CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl)]
16 + public static extern int setSkeleton(System.IntPtr kinect, System.IntPtr data, System.IntPtr state, System.IntPtr id);
17 +
18 + int bodyCount = 6;
19 + int jointCount = 25;
20 + private System.IntPtr kinect;
21 +
22 + public GameObject humanoid;
23 + public bool mirror = true;
24 + public bool move = true;
25 + CharacterSkeleton skeleton;
26 +
27 + void Start()
28 + {
29 + kinect = getKinect();
30 + skeleton = new CharacterSkeleton(humanoid);
31 + }
32 + void Update()
33 + {
34 + float[] data = new float[bodyCount * jointCount * 3];
35 + int[] state = new int[bodyCount * jointCount];
36 + int[] id = new int[bodyCount];
37 + GCHandle gch = GCHandle.Alloc(data, GCHandleType.Pinned);
38 + GCHandle gch2 = GCHandle.Alloc(state, GCHandleType.Pinned);
39 + GCHandle gch3 = GCHandle.Alloc(id, GCHandleType.Pinned);
40 + int n = setSkeleton(kinect, gch.AddrOfPinnedObject(), gch2.AddrOfPinnedObject(), gch3.AddrOfPinnedObject());
41 + gch.Free();
42 + gch2.Free();
43 + gch3.Free();
44 + if (n > 0)
45 + {
46 + skeleton.set(data, state, 0, mirror, move);
47 + }
48 +
49 + }
50 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.CameraIntrinsics
8 + //
9 + [RootSystem.Runtime.InteropServices.StructLayout(RootSystem.Runtime.InteropServices.LayoutKind.Sequential)]
10 + public struct CameraIntrinsics
11 + {
12 + public float FocalLengthX { get; set; }
13 + public float FocalLengthY { get; set; }
14 + public float PrincipalPointX { get; set; }
15 + public float PrincipalPointY { get; set; }
16 + public float RadialDistortionSecondOrder { get; set; }
17 + public float RadialDistortionFourthOrder { get; set; }
18 + public float RadialDistortionSixthOrder { get; set; }
19 +
20 + public override int GetHashCode()
21 + {
22 + return FocalLengthX.GetHashCode() ^ FocalLengthY.GetHashCode() ^
23 + PrincipalPointX.GetHashCode() ^ PrincipalPointY.GetHashCode() ^
24 + RadialDistortionSecondOrder.GetHashCode() ^ RadialDistortionFourthOrder.GetHashCode() ^
25 + RadialDistortionSixthOrder.GetHashCode();
26 + }
27 +
28 + public override bool Equals(object obj)
29 + {
30 + if (!(obj is CameraIntrinsics))
31 + {
32 + return false;
33 + }
34 +
35 + return this.Equals((CameraIntrinsics)obj);
36 + }
37 +
38 + public bool Equals(CameraIntrinsics obj)
39 + {
40 + return FocalLengthX.Equals(obj.FocalLengthX) && FocalLengthY.Equals(obj.FocalLengthY) &&
41 + PrincipalPointX.Equals(obj.PrincipalPointX) && PrincipalPointY.Equals(obj.PrincipalPointY) &&
42 + RadialDistortionSecondOrder.Equals(obj.RadialDistortionSecondOrder) &&
43 + RadialDistortionFourthOrder.Equals(obj.RadialDistortionFourthOrder) &&
44 + RadialDistortionSixthOrder.Equals(obj.RadialDistortionSixthOrder);
45 + }
46 +
47 + public static bool operator ==(CameraIntrinsics a, CameraIntrinsics b)
48 + {
49 + return a.Equals(b);
50 + }
51 +
52 + public static bool operator !=(CameraIntrinsics a, CameraIntrinsics b)
53 + {
54 + return !(a.Equals(b));
55 + }
56 + }
57 +
58 +}
1 +using System;
2 +using System.Collections.Generic;
3 +using System.Linq;
4 +using System.Text;
5 +
6 +namespace Helper
7 +{
8 + class CollectionMap<TKey, TValue> : Helper.ThreadSafeDictionary<TKey, TValue> where TValue : new()
9 + {
10 + public bool TryAddDefault(TKey key)
11 + {
12 + lock (_impl)
13 + {
14 + if (!_impl.ContainsKey(key))
15 + {
16 + _impl.Add(key, new TValue());
17 + return true;
18 + }
19 + else
20 + {
21 + return false;
22 + }
23 + }
24 + }
25 + }
26 +}
1 +using UnityEngine;
2 +using UnityEditor;
3 +using System;
4 +using System.Collections.Generic;
5 +using System.IO;
6 +
7 +public static class KinectCopyPluginDataHelper
8 +{
9 + private const string DataDirSuffix = "_Data";
10 + private const string PluginsDirName = "Plugins";
11 +
12 + private static Dictionary<BuildTarget, string> TargetToDirName = new Dictionary<BuildTarget, string>()
13 + {
14 + {BuildTarget.StandaloneWindows, "x86"},
15 + {BuildTarget.StandaloneWindows64, "x86_64"}
16 + };
17 +
18 + public static void CopyPluginData(BuildTarget target, string buildTargetPath, string subDirToCopy)
19 + {
20 + string subDirName;
21 + if (!TargetToDirName.TryGetValue (target, out subDirName))
22 + {
23 + // No work to do
24 + return;
25 + }
26 +
27 + // Get Required Paths
28 + var buildName = Path.GetFileNameWithoutExtension(buildTargetPath);
29 + var targetDir = Directory.GetParent(buildTargetPath);
30 + var separator = Path.DirectorySeparatorChar;
31 +
32 + var buildDataDir = targetDir.FullName + separator + buildName + DataDirSuffix + separator;
33 + var tgtPluginsDir = buildDataDir + separator + PluginsDirName + separator + subDirToCopy + separator;
34 + var srcPluginsDir = Application.dataPath + separator + PluginsDirName + separator + subDirName + separator + subDirToCopy + separator;
35 +
36 + CopyAll (new DirectoryInfo (srcPluginsDir), new DirectoryInfo(tgtPluginsDir));
37 + }
38 +
39 + /// <summary>
40 + /// Recursive Copy Directory Method
41 + /// </summary>
42 + private static void CopyAll(DirectoryInfo source, DirectoryInfo target)
43 + {
44 + // Check if the source directory exists, if not, don't do any work.
45 + if (!Directory.Exists(source.FullName))
46 + {
47 + return;
48 + }
49 +
50 + // Check if the target directory exists, if not, create it.
51 + if (!Directory.Exists(target.FullName))
52 + {
53 + Directory.CreateDirectory(target.FullName);
54 + }
55 +
56 + // Copy each file into it’s new directory.
57 + foreach (var fileInfo in source.GetFiles())
58 + {
59 + fileInfo.CopyTo (Path.Combine (target.ToString (), fileInfo.Name), true);
60 + }
61 +
62 + // Copy each subdirectory using recursion.
63 + foreach (var subDirInfo in source.GetDirectories())
64 + {
65 + DirectoryInfo nextTargetSubDir = target.CreateSubdirectory(subDirInfo.Name);
66 + CopyAll(subDirInfo, nextTargetSubDir);
67 + }
68 + }
69 +
70 +}
1 +using System;
2 +using System.Collections.Generic;
3 +using System.Runtime.InteropServices;
4 +using System.Linq;
5 +
6 +namespace Helper
7 +{
8 + internal class EventPump : UnityEngine.MonoBehaviour
9 + {
10 + private static object s_Lock = new object();
11 + private Queue<Action> m_Queue = new Queue<Action>();
12 +
13 + public static EventPump Instance
14 + {
15 + get;
16 + private set;
17 + }
18 +
19 + public static void EnsureInitialized()
20 + {
21 + try
22 + {
23 + if (EventPump.Instance == null)
24 + {
25 + lock (s_Lock)
26 + {
27 + if (EventPump.Instance == null)
28 + {
29 + UnityEngine.GameObject parent = new UnityEngine.GameObject("Kinect Desktop Event Pump");
30 + EventPump.Instance = parent.AddComponent<Helper.EventPump>();
31 + DontDestroyOnLoad(parent);
32 + }
33 + }
34 + }
35 + }
36 + catch
37 + {
38 + UnityEngine.Debug.LogError("Events must be registered on the main thread.");
39 + return;
40 + }
41 + }
42 +
43 + private void Update()
44 + {
45 + lock (m_Queue)
46 + {
47 + while (m_Queue.Count > 0)
48 + {
49 + var action = m_Queue.Dequeue();
50 + try
51 + {
52 + action.Invoke();
53 + }
54 + catch { }
55 + }
56 + }
57 + }
58 +
59 + private void OnApplicationQuit()
60 + {
61 + var sensor = Windows.Kinect.KinectSensor.GetDefault();
62 + if (sensor != null && sensor.IsOpen)
63 + {
64 + sensor.Close();
65 + }
66 +
67 + NativeObjectCache.Flush();
68 + }
69 +
70 + public void Enqueue(Action action)
71 + {
72 + lock (m_Queue)
73 + {
74 + m_Queue.Enqueue(action);
75 + }
76 + }
77 + }
78 +}
...\ No newline at end of file ...\ No newline at end of file
1 +using System;
2 +using System.Runtime.InteropServices;
3 +
4 +namespace Helper
5 +{
6 + public static class ExceptionHelper
7 + {
8 + private const int E_NOTIMPL = unchecked((int)0x80004001);
9 + private const int E_OUTOFMEMORY = unchecked((int)0x8007000E);
10 + private const int E_INVALIDARG = unchecked((int)0x80070057);
11 + private const int E_POINTER = unchecked((int) 0x80004003);
12 + private const int E_PENDING = unchecked((int)0x8000000A);
13 + private const int E_FAIL = unchecked((int)0x80004005);
14 +
15 + public static void CheckLastError()
16 + {
17 + int hr = Marshal.GetLastWin32Error();
18 +
19 + if ((hr == E_PENDING) || (hr == E_FAIL))
20 + {
21 + // Ignore E_PENDING/E_FAIL - We use this to indicate no pending or missed frames
22 + return;
23 + }
24 +
25 + if (hr < 0)
26 + {
27 + Exception exception = Marshal.GetExceptionForHR(hr);
28 + string message = string.Format("This API has returned an exception from an HRESULT: 0x{0:X}", hr);
29 +
30 + switch (hr)
31 + {
32 + case E_NOTIMPL:
33 + throw new NotImplementedException(message, exception);
34 +
35 + case E_OUTOFMEMORY:
36 + throw new OutOfMemoryException(message, exception);
37 +
38 + case E_INVALIDARG:
39 + throw new ArgumentException(message, exception);
40 +
41 + case E_POINTER:
42 + throw new ArgumentNullException(message, exception);
43 +
44 + default:
45 + throw new InvalidOperationException(message, exception);
46 + }
47 + }
48 + }
49 + }
50 +}
...\ No newline at end of file ...\ No newline at end of file
1 +using System;
2 +using System.Collections.Generic;
3 +using System.Runtime.InteropServices;
4 +using System.Linq;
5 +
6 +namespace Helper
7 +{
8 + internal interface INativeWrapper
9 + {
10 + System.IntPtr nativePtr { get; }
11 + }
12 +}
...\ No newline at end of file ...\ No newline at end of file
1 +using RootSystem = System;
2 +using System;
3 +using System.Collections.Generic;
4 +using System.Runtime.InteropServices;
5 +
6 +namespace Windows.Kinect
7 +{
8 + // NOTE: This uses an IBuffer under the covers, it is renamed here to give parity to our managed APIs.
9 + public class KinectBuffer : Helper.INativeWrapper, IDisposable
10 + {
11 + internal RootSystem.IntPtr _pNative;
12 +
13 + RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
14 +
15 + // Constructors and Finalizers
16 + internal KinectBuffer(RootSystem.IntPtr pNative)
17 + {
18 + _pNative = pNative;
19 + Windows_Storage_Streams_IBuffer_AddRefObject(ref _pNative);
20 + }
21 +
22 + ~KinectBuffer()
23 + {
24 + Dispose(false);
25 + }
26 +
27 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl)]
28 + private static extern void Windows_Storage_Streams_IBuffer_ReleaseObject(ref RootSystem.IntPtr pNative);
29 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl)]
30 + private static extern void Windows_Storage_Streams_IBuffer_AddRefObject(ref RootSystem.IntPtr pNative);
31 + private void Dispose(bool disposing)
32 + {
33 + if (_pNative == RootSystem.IntPtr.Zero)
34 + {
35 + return;
36 + }
37 +
38 + Helper.NativeObjectCache.RemoveObject<KinectBuffer>(_pNative);
39 +
40 + if (disposing)
41 + {
42 + Windows_Storage_Streams_IBuffer_Dispose(_pNative);
43 + }
44 +
45 + Windows_Storage_Streams_IBuffer_ReleaseObject(ref _pNative);
46 +
47 + _pNative = RootSystem.IntPtr.Zero;
48 + }
49 +
50 +
51 + // Public Properties
52 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError = true)]
53 + private static extern uint Windows_Storage_Streams_IBuffer_get_Capacity(RootSystem.IntPtr pNative);
54 + public uint Capacity
55 + {
56 + get
57 + {
58 + if (_pNative == RootSystem.IntPtr.Zero)
59 + {
60 + throw new RootSystem.ObjectDisposedException("KinectBuffer");
61 + }
62 +
63 + uint capacity = Windows_Storage_Streams_IBuffer_get_Capacity(_pNative);
64 + Helper.ExceptionHelper.CheckLastError();
65 + return capacity;
66 + }
67 + }
68 +
69 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError = true)]
70 + private static extern uint Windows_Storage_Streams_IBuffer_get_Length(RootSystem.IntPtr pNative);
71 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError = true)]
72 + private static extern void Windows_Storage_Streams_IBuffer_put_Length(RootSystem.IntPtr pNative, uint value);
73 + public uint Length
74 + {
75 + get
76 + {
77 + if (_pNative == RootSystem.IntPtr.Zero)
78 + {
79 + throw new RootSystem.ObjectDisposedException("KinectBuffer");
80 + }
81 +
82 + uint length = Windows_Storage_Streams_IBuffer_get_Length(_pNative);
83 + Helper.ExceptionHelper.CheckLastError();
84 + return length;
85 + }
86 + set
87 + {
88 + if (_pNative == RootSystem.IntPtr.Zero)
89 + {
90 + throw new RootSystem.ObjectDisposedException("KinectBuffer");
91 + }
92 +
93 + Windows_Storage_Streams_IBuffer_put_Length(_pNative, value);
94 + Helper.ExceptionHelper.CheckLastError();
95 + }
96 + }
97 +
98 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl)]
99 + private static extern void Windows_Storage_Streams_IBuffer_Dispose(RootSystem.IntPtr pNative);
100 + // Constructors and Finalizers
101 + public void Dispose()
102 + {
103 + if (_pNative == RootSystem.IntPtr.Zero)
104 + {
105 + throw new RootSystem.ObjectDisposedException("KinectBuffer");
106 + }
107 +
108 + Dispose(true);
109 + RootSystem.GC.SuppressFinalize(this);
110 + }
111 +
112 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError = true)]
113 + private static extern RootSystem.IntPtr Windows_Storage_Streams_IBuffer_get_UnderlyingBuffer(RootSystem.IntPtr pNative);
114 + public IntPtr UnderlyingBuffer
115 + {
116 + get
117 + {
118 + if (_pNative == RootSystem.IntPtr.Zero)
119 + {
120 + throw new RootSystem.ObjectDisposedException("KinectBuffer");
121 + }
122 +
123 + RootSystem.IntPtr value = Windows_Storage_Streams_IBuffer_get_UnderlyingBuffer(_pNative);
124 + Helper.ExceptionHelper.CheckLastError();
125 + return value;
126 + }
127 + }
128 + }
129 +}
...\ No newline at end of file ...\ No newline at end of file
1 +using RootSystem = System;
2 +using System;
3 +using System.Collections.Generic;
4 +using System.Runtime.InteropServices;
5 +
6 +namespace Windows.Kinect
7 +{
8 + [RootSystem.Runtime.InteropServices.StructLayout(RootSystem.Runtime.InteropServices.LayoutKind.Sequential)]
9 + public struct PointF
10 + {
11 + public float X { get; set; }
12 + public float Y { get; set; }
13 +
14 + public override int GetHashCode()
15 + {
16 + return X.GetHashCode() ^ Y.GetHashCode();
17 + }
18 +
19 + public override bool Equals(object obj)
20 + {
21 + if (!(obj is PointF))
22 + {
23 + return false;
24 + }
25 +
26 + return this.Equals((ColorSpacePoint)obj);
27 + }
28 +
29 + public bool Equals(ColorSpacePoint obj)
30 + {
31 + return (X == obj.X) && (Y == obj.Y);
32 + }
33 +
34 + public static bool operator ==(PointF a, PointF b)
35 + {
36 + return a.Equals(b);
37 + }
38 +
39 + public static bool operator !=(PointF a, PointF b)
40 + {
41 + return !(a.Equals(b));
42 + }
43 + }
44 +
45 + public sealed partial class AudioBeamSubFrame
46 + {
47 + [RootSystem.Runtime.InteropServices.DllImport(
48 + "KinectUnityAddin",
49 + EntryPoint = "Windows_Kinect_AudioBeamSubFrame_CopyFrameDataToArray",
50 + CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl,
51 + SetLastError = true)]
52 + private static extern void Windows_Kinect_AudioBeamSubFrame_CopyFrameDataToIntPtr(RootSystem.IntPtr pNative, RootSystem.IntPtr frameData, uint frameDataSize);
53 + public void CopyFrameDataToIntPtr(RootSystem.IntPtr frameData, uint size)
54 + {
55 + if (_pNative == RootSystem.IntPtr.Zero)
56 + {
57 + throw new RootSystem.ObjectDisposedException("AudioBeamSubFrame");
58 + }
59 +
60 + Windows_Kinect_AudioBeamSubFrame_CopyFrameDataToIntPtr(_pNative, frameData, size);
61 + Helper.ExceptionHelper.CheckLastError();
62 + }
63 +
64 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError = true)]
65 + private static extern RootSystem.IntPtr Windows_Kinect_AudioBeamSubFrame_LockAudioBuffer(RootSystem.IntPtr pNative);
66 + public Windows.Kinect.KinectBuffer LockAudioBuffer()
67 + {
68 + if (_pNative == RootSystem.IntPtr.Zero)
69 + {
70 + throw new RootSystem.ObjectDisposedException("AudioBeamSubFrame");
71 + }
72 +
73 + RootSystem.IntPtr objectPointer = Windows_Kinect_AudioBeamSubFrame_LockAudioBuffer(_pNative);
74 + Helper.ExceptionHelper.CheckLastError();
75 +
76 + if (objectPointer == RootSystem.IntPtr.Zero)
77 + {
78 + return null;
79 + }
80 +
81 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.KinectBuffer>(objectPointer, n => new Windows.Kinect.KinectBuffer(n));
82 + }
83 + }
84 +
85 + public sealed partial class AudioBeamFrame
86 + {
87 + private Windows.Kinect.AudioBeamSubFrame[] _subFrames = null;
88 +
89 + private void Dispose(bool disposing)
90 + {
91 + if (_pNative == RootSystem.IntPtr.Zero)
92 + {
93 + return;
94 + }
95 +
96 + if (_subFrames != null)
97 + {
98 + foreach (var subFrame in _subFrames)
99 + {
100 + subFrame.Dispose();
101 + }
102 +
103 + _subFrames = null;
104 + }
105 +
106 + __EventCleanup();
107 +
108 + Helper.NativeObjectCache.RemoveObject<AudioBeamFrame>(_pNative);
109 + Windows_Kinect_AudioBeamFrame_ReleaseObject(ref _pNative);
110 +
111 + if (disposing)
112 + {
113 + Windows_Kinect_AudioBeamFrame_Dispose(_pNative);
114 + }
115 +
116 + _pNative = RootSystem.IntPtr.Zero;
117 + }
118 +
119 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl)]
120 + private static extern void Windows_Kinect_AudioBeamFrame_Dispose(RootSystem.IntPtr pNative);
121 + public void Dispose()
122 + {
123 + if (_pNative == RootSystem.IntPtr.Zero)
124 + {
125 + return;
126 + }
127 +
128 + Dispose(true);
129 + RootSystem.GC.SuppressFinalize(this);
130 + }
131 +
132 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError = true)]
133 + private static extern int Windows_Kinect_AudioBeamFrame_get_SubFrames(RootSystem.IntPtr pNative, [RootSystem.Runtime.InteropServices.Out] RootSystem.IntPtr[] outCollection, int outCollectionSize);
134 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl)]
135 + private static extern int Windows_Kinect_AudioBeamFrame_get_SubFrames_Length(RootSystem.IntPtr pNative);
136 + public RootSystem.Collections.Generic.IList<Windows.Kinect.AudioBeamSubFrame> SubFrames
137 + {
138 + get
139 + {
140 + if (_pNative == RootSystem.IntPtr.Zero)
141 + {
142 + throw new RootSystem.ObjectDisposedException("AudioBeamFrame");
143 + }
144 +
145 + if (_subFrames == null)
146 + {
147 + int collectionSize = Windows_Kinect_AudioBeamFrame_get_SubFrames_Length(_pNative);
148 + var outCollection = new RootSystem.IntPtr[collectionSize];
149 + _subFrames = new Windows.Kinect.AudioBeamSubFrame[collectionSize];
150 +
151 + collectionSize = Windows_Kinect_AudioBeamFrame_get_SubFrames(_pNative, outCollection, collectionSize);
152 + Helper.ExceptionHelper.CheckLastError();
153 +
154 + for (int i = 0; i < collectionSize; i++)
155 + {
156 + if (outCollection[i] == RootSystem.IntPtr.Zero)
157 + {
158 + continue;
159 + }
160 +
161 + var obj = Helper.NativeObjectCache.GetObject<Windows.Kinect.AudioBeamSubFrame>(outCollection[i]);
162 + if (obj == null)
163 + {
164 + obj = new Windows.Kinect.AudioBeamSubFrame(outCollection[i]);
165 + Helper.NativeObjectCache.AddObject<Windows.Kinect.AudioBeamSubFrame>(outCollection[i], obj);
166 + }
167 +
168 + _subFrames[i] = obj;
169 + }
170 + }
171 +
172 + return _subFrames;
173 + }
174 + }
175 + }
176 +
177 + public sealed partial class BodyFrame
178 + {
179 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError = true)]
180 + private static extern void Windows_Kinect_BodyFrame_GetAndRefreshBodyData(RootSystem.IntPtr pNative, [RootSystem.Runtime.InteropServices.Out] RootSystem.IntPtr[] bodies, int bodiesSize);
181 + public void GetAndRefreshBodyData(RootSystem.Collections.Generic.IList<Windows.Kinect.Body> bodies)
182 + {
183 + if (_pNative == RootSystem.IntPtr.Zero)
184 + {
185 + throw new RootSystem.ObjectDisposedException("BodyFrame");
186 + }
187 +
188 + int _bodies_idx = 0;
189 + var _bodies = new RootSystem.IntPtr[bodies.Count];
190 + for (int i = 0; i < bodies.Count; i++)
191 + {
192 + if (bodies[i] == null)
193 + {
194 + bodies[i] = new Body();
195 + }
196 +
197 + _bodies[_bodies_idx] = bodies[i].GetIntPtr();
198 + _bodies_idx++;
199 + }
200 +
201 + Windows_Kinect_BodyFrame_GetAndRefreshBodyData(_pNative, _bodies, bodies.Count);
202 + Helper.ExceptionHelper.CheckLastError();
203 +
204 + for (int i = 0; i < bodies.Count; i++)
205 + {
206 + bodies[i].SetIntPtr(_bodies[i]);
207 + }
208 + }
209 + }
210 +
211 + public sealed partial class Body
212 + {
213 + internal void SetIntPtr(RootSystem.IntPtr value) { _pNative = value; }
214 + internal RootSystem.IntPtr GetIntPtr() { return _pNative; }
215 +
216 + internal Body() { }
217 +
218 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError = true)]
219 + private static extern RootSystem.IntPtr Windows_Kinect_Body_get_Lean(RootSystem.IntPtr pNative);
220 + public Windows.Kinect.PointF Lean
221 + {
222 + get
223 + {
224 + if (_pNative == RootSystem.IntPtr.Zero)
225 + {
226 + throw new RootSystem.ObjectDisposedException("Body");
227 + }
228 +
229 + var objectPointer = Windows_Kinect_Body_get_Lean(_pNative);
230 + Helper.ExceptionHelper.CheckLastError();
231 +
232 + var obj = (Windows.Kinect.PointF)RootSystem.Runtime.InteropServices.Marshal.PtrToStructure(objectPointer, typeof(Windows.Kinect.PointF));
233 + RootSystem.Runtime.InteropServices.Marshal.FreeHGlobal(objectPointer);
234 + return obj;
235 + }
236 + }
237 + }
238 +
239 + public sealed partial class ColorFrame
240 + {
241 + [RootSystem.Runtime.InteropServices.DllImport(
242 + "KinectUnityAddin",
243 + EntryPoint = "Windows_Kinect_ColorFrame_CopyRawFrameDataToArray",
244 + CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl,
245 + SetLastError = true)]
246 + private static extern void Windows_Kinect_ColorFrame_CopyRawFrameDataToIntPtr(RootSystem.IntPtr pNative, IntPtr frameData, uint frameDataSize);
247 + public void CopyRawFrameDataToIntPtr(RootSystem.IntPtr frameData, uint size)
248 + {
249 + if (_pNative == RootSystem.IntPtr.Zero)
250 + {
251 + throw new RootSystem.ObjectDisposedException("ColorFrame");
252 + }
253 +
254 + Windows_Kinect_ColorFrame_CopyRawFrameDataToIntPtr(_pNative, frameData, size);
255 + Helper.ExceptionHelper.CheckLastError();
256 + }
257 +
258 + [RootSystem.Runtime.InteropServices.DllImport(
259 + "KinectUnityAddin",
260 + EntryPoint = "Windows_Kinect_ColorFrame_CopyConvertedFrameDataToArray",
261 + CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl,
262 + SetLastError = true)]
263 + private static extern void Windows_Kinect_ColorFrame_CopyConvertedFrameDataToIntPtr(RootSystem.IntPtr pNative, IntPtr frameData, uint frameDataSize, Windows.Kinect.ColorImageFormat colorFormat);
264 + public void CopyConvertedFrameDataToIntPtr(RootSystem.IntPtr frameData, uint size, Windows.Kinect.ColorImageFormat colorFormat)
265 + {
266 + if (_pNative == RootSystem.IntPtr.Zero)
267 + {
268 + throw new RootSystem.ObjectDisposedException("ColorFrame");
269 + }
270 +
271 + Windows_Kinect_ColorFrame_CopyConvertedFrameDataToIntPtr(_pNative, frameData, size, colorFormat);
272 + Helper.ExceptionHelper.CheckLastError();
273 + }
274 +
275 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError = true)]
276 + private static extern RootSystem.IntPtr Windows_Kinect_ColorFrame_LockRawImageBuffer(RootSystem.IntPtr pNative);
277 + public Windows.Kinect.KinectBuffer LockRawImageBuffer()
278 + {
279 + if (_pNative == RootSystem.IntPtr.Zero)
280 + {
281 + throw new RootSystem.ObjectDisposedException("ColorFrame");
282 + }
283 +
284 + RootSystem.IntPtr objectPointer = Windows_Kinect_ColorFrame_LockRawImageBuffer(_pNative);
285 + Helper.ExceptionHelper.CheckLastError();
286 +
287 + if (objectPointer == RootSystem.IntPtr.Zero)
288 + {
289 + return null;
290 + }
291 +
292 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.KinectBuffer>(objectPointer, n => new Windows.Kinect.KinectBuffer(n));
293 + }
294 +
295 + }
296 +
297 + public sealed partial class DepthFrame
298 + {
299 + [RootSystem.Runtime.InteropServices.DllImport(
300 + "KinectUnityAddin",
301 + EntryPoint = "Windows_Kinect_DepthFrame_CopyFrameDataToArray",
302 + CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl,
303 + SetLastError = true)]
304 + private static extern void Windows_Kinect_DepthFrame_CopyFrameDataToIntPtr(RootSystem.IntPtr pNative, IntPtr frameData, uint frameDataSize);
305 + public void CopyFrameDataToIntPtr(RootSystem.IntPtr frameData, uint size)
306 + {
307 + if (_pNative == RootSystem.IntPtr.Zero)
308 + {
309 + throw new RootSystem.ObjectDisposedException("DepthFrame");
310 + }
311 +
312 + Windows_Kinect_DepthFrame_CopyFrameDataToIntPtr(_pNative, frameData, size / sizeof(ushort));
313 + Helper.ExceptionHelper.CheckLastError();
314 + }
315 +
316 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError = true)]
317 + private static extern RootSystem.IntPtr Windows_Kinect_DepthFrame_LockImageBuffer(RootSystem.IntPtr pNative);
318 + public Windows.Kinect.KinectBuffer LockImageBuffer()
319 + {
320 + if (_pNative == RootSystem.IntPtr.Zero)
321 + {
322 + throw new RootSystem.ObjectDisposedException("DepthFrame");
323 + }
324 +
325 + RootSystem.IntPtr objectPointer = Windows_Kinect_DepthFrame_LockImageBuffer(_pNative);
326 + Helper.ExceptionHelper.CheckLastError();
327 +
328 + if (objectPointer == RootSystem.IntPtr.Zero)
329 + {
330 + return null;
331 + }
332 +
333 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.KinectBuffer>(objectPointer, n => new Windows.Kinect.KinectBuffer(n));
334 + }
335 + }
336 +
337 + public sealed partial class BodyIndexFrame
338 + {
339 + [RootSystem.Runtime.InteropServices.DllImport(
340 + "KinectUnityAddin",
341 + EntryPoint = "Windows_Kinect_BodyIndexFrame_CopyFrameDataToArray",
342 + CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl,
343 + SetLastError = true)]
344 + private static extern void Windows_Kinect_BodyIndexFrame_CopyFrameDataToIntPtr(RootSystem.IntPtr pNative, IntPtr frameData, uint frameDataSize);
345 + public void CopyFrameDataToIntPtr(RootSystem.IntPtr frameData, uint size)
346 + {
347 + if (_pNative == RootSystem.IntPtr.Zero)
348 + {
349 + throw new RootSystem.ObjectDisposedException("BodyIndexFrame");
350 + }
351 +
352 + Windows_Kinect_BodyIndexFrame_CopyFrameDataToIntPtr(_pNative, frameData, size);
353 + Helper.ExceptionHelper.CheckLastError();
354 + }
355 +
356 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError = true)]
357 + private static extern RootSystem.IntPtr Windows_Kinect_BodyIndexFrame_LockImageBuffer(RootSystem.IntPtr pNative);
358 + public Windows.Kinect.KinectBuffer LockImageBuffer()
359 + {
360 + if (_pNative == RootSystem.IntPtr.Zero)
361 + {
362 + throw new RootSystem.ObjectDisposedException("BodyIndexFrame");
363 + }
364 +
365 + RootSystem.IntPtr objectPointer = Windows_Kinect_BodyIndexFrame_LockImageBuffer(_pNative);
366 + Helper.ExceptionHelper.CheckLastError();
367 +
368 + if (objectPointer == RootSystem.IntPtr.Zero)
369 + {
370 + return null;
371 + }
372 +
373 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.KinectBuffer>(objectPointer, n => new Windows.Kinect.KinectBuffer(n));
374 + }
375 +
376 + }
377 +
378 + public sealed partial class InfraredFrame
379 + {
380 + [RootSystem.Runtime.InteropServices.DllImport(
381 + "KinectUnityAddin",
382 + EntryPoint = "Windows_Kinect_InfraredFrame_CopyFrameDataToArray",
383 + CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl,
384 + SetLastError = true)]
385 + private static extern void Windows_Kinect_InfraredFrame_CopyFrameDataToIntPtr(RootSystem.IntPtr pNative, IntPtr frameData, uint frameDataSize);
386 + public void CopyFrameDataToIntPtr(RootSystem.IntPtr frameData, uint size)
387 + {
388 + if (_pNative == RootSystem.IntPtr.Zero)
389 + {
390 + throw new RootSystem.ObjectDisposedException("InfraredFrame");
391 + }
392 +
393 + Windows_Kinect_InfraredFrame_CopyFrameDataToIntPtr(_pNative, frameData, size / sizeof(ushort));
394 + Helper.ExceptionHelper.CheckLastError();
395 + }
396 +
397 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError = true)]
398 + private static extern RootSystem.IntPtr Windows_Kinect_InfraredFrame_LockImageBuffer(RootSystem.IntPtr pNative);
399 + public Windows.Kinect.KinectBuffer LockImageBuffer()
400 + {
401 + if (_pNative == RootSystem.IntPtr.Zero)
402 + {
403 + throw new RootSystem.ObjectDisposedException("InfraredFrame");
404 + }
405 +
406 + RootSystem.IntPtr objectPointer = Windows_Kinect_InfraredFrame_LockImageBuffer(_pNative);
407 + Helper.ExceptionHelper.CheckLastError();
408 +
409 + if (objectPointer == RootSystem.IntPtr.Zero)
410 + {
411 + return null;
412 + }
413 +
414 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.KinectBuffer>(objectPointer, n => new Windows.Kinect.KinectBuffer(n));
415 + }
416 +
417 + }
418 +
419 + public sealed partial class KinectSensor
420 + {
421 + private void Dispose(bool disposing)
422 + {
423 + if (_pNative == RootSystem.IntPtr.Zero)
424 + {
425 + return;
426 + }
427 +
428 + if (IsOpen)
429 + {
430 + Close();
431 + }
432 +
433 + __EventCleanup();
434 +
435 + Helper.NativeObjectCache.RemoveObject<KinectSensor>(_pNative);
436 + Windows_Kinect_KinectSensor_ReleaseObject(ref _pNative);
437 +
438 + _pNative = RootSystem.IntPtr.Zero;
439 + }
440 + }
441 +
442 + public sealed partial class LongExposureInfraredFrame
443 + {
444 + [RootSystem.Runtime.InteropServices.DllImport(
445 + "KinectUnityAddin",
446 + EntryPoint = "Windows_Kinect_LongExposureInfraredFrame_CopyFrameDataToArray",
447 + CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl,
448 + SetLastError = true)]
449 + private static extern void Windows_Kinect_LongExposureInfraredFrame_CopyFrameDataToIntPtr(RootSystem.IntPtr pNative, IntPtr frameData, uint frameDataSize);
450 + public void CopyFrameDataToIntPtr(RootSystem.IntPtr frameData, uint size)
451 + {
452 + if (_pNative == RootSystem.IntPtr.Zero)
453 + {
454 + throw new RootSystem.ObjectDisposedException("LongExposureInfraredFrame");
455 + }
456 +
457 + Windows_Kinect_LongExposureInfraredFrame_CopyFrameDataToIntPtr(_pNative, frameData, size / sizeof(ushort));
458 + Helper.ExceptionHelper.CheckLastError();
459 + }
460 +
461 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError = true)]
462 + private static extern RootSystem.IntPtr Windows_Kinect_LongExposureInfraredFrame_LockImageBuffer(RootSystem.IntPtr pNative);
463 + public Windows.Kinect.KinectBuffer LockImageBuffer()
464 + {
465 + if (_pNative == RootSystem.IntPtr.Zero)
466 + {
467 + throw new RootSystem.ObjectDisposedException("LongExposureInfraredFrame");
468 + }
469 +
470 + RootSystem.IntPtr objectPointer = Windows_Kinect_LongExposureInfraredFrame_LockImageBuffer(_pNative);
471 + Helper.ExceptionHelper.CheckLastError();
472 +
473 + if (objectPointer == RootSystem.IntPtr.Zero)
474 + {
475 + return null;
476 + }
477 +
478 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.KinectBuffer>(objectPointer, n => new Windows.Kinect.KinectBuffer(n));
479 + }
480 +
481 + }
482 +
483 + public sealed partial class CoordinateMapper
484 + {
485 + private PointF[] _DepthFrameToCameraSpaceTable = null;
486 +
487 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError = true)]
488 + private static extern RootSystem.IntPtr Windows_Kinect_CoordinateMapper_GetDepthCameraIntrinsics(RootSystem.IntPtr pNative);
489 + public Windows.Kinect.CameraIntrinsics GetDepthCameraIntrinsics()
490 + {
491 + if (_pNative == RootSystem.IntPtr.Zero)
492 + {
493 + throw new RootSystem.ObjectDisposedException("CoordinateMapper");
494 + }
495 +
496 + var objectPointer = Windows_Kinect_CoordinateMapper_GetDepthCameraIntrinsics(_pNative);
497 + Helper.ExceptionHelper.CheckLastError();
498 +
499 + var obj = (Windows.Kinect.CameraIntrinsics)RootSystem.Runtime.InteropServices.Marshal.PtrToStructure(objectPointer, typeof(Windows.Kinect.CameraIntrinsics));
500 + RootSystem.Runtime.InteropServices.Marshal.FreeHGlobal(objectPointer);
501 + return obj;
502 + }
503 +
504 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError = true)]
505 + private static extern int Windows_Kinect_CoordinateMapper_GetDepthFrameToCameraSpaceTable(RootSystem.IntPtr pNative, RootSystem.IntPtr outCollection, uint outCollectionSize);
506 + public Windows.Kinect.PointF[] GetDepthFrameToCameraSpaceTable()
507 + {
508 + if (_pNative == RootSystem.IntPtr.Zero)
509 + {
510 + throw new RootSystem.ObjectDisposedException("CoordinateMapper");
511 + }
512 +
513 + if (_DepthFrameToCameraSpaceTable == null)
514 + {
515 + var desc = KinectSensor.GetDefault().DepthFrameSource.FrameDescription;
516 + _DepthFrameToCameraSpaceTable = new PointF[desc.Width * desc.Height];
517 +
518 + var pointsSmartGCHandle = new Helper.SmartGCHandle(RootSystem.Runtime.InteropServices.GCHandle.Alloc(_DepthFrameToCameraSpaceTable, RootSystem.Runtime.InteropServices.GCHandleType.Pinned));
519 + var _points = pointsSmartGCHandle.AddrOfPinnedObject();
520 + Windows_Kinect_CoordinateMapper_GetDepthFrameToCameraSpaceTable(_pNative, _points, (uint)_DepthFrameToCameraSpaceTable.Length);
521 + Helper.ExceptionHelper.CheckLastError();
522 + }
523 +
524 + return _DepthFrameToCameraSpaceTable;
525 + }
526 +
527 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError = true)]
528 + private static extern void Windows_Kinect_CoordinateMapper_MapColorFrameToDepthSpace(
529 + RootSystem.IntPtr pNative,
530 + RootSystem.IntPtr depthFrameData,
531 + uint depthFrameDataSize,
532 + RootSystem.IntPtr depthSpacePoints,
533 + uint depthSpacePointsSize);
534 + public void MapColorFrameToDepthSpaceUsingIntPtr(RootSystem.IntPtr depthFrameData, uint depthFrameSize, RootSystem.IntPtr depthSpacePoints, uint depthSpacePointsSize)
535 + {
536 + if (_pNative == RootSystem.IntPtr.Zero)
537 + {
538 + throw new RootSystem.ObjectDisposedException("CoordinateMapper");
539 + }
540 +
541 + uint length = depthFrameSize / sizeof(UInt16);
542 + Windows_Kinect_CoordinateMapper_MapColorFrameToDepthSpace(_pNative, depthFrameData, length, depthSpacePoints, depthSpacePointsSize);
543 + Helper.ExceptionHelper.CheckLastError();
544 + }
545 +
546 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError = true)]
547 + private static extern void Windows_Kinect_CoordinateMapper_MapColorFrameToCameraSpace(
548 + RootSystem.IntPtr pNative,
549 + RootSystem.IntPtr depthFrameData,
550 + uint depthFrameDataSize,
551 + RootSystem.IntPtr cameraSpacePoints,
552 + uint cameraSpacePointsSize);
553 + public void MapColorFrameToCameraSpaceUsingIntPtr(RootSystem.IntPtr depthFrameData, int depthFrameSize, RootSystem.IntPtr cameraSpacePoints, uint cameraSpacePointsSize)
554 + {
555 + if (_pNative == RootSystem.IntPtr.Zero)
556 + {
557 + throw new RootSystem.ObjectDisposedException("CoordinateMapper");
558 + }
559 +
560 + uint length = (uint)depthFrameSize / sizeof(UInt16);
561 + Windows_Kinect_CoordinateMapper_MapColorFrameToCameraSpace(_pNative, depthFrameData, length, cameraSpacePoints, cameraSpacePointsSize);
562 + Helper.ExceptionHelper.CheckLastError();
563 + }
564 +
565 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError = true)]
566 + private static extern void Windows_Kinect_CoordinateMapper_MapDepthFrameToColorSpace(
567 + RootSystem.IntPtr pNative,
568 + RootSystem.IntPtr depthFrameData,
569 + uint depthFrameDataSize,
570 + RootSystem.IntPtr colorSpacePoints,
571 + uint colorSpacePointsSize);
572 + public void MapDepthFrameToColorSpaceUsingIntPtr(RootSystem.IntPtr depthFrameData, int depthFrameSize, RootSystem.IntPtr colorSpacePoints, uint colorSpacePointsSize)
573 + {
574 + if (_pNative == RootSystem.IntPtr.Zero)
575 + {
576 + throw new RootSystem.ObjectDisposedException("CoordinateMapper");
577 + }
578 +
579 + uint length = (uint)depthFrameSize / sizeof(UInt16);
580 + Windows_Kinect_CoordinateMapper_MapDepthFrameToColorSpace(_pNative, depthFrameData, length, colorSpacePoints, colorSpacePointsSize);
581 + Helper.ExceptionHelper.CheckLastError();
582 + }
583 +
584 +
585 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError = true)]
586 + private static extern void Windows_Kinect_CoordinateMapper_MapDepthFrameToCameraSpace(
587 + RootSystem.IntPtr pNative,
588 + IntPtr depthFrameData,
589 + uint depthFrameDataSize,
590 + RootSystem.IntPtr cameraSpacePoints,
591 + uint cameraSpacePointsSize);
592 + public void MapDepthFrameToCameraSpaceUsingIntPtr(RootSystem.IntPtr depthFrameData, int depthFrameSize, RootSystem.IntPtr cameraSpacePoints, uint cameraSpacePointsSize)
593 + {
594 + if (_pNative == RootSystem.IntPtr.Zero)
595 + {
596 + throw new RootSystem.ObjectDisposedException("CoordinateMapper");
597 + }
598 +
599 + uint length = (uint)depthFrameSize / sizeof(UInt16);
600 + Windows_Kinect_CoordinateMapper_MapDepthFrameToCameraSpace(_pNative, depthFrameData, length, cameraSpacePoints, cameraSpacePointsSize);
601 + Helper.ExceptionHelper.CheckLastError();
602 + }
603 + }
604 +}
1 +using System;
2 +using System.Collections.Generic;
3 +using System.Runtime.InteropServices;
4 +using System.Linq;
5 +
6 +namespace Helper
7 +{
8 + public static class NativeObjectCache
9 + {
10 + private static object _lock = new object();
11 + private static Dictionary<Type, Dictionary<IntPtr, WeakReference>> _objectCache = new Dictionary<Type, Dictionary<IntPtr, WeakReference>>();
12 + public static void AddObject<T>(IntPtr nativePtr, T obj) where T : class
13 + {
14 + lock (_lock)
15 + {
16 + Dictionary<IntPtr, WeakReference> objCache = null;
17 +
18 + if (!_objectCache.TryGetValue(typeof(T), out objCache) || objCache == null)
19 + {
20 + objCache = new Dictionary<IntPtr, WeakReference>();
21 + _objectCache[typeof(T)] = objCache;
22 + }
23 +
24 + objCache[nativePtr] = new WeakReference(obj);
25 + }
26 + }
27 +
28 + public static void Flush()
29 + {
30 + lock(_lock)
31 + {
32 + foreach (var byType in _objectCache.ToArray())
33 + {
34 + foreach(var kvp in byType.Value.ToArray())
35 + {
36 + IDisposable disp = kvp.Value.Target as IDisposable;
37 + if(disp != null)
38 + {
39 + disp.Dispose();
40 + }
41 +
42 + }
43 + }
44 + }
45 + }
46 +
47 + public static void RemoveObject<T>(IntPtr nativePtr)
48 + {
49 + lock (_lock)
50 + {
51 + Dictionary<IntPtr, WeakReference> objCache = null;
52 +
53 + if (!_objectCache.TryGetValue(typeof(T), out objCache) || objCache == null)
54 + {
55 + objCache = new Dictionary<IntPtr, WeakReference>();
56 + _objectCache[typeof(T)] = objCache;
57 + }
58 +
59 + if (objCache.ContainsKey(nativePtr))
60 + {
61 + objCache.Remove(nativePtr);
62 + }
63 + }
64 + }
65 +
66 + public static T GetObject<T>(IntPtr nativePtr) where T : class
67 + {
68 + lock (_lock)
69 + {
70 + Dictionary<IntPtr, WeakReference> objCache = null;
71 +
72 + if (!_objectCache.TryGetValue(typeof(T), out objCache) || objCache == null)
73 + {
74 + objCache = new Dictionary<IntPtr, WeakReference>();
75 + _objectCache[typeof(T)] = objCache;
76 + }
77 +
78 + WeakReference reference = null;
79 + if (objCache.TryGetValue(nativePtr, out reference))
80 + {
81 + if (reference != null)
82 + {
83 + T obj = reference.Target as T;
84 + if (obj != null)
85 + {
86 + return (T)obj;
87 + }
88 + }
89 + }
90 +
91 + return null;
92 + }
93 + }
94 +
95 + public static T CreateOrGetObject<T>(IntPtr nativePtr, Func<System.IntPtr,T> create) where T : class
96 + {
97 + T outputValue = null;
98 +
99 + lock (_lock)
100 + {
101 + Dictionary<IntPtr, WeakReference> objCache = null;
102 +
103 + if (!_objectCache.TryGetValue(typeof(T), out objCache) || objCache == null)
104 + {
105 + objCache = new Dictionary<IntPtr, WeakReference>();
106 + _objectCache[typeof(T)] = objCache;
107 + }
108 +
109 + WeakReference reference = null;
110 + if (objCache.TryGetValue(nativePtr, out reference))
111 + {
112 + if ((reference != null) && reference.IsAlive)
113 + {
114 + outputValue = reference.Target as T;
115 + }
116 + }
117 +
118 + if (outputValue == null)
119 + {
120 + if (create != null)
121 + {
122 + outputValue = create(nativePtr);
123 + objCache[nativePtr] = new WeakReference(outputValue);
124 + }
125 + else if(typeof(T) == typeof(System.Object))
126 + {
127 + //T is an object, so lets just pass back our IntPtr, which is an object.
128 + outputValue = (T)(System.Object)nativePtr;
129 + }
130 + }
131 + }
132 +
133 + return outputValue;
134 + }
135 + }
136 +}
...\ No newline at end of file ...\ No newline at end of file
1 +using System;
2 +using System.Collections.Generic;
3 +using System.Runtime.InteropServices;
4 +using System.Linq;
5 +
6 +namespace Helper
7 +{
8 + public static class NativeWrapper
9 + {
10 + public static System.IntPtr GetNativePtr(Object obj)
11 + {
12 + if(obj == null)
13 + {
14 + return System.IntPtr.Zero;
15 + }
16 +
17 + var nativeWrapperIface = obj as INativeWrapper;
18 + if(nativeWrapperIface != null)
19 + {
20 + return nativeWrapperIface.nativePtr;
21 + }
22 + else
23 + {
24 + throw new ArgumentException("Object must wrap native type");
25 + }
26 + }
27 + }
28 +}
...\ No newline at end of file ...\ No newline at end of file
1 +using System;
2 +using System.Collections.Generic;
3 +using System.Runtime.InteropServices;
4 +using System.Linq;
5 +
6 +namespace Helper
7 +{
8 + public class SmartGCHandle : IDisposable
9 + {
10 + private GCHandle handle;
11 + public SmartGCHandle(GCHandle handle)
12 + {
13 + this.handle = handle;
14 + }
15 +
16 + ~SmartGCHandle()
17 + {
18 + Dispose(false);
19 + }
20 +
21 + public System.IntPtr AddrOfPinnedObject()
22 + {
23 + return handle.AddrOfPinnedObject();
24 + }
25 +
26 + public virtual void Dispose()
27 + {
28 + Dispose(true);
29 + }
30 +
31 + protected virtual void Dispose(bool disposing)
32 + {
33 + this.handle.Free();
34 + }
35 +
36 + public static implicit operator GCHandle(SmartGCHandle other)
37 + {
38 +
39 + return other.handle;
40 + }
41 + }
42 +}
...\ No newline at end of file ...\ No newline at end of file
1 +using System;
2 +using System.Collections.Generic;
3 +using System.Runtime.InteropServices;
4 +using System.Linq;
5 +
6 +namespace Helper
7 +{
8 + public class ThreadSafeDictionary<TKey, TValue>
9 + {
10 + protected readonly Dictionary<TKey, TValue> _impl = new Dictionary<TKey, TValue>();
11 + public TValue this[TKey key]
12 + {
13 + get
14 + {
15 + lock (_impl)
16 + {
17 + return _impl[key];
18 + }
19 + }
20 + set
21 + {
22 + lock (_impl)
23 + {
24 + _impl[key] = value;
25 + }
26 + }
27 + }
28 +
29 + public void Add(TKey key, TValue value)
30 + {
31 + lock (_impl)
32 + {
33 + _impl.Add(key, value);
34 + }
35 + }
36 +
37 + public bool TryGetValue(TKey key, out TValue value)
38 + {
39 + lock (_impl)
40 + {
41 + return _impl.TryGetValue(key, out value);
42 + }
43 + }
44 +
45 + public bool Remove(TKey key)
46 + {
47 + lock (_impl)
48 + {
49 + return _impl.Remove(key);
50 + }
51 + }
52 +
53 + public void Clear()
54 + {
55 + lock (_impl)
56 + {
57 + _impl.Clear();
58 + }
59 + }
60 + }
61 +}
...\ No newline at end of file ...\ No newline at end of file
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Data
5 +{
6 + //
7 + // Windows.Data.PropertyChangedEventArgs
8 + //
9 + public sealed partial class PropertyChangedEventArgs : RootSystem.EventArgs, Helper.INativeWrapper
10 +
11 + {
12 + internal RootSystem.IntPtr _pNative;
13 + RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
14 +
15 + // Constructors and Finalizers
16 + internal PropertyChangedEventArgs(RootSystem.IntPtr pNative)
17 + {
18 + _pNative = pNative;
19 + Windows_Data_PropertyChangedEventArgs_AddRefObject(ref _pNative);
20 + }
21 +
22 + ~PropertyChangedEventArgs()
23 + {
24 + Dispose(false);
25 + }
26 +
27 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
28 + private static extern void Windows_Data_PropertyChangedEventArgs_ReleaseObject(ref RootSystem.IntPtr pNative);
29 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
30 + private static extern void Windows_Data_PropertyChangedEventArgs_AddRefObject(ref RootSystem.IntPtr pNative);
31 + private void Dispose(bool disposing)
32 + {
33 + if (_pNative == RootSystem.IntPtr.Zero)
34 + {
35 + return;
36 + }
37 +
38 + __EventCleanup();
39 +
40 + Helper.NativeObjectCache.RemoveObject<PropertyChangedEventArgs>(_pNative);
41 + Windows_Data_PropertyChangedEventArgs_ReleaseObject(ref _pNative);
42 +
43 + _pNative = RootSystem.IntPtr.Zero;
44 + }
45 +
46 +
47 + // Public Properties
48 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
49 + private static extern RootSystem.IntPtr Windows_Data_PropertyChangedEventArgs_get_PropertyName(RootSystem.IntPtr pNative);
50 + public string PropertyName
51 + {
52 + get
53 + {
54 + if (_pNative == RootSystem.IntPtr.Zero)
55 + {
56 + throw new RootSystem.ObjectDisposedException("PropertyChangedEventArgs");
57 + }
58 +
59 + RootSystem.IntPtr objectPointer = Windows_Data_PropertyChangedEventArgs_get_PropertyName(_pNative);
60 + Helper.ExceptionHelper.CheckLastError();
61 +
62 + var managedString = RootSystem.Runtime.InteropServices.Marshal.PtrToStringUni(objectPointer);
63 + RootSystem.Runtime.InteropServices.Marshal.FreeCoTaskMem(objectPointer);
64 + return managedString;
65 + }
66 + }
67 +
68 + private void __EventCleanup()
69 + {
70 + }
71 + }
72 +
73 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.Activity
8 + //
9 + public enum Activity : int
10 + {
11 + EyeLeftClosed =0,
12 + EyeRightClosed =1,
13 + MouthOpen =2,
14 + MouthMoved =3,
15 + LookingAway =4,
16 + }
17 +
18 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.Appearance
8 + //
9 + public enum Appearance : int
10 + {
11 + WearingGlasses =0,
12 + }
13 +
14 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.AudioBeam
8 + //
9 + public sealed partial class AudioBeam : Helper.INativeWrapper
10 +
11 + {
12 + internal RootSystem.IntPtr _pNative;
13 + RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
14 +
15 + // Constructors and Finalizers
16 + internal AudioBeam(RootSystem.IntPtr pNative)
17 + {
18 + _pNative = pNative;
19 + Windows_Kinect_AudioBeam_AddRefObject(ref _pNative);
20 + }
21 +
22 + ~AudioBeam()
23 + {
24 + Dispose(false);
25 + }
26 +
27 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
28 + private static extern void Windows_Kinect_AudioBeam_ReleaseObject(ref RootSystem.IntPtr pNative);
29 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
30 + private static extern void Windows_Kinect_AudioBeam_AddRefObject(ref RootSystem.IntPtr pNative);
31 + private void Dispose(bool disposing)
32 + {
33 + if (_pNative == RootSystem.IntPtr.Zero)
34 + {
35 + return;
36 + }
37 +
38 + __EventCleanup();
39 +
40 + Helper.NativeObjectCache.RemoveObject<AudioBeam>(_pNative);
41 + Windows_Kinect_AudioBeam_ReleaseObject(ref _pNative);
42 +
43 + _pNative = RootSystem.IntPtr.Zero;
44 + }
45 +
46 +
47 + // Public Properties
48 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
49 + private static extern Windows.Kinect.AudioBeamMode Windows_Kinect_AudioBeam_get_AudioBeamMode(RootSystem.IntPtr pNative);
50 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
51 + private static extern void Windows_Kinect_AudioBeam_put_AudioBeamMode(RootSystem.IntPtr pNative, Windows.Kinect.AudioBeamMode audioBeamMode);
52 + public Windows.Kinect.AudioBeamMode AudioBeamMode
53 + {
54 + get
55 + {
56 + if (_pNative == RootSystem.IntPtr.Zero)
57 + {
58 + throw new RootSystem.ObjectDisposedException("AudioBeam");
59 + }
60 +
61 + return Windows_Kinect_AudioBeam_get_AudioBeamMode(_pNative);
62 + }
63 + set
64 + {
65 + if (_pNative == RootSystem.IntPtr.Zero)
66 + {
67 + throw new RootSystem.ObjectDisposedException("AudioBeam");
68 + }
69 +
70 + Windows_Kinect_AudioBeam_put_AudioBeamMode(_pNative, value);
71 + Helper.ExceptionHelper.CheckLastError();
72 + }
73 + }
74 +
75 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
76 + private static extern RootSystem.IntPtr Windows_Kinect_AudioBeam_get_AudioSource(RootSystem.IntPtr pNative);
77 + public Windows.Kinect.AudioSource AudioSource
78 + {
79 + get
80 + {
81 + if (_pNative == RootSystem.IntPtr.Zero)
82 + {
83 + throw new RootSystem.ObjectDisposedException("AudioBeam");
84 + }
85 +
86 + RootSystem.IntPtr objectPointer = Windows_Kinect_AudioBeam_get_AudioSource(_pNative);
87 + Helper.ExceptionHelper.CheckLastError();
88 + if (objectPointer == RootSystem.IntPtr.Zero)
89 + {
90 + return null;
91 + }
92 +
93 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.AudioSource>(objectPointer, n => new Windows.Kinect.AudioSource(n));
94 + }
95 + }
96 +
97 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
98 + private static extern float Windows_Kinect_AudioBeam_get_BeamAngle(RootSystem.IntPtr pNative);
99 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
100 + private static extern void Windows_Kinect_AudioBeam_put_BeamAngle(RootSystem.IntPtr pNative, float beamAngle);
101 + public float BeamAngle
102 + {
103 + get
104 + {
105 + if (_pNative == RootSystem.IntPtr.Zero)
106 + {
107 + throw new RootSystem.ObjectDisposedException("AudioBeam");
108 + }
109 +
110 + return Windows_Kinect_AudioBeam_get_BeamAngle(_pNative);
111 + }
112 + set
113 + {
114 + if (_pNative == RootSystem.IntPtr.Zero)
115 + {
116 + throw new RootSystem.ObjectDisposedException("AudioBeam");
117 + }
118 +
119 + Windows_Kinect_AudioBeam_put_BeamAngle(_pNative, value);
120 + Helper.ExceptionHelper.CheckLastError();
121 + }
122 + }
123 +
124 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
125 + private static extern float Windows_Kinect_AudioBeam_get_BeamAngleConfidence(RootSystem.IntPtr pNative);
126 + public float BeamAngleConfidence
127 + {
128 + get
129 + {
130 + if (_pNative == RootSystem.IntPtr.Zero)
131 + {
132 + throw new RootSystem.ObjectDisposedException("AudioBeam");
133 + }
134 +
135 + return Windows_Kinect_AudioBeam_get_BeamAngleConfidence(_pNative);
136 + }
137 + }
138 +
139 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
140 + private static extern long Windows_Kinect_AudioBeam_get_RelativeTime(RootSystem.IntPtr pNative);
141 + public RootSystem.TimeSpan RelativeTime
142 + {
143 + get
144 + {
145 + if (_pNative == RootSystem.IntPtr.Zero)
146 + {
147 + throw new RootSystem.ObjectDisposedException("AudioBeam");
148 + }
149 +
150 + return RootSystem.TimeSpan.FromMilliseconds(Windows_Kinect_AudioBeam_get_RelativeTime(_pNative));
151 + }
152 + }
153 +
154 +
155 + // Events
156 + private static RootSystem.Runtime.InteropServices.GCHandle _Windows_Data_PropertyChangedEventArgs_Delegate_Handle;
157 + [RootSystem.Runtime.InteropServices.UnmanagedFunctionPointer(RootSystem.Runtime.InteropServices.CallingConvention.Cdecl)]
158 + private delegate void _Windows_Data_PropertyChangedEventArgs_Delegate(RootSystem.IntPtr args, RootSystem.IntPtr pNative);
159 + private static Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs>>> Windows_Data_PropertyChangedEventArgs_Delegate_callbacks = new Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs>>>();
160 + [AOT.MonoPInvokeCallbackAttribute(typeof(_Windows_Data_PropertyChangedEventArgs_Delegate))]
161 + private static void Windows_Data_PropertyChangedEventArgs_Delegate_Handler(RootSystem.IntPtr result, RootSystem.IntPtr pNative)
162 + {
163 + List<RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs>> callbackList = null;
164 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryGetValue(pNative, out callbackList);
165 + lock(callbackList)
166 + {
167 + var objThis = Helper.NativeObjectCache.GetObject<AudioBeam>(pNative);
168 + var args = new Windows.Data.PropertyChangedEventArgs(result);
169 + foreach(var func in callbackList)
170 + {
171 + Helper.EventPump.Instance.Enqueue(() => { try { func(objThis, args); } catch { } });
172 + }
173 + }
174 + }
175 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
176 + private static extern void Windows_Kinect_AudioBeam_add_PropertyChanged(RootSystem.IntPtr pNative, _Windows_Data_PropertyChangedEventArgs_Delegate eventCallback, bool unsubscribe);
177 + public event RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs> PropertyChanged
178 + {
179 + add
180 + {
181 + Helper.EventPump.EnsureInitialized();
182 +
183 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
184 + var callbackList = Windows_Data_PropertyChangedEventArgs_Delegate_callbacks[_pNative];
185 + lock (callbackList)
186 + {
187 + callbackList.Add(value);
188 + if(callbackList.Count == 1)
189 + {
190 + var del = new _Windows_Data_PropertyChangedEventArgs_Delegate(Windows_Data_PropertyChangedEventArgs_Delegate_Handler);
191 + _Windows_Data_PropertyChangedEventArgs_Delegate_Handle = RootSystem.Runtime.InteropServices.GCHandle.Alloc(del);
192 + Windows_Kinect_AudioBeam_add_PropertyChanged(_pNative, del, false);
193 + }
194 + }
195 + }
196 + remove
197 + {
198 + if (_pNative == RootSystem.IntPtr.Zero)
199 + {
200 + return;
201 + }
202 +
203 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
204 + var callbackList = Windows_Data_PropertyChangedEventArgs_Delegate_callbacks[_pNative];
205 + lock (callbackList)
206 + {
207 + callbackList.Remove(value);
208 + if(callbackList.Count == 0)
209 + {
210 + Windows_Kinect_AudioBeam_add_PropertyChanged(_pNative, Windows_Data_PropertyChangedEventArgs_Delegate_Handler, true);
211 + _Windows_Data_PropertyChangedEventArgs_Delegate_Handle.Free();
212 + }
213 + }
214 + }
215 + }
216 +
217 +
218 + // Public Methods
219 + private void __EventCleanup()
220 + {
221 + {
222 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
223 + var callbackList = Windows_Data_PropertyChangedEventArgs_Delegate_callbacks[_pNative];
224 + lock (callbackList)
225 + {
226 + if (callbackList.Count > 0)
227 + {
228 + callbackList.Clear();
229 + if (_pNative != RootSystem.IntPtr.Zero)
230 + {
231 + Windows_Kinect_AudioBeam_add_PropertyChanged(_pNative, Windows_Data_PropertyChangedEventArgs_Delegate_Handler, true);
232 + }
233 + _Windows_Data_PropertyChangedEventArgs_Delegate_Handle.Free();
234 + }
235 + }
236 + }
237 + }
238 + }
239 +
240 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.AudioBeamFrame
8 + //
9 + public sealed partial class AudioBeamFrame : RootSystem.IDisposable, Helper.INativeWrapper
10 +
11 + {
12 + internal RootSystem.IntPtr _pNative;
13 + RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
14 +
15 + // Constructors and Finalizers
16 + internal AudioBeamFrame(RootSystem.IntPtr pNative)
17 + {
18 + _pNative = pNative;
19 + Windows_Kinect_AudioBeamFrame_AddRefObject(ref _pNative);
20 + }
21 +
22 + ~AudioBeamFrame()
23 + {
24 + Dispose(false);
25 + }
26 +
27 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
28 + private static extern void Windows_Kinect_AudioBeamFrame_ReleaseObject(ref RootSystem.IntPtr pNative);
29 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
30 + private static extern void Windows_Kinect_AudioBeamFrame_AddRefObject(ref RootSystem.IntPtr pNative);
31 +
32 + // Public Properties
33 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
34 + private static extern RootSystem.IntPtr Windows_Kinect_AudioBeamFrame_get_AudioBeam(RootSystem.IntPtr pNative);
35 + public Windows.Kinect.AudioBeam AudioBeam
36 + {
37 + get
38 + {
39 + if (_pNative == RootSystem.IntPtr.Zero)
40 + {
41 + throw new RootSystem.ObjectDisposedException("AudioBeamFrame");
42 + }
43 +
44 + RootSystem.IntPtr objectPointer = Windows_Kinect_AudioBeamFrame_get_AudioBeam(_pNative);
45 + Helper.ExceptionHelper.CheckLastError();
46 + if (objectPointer == RootSystem.IntPtr.Zero)
47 + {
48 + return null;
49 + }
50 +
51 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.AudioBeam>(objectPointer, n => new Windows.Kinect.AudioBeam(n));
52 + }
53 + }
54 +
55 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
56 + private static extern RootSystem.IntPtr Windows_Kinect_AudioBeamFrame_get_AudioSource(RootSystem.IntPtr pNative);
57 + public Windows.Kinect.AudioSource AudioSource
58 + {
59 + get
60 + {
61 + if (_pNative == RootSystem.IntPtr.Zero)
62 + {
63 + throw new RootSystem.ObjectDisposedException("AudioBeamFrame");
64 + }
65 +
66 + RootSystem.IntPtr objectPointer = Windows_Kinect_AudioBeamFrame_get_AudioSource(_pNative);
67 + Helper.ExceptionHelper.CheckLastError();
68 + if (objectPointer == RootSystem.IntPtr.Zero)
69 + {
70 + return null;
71 + }
72 +
73 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.AudioSource>(objectPointer, n => new Windows.Kinect.AudioSource(n));
74 + }
75 + }
76 +
77 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
78 + private static extern long Windows_Kinect_AudioBeamFrame_get_Duration(RootSystem.IntPtr pNative);
79 + public RootSystem.TimeSpan Duration
80 + {
81 + get
82 + {
83 + if (_pNative == RootSystem.IntPtr.Zero)
84 + {
85 + throw new RootSystem.ObjectDisposedException("AudioBeamFrame");
86 + }
87 +
88 + return RootSystem.TimeSpan.FromMilliseconds(Windows_Kinect_AudioBeamFrame_get_Duration(_pNative));
89 + }
90 + }
91 +
92 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
93 + private static extern long Windows_Kinect_AudioBeamFrame_get_RelativeTimeStart(RootSystem.IntPtr pNative);
94 + public RootSystem.TimeSpan RelativeTimeStart
95 + {
96 + get
97 + {
98 + if (_pNative == RootSystem.IntPtr.Zero)
99 + {
100 + throw new RootSystem.ObjectDisposedException("AudioBeamFrame");
101 + }
102 +
103 + return RootSystem.TimeSpan.FromMilliseconds(Windows_Kinect_AudioBeamFrame_get_RelativeTimeStart(_pNative));
104 + }
105 + }
106 +
107 +
108 + // Public Methods
109 + private void __EventCleanup()
110 + {
111 + }
112 + }
113 +
114 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.AudioBeamFrameArrivedEventArgs
8 + //
9 + public sealed partial class AudioBeamFrameArrivedEventArgs : RootSystem.EventArgs, Helper.INativeWrapper
10 +
11 + {
12 + internal RootSystem.IntPtr _pNative;
13 + RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
14 +
15 + // Constructors and Finalizers
16 + internal AudioBeamFrameArrivedEventArgs(RootSystem.IntPtr pNative)
17 + {
18 + _pNative = pNative;
19 + Windows_Kinect_AudioBeamFrameArrivedEventArgs_AddRefObject(ref _pNative);
20 + }
21 +
22 + ~AudioBeamFrameArrivedEventArgs()
23 + {
24 + Dispose(false);
25 + }
26 +
27 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
28 + private static extern void Windows_Kinect_AudioBeamFrameArrivedEventArgs_ReleaseObject(ref RootSystem.IntPtr pNative);
29 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
30 + private static extern void Windows_Kinect_AudioBeamFrameArrivedEventArgs_AddRefObject(ref RootSystem.IntPtr pNative);
31 + private void Dispose(bool disposing)
32 + {
33 + if (_pNative == RootSystem.IntPtr.Zero)
34 + {
35 + return;
36 + }
37 +
38 + __EventCleanup();
39 +
40 + Helper.NativeObjectCache.RemoveObject<AudioBeamFrameArrivedEventArgs>(_pNative);
41 + Windows_Kinect_AudioBeamFrameArrivedEventArgs_ReleaseObject(ref _pNative);
42 +
43 + _pNative = RootSystem.IntPtr.Zero;
44 + }
45 +
46 +
47 + // Public Properties
48 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
49 + private static extern RootSystem.IntPtr Windows_Kinect_AudioBeamFrameArrivedEventArgs_get_FrameReference(RootSystem.IntPtr pNative);
50 + public Windows.Kinect.AudioBeamFrameReference FrameReference
51 + {
52 + get
53 + {
54 + if (_pNative == RootSystem.IntPtr.Zero)
55 + {
56 + throw new RootSystem.ObjectDisposedException("AudioBeamFrameArrivedEventArgs");
57 + }
58 +
59 + RootSystem.IntPtr objectPointer = Windows_Kinect_AudioBeamFrameArrivedEventArgs_get_FrameReference(_pNative);
60 + Helper.ExceptionHelper.CheckLastError();
61 + if (objectPointer == RootSystem.IntPtr.Zero)
62 + {
63 + return null;
64 + }
65 +
66 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.AudioBeamFrameReference>(objectPointer, n => new Windows.Kinect.AudioBeamFrameReference(n));
67 + }
68 + }
69 +
70 + private void __EventCleanup()
71 + {
72 + }
73 + }
74 +
75 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.AudioBeamFrameList
8 + //
9 + public sealed partial class AudioBeamFrameList : RootSystem.IDisposable, Helper.INativeWrapper
10 +
11 + {
12 + internal RootSystem.IntPtr _pNative;
13 + RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
14 +
15 + // Constructors and Finalizers
16 + internal AudioBeamFrameList(RootSystem.IntPtr pNative)
17 + {
18 + _pNative = pNative;
19 + Windows_Kinect_AudioBeamFrameList_AddRefObject(ref _pNative);
20 + }
21 +
22 + ~AudioBeamFrameList()
23 + {
24 + Dispose(false);
25 + }
26 +
27 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
28 + private static extern void Windows_Kinect_AudioBeamFrameList_ReleaseObject(ref RootSystem.IntPtr pNative);
29 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
30 + private static extern void Windows_Kinect_AudioBeamFrameList_AddRefObject(ref RootSystem.IntPtr pNative);
31 + private void Dispose(bool disposing)
32 + {
33 + if (_pNative == RootSystem.IntPtr.Zero)
34 + {
35 + return;
36 + }
37 +
38 + __EventCleanup();
39 +
40 + Helper.NativeObjectCache.RemoveObject<AudioBeamFrameList>(_pNative);
41 +
42 + if (disposing)
43 + {
44 + Windows_Kinect_AudioBeamFrameList_Dispose(_pNative);
45 + }
46 + Windows_Kinect_AudioBeamFrameList_ReleaseObject(ref _pNative);
47 +
48 + _pNative = RootSystem.IntPtr.Zero;
49 + }
50 +
51 +
52 + // Public Methods
53 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
54 + private static extern void Windows_Kinect_AudioBeamFrameList_Dispose(RootSystem.IntPtr pNative);
55 + public void Dispose()
56 + {
57 + if (_pNative == RootSystem.IntPtr.Zero)
58 + {
59 + return;
60 + }
61 +
62 + Dispose(true);
63 + RootSystem.GC.SuppressFinalize(this);
64 + }
65 +
66 + private void __EventCleanup()
67 + {
68 + }
69 + }
70 +
71 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.AudioBeamFrameReader
8 + //
9 + public sealed partial class AudioBeamFrameReader : RootSystem.IDisposable, Helper.INativeWrapper
10 +
11 + {
12 + internal RootSystem.IntPtr _pNative;
13 + RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
14 +
15 + // Constructors and Finalizers
16 + internal AudioBeamFrameReader(RootSystem.IntPtr pNative)
17 + {
18 + _pNative = pNative;
19 + Windows_Kinect_AudioBeamFrameReader_AddRefObject(ref _pNative);
20 + }
21 +
22 + ~AudioBeamFrameReader()
23 + {
24 + Dispose(false);
25 + }
26 +
27 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
28 + private static extern void Windows_Kinect_AudioBeamFrameReader_ReleaseObject(ref RootSystem.IntPtr pNative);
29 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
30 + private static extern void Windows_Kinect_AudioBeamFrameReader_AddRefObject(ref RootSystem.IntPtr pNative);
31 + private void Dispose(bool disposing)
32 + {
33 + if (_pNative == RootSystem.IntPtr.Zero)
34 + {
35 + return;
36 + }
37 +
38 + __EventCleanup();
39 +
40 + Helper.NativeObjectCache.RemoveObject<AudioBeamFrameReader>(_pNative);
41 +
42 + if (disposing)
43 + {
44 + Windows_Kinect_AudioBeamFrameReader_Dispose(_pNative);
45 + }
46 + Windows_Kinect_AudioBeamFrameReader_ReleaseObject(ref _pNative);
47 +
48 + _pNative = RootSystem.IntPtr.Zero;
49 + }
50 +
51 +
52 + // Public Properties
53 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
54 + private static extern RootSystem.IntPtr Windows_Kinect_AudioBeamFrameReader_get_AudioSource(RootSystem.IntPtr pNative);
55 + public Windows.Kinect.AudioSource AudioSource
56 + {
57 + get
58 + {
59 + if (_pNative == RootSystem.IntPtr.Zero)
60 + {
61 + throw new RootSystem.ObjectDisposedException("AudioBeamFrameReader");
62 + }
63 +
64 + RootSystem.IntPtr objectPointer = Windows_Kinect_AudioBeamFrameReader_get_AudioSource(_pNative);
65 + Helper.ExceptionHelper.CheckLastError();
66 + if (objectPointer == RootSystem.IntPtr.Zero)
67 + {
68 + return null;
69 + }
70 +
71 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.AudioSource>(objectPointer, n => new Windows.Kinect.AudioSource(n));
72 + }
73 + }
74 +
75 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
76 + private static extern bool Windows_Kinect_AudioBeamFrameReader_get_IsPaused(RootSystem.IntPtr pNative);
77 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
78 + private static extern void Windows_Kinect_AudioBeamFrameReader_put_IsPaused(RootSystem.IntPtr pNative, bool isPaused);
79 + public bool IsPaused
80 + {
81 + get
82 + {
83 + if (_pNative == RootSystem.IntPtr.Zero)
84 + {
85 + throw new RootSystem.ObjectDisposedException("AudioBeamFrameReader");
86 + }
87 +
88 + return Windows_Kinect_AudioBeamFrameReader_get_IsPaused(_pNative);
89 + }
90 + set
91 + {
92 + if (_pNative == RootSystem.IntPtr.Zero)
93 + {
94 + throw new RootSystem.ObjectDisposedException("AudioBeamFrameReader");
95 + }
96 +
97 + Windows_Kinect_AudioBeamFrameReader_put_IsPaused(_pNative, value);
98 + Helper.ExceptionHelper.CheckLastError();
99 + }
100 + }
101 +
102 +
103 + // Events
104 + private static RootSystem.Runtime.InteropServices.GCHandle _Windows_Kinect_AudioBeamFrameArrivedEventArgs_Delegate_Handle;
105 + [RootSystem.Runtime.InteropServices.UnmanagedFunctionPointer(RootSystem.Runtime.InteropServices.CallingConvention.Cdecl)]
106 + private delegate void _Windows_Kinect_AudioBeamFrameArrivedEventArgs_Delegate(RootSystem.IntPtr args, RootSystem.IntPtr pNative);
107 + private static Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Kinect.AudioBeamFrameArrivedEventArgs>>> Windows_Kinect_AudioBeamFrameArrivedEventArgs_Delegate_callbacks = new Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Kinect.AudioBeamFrameArrivedEventArgs>>>();
108 + [AOT.MonoPInvokeCallbackAttribute(typeof(_Windows_Kinect_AudioBeamFrameArrivedEventArgs_Delegate))]
109 + private static void Windows_Kinect_AudioBeamFrameArrivedEventArgs_Delegate_Handler(RootSystem.IntPtr result, RootSystem.IntPtr pNative)
110 + {
111 + List<RootSystem.EventHandler<Windows.Kinect.AudioBeamFrameArrivedEventArgs>> callbackList = null;
112 + Windows_Kinect_AudioBeamFrameArrivedEventArgs_Delegate_callbacks.TryGetValue(pNative, out callbackList);
113 + lock(callbackList)
114 + {
115 + var objThis = Helper.NativeObjectCache.GetObject<AudioBeamFrameReader>(pNative);
116 + var args = new Windows.Kinect.AudioBeamFrameArrivedEventArgs(result);
117 + foreach(var func in callbackList)
118 + {
119 + Helper.EventPump.Instance.Enqueue(() => { try { func(objThis, args); } catch { } });
120 + }
121 + }
122 + }
123 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
124 + private static extern void Windows_Kinect_AudioBeamFrameReader_add_FrameArrived(RootSystem.IntPtr pNative, _Windows_Kinect_AudioBeamFrameArrivedEventArgs_Delegate eventCallback, bool unsubscribe);
125 + public event RootSystem.EventHandler<Windows.Kinect.AudioBeamFrameArrivedEventArgs> FrameArrived
126 + {
127 + add
128 + {
129 + Helper.EventPump.EnsureInitialized();
130 +
131 + Windows_Kinect_AudioBeamFrameArrivedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
132 + var callbackList = Windows_Kinect_AudioBeamFrameArrivedEventArgs_Delegate_callbacks[_pNative];
133 + lock (callbackList)
134 + {
135 + callbackList.Add(value);
136 + if(callbackList.Count == 1)
137 + {
138 + var del = new _Windows_Kinect_AudioBeamFrameArrivedEventArgs_Delegate(Windows_Kinect_AudioBeamFrameArrivedEventArgs_Delegate_Handler);
139 + _Windows_Kinect_AudioBeamFrameArrivedEventArgs_Delegate_Handle = RootSystem.Runtime.InteropServices.GCHandle.Alloc(del);
140 + Windows_Kinect_AudioBeamFrameReader_add_FrameArrived(_pNative, del, false);
141 + }
142 + }
143 + }
144 + remove
145 + {
146 + if (_pNative == RootSystem.IntPtr.Zero)
147 + {
148 + return;
149 + }
150 +
151 + Windows_Kinect_AudioBeamFrameArrivedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
152 + var callbackList = Windows_Kinect_AudioBeamFrameArrivedEventArgs_Delegate_callbacks[_pNative];
153 + lock (callbackList)
154 + {
155 + callbackList.Remove(value);
156 + if(callbackList.Count == 0)
157 + {
158 + Windows_Kinect_AudioBeamFrameReader_add_FrameArrived(_pNative, Windows_Kinect_AudioBeamFrameArrivedEventArgs_Delegate_Handler, true);
159 + _Windows_Kinect_AudioBeamFrameArrivedEventArgs_Delegate_Handle.Free();
160 + }
161 + }
162 + }
163 + }
164 +
165 + private static RootSystem.Runtime.InteropServices.GCHandle _Windows_Data_PropertyChangedEventArgs_Delegate_Handle;
166 + [RootSystem.Runtime.InteropServices.UnmanagedFunctionPointer(RootSystem.Runtime.InteropServices.CallingConvention.Cdecl)]
167 + private delegate void _Windows_Data_PropertyChangedEventArgs_Delegate(RootSystem.IntPtr args, RootSystem.IntPtr pNative);
168 + private static Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs>>> Windows_Data_PropertyChangedEventArgs_Delegate_callbacks = new Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs>>>();
169 + [AOT.MonoPInvokeCallbackAttribute(typeof(_Windows_Data_PropertyChangedEventArgs_Delegate))]
170 + private static void Windows_Data_PropertyChangedEventArgs_Delegate_Handler(RootSystem.IntPtr result, RootSystem.IntPtr pNative)
171 + {
172 + List<RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs>> callbackList = null;
173 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryGetValue(pNative, out callbackList);
174 + lock(callbackList)
175 + {
176 + var objThis = Helper.NativeObjectCache.GetObject<AudioBeamFrameReader>(pNative);
177 + var args = new Windows.Data.PropertyChangedEventArgs(result);
178 + foreach(var func in callbackList)
179 + {
180 + Helper.EventPump.Instance.Enqueue(() => { try { func(objThis, args); } catch { } });
181 + }
182 + }
183 + }
184 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
185 + private static extern void Windows_Kinect_AudioBeamFrameReader_add_PropertyChanged(RootSystem.IntPtr pNative, _Windows_Data_PropertyChangedEventArgs_Delegate eventCallback, bool unsubscribe);
186 + public event RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs> PropertyChanged
187 + {
188 + add
189 + {
190 + Helper.EventPump.EnsureInitialized();
191 +
192 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
193 + var callbackList = Windows_Data_PropertyChangedEventArgs_Delegate_callbacks[_pNative];
194 + lock (callbackList)
195 + {
196 + callbackList.Add(value);
197 + if(callbackList.Count == 1)
198 + {
199 + var del = new _Windows_Data_PropertyChangedEventArgs_Delegate(Windows_Data_PropertyChangedEventArgs_Delegate_Handler);
200 + _Windows_Data_PropertyChangedEventArgs_Delegate_Handle = RootSystem.Runtime.InteropServices.GCHandle.Alloc(del);
201 + Windows_Kinect_AudioBeamFrameReader_add_PropertyChanged(_pNative, del, false);
202 + }
203 + }
204 + }
205 + remove
206 + {
207 + if (_pNative == RootSystem.IntPtr.Zero)
208 + {
209 + return;
210 + }
211 +
212 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
213 + var callbackList = Windows_Data_PropertyChangedEventArgs_Delegate_callbacks[_pNative];
214 + lock (callbackList)
215 + {
216 + callbackList.Remove(value);
217 + if(callbackList.Count == 0)
218 + {
219 + Windows_Kinect_AudioBeamFrameReader_add_PropertyChanged(_pNative, Windows_Data_PropertyChangedEventArgs_Delegate_Handler, true);
220 + _Windows_Data_PropertyChangedEventArgs_Delegate_Handle.Free();
221 + }
222 + }
223 + }
224 + }
225 +
226 +
227 + // Public Methods
228 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
229 + private static extern int Windows_Kinect_AudioBeamFrameReader_AcquireLatestBeamFrames_Length(RootSystem.IntPtr pNative);
230 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
231 + private static extern int Windows_Kinect_AudioBeamFrameReader_AcquireLatestBeamFrames(RootSystem.IntPtr pNative, [RootSystem.Runtime.InteropServices.Out] RootSystem.IntPtr[] outCollection, int outCollectionSize);
232 + public RootSystem.Collections.Generic.IList<Windows.Kinect.AudioBeamFrame> AcquireLatestBeamFrames()
233 + {
234 + if (_pNative == RootSystem.IntPtr.Zero)
235 + {
236 + throw new RootSystem.ObjectDisposedException("AudioBeamFrameReader");
237 + }
238 +
239 + int outCollectionSize = Windows_Kinect_AudioBeamFrameReader_AcquireLatestBeamFrames_Length(_pNative);
240 + var outCollection = new RootSystem.IntPtr[outCollectionSize];
241 + var managedCollection = new Windows.Kinect.AudioBeamFrame[outCollectionSize];
242 +
243 + outCollectionSize = Windows_Kinect_AudioBeamFrameReader_AcquireLatestBeamFrames(_pNative, outCollection, outCollectionSize);
244 + Helper.ExceptionHelper.CheckLastError();
245 + for(int i=0;i<outCollectionSize;i++)
246 + {
247 + if(outCollection[i] == RootSystem.IntPtr.Zero)
248 + {
249 + continue;
250 + }
251 +
252 + var obj = Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.AudioBeamFrame>(outCollection[i], n => new Windows.Kinect.AudioBeamFrame(n));
253 +
254 + managedCollection[i] = obj;
255 + }
256 + return managedCollection;
257 + }
258 +
259 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
260 + private static extern void Windows_Kinect_AudioBeamFrameReader_Dispose(RootSystem.IntPtr pNative);
261 + public void Dispose()
262 + {
263 + if (_pNative == RootSystem.IntPtr.Zero)
264 + {
265 + return;
266 + }
267 +
268 + Dispose(true);
269 + RootSystem.GC.SuppressFinalize(this);
270 + }
271 +
272 + private void __EventCleanup()
273 + {
274 + {
275 + Windows_Kinect_AudioBeamFrameArrivedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
276 + var callbackList = Windows_Kinect_AudioBeamFrameArrivedEventArgs_Delegate_callbacks[_pNative];
277 + lock (callbackList)
278 + {
279 + if (callbackList.Count > 0)
280 + {
281 + callbackList.Clear();
282 + if (_pNative != RootSystem.IntPtr.Zero)
283 + {
284 + Windows_Kinect_AudioBeamFrameReader_add_FrameArrived(_pNative, Windows_Kinect_AudioBeamFrameArrivedEventArgs_Delegate_Handler, true);
285 + }
286 + _Windows_Kinect_AudioBeamFrameArrivedEventArgs_Delegate_Handle.Free();
287 + }
288 + }
289 + }
290 + {
291 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
292 + var callbackList = Windows_Data_PropertyChangedEventArgs_Delegate_callbacks[_pNative];
293 + lock (callbackList)
294 + {
295 + if (callbackList.Count > 0)
296 + {
297 + callbackList.Clear();
298 + if (_pNative != RootSystem.IntPtr.Zero)
299 + {
300 + Windows_Kinect_AudioBeamFrameReader_add_PropertyChanged(_pNative, Windows_Data_PropertyChangedEventArgs_Delegate_Handler, true);
301 + }
302 + _Windows_Data_PropertyChangedEventArgs_Delegate_Handle.Free();
303 + }
304 + }
305 + }
306 + }
307 + }
308 +
309 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.AudioBeamFrameReference
8 + //
9 + public sealed partial class AudioBeamFrameReference : Helper.INativeWrapper
10 +
11 + {
12 + internal RootSystem.IntPtr _pNative;
13 + RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
14 +
15 + // Constructors and Finalizers
16 + internal AudioBeamFrameReference(RootSystem.IntPtr pNative)
17 + {
18 + _pNative = pNative;
19 + Windows_Kinect_AudioBeamFrameReference_AddRefObject(ref _pNative);
20 + }
21 +
22 + ~AudioBeamFrameReference()
23 + {
24 + Dispose(false);
25 + }
26 +
27 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
28 + private static extern void Windows_Kinect_AudioBeamFrameReference_ReleaseObject(ref RootSystem.IntPtr pNative);
29 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
30 + private static extern void Windows_Kinect_AudioBeamFrameReference_AddRefObject(ref RootSystem.IntPtr pNative);
31 + private void Dispose(bool disposing)
32 + {
33 + if (_pNative == RootSystem.IntPtr.Zero)
34 + {
35 + return;
36 + }
37 +
38 + __EventCleanup();
39 +
40 + Helper.NativeObjectCache.RemoveObject<AudioBeamFrameReference>(_pNative);
41 + Windows_Kinect_AudioBeamFrameReference_ReleaseObject(ref _pNative);
42 +
43 + _pNative = RootSystem.IntPtr.Zero;
44 + }
45 +
46 +
47 + // Public Properties
48 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
49 + private static extern long Windows_Kinect_AudioBeamFrameReference_get_RelativeTime(RootSystem.IntPtr pNative);
50 + public RootSystem.TimeSpan RelativeTime
51 + {
52 + get
53 + {
54 + if (_pNative == RootSystem.IntPtr.Zero)
55 + {
56 + throw new RootSystem.ObjectDisposedException("AudioBeamFrameReference");
57 + }
58 +
59 + return RootSystem.TimeSpan.FromMilliseconds(Windows_Kinect_AudioBeamFrameReference_get_RelativeTime(_pNative));
60 + }
61 + }
62 +
63 +
64 + // Public Methods
65 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
66 + private static extern int Windows_Kinect_AudioBeamFrameReference_AcquireBeamFrames_Length(RootSystem.IntPtr pNative);
67 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
68 + private static extern int Windows_Kinect_AudioBeamFrameReference_AcquireBeamFrames(RootSystem.IntPtr pNative, [RootSystem.Runtime.InteropServices.Out] RootSystem.IntPtr[] outCollection, int outCollectionSize);
69 + public RootSystem.Collections.Generic.IList<Windows.Kinect.AudioBeamFrame> AcquireBeamFrames()
70 + {
71 + if (_pNative == RootSystem.IntPtr.Zero)
72 + {
73 + throw new RootSystem.ObjectDisposedException("AudioBeamFrameReference");
74 + }
75 +
76 + int outCollectionSize = Windows_Kinect_AudioBeamFrameReference_AcquireBeamFrames_Length(_pNative);
77 + var outCollection = new RootSystem.IntPtr[outCollectionSize];
78 + var managedCollection = new Windows.Kinect.AudioBeamFrame[outCollectionSize];
79 +
80 + outCollectionSize = Windows_Kinect_AudioBeamFrameReference_AcquireBeamFrames(_pNative, outCollection, outCollectionSize);
81 + Helper.ExceptionHelper.CheckLastError();
82 + for(int i=0;i<outCollectionSize;i++)
83 + {
84 + if(outCollection[i] == RootSystem.IntPtr.Zero)
85 + {
86 + continue;
87 + }
88 +
89 + var obj = Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.AudioBeamFrame>(outCollection[i], n => new Windows.Kinect.AudioBeamFrame(n));
90 +
91 + managedCollection[i] = obj;
92 + }
93 + return managedCollection;
94 + }
95 +
96 + private void __EventCleanup()
97 + {
98 + }
99 + }
100 +
101 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.AudioBeamMode
8 + //
9 + public enum AudioBeamMode : int
10 + {
11 + Automatic =0,
12 + Manual =1,
13 + }
14 +
15 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.AudioBeamSubFrame
8 + //
9 + public sealed partial class AudioBeamSubFrame : RootSystem.IDisposable, Helper.INativeWrapper
10 +
11 + {
12 + internal RootSystem.IntPtr _pNative;
13 + RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
14 +
15 + // Constructors and Finalizers
16 + internal AudioBeamSubFrame(RootSystem.IntPtr pNative)
17 + {
18 + _pNative = pNative;
19 + Windows_Kinect_AudioBeamSubFrame_AddRefObject(ref _pNative);
20 + }
21 +
22 + ~AudioBeamSubFrame()
23 + {
24 + Dispose(false);
25 + }
26 +
27 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
28 + private static extern void Windows_Kinect_AudioBeamSubFrame_ReleaseObject(ref RootSystem.IntPtr pNative);
29 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
30 + private static extern void Windows_Kinect_AudioBeamSubFrame_AddRefObject(ref RootSystem.IntPtr pNative);
31 + private void Dispose(bool disposing)
32 + {
33 + if (_pNative == RootSystem.IntPtr.Zero)
34 + {
35 + return;
36 + }
37 +
38 + __EventCleanup();
39 +
40 + Helper.NativeObjectCache.RemoveObject<AudioBeamSubFrame>(_pNative);
41 +
42 + if (disposing)
43 + {
44 + Windows_Kinect_AudioBeamSubFrame_Dispose(_pNative);
45 + }
46 + Windows_Kinect_AudioBeamSubFrame_ReleaseObject(ref _pNative);
47 +
48 + _pNative = RootSystem.IntPtr.Zero;
49 + }
50 +
51 +
52 + // Public Properties
53 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
54 + private static extern Windows.Kinect.AudioBeamMode Windows_Kinect_AudioBeamSubFrame_get_AudioBeamMode(RootSystem.IntPtr pNative);
55 + public Windows.Kinect.AudioBeamMode AudioBeamMode
56 + {
57 + get
58 + {
59 + if (_pNative == RootSystem.IntPtr.Zero)
60 + {
61 + throw new RootSystem.ObjectDisposedException("AudioBeamSubFrame");
62 + }
63 +
64 + return Windows_Kinect_AudioBeamSubFrame_get_AudioBeamMode(_pNative);
65 + }
66 + }
67 +
68 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
69 + private static extern int Windows_Kinect_AudioBeamSubFrame_get_AudioBodyCorrelations(RootSystem.IntPtr pNative, [RootSystem.Runtime.InteropServices.Out] RootSystem.IntPtr[] outCollection, int outCollectionSize);
70 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
71 + private static extern int Windows_Kinect_AudioBeamSubFrame_get_AudioBodyCorrelations_Length(RootSystem.IntPtr pNative);
72 + public RootSystem.Collections.Generic.IList<Windows.Kinect.AudioBodyCorrelation> AudioBodyCorrelations
73 + {
74 + get
75 + {
76 + if (_pNative == RootSystem.IntPtr.Zero)
77 + {
78 + throw new RootSystem.ObjectDisposedException("AudioBeamSubFrame");
79 + }
80 +
81 + int outCollectionSize = Windows_Kinect_AudioBeamSubFrame_get_AudioBodyCorrelations_Length(_pNative);
82 + var outCollection = new RootSystem.IntPtr[outCollectionSize];
83 + var managedCollection = new Windows.Kinect.AudioBodyCorrelation[outCollectionSize];
84 +
85 + outCollectionSize = Windows_Kinect_AudioBeamSubFrame_get_AudioBodyCorrelations(_pNative, outCollection, outCollectionSize);
86 + Helper.ExceptionHelper.CheckLastError();
87 + for(int i=0;i<outCollectionSize;i++)
88 + {
89 + if(outCollection[i] == RootSystem.IntPtr.Zero)
90 + {
91 + continue;
92 + }
93 +
94 + var obj = Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.AudioBodyCorrelation>(outCollection[i], n => new Windows.Kinect.AudioBodyCorrelation(n));
95 +
96 + managedCollection[i] = obj;
97 + }
98 + return managedCollection;
99 + }
100 + }
101 +
102 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
103 + private static extern float Windows_Kinect_AudioBeamSubFrame_get_BeamAngle(RootSystem.IntPtr pNative);
104 + public float BeamAngle
105 + {
106 + get
107 + {
108 + if (_pNative == RootSystem.IntPtr.Zero)
109 + {
110 + throw new RootSystem.ObjectDisposedException("AudioBeamSubFrame");
111 + }
112 +
113 + return Windows_Kinect_AudioBeamSubFrame_get_BeamAngle(_pNative);
114 + }
115 + }
116 +
117 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
118 + private static extern float Windows_Kinect_AudioBeamSubFrame_get_BeamAngleConfidence(RootSystem.IntPtr pNative);
119 + public float BeamAngleConfidence
120 + {
121 + get
122 + {
123 + if (_pNative == RootSystem.IntPtr.Zero)
124 + {
125 + throw new RootSystem.ObjectDisposedException("AudioBeamSubFrame");
126 + }
127 +
128 + return Windows_Kinect_AudioBeamSubFrame_get_BeamAngleConfidence(_pNative);
129 + }
130 + }
131 +
132 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
133 + private static extern long Windows_Kinect_AudioBeamSubFrame_get_Duration(RootSystem.IntPtr pNative);
134 + public RootSystem.TimeSpan Duration
135 + {
136 + get
137 + {
138 + if (_pNative == RootSystem.IntPtr.Zero)
139 + {
140 + throw new RootSystem.ObjectDisposedException("AudioBeamSubFrame");
141 + }
142 +
143 + return RootSystem.TimeSpan.FromMilliseconds(Windows_Kinect_AudioBeamSubFrame_get_Duration(_pNative));
144 + }
145 + }
146 +
147 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
148 + private static extern uint Windows_Kinect_AudioBeamSubFrame_get_FrameLengthInBytes(RootSystem.IntPtr pNative);
149 + public uint FrameLengthInBytes
150 + {
151 + get
152 + {
153 + if (_pNative == RootSystem.IntPtr.Zero)
154 + {
155 + throw new RootSystem.ObjectDisposedException("AudioBeamSubFrame");
156 + }
157 +
158 + return Windows_Kinect_AudioBeamSubFrame_get_FrameLengthInBytes(_pNative);
159 + }
160 + }
161 +
162 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
163 + private static extern long Windows_Kinect_AudioBeamSubFrame_get_RelativeTime(RootSystem.IntPtr pNative);
164 + public RootSystem.TimeSpan RelativeTime
165 + {
166 + get
167 + {
168 + if (_pNative == RootSystem.IntPtr.Zero)
169 + {
170 + throw new RootSystem.ObjectDisposedException("AudioBeamSubFrame");
171 + }
172 +
173 + return RootSystem.TimeSpan.FromMilliseconds(Windows_Kinect_AudioBeamSubFrame_get_RelativeTime(_pNative));
174 + }
175 + }
176 +
177 +
178 + // Public Methods
179 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
180 + private static extern void Windows_Kinect_AudioBeamSubFrame_CopyFrameDataToArray(RootSystem.IntPtr pNative, RootSystem.IntPtr frameData, int frameDataSize);
181 + public void CopyFrameDataToArray(byte[] frameData)
182 + {
183 + if (_pNative == RootSystem.IntPtr.Zero)
184 + {
185 + throw new RootSystem.ObjectDisposedException("AudioBeamSubFrame");
186 + }
187 +
188 + var frameDataSmartGCHandle = new Helper.SmartGCHandle(RootSystem.Runtime.InteropServices.GCHandle.Alloc(frameData, RootSystem.Runtime.InteropServices.GCHandleType.Pinned));
189 + var _frameData = frameDataSmartGCHandle.AddrOfPinnedObject();
190 + Windows_Kinect_AudioBeamSubFrame_CopyFrameDataToArray(_pNative, _frameData, frameData.Length);
191 + Helper.ExceptionHelper.CheckLastError();
192 + }
193 +
194 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
195 + private static extern void Windows_Kinect_AudioBeamSubFrame_Dispose(RootSystem.IntPtr pNative);
196 + public void Dispose()
197 + {
198 + if (_pNative == RootSystem.IntPtr.Zero)
199 + {
200 + return;
201 + }
202 +
203 + Dispose(true);
204 + RootSystem.GC.SuppressFinalize(this);
205 + }
206 +
207 + private void __EventCleanup()
208 + {
209 + }
210 + }
211 +
212 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.AudioBodyCorrelation
8 + //
9 + public sealed partial class AudioBodyCorrelation : Helper.INativeWrapper
10 +
11 + {
12 + internal RootSystem.IntPtr _pNative;
13 + RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
14 +
15 + // Constructors and Finalizers
16 + internal AudioBodyCorrelation(RootSystem.IntPtr pNative)
17 + {
18 + _pNative = pNative;
19 + Windows_Kinect_AudioBodyCorrelation_AddRefObject(ref _pNative);
20 + }
21 +
22 + ~AudioBodyCorrelation()
23 + {
24 + Dispose(false);
25 + }
26 +
27 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
28 + private static extern void Windows_Kinect_AudioBodyCorrelation_ReleaseObject(ref RootSystem.IntPtr pNative);
29 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
30 + private static extern void Windows_Kinect_AudioBodyCorrelation_AddRefObject(ref RootSystem.IntPtr pNative);
31 + private void Dispose(bool disposing)
32 + {
33 + if (_pNative == RootSystem.IntPtr.Zero)
34 + {
35 + return;
36 + }
37 +
38 + __EventCleanup();
39 +
40 + Helper.NativeObjectCache.RemoveObject<AudioBodyCorrelation>(_pNative);
41 + Windows_Kinect_AudioBodyCorrelation_ReleaseObject(ref _pNative);
42 +
43 + _pNative = RootSystem.IntPtr.Zero;
44 + }
45 +
46 +
47 + // Public Properties
48 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
49 + private static extern ulong Windows_Kinect_AudioBodyCorrelation_get_BodyTrackingId(RootSystem.IntPtr pNative);
50 + public ulong BodyTrackingId
51 + {
52 + get
53 + {
54 + if (_pNative == RootSystem.IntPtr.Zero)
55 + {
56 + throw new RootSystem.ObjectDisposedException("AudioBodyCorrelation");
57 + }
58 +
59 + return Windows_Kinect_AudioBodyCorrelation_get_BodyTrackingId(_pNative);
60 + }
61 + }
62 +
63 + private void __EventCleanup()
64 + {
65 + }
66 + }
67 +
68 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.AudioSource
8 + //
9 + public sealed partial class AudioSource : Helper.INativeWrapper
10 +
11 + {
12 + internal RootSystem.IntPtr _pNative;
13 + RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
14 +
15 + // Constructors and Finalizers
16 + internal AudioSource(RootSystem.IntPtr pNative)
17 + {
18 + _pNative = pNative;
19 + Windows_Kinect_AudioSource_AddRefObject(ref _pNative);
20 + }
21 +
22 + ~AudioSource()
23 + {
24 + Dispose(false);
25 + }
26 +
27 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
28 + private static extern void Windows_Kinect_AudioSource_ReleaseObject(ref RootSystem.IntPtr pNative);
29 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
30 + private static extern void Windows_Kinect_AudioSource_AddRefObject(ref RootSystem.IntPtr pNative);
31 + private void Dispose(bool disposing)
32 + {
33 + if (_pNative == RootSystem.IntPtr.Zero)
34 + {
35 + return;
36 + }
37 +
38 + __EventCleanup();
39 +
40 + Helper.NativeObjectCache.RemoveObject<AudioSource>(_pNative);
41 + Windows_Kinect_AudioSource_ReleaseObject(ref _pNative);
42 +
43 + _pNative = RootSystem.IntPtr.Zero;
44 + }
45 +
46 +
47 + // Public Properties
48 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
49 + private static extern int Windows_Kinect_AudioSource_get_AudioBeams(RootSystem.IntPtr pNative, [RootSystem.Runtime.InteropServices.Out] RootSystem.IntPtr[] outCollection, int outCollectionSize);
50 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
51 + private static extern int Windows_Kinect_AudioSource_get_AudioBeams_Length(RootSystem.IntPtr pNative);
52 + public RootSystem.Collections.Generic.IList<Windows.Kinect.AudioBeam> AudioBeams
53 + {
54 + get
55 + {
56 + if (_pNative == RootSystem.IntPtr.Zero)
57 + {
58 + throw new RootSystem.ObjectDisposedException("AudioSource");
59 + }
60 +
61 + int outCollectionSize = Windows_Kinect_AudioSource_get_AudioBeams_Length(_pNative);
62 + var outCollection = new RootSystem.IntPtr[outCollectionSize];
63 + var managedCollection = new Windows.Kinect.AudioBeam[outCollectionSize];
64 +
65 + outCollectionSize = Windows_Kinect_AudioSource_get_AudioBeams(_pNative, outCollection, outCollectionSize);
66 + Helper.ExceptionHelper.CheckLastError();
67 + for(int i=0;i<outCollectionSize;i++)
68 + {
69 + if(outCollection[i] == RootSystem.IntPtr.Zero)
70 + {
71 + continue;
72 + }
73 +
74 + var obj = Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.AudioBeam>(outCollection[i], n => new Windows.Kinect.AudioBeam(n));
75 +
76 + managedCollection[i] = obj;
77 + }
78 + return managedCollection;
79 + }
80 + }
81 +
82 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
83 + private static extern bool Windows_Kinect_AudioSource_get_IsActive(RootSystem.IntPtr pNative);
84 + public bool IsActive
85 + {
86 + get
87 + {
88 + if (_pNative == RootSystem.IntPtr.Zero)
89 + {
90 + throw new RootSystem.ObjectDisposedException("AudioSource");
91 + }
92 +
93 + return Windows_Kinect_AudioSource_get_IsActive(_pNative);
94 + }
95 + }
96 +
97 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
98 + private static extern RootSystem.IntPtr Windows_Kinect_AudioSource_get_KinectSensor(RootSystem.IntPtr pNative);
99 + public Windows.Kinect.KinectSensor KinectSensor
100 + {
101 + get
102 + {
103 + if (_pNative == RootSystem.IntPtr.Zero)
104 + {
105 + throw new RootSystem.ObjectDisposedException("AudioSource");
106 + }
107 +
108 + RootSystem.IntPtr objectPointer = Windows_Kinect_AudioSource_get_KinectSensor(_pNative);
109 + Helper.ExceptionHelper.CheckLastError();
110 + if (objectPointer == RootSystem.IntPtr.Zero)
111 + {
112 + return null;
113 + }
114 +
115 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.KinectSensor>(objectPointer, n => new Windows.Kinect.KinectSensor(n));
116 + }
117 + }
118 +
119 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
120 + private static extern uint Windows_Kinect_AudioSource_get_MaxSubFrameCount(RootSystem.IntPtr pNative);
121 + public uint MaxSubFrameCount
122 + {
123 + get
124 + {
125 + if (_pNative == RootSystem.IntPtr.Zero)
126 + {
127 + throw new RootSystem.ObjectDisposedException("AudioSource");
128 + }
129 +
130 + return Windows_Kinect_AudioSource_get_MaxSubFrameCount(_pNative);
131 + }
132 + }
133 +
134 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
135 + private static extern long Windows_Kinect_AudioSource_get_SubFrameDuration(RootSystem.IntPtr pNative);
136 + public RootSystem.TimeSpan SubFrameDuration
137 + {
138 + get
139 + {
140 + if (_pNative == RootSystem.IntPtr.Zero)
141 + {
142 + throw new RootSystem.ObjectDisposedException("AudioSource");
143 + }
144 +
145 + return RootSystem.TimeSpan.FromMilliseconds(Windows_Kinect_AudioSource_get_SubFrameDuration(_pNative));
146 + }
147 + }
148 +
149 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
150 + private static extern uint Windows_Kinect_AudioSource_get_SubFrameLengthInBytes(RootSystem.IntPtr pNative);
151 + public uint SubFrameLengthInBytes
152 + {
153 + get
154 + {
155 + if (_pNative == RootSystem.IntPtr.Zero)
156 + {
157 + throw new RootSystem.ObjectDisposedException("AudioSource");
158 + }
159 +
160 + return Windows_Kinect_AudioSource_get_SubFrameLengthInBytes(_pNative);
161 + }
162 + }
163 +
164 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
165 + private static extern Windows.Kinect.KinectAudioCalibrationState Windows_Kinect_AudioSource_get_AudioCalibrationState(RootSystem.IntPtr pNative);
166 + public Windows.Kinect.KinectAudioCalibrationState AudioCalibrationState
167 + {
168 + get
169 + {
170 + if (_pNative == RootSystem.IntPtr.Zero)
171 + {
172 + throw new RootSystem.ObjectDisposedException("AudioSource");
173 + }
174 +
175 + return Windows_Kinect_AudioSource_get_AudioCalibrationState(_pNative);
176 + }
177 + }
178 +
179 +
180 + // Events
181 + private static RootSystem.Runtime.InteropServices.GCHandle _Windows_Kinect_FrameCapturedEventArgs_Delegate_Handle;
182 + [RootSystem.Runtime.InteropServices.UnmanagedFunctionPointer(RootSystem.Runtime.InteropServices.CallingConvention.Cdecl)]
183 + private delegate void _Windows_Kinect_FrameCapturedEventArgs_Delegate(RootSystem.IntPtr args, RootSystem.IntPtr pNative);
184 + private static Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Kinect.FrameCapturedEventArgs>>> Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks = new Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Kinect.FrameCapturedEventArgs>>>();
185 + [AOT.MonoPInvokeCallbackAttribute(typeof(_Windows_Kinect_FrameCapturedEventArgs_Delegate))]
186 + private static void Windows_Kinect_FrameCapturedEventArgs_Delegate_Handler(RootSystem.IntPtr result, RootSystem.IntPtr pNative)
187 + {
188 + List<RootSystem.EventHandler<Windows.Kinect.FrameCapturedEventArgs>> callbackList = null;
189 + Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks.TryGetValue(pNative, out callbackList);
190 + lock(callbackList)
191 + {
192 + var objThis = Helper.NativeObjectCache.GetObject<AudioSource>(pNative);
193 + var args = new Windows.Kinect.FrameCapturedEventArgs(result);
194 + foreach(var func in callbackList)
195 + {
196 + Helper.EventPump.Instance.Enqueue(() => { try { func(objThis, args); } catch { } });
197 + }
198 + }
199 + }
200 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
201 + private static extern void Windows_Kinect_AudioSource_add_FrameCaptured(RootSystem.IntPtr pNative, _Windows_Kinect_FrameCapturedEventArgs_Delegate eventCallback, bool unsubscribe);
202 + public event RootSystem.EventHandler<Windows.Kinect.FrameCapturedEventArgs> FrameCaptured
203 + {
204 + add
205 + {
206 + Helper.EventPump.EnsureInitialized();
207 +
208 + Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
209 + var callbackList = Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks[_pNative];
210 + lock (callbackList)
211 + {
212 + callbackList.Add(value);
213 + if(callbackList.Count == 1)
214 + {
215 + var del = new _Windows_Kinect_FrameCapturedEventArgs_Delegate(Windows_Kinect_FrameCapturedEventArgs_Delegate_Handler);
216 + _Windows_Kinect_FrameCapturedEventArgs_Delegate_Handle = RootSystem.Runtime.InteropServices.GCHandle.Alloc(del);
217 + Windows_Kinect_AudioSource_add_FrameCaptured(_pNative, del, false);
218 + }
219 + }
220 + }
221 + remove
222 + {
223 + if (_pNative == RootSystem.IntPtr.Zero)
224 + {
225 + return;
226 + }
227 +
228 + Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
229 + var callbackList = Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks[_pNative];
230 + lock (callbackList)
231 + {
232 + callbackList.Remove(value);
233 + if(callbackList.Count == 0)
234 + {
235 + Windows_Kinect_AudioSource_add_FrameCaptured(_pNative, Windows_Kinect_FrameCapturedEventArgs_Delegate_Handler, true);
236 + _Windows_Kinect_FrameCapturedEventArgs_Delegate_Handle.Free();
237 + }
238 + }
239 + }
240 + }
241 +
242 + private static RootSystem.Runtime.InteropServices.GCHandle _Windows_Data_PropertyChangedEventArgs_Delegate_Handle;
243 + [RootSystem.Runtime.InteropServices.UnmanagedFunctionPointer(RootSystem.Runtime.InteropServices.CallingConvention.Cdecl)]
244 + private delegate void _Windows_Data_PropertyChangedEventArgs_Delegate(RootSystem.IntPtr args, RootSystem.IntPtr pNative);
245 + private static Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs>>> Windows_Data_PropertyChangedEventArgs_Delegate_callbacks = new Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs>>>();
246 + [AOT.MonoPInvokeCallbackAttribute(typeof(_Windows_Data_PropertyChangedEventArgs_Delegate))]
247 + private static void Windows_Data_PropertyChangedEventArgs_Delegate_Handler(RootSystem.IntPtr result, RootSystem.IntPtr pNative)
248 + {
249 + List<RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs>> callbackList = null;
250 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryGetValue(pNative, out callbackList);
251 + lock(callbackList)
252 + {
253 + var objThis = Helper.NativeObjectCache.GetObject<AudioSource>(pNative);
254 + var args = new Windows.Data.PropertyChangedEventArgs(result);
255 + foreach(var func in callbackList)
256 + {
257 + Helper.EventPump.Instance.Enqueue(() => { try { func(objThis, args); } catch { } });
258 + }
259 + }
260 + }
261 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
262 + private static extern void Windows_Kinect_AudioSource_add_PropertyChanged(RootSystem.IntPtr pNative, _Windows_Data_PropertyChangedEventArgs_Delegate eventCallback, bool unsubscribe);
263 + public event RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs> PropertyChanged
264 + {
265 + add
266 + {
267 + Helper.EventPump.EnsureInitialized();
268 +
269 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
270 + var callbackList = Windows_Data_PropertyChangedEventArgs_Delegate_callbacks[_pNative];
271 + lock (callbackList)
272 + {
273 + callbackList.Add(value);
274 + if(callbackList.Count == 1)
275 + {
276 + var del = new _Windows_Data_PropertyChangedEventArgs_Delegate(Windows_Data_PropertyChangedEventArgs_Delegate_Handler);
277 + _Windows_Data_PropertyChangedEventArgs_Delegate_Handle = RootSystem.Runtime.InteropServices.GCHandle.Alloc(del);
278 + Windows_Kinect_AudioSource_add_PropertyChanged(_pNative, del, false);
279 + }
280 + }
281 + }
282 + remove
283 + {
284 + if (_pNative == RootSystem.IntPtr.Zero)
285 + {
286 + return;
287 + }
288 +
289 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
290 + var callbackList = Windows_Data_PropertyChangedEventArgs_Delegate_callbacks[_pNative];
291 + lock (callbackList)
292 + {
293 + callbackList.Remove(value);
294 + if(callbackList.Count == 0)
295 + {
296 + Windows_Kinect_AudioSource_add_PropertyChanged(_pNative, Windows_Data_PropertyChangedEventArgs_Delegate_Handler, true);
297 + _Windows_Data_PropertyChangedEventArgs_Delegate_Handle.Free();
298 + }
299 + }
300 + }
301 + }
302 +
303 +
304 + // Public Methods
305 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
306 + private static extern RootSystem.IntPtr Windows_Kinect_AudioSource_OpenReader(RootSystem.IntPtr pNative);
307 + public Windows.Kinect.AudioBeamFrameReader OpenReader()
308 + {
309 + if (_pNative == RootSystem.IntPtr.Zero)
310 + {
311 + throw new RootSystem.ObjectDisposedException("AudioSource");
312 + }
313 +
314 + RootSystem.IntPtr objectPointer = Windows_Kinect_AudioSource_OpenReader(_pNative);
315 + Helper.ExceptionHelper.CheckLastError();
316 + if (objectPointer == RootSystem.IntPtr.Zero)
317 + {
318 + return null;
319 + }
320 +
321 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.AudioBeamFrameReader>(objectPointer, n => new Windows.Kinect.AudioBeamFrameReader(n));
322 + }
323 +
324 + private void __EventCleanup()
325 + {
326 + {
327 + Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
328 + var callbackList = Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks[_pNative];
329 + lock (callbackList)
330 + {
331 + if (callbackList.Count > 0)
332 + {
333 + callbackList.Clear();
334 + if (_pNative != RootSystem.IntPtr.Zero)
335 + {
336 + Windows_Kinect_AudioSource_add_FrameCaptured(_pNative, Windows_Kinect_FrameCapturedEventArgs_Delegate_Handler, true);
337 + }
338 + _Windows_Kinect_FrameCapturedEventArgs_Delegate_Handle.Free();
339 + }
340 + }
341 + }
342 + {
343 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
344 + var callbackList = Windows_Data_PropertyChangedEventArgs_Delegate_callbacks[_pNative];
345 + lock (callbackList)
346 + {
347 + if (callbackList.Count > 0)
348 + {
349 + callbackList.Clear();
350 + if (_pNative != RootSystem.IntPtr.Zero)
351 + {
352 + Windows_Kinect_AudioSource_add_PropertyChanged(_pNative, Windows_Data_PropertyChangedEventArgs_Delegate_Handler, true);
353 + }
354 + _Windows_Data_PropertyChangedEventArgs_Delegate_Handle.Free();
355 + }
356 + }
357 + }
358 + }
359 + }
360 +
361 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.Body
8 + //
9 + public sealed partial class Body : Helper.INativeWrapper
10 +
11 + {
12 + internal RootSystem.IntPtr _pNative;
13 + RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
14 +
15 + // Constructors and Finalizers
16 + internal Body(RootSystem.IntPtr pNative)
17 + {
18 + _pNative = pNative;
19 + Windows_Kinect_Body_AddRefObject(ref _pNative);
20 + }
21 +
22 + ~Body()
23 + {
24 + Dispose(false);
25 + }
26 +
27 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
28 + private static extern void Windows_Kinect_Body_ReleaseObject(ref RootSystem.IntPtr pNative);
29 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
30 + private static extern void Windows_Kinect_Body_AddRefObject(ref RootSystem.IntPtr pNative);
31 + private void Dispose(bool disposing)
32 + {
33 + if (_pNative == RootSystem.IntPtr.Zero)
34 + {
35 + return;
36 + }
37 +
38 + __EventCleanup();
39 +
40 + Helper.NativeObjectCache.RemoveObject<Body>(_pNative);
41 + Windows_Kinect_Body_ReleaseObject(ref _pNative);
42 +
43 + _pNative = RootSystem.IntPtr.Zero;
44 + }
45 +
46 +
47 + // Public Properties
48 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
49 + private static extern int Windows_Kinect_Body_get_Activities(RootSystem.IntPtr pNative, [RootSystem.Runtime.InteropServices.Out] Windows.Kinect.Activity[] outKeys, [RootSystem.Runtime.InteropServices.Out] Windows.Kinect.DetectionResult[] outValues, int outCollectionSize);
50 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
51 + private static extern int Windows_Kinect_Body_get_Activities_Length(RootSystem.IntPtr pNative);
52 + public RootSystem.Collections.Generic.Dictionary<Windows.Kinect.Activity, Windows.Kinect.DetectionResult> Activities
53 + {
54 + get
55 + {
56 + if (_pNative == RootSystem.IntPtr.Zero)
57 + {
58 + throw new RootSystem.ObjectDisposedException("Body");
59 + }
60 +
61 + int outCollectionSize = Windows_Kinect_Body_get_Activities_Length(_pNative);
62 + var outKeys = new Windows.Kinect.Activity[outCollectionSize];
63 + var outValues = new Windows.Kinect.DetectionResult[outCollectionSize];
64 + var managedDictionary = new RootSystem.Collections.Generic.Dictionary<Windows.Kinect.Activity, Windows.Kinect.DetectionResult>();
65 +
66 + outCollectionSize = Windows_Kinect_Body_get_Activities(_pNative, outKeys, outValues, outCollectionSize);
67 + Helper.ExceptionHelper.CheckLastError();
68 + for(int i=0;i<outCollectionSize;i++)
69 + {
70 + managedDictionary.Add(outKeys[i], outValues[i]);
71 + }
72 + return managedDictionary;
73 + }
74 + }
75 +
76 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
77 + private static extern int Windows_Kinect_Body_get_Appearance(RootSystem.IntPtr pNative, [RootSystem.Runtime.InteropServices.Out] Windows.Kinect.Appearance[] outKeys, [RootSystem.Runtime.InteropServices.Out] Windows.Kinect.DetectionResult[] outValues, int outCollectionSize);
78 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
79 + private static extern int Windows_Kinect_Body_get_Appearance_Length(RootSystem.IntPtr pNative);
80 + public RootSystem.Collections.Generic.Dictionary<Windows.Kinect.Appearance, Windows.Kinect.DetectionResult> Appearance
81 + {
82 + get
83 + {
84 + if (_pNative == RootSystem.IntPtr.Zero)
85 + {
86 + throw new RootSystem.ObjectDisposedException("Body");
87 + }
88 +
89 + int outCollectionSize = Windows_Kinect_Body_get_Appearance_Length(_pNative);
90 + var outKeys = new Windows.Kinect.Appearance[outCollectionSize];
91 + var outValues = new Windows.Kinect.DetectionResult[outCollectionSize];
92 + var managedDictionary = new RootSystem.Collections.Generic.Dictionary<Windows.Kinect.Appearance, Windows.Kinect.DetectionResult>();
93 +
94 + outCollectionSize = Windows_Kinect_Body_get_Appearance(_pNative, outKeys, outValues, outCollectionSize);
95 + Helper.ExceptionHelper.CheckLastError();
96 + for(int i=0;i<outCollectionSize;i++)
97 + {
98 + managedDictionary.Add(outKeys[i], outValues[i]);
99 + }
100 + return managedDictionary;
101 + }
102 + }
103 +
104 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
105 + private static extern Windows.Kinect.FrameEdges Windows_Kinect_Body_get_ClippedEdges(RootSystem.IntPtr pNative);
106 + public Windows.Kinect.FrameEdges ClippedEdges
107 + {
108 + get
109 + {
110 + if (_pNative == RootSystem.IntPtr.Zero)
111 + {
112 + throw new RootSystem.ObjectDisposedException("Body");
113 + }
114 +
115 + return Windows_Kinect_Body_get_ClippedEdges(_pNative);
116 + }
117 + }
118 +
119 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
120 + private static extern Windows.Kinect.DetectionResult Windows_Kinect_Body_get_Engaged(RootSystem.IntPtr pNative);
121 + public Windows.Kinect.DetectionResult Engaged
122 + {
123 + get
124 + {
125 + if (_pNative == RootSystem.IntPtr.Zero)
126 + {
127 + throw new RootSystem.ObjectDisposedException("Body");
128 + }
129 +
130 + return Windows_Kinect_Body_get_Engaged(_pNative);
131 + }
132 + }
133 +
134 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
135 + private static extern int Windows_Kinect_Body_get_Expressions(RootSystem.IntPtr pNative, [RootSystem.Runtime.InteropServices.Out] Windows.Kinect.Expression[] outKeys, [RootSystem.Runtime.InteropServices.Out] Windows.Kinect.DetectionResult[] outValues, int outCollectionSize);
136 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
137 + private static extern int Windows_Kinect_Body_get_Expressions_Length(RootSystem.IntPtr pNative);
138 + public RootSystem.Collections.Generic.Dictionary<Windows.Kinect.Expression, Windows.Kinect.DetectionResult> Expressions
139 + {
140 + get
141 + {
142 + if (_pNative == RootSystem.IntPtr.Zero)
143 + {
144 + throw new RootSystem.ObjectDisposedException("Body");
145 + }
146 +
147 + int outCollectionSize = Windows_Kinect_Body_get_Expressions_Length(_pNative);
148 + var outKeys = new Windows.Kinect.Expression[outCollectionSize];
149 + var outValues = new Windows.Kinect.DetectionResult[outCollectionSize];
150 + var managedDictionary = new RootSystem.Collections.Generic.Dictionary<Windows.Kinect.Expression, Windows.Kinect.DetectionResult>();
151 +
152 + outCollectionSize = Windows_Kinect_Body_get_Expressions(_pNative, outKeys, outValues, outCollectionSize);
153 + Helper.ExceptionHelper.CheckLastError();
154 + for(int i=0;i<outCollectionSize;i++)
155 + {
156 + managedDictionary.Add(outKeys[i], outValues[i]);
157 + }
158 + return managedDictionary;
159 + }
160 + }
161 +
162 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
163 + private static extern Windows.Kinect.TrackingConfidence Windows_Kinect_Body_get_HandLeftConfidence(RootSystem.IntPtr pNative);
164 + public Windows.Kinect.TrackingConfidence HandLeftConfidence
165 + {
166 + get
167 + {
168 + if (_pNative == RootSystem.IntPtr.Zero)
169 + {
170 + throw new RootSystem.ObjectDisposedException("Body");
171 + }
172 +
173 + return Windows_Kinect_Body_get_HandLeftConfidence(_pNative);
174 + }
175 + }
176 +
177 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
178 + private static extern Windows.Kinect.HandState Windows_Kinect_Body_get_HandLeftState(RootSystem.IntPtr pNative);
179 + public Windows.Kinect.HandState HandLeftState
180 + {
181 + get
182 + {
183 + if (_pNative == RootSystem.IntPtr.Zero)
184 + {
185 + throw new RootSystem.ObjectDisposedException("Body");
186 + }
187 +
188 + return Windows_Kinect_Body_get_HandLeftState(_pNative);
189 + }
190 + }
191 +
192 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
193 + private static extern Windows.Kinect.TrackingConfidence Windows_Kinect_Body_get_HandRightConfidence(RootSystem.IntPtr pNative);
194 + public Windows.Kinect.TrackingConfidence HandRightConfidence
195 + {
196 + get
197 + {
198 + if (_pNative == RootSystem.IntPtr.Zero)
199 + {
200 + throw new RootSystem.ObjectDisposedException("Body");
201 + }
202 +
203 + return Windows_Kinect_Body_get_HandRightConfidence(_pNative);
204 + }
205 + }
206 +
207 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
208 + private static extern Windows.Kinect.HandState Windows_Kinect_Body_get_HandRightState(RootSystem.IntPtr pNative);
209 + public Windows.Kinect.HandState HandRightState
210 + {
211 + get
212 + {
213 + if (_pNative == RootSystem.IntPtr.Zero)
214 + {
215 + throw new RootSystem.ObjectDisposedException("Body");
216 + }
217 +
218 + return Windows_Kinect_Body_get_HandRightState(_pNative);
219 + }
220 + }
221 +
222 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
223 + private static extern bool Windows_Kinect_Body_get_IsRestricted(RootSystem.IntPtr pNative);
224 + public bool IsRestricted
225 + {
226 + get
227 + {
228 + if (_pNative == RootSystem.IntPtr.Zero)
229 + {
230 + throw new RootSystem.ObjectDisposedException("Body");
231 + }
232 +
233 + return Windows_Kinect_Body_get_IsRestricted(_pNative);
234 + }
235 + }
236 +
237 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
238 + private static extern bool Windows_Kinect_Body_get_IsTracked(RootSystem.IntPtr pNative);
239 + public bool IsTracked
240 + {
241 + get
242 + {
243 + if (_pNative == RootSystem.IntPtr.Zero)
244 + {
245 + throw new RootSystem.ObjectDisposedException("Body");
246 + }
247 +
248 + return Windows_Kinect_Body_get_IsTracked(_pNative);
249 + }
250 + }
251 +
252 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
253 + private static extern int Windows_Kinect_Body_get_JointOrientations(RootSystem.IntPtr pNative, [RootSystem.Runtime.InteropServices.Out] Windows.Kinect.JointType[] outKeys, [RootSystem.Runtime.InteropServices.Out] Windows.Kinect.JointOrientation[] outValues, int outCollectionSize);
254 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
255 + private static extern int Windows_Kinect_Body_get_JointOrientations_Length(RootSystem.IntPtr pNative);
256 + public RootSystem.Collections.Generic.Dictionary<Windows.Kinect.JointType, Windows.Kinect.JointOrientation> JointOrientations
257 + {
258 + get
259 + {
260 + if (_pNative == RootSystem.IntPtr.Zero)
261 + {
262 + throw new RootSystem.ObjectDisposedException("Body");
263 + }
264 +
265 + int outCollectionSize = Windows_Kinect_Body_get_JointOrientations_Length(_pNative);
266 + var outKeys = new Windows.Kinect.JointType[outCollectionSize];
267 + var outValues = new Windows.Kinect.JointOrientation[outCollectionSize];
268 + var managedDictionary = new RootSystem.Collections.Generic.Dictionary<Windows.Kinect.JointType, Windows.Kinect.JointOrientation>();
269 +
270 + outCollectionSize = Windows_Kinect_Body_get_JointOrientations(_pNative, outKeys, outValues, outCollectionSize);
271 + Helper.ExceptionHelper.CheckLastError();
272 + for(int i=0;i<outCollectionSize;i++)
273 + {
274 + managedDictionary.Add(outKeys[i], outValues[i]);
275 + }
276 + return managedDictionary;
277 + }
278 + }
279 +
280 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
281 + private static extern int Windows_Kinect_Body_get_Joints(RootSystem.IntPtr pNative, [RootSystem.Runtime.InteropServices.Out] Windows.Kinect.JointType[] outKeys, [RootSystem.Runtime.InteropServices.Out] Windows.Kinect.Joint[] outValues, int outCollectionSize);
282 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
283 + private static extern int Windows_Kinect_Body_get_Joints_Length(RootSystem.IntPtr pNative);
284 + public RootSystem.Collections.Generic.Dictionary<Windows.Kinect.JointType, Windows.Kinect.Joint> Joints
285 + {
286 + get
287 + {
288 + if (_pNative == RootSystem.IntPtr.Zero)
289 + {
290 + throw new RootSystem.ObjectDisposedException("Body");
291 + }
292 +
293 + int outCollectionSize = Windows_Kinect_Body_get_Joints_Length(_pNative);
294 + var outKeys = new Windows.Kinect.JointType[outCollectionSize];
295 + var outValues = new Windows.Kinect.Joint[outCollectionSize];
296 + var managedDictionary = new RootSystem.Collections.Generic.Dictionary<Windows.Kinect.JointType, Windows.Kinect.Joint>();
297 +
298 + outCollectionSize = Windows_Kinect_Body_get_Joints(_pNative, outKeys, outValues, outCollectionSize);
299 + Helper.ExceptionHelper.CheckLastError();
300 + for(int i=0;i<outCollectionSize;i++)
301 + {
302 + managedDictionary.Add(outKeys[i], outValues[i]);
303 + }
304 + return managedDictionary;
305 + }
306 + }
307 +
308 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
309 + private static extern Windows.Kinect.TrackingState Windows_Kinect_Body_get_LeanTrackingState(RootSystem.IntPtr pNative);
310 + public Windows.Kinect.TrackingState LeanTrackingState
311 + {
312 + get
313 + {
314 + if (_pNative == RootSystem.IntPtr.Zero)
315 + {
316 + throw new RootSystem.ObjectDisposedException("Body");
317 + }
318 +
319 + return Windows_Kinect_Body_get_LeanTrackingState(_pNative);
320 + }
321 + }
322 +
323 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
324 + private static extern ulong Windows_Kinect_Body_get_TrackingId(RootSystem.IntPtr pNative);
325 + public ulong TrackingId
326 + {
327 + get
328 + {
329 + if (_pNative == RootSystem.IntPtr.Zero)
330 + {
331 + throw new RootSystem.ObjectDisposedException("Body");
332 + }
333 +
334 + return Windows_Kinect_Body_get_TrackingId(_pNative);
335 + }
336 + }
337 +
338 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
339 + private static extern int Windows_Kinect_Body_get_JointCount();
340 + public static int JointCount
341 + {
342 + get
343 + {
344 + return Windows_Kinect_Body_get_JointCount();
345 + }
346 + }
347 +
348 +
349 + // Public Methods
350 + private void __EventCleanup()
351 + {
352 + }
353 + }
354 +
355 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.BodyFrame
8 + //
9 + public sealed partial class BodyFrame : RootSystem.IDisposable, Helper.INativeWrapper
10 +
11 + {
12 + internal RootSystem.IntPtr _pNative;
13 + RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
14 +
15 + // Constructors and Finalizers
16 + internal BodyFrame(RootSystem.IntPtr pNative)
17 + {
18 + _pNative = pNative;
19 + Windows_Kinect_BodyFrame_AddRefObject(ref _pNative);
20 + }
21 +
22 + ~BodyFrame()
23 + {
24 + Dispose(false);
25 + }
26 +
27 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
28 + private static extern void Windows_Kinect_BodyFrame_ReleaseObject(ref RootSystem.IntPtr pNative);
29 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
30 + private static extern void Windows_Kinect_BodyFrame_AddRefObject(ref RootSystem.IntPtr pNative);
31 + private void Dispose(bool disposing)
32 + {
33 + if (_pNative == RootSystem.IntPtr.Zero)
34 + {
35 + return;
36 + }
37 +
38 + __EventCleanup();
39 +
40 + Helper.NativeObjectCache.RemoveObject<BodyFrame>(_pNative);
41 +
42 + if (disposing)
43 + {
44 + Windows_Kinect_BodyFrame_Dispose(_pNative);
45 + }
46 + Windows_Kinect_BodyFrame_ReleaseObject(ref _pNative);
47 +
48 + _pNative = RootSystem.IntPtr.Zero;
49 + }
50 +
51 +
52 + // Public Properties
53 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
54 + private static extern int Windows_Kinect_BodyFrame_get_BodyCount(RootSystem.IntPtr pNative);
55 + public int BodyCount
56 + {
57 + get
58 + {
59 + if (_pNative == RootSystem.IntPtr.Zero)
60 + {
61 + throw new RootSystem.ObjectDisposedException("BodyFrame");
62 + }
63 +
64 + return Windows_Kinect_BodyFrame_get_BodyCount(_pNative);
65 + }
66 + }
67 +
68 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
69 + private static extern RootSystem.IntPtr Windows_Kinect_BodyFrame_get_BodyFrameSource(RootSystem.IntPtr pNative);
70 + public Windows.Kinect.BodyFrameSource BodyFrameSource
71 + {
72 + get
73 + {
74 + if (_pNative == RootSystem.IntPtr.Zero)
75 + {
76 + throw new RootSystem.ObjectDisposedException("BodyFrame");
77 + }
78 +
79 + RootSystem.IntPtr objectPointer = Windows_Kinect_BodyFrame_get_BodyFrameSource(_pNative);
80 + Helper.ExceptionHelper.CheckLastError();
81 + if (objectPointer == RootSystem.IntPtr.Zero)
82 + {
83 + return null;
84 + }
85 +
86 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.BodyFrameSource>(objectPointer, n => new Windows.Kinect.BodyFrameSource(n));
87 + }
88 + }
89 +
90 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
91 + private static extern RootSystem.IntPtr Windows_Kinect_BodyFrame_get_FloorClipPlane(RootSystem.IntPtr pNative);
92 + public Windows.Kinect.Vector4 FloorClipPlane
93 + {
94 + get
95 + {
96 + if (_pNative == RootSystem.IntPtr.Zero)
97 + {
98 + throw new RootSystem.ObjectDisposedException("BodyFrame");
99 + }
100 +
101 + var objectPointer = Windows_Kinect_BodyFrame_get_FloorClipPlane(_pNative);
102 + Helper.ExceptionHelper.CheckLastError();
103 + var obj = (Windows.Kinect.Vector4)RootSystem.Runtime.InteropServices.Marshal.PtrToStructure(objectPointer, typeof(Windows.Kinect.Vector4));
104 + Windows.Kinect.KinectUnityAddinUtils.FreeMemory(objectPointer);
105 + return obj;
106 + }
107 + }
108 +
109 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
110 + private static extern long Windows_Kinect_BodyFrame_get_RelativeTime(RootSystem.IntPtr pNative);
111 + public RootSystem.TimeSpan RelativeTime
112 + {
113 + get
114 + {
115 + if (_pNative == RootSystem.IntPtr.Zero)
116 + {
117 + throw new RootSystem.ObjectDisposedException("BodyFrame");
118 + }
119 +
120 + return RootSystem.TimeSpan.FromMilliseconds(Windows_Kinect_BodyFrame_get_RelativeTime(_pNative));
121 + }
122 + }
123 +
124 +
125 + // Public Methods
126 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
127 + private static extern void Windows_Kinect_BodyFrame_Dispose(RootSystem.IntPtr pNative);
128 + public void Dispose()
129 + {
130 + if (_pNative == RootSystem.IntPtr.Zero)
131 + {
132 + return;
133 + }
134 +
135 + Dispose(true);
136 + RootSystem.GC.SuppressFinalize(this);
137 + }
138 +
139 + private void __EventCleanup()
140 + {
141 + }
142 + }
143 +
144 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.BodyFrameArrivedEventArgs
8 + //
9 + public sealed partial class BodyFrameArrivedEventArgs : RootSystem.EventArgs, Helper.INativeWrapper
10 +
11 + {
12 + internal RootSystem.IntPtr _pNative;
13 + RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
14 +
15 + // Constructors and Finalizers
16 + internal BodyFrameArrivedEventArgs(RootSystem.IntPtr pNative)
17 + {
18 + _pNative = pNative;
19 + Windows_Kinect_BodyFrameArrivedEventArgs_AddRefObject(ref _pNative);
20 + }
21 +
22 + ~BodyFrameArrivedEventArgs()
23 + {
24 + Dispose(false);
25 + }
26 +
27 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
28 + private static extern void Windows_Kinect_BodyFrameArrivedEventArgs_ReleaseObject(ref RootSystem.IntPtr pNative);
29 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
30 + private static extern void Windows_Kinect_BodyFrameArrivedEventArgs_AddRefObject(ref RootSystem.IntPtr pNative);
31 + private void Dispose(bool disposing)
32 + {
33 + if (_pNative == RootSystem.IntPtr.Zero)
34 + {
35 + return;
36 + }
37 +
38 + __EventCleanup();
39 +
40 + Helper.NativeObjectCache.RemoveObject<BodyFrameArrivedEventArgs>(_pNative);
41 + Windows_Kinect_BodyFrameArrivedEventArgs_ReleaseObject(ref _pNative);
42 +
43 + _pNative = RootSystem.IntPtr.Zero;
44 + }
45 +
46 +
47 + // Public Properties
48 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
49 + private static extern RootSystem.IntPtr Windows_Kinect_BodyFrameArrivedEventArgs_get_FrameReference(RootSystem.IntPtr pNative);
50 + public Windows.Kinect.BodyFrameReference FrameReference
51 + {
52 + get
53 + {
54 + if (_pNative == RootSystem.IntPtr.Zero)
55 + {
56 + throw new RootSystem.ObjectDisposedException("BodyFrameArrivedEventArgs");
57 + }
58 +
59 + RootSystem.IntPtr objectPointer = Windows_Kinect_BodyFrameArrivedEventArgs_get_FrameReference(_pNative);
60 + Helper.ExceptionHelper.CheckLastError();
61 + if (objectPointer == RootSystem.IntPtr.Zero)
62 + {
63 + return null;
64 + }
65 +
66 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.BodyFrameReference>(objectPointer, n => new Windows.Kinect.BodyFrameReference(n));
67 + }
68 + }
69 +
70 + private void __EventCleanup()
71 + {
72 + }
73 + }
74 +
75 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.BodyFrameReader
8 + //
9 + public sealed partial class BodyFrameReader : RootSystem.IDisposable, Helper.INativeWrapper
10 +
11 + {
12 + internal RootSystem.IntPtr _pNative;
13 + RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
14 +
15 + // Constructors and Finalizers
16 + internal BodyFrameReader(RootSystem.IntPtr pNative)
17 + {
18 + _pNative = pNative;
19 + Windows_Kinect_BodyFrameReader_AddRefObject(ref _pNative);
20 + }
21 +
22 + ~BodyFrameReader()
23 + {
24 + Dispose(false);
25 + }
26 +
27 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
28 + private static extern void Windows_Kinect_BodyFrameReader_ReleaseObject(ref RootSystem.IntPtr pNative);
29 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
30 + private static extern void Windows_Kinect_BodyFrameReader_AddRefObject(ref RootSystem.IntPtr pNative);
31 + private void Dispose(bool disposing)
32 + {
33 + if (_pNative == RootSystem.IntPtr.Zero)
34 + {
35 + return;
36 + }
37 +
38 + __EventCleanup();
39 +
40 + Helper.NativeObjectCache.RemoveObject<BodyFrameReader>(_pNative);
41 +
42 + if (disposing)
43 + {
44 + Windows_Kinect_BodyFrameReader_Dispose(_pNative);
45 + }
46 + Windows_Kinect_BodyFrameReader_ReleaseObject(ref _pNative);
47 +
48 + _pNative = RootSystem.IntPtr.Zero;
49 + }
50 +
51 +
52 + // Public Properties
53 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
54 + private static extern RootSystem.IntPtr Windows_Kinect_BodyFrameReader_get_BodyFrameSource(RootSystem.IntPtr pNative);
55 + public Windows.Kinect.BodyFrameSource BodyFrameSource
56 + {
57 + get
58 + {
59 + if (_pNative == RootSystem.IntPtr.Zero)
60 + {
61 + throw new RootSystem.ObjectDisposedException("BodyFrameReader");
62 + }
63 +
64 + RootSystem.IntPtr objectPointer = Windows_Kinect_BodyFrameReader_get_BodyFrameSource(_pNative);
65 + Helper.ExceptionHelper.CheckLastError();
66 + if (objectPointer == RootSystem.IntPtr.Zero)
67 + {
68 + return null;
69 + }
70 +
71 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.BodyFrameSource>(objectPointer, n => new Windows.Kinect.BodyFrameSource(n));
72 + }
73 + }
74 +
75 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
76 + private static extern bool Windows_Kinect_BodyFrameReader_get_IsPaused(RootSystem.IntPtr pNative);
77 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
78 + private static extern void Windows_Kinect_BodyFrameReader_put_IsPaused(RootSystem.IntPtr pNative, bool isPaused);
79 + public bool IsPaused
80 + {
81 + get
82 + {
83 + if (_pNative == RootSystem.IntPtr.Zero)
84 + {
85 + throw new RootSystem.ObjectDisposedException("BodyFrameReader");
86 + }
87 +
88 + return Windows_Kinect_BodyFrameReader_get_IsPaused(_pNative);
89 + }
90 + set
91 + {
92 + if (_pNative == RootSystem.IntPtr.Zero)
93 + {
94 + throw new RootSystem.ObjectDisposedException("BodyFrameReader");
95 + }
96 +
97 + Windows_Kinect_BodyFrameReader_put_IsPaused(_pNative, value);
98 + Helper.ExceptionHelper.CheckLastError();
99 + }
100 + }
101 +
102 +
103 + // Events
104 + private static RootSystem.Runtime.InteropServices.GCHandle _Windows_Kinect_BodyFrameArrivedEventArgs_Delegate_Handle;
105 + [RootSystem.Runtime.InteropServices.UnmanagedFunctionPointer(RootSystem.Runtime.InteropServices.CallingConvention.Cdecl)]
106 + private delegate void _Windows_Kinect_BodyFrameArrivedEventArgs_Delegate(RootSystem.IntPtr args, RootSystem.IntPtr pNative);
107 + private static Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Kinect.BodyFrameArrivedEventArgs>>> Windows_Kinect_BodyFrameArrivedEventArgs_Delegate_callbacks = new Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Kinect.BodyFrameArrivedEventArgs>>>();
108 + [AOT.MonoPInvokeCallbackAttribute(typeof(_Windows_Kinect_BodyFrameArrivedEventArgs_Delegate))]
109 + private static void Windows_Kinect_BodyFrameArrivedEventArgs_Delegate_Handler(RootSystem.IntPtr result, RootSystem.IntPtr pNative)
110 + {
111 + List<RootSystem.EventHandler<Windows.Kinect.BodyFrameArrivedEventArgs>> callbackList = null;
112 + Windows_Kinect_BodyFrameArrivedEventArgs_Delegate_callbacks.TryGetValue(pNative, out callbackList);
113 + lock(callbackList)
114 + {
115 + var objThis = Helper.NativeObjectCache.GetObject<BodyFrameReader>(pNative);
116 + var args = new Windows.Kinect.BodyFrameArrivedEventArgs(result);
117 + foreach(var func in callbackList)
118 + {
119 + Helper.EventPump.Instance.Enqueue(() => { try { func(objThis, args); } catch { } });
120 + }
121 + }
122 + }
123 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
124 + private static extern void Windows_Kinect_BodyFrameReader_add_FrameArrived(RootSystem.IntPtr pNative, _Windows_Kinect_BodyFrameArrivedEventArgs_Delegate eventCallback, bool unsubscribe);
125 + public event RootSystem.EventHandler<Windows.Kinect.BodyFrameArrivedEventArgs> FrameArrived
126 + {
127 + add
128 + {
129 + Helper.EventPump.EnsureInitialized();
130 +
131 + Windows_Kinect_BodyFrameArrivedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
132 + var callbackList = Windows_Kinect_BodyFrameArrivedEventArgs_Delegate_callbacks[_pNative];
133 + lock (callbackList)
134 + {
135 + callbackList.Add(value);
136 + if(callbackList.Count == 1)
137 + {
138 + var del = new _Windows_Kinect_BodyFrameArrivedEventArgs_Delegate(Windows_Kinect_BodyFrameArrivedEventArgs_Delegate_Handler);
139 + _Windows_Kinect_BodyFrameArrivedEventArgs_Delegate_Handle = RootSystem.Runtime.InteropServices.GCHandle.Alloc(del);
140 + Windows_Kinect_BodyFrameReader_add_FrameArrived(_pNative, del, false);
141 + }
142 + }
143 + }
144 + remove
145 + {
146 + if (_pNative == RootSystem.IntPtr.Zero)
147 + {
148 + return;
149 + }
150 +
151 + Windows_Kinect_BodyFrameArrivedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
152 + var callbackList = Windows_Kinect_BodyFrameArrivedEventArgs_Delegate_callbacks[_pNative];
153 + lock (callbackList)
154 + {
155 + callbackList.Remove(value);
156 + if(callbackList.Count == 0)
157 + {
158 + Windows_Kinect_BodyFrameReader_add_FrameArrived(_pNative, Windows_Kinect_BodyFrameArrivedEventArgs_Delegate_Handler, true);
159 + _Windows_Kinect_BodyFrameArrivedEventArgs_Delegate_Handle.Free();
160 + }
161 + }
162 + }
163 + }
164 +
165 + private static RootSystem.Runtime.InteropServices.GCHandle _Windows_Data_PropertyChangedEventArgs_Delegate_Handle;
166 + [RootSystem.Runtime.InteropServices.UnmanagedFunctionPointer(RootSystem.Runtime.InteropServices.CallingConvention.Cdecl)]
167 + private delegate void _Windows_Data_PropertyChangedEventArgs_Delegate(RootSystem.IntPtr args, RootSystem.IntPtr pNative);
168 + private static Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs>>> Windows_Data_PropertyChangedEventArgs_Delegate_callbacks = new Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs>>>();
169 + [AOT.MonoPInvokeCallbackAttribute(typeof(_Windows_Data_PropertyChangedEventArgs_Delegate))]
170 + private static void Windows_Data_PropertyChangedEventArgs_Delegate_Handler(RootSystem.IntPtr result, RootSystem.IntPtr pNative)
171 + {
172 + List<RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs>> callbackList = null;
173 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryGetValue(pNative, out callbackList);
174 + lock(callbackList)
175 + {
176 + var objThis = Helper.NativeObjectCache.GetObject<BodyFrameReader>(pNative);
177 + var args = new Windows.Data.PropertyChangedEventArgs(result);
178 + foreach(var func in callbackList)
179 + {
180 + Helper.EventPump.Instance.Enqueue(() => { try { func(objThis, args); } catch { } });
181 + }
182 + }
183 + }
184 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
185 + private static extern void Windows_Kinect_BodyFrameReader_add_PropertyChanged(RootSystem.IntPtr pNative, _Windows_Data_PropertyChangedEventArgs_Delegate eventCallback, bool unsubscribe);
186 + public event RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs> PropertyChanged
187 + {
188 + add
189 + {
190 + Helper.EventPump.EnsureInitialized();
191 +
192 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
193 + var callbackList = Windows_Data_PropertyChangedEventArgs_Delegate_callbacks[_pNative];
194 + lock (callbackList)
195 + {
196 + callbackList.Add(value);
197 + if(callbackList.Count == 1)
198 + {
199 + var del = new _Windows_Data_PropertyChangedEventArgs_Delegate(Windows_Data_PropertyChangedEventArgs_Delegate_Handler);
200 + _Windows_Data_PropertyChangedEventArgs_Delegate_Handle = RootSystem.Runtime.InteropServices.GCHandle.Alloc(del);
201 + Windows_Kinect_BodyFrameReader_add_PropertyChanged(_pNative, del, false);
202 + }
203 + }
204 + }
205 + remove
206 + {
207 + if (_pNative == RootSystem.IntPtr.Zero)
208 + {
209 + return;
210 + }
211 +
212 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
213 + var callbackList = Windows_Data_PropertyChangedEventArgs_Delegate_callbacks[_pNative];
214 + lock (callbackList)
215 + {
216 + callbackList.Remove(value);
217 + if(callbackList.Count == 0)
218 + {
219 + Windows_Kinect_BodyFrameReader_add_PropertyChanged(_pNative, Windows_Data_PropertyChangedEventArgs_Delegate_Handler, true);
220 + _Windows_Data_PropertyChangedEventArgs_Delegate_Handle.Free();
221 + }
222 + }
223 + }
224 + }
225 +
226 +
227 + // Public Methods
228 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
229 + private static extern RootSystem.IntPtr Windows_Kinect_BodyFrameReader_AcquireLatestFrame(RootSystem.IntPtr pNative);
230 + public Windows.Kinect.BodyFrame AcquireLatestFrame()
231 + {
232 + if (_pNative == RootSystem.IntPtr.Zero)
233 + {
234 + throw new RootSystem.ObjectDisposedException("BodyFrameReader");
235 + }
236 +
237 + RootSystem.IntPtr objectPointer = Windows_Kinect_BodyFrameReader_AcquireLatestFrame(_pNative);
238 + Helper.ExceptionHelper.CheckLastError();
239 + if (objectPointer == RootSystem.IntPtr.Zero)
240 + {
241 + return null;
242 + }
243 +
244 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.BodyFrame>(objectPointer, n => new Windows.Kinect.BodyFrame(n));
245 + }
246 +
247 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
248 + private static extern void Windows_Kinect_BodyFrameReader_Dispose(RootSystem.IntPtr pNative);
249 + public void Dispose()
250 + {
251 + if (_pNative == RootSystem.IntPtr.Zero)
252 + {
253 + return;
254 + }
255 +
256 + Dispose(true);
257 + RootSystem.GC.SuppressFinalize(this);
258 + }
259 +
260 + private void __EventCleanup()
261 + {
262 + {
263 + Windows_Kinect_BodyFrameArrivedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
264 + var callbackList = Windows_Kinect_BodyFrameArrivedEventArgs_Delegate_callbacks[_pNative];
265 + lock (callbackList)
266 + {
267 + if (callbackList.Count > 0)
268 + {
269 + callbackList.Clear();
270 + if (_pNative != RootSystem.IntPtr.Zero)
271 + {
272 + Windows_Kinect_BodyFrameReader_add_FrameArrived(_pNative, Windows_Kinect_BodyFrameArrivedEventArgs_Delegate_Handler, true);
273 + }
274 + _Windows_Kinect_BodyFrameArrivedEventArgs_Delegate_Handle.Free();
275 + }
276 + }
277 + }
278 + {
279 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
280 + var callbackList = Windows_Data_PropertyChangedEventArgs_Delegate_callbacks[_pNative];
281 + lock (callbackList)
282 + {
283 + if (callbackList.Count > 0)
284 + {
285 + callbackList.Clear();
286 + if (_pNative != RootSystem.IntPtr.Zero)
287 + {
288 + Windows_Kinect_BodyFrameReader_add_PropertyChanged(_pNative, Windows_Data_PropertyChangedEventArgs_Delegate_Handler, true);
289 + }
290 + _Windows_Data_PropertyChangedEventArgs_Delegate_Handle.Free();
291 + }
292 + }
293 + }
294 + }
295 + }
296 +
297 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.BodyFrameReference
8 + //
9 + public sealed partial class BodyFrameReference : Helper.INativeWrapper
10 +
11 + {
12 + internal RootSystem.IntPtr _pNative;
13 + RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
14 +
15 + // Constructors and Finalizers
16 + internal BodyFrameReference(RootSystem.IntPtr pNative)
17 + {
18 + _pNative = pNative;
19 + Windows_Kinect_BodyFrameReference_AddRefObject(ref _pNative);
20 + }
21 +
22 + ~BodyFrameReference()
23 + {
24 + Dispose(false);
25 + }
26 +
27 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
28 + private static extern void Windows_Kinect_BodyFrameReference_ReleaseObject(ref RootSystem.IntPtr pNative);
29 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
30 + private static extern void Windows_Kinect_BodyFrameReference_AddRefObject(ref RootSystem.IntPtr pNative);
31 + private void Dispose(bool disposing)
32 + {
33 + if (_pNative == RootSystem.IntPtr.Zero)
34 + {
35 + return;
36 + }
37 +
38 + __EventCleanup();
39 +
40 + Helper.NativeObjectCache.RemoveObject<BodyFrameReference>(_pNative);
41 + Windows_Kinect_BodyFrameReference_ReleaseObject(ref _pNative);
42 +
43 + _pNative = RootSystem.IntPtr.Zero;
44 + }
45 +
46 +
47 + // Public Properties
48 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
49 + private static extern long Windows_Kinect_BodyFrameReference_get_RelativeTime(RootSystem.IntPtr pNative);
50 + public RootSystem.TimeSpan RelativeTime
51 + {
52 + get
53 + {
54 + if (_pNative == RootSystem.IntPtr.Zero)
55 + {
56 + throw new RootSystem.ObjectDisposedException("BodyFrameReference");
57 + }
58 +
59 + return RootSystem.TimeSpan.FromMilliseconds(Windows_Kinect_BodyFrameReference_get_RelativeTime(_pNative));
60 + }
61 + }
62 +
63 +
64 + // Public Methods
65 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
66 + private static extern RootSystem.IntPtr Windows_Kinect_BodyFrameReference_AcquireFrame(RootSystem.IntPtr pNative);
67 + public Windows.Kinect.BodyFrame AcquireFrame()
68 + {
69 + if (_pNative == RootSystem.IntPtr.Zero)
70 + {
71 + throw new RootSystem.ObjectDisposedException("BodyFrameReference");
72 + }
73 +
74 + RootSystem.IntPtr objectPointer = Windows_Kinect_BodyFrameReference_AcquireFrame(_pNative);
75 + Helper.ExceptionHelper.CheckLastError();
76 + if (objectPointer == RootSystem.IntPtr.Zero)
77 + {
78 + return null;
79 + }
80 +
81 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.BodyFrame>(objectPointer, n => new Windows.Kinect.BodyFrame(n));
82 + }
83 +
84 + private void __EventCleanup()
85 + {
86 + }
87 + }
88 +
89 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.BodyFrameSource
8 + //
9 + public sealed partial class BodyFrameSource : Helper.INativeWrapper
10 +
11 + {
12 + internal RootSystem.IntPtr _pNative;
13 + RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
14 +
15 + // Constructors and Finalizers
16 + internal BodyFrameSource(RootSystem.IntPtr pNative)
17 + {
18 + _pNative = pNative;
19 + Windows_Kinect_BodyFrameSource_AddRefObject(ref _pNative);
20 + }
21 +
22 + ~BodyFrameSource()
23 + {
24 + Dispose(false);
25 + }
26 +
27 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
28 + private static extern void Windows_Kinect_BodyFrameSource_ReleaseObject(ref RootSystem.IntPtr pNative);
29 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
30 + private static extern void Windows_Kinect_BodyFrameSource_AddRefObject(ref RootSystem.IntPtr pNative);
31 + private void Dispose(bool disposing)
32 + {
33 + if (_pNative == RootSystem.IntPtr.Zero)
34 + {
35 + return;
36 + }
37 +
38 + __EventCleanup();
39 +
40 + Helper.NativeObjectCache.RemoveObject<BodyFrameSource>(_pNative);
41 + Windows_Kinect_BodyFrameSource_ReleaseObject(ref _pNative);
42 +
43 + _pNative = RootSystem.IntPtr.Zero;
44 + }
45 +
46 +
47 + // Public Properties
48 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
49 + private static extern int Windows_Kinect_BodyFrameSource_get_BodyCount(RootSystem.IntPtr pNative);
50 + public int BodyCount
51 + {
52 + get
53 + {
54 + if (_pNative == RootSystem.IntPtr.Zero)
55 + {
56 + throw new RootSystem.ObjectDisposedException("BodyFrameSource");
57 + }
58 +
59 + return Windows_Kinect_BodyFrameSource_get_BodyCount(_pNative);
60 + }
61 + }
62 +
63 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
64 + private static extern bool Windows_Kinect_BodyFrameSource_get_IsActive(RootSystem.IntPtr pNative);
65 + public bool IsActive
66 + {
67 + get
68 + {
69 + if (_pNative == RootSystem.IntPtr.Zero)
70 + {
71 + throw new RootSystem.ObjectDisposedException("BodyFrameSource");
72 + }
73 +
74 + return Windows_Kinect_BodyFrameSource_get_IsActive(_pNative);
75 + }
76 + }
77 +
78 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
79 + private static extern RootSystem.IntPtr Windows_Kinect_BodyFrameSource_get_KinectSensor(RootSystem.IntPtr pNative);
80 + public Windows.Kinect.KinectSensor KinectSensor
81 + {
82 + get
83 + {
84 + if (_pNative == RootSystem.IntPtr.Zero)
85 + {
86 + throw new RootSystem.ObjectDisposedException("BodyFrameSource");
87 + }
88 +
89 + RootSystem.IntPtr objectPointer = Windows_Kinect_BodyFrameSource_get_KinectSensor(_pNative);
90 + Helper.ExceptionHelper.CheckLastError();
91 + if (objectPointer == RootSystem.IntPtr.Zero)
92 + {
93 + return null;
94 + }
95 +
96 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.KinectSensor>(objectPointer, n => new Windows.Kinect.KinectSensor(n));
97 + }
98 + }
99 +
100 +
101 + // Events
102 + private static RootSystem.Runtime.InteropServices.GCHandle _Windows_Kinect_FrameCapturedEventArgs_Delegate_Handle;
103 + [RootSystem.Runtime.InteropServices.UnmanagedFunctionPointer(RootSystem.Runtime.InteropServices.CallingConvention.Cdecl)]
104 + private delegate void _Windows_Kinect_FrameCapturedEventArgs_Delegate(RootSystem.IntPtr args, RootSystem.IntPtr pNative);
105 + private static Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Kinect.FrameCapturedEventArgs>>> Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks = new Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Kinect.FrameCapturedEventArgs>>>();
106 + [AOT.MonoPInvokeCallbackAttribute(typeof(_Windows_Kinect_FrameCapturedEventArgs_Delegate))]
107 + private static void Windows_Kinect_FrameCapturedEventArgs_Delegate_Handler(RootSystem.IntPtr result, RootSystem.IntPtr pNative)
108 + {
109 + List<RootSystem.EventHandler<Windows.Kinect.FrameCapturedEventArgs>> callbackList = null;
110 + Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks.TryGetValue(pNative, out callbackList);
111 + lock(callbackList)
112 + {
113 + var objThis = Helper.NativeObjectCache.GetObject<BodyFrameSource>(pNative);
114 + var args = new Windows.Kinect.FrameCapturedEventArgs(result);
115 + foreach(var func in callbackList)
116 + {
117 + Helper.EventPump.Instance.Enqueue(() => { try { func(objThis, args); } catch { } });
118 + }
119 + }
120 + }
121 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
122 + private static extern void Windows_Kinect_BodyFrameSource_add_FrameCaptured(RootSystem.IntPtr pNative, _Windows_Kinect_FrameCapturedEventArgs_Delegate eventCallback, bool unsubscribe);
123 + public event RootSystem.EventHandler<Windows.Kinect.FrameCapturedEventArgs> FrameCaptured
124 + {
125 + add
126 + {
127 + Helper.EventPump.EnsureInitialized();
128 +
129 + Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
130 + var callbackList = Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks[_pNative];
131 + lock (callbackList)
132 + {
133 + callbackList.Add(value);
134 + if(callbackList.Count == 1)
135 + {
136 + var del = new _Windows_Kinect_FrameCapturedEventArgs_Delegate(Windows_Kinect_FrameCapturedEventArgs_Delegate_Handler);
137 + _Windows_Kinect_FrameCapturedEventArgs_Delegate_Handle = RootSystem.Runtime.InteropServices.GCHandle.Alloc(del);
138 + Windows_Kinect_BodyFrameSource_add_FrameCaptured(_pNative, del, false);
139 + }
140 + }
141 + }
142 + remove
143 + {
144 + if (_pNative == RootSystem.IntPtr.Zero)
145 + {
146 + return;
147 + }
148 +
149 + Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
150 + var callbackList = Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks[_pNative];
151 + lock (callbackList)
152 + {
153 + callbackList.Remove(value);
154 + if(callbackList.Count == 0)
155 + {
156 + Windows_Kinect_BodyFrameSource_add_FrameCaptured(_pNative, Windows_Kinect_FrameCapturedEventArgs_Delegate_Handler, true);
157 + _Windows_Kinect_FrameCapturedEventArgs_Delegate_Handle.Free();
158 + }
159 + }
160 + }
161 + }
162 +
163 + private static RootSystem.Runtime.InteropServices.GCHandle _Windows_Data_PropertyChangedEventArgs_Delegate_Handle;
164 + [RootSystem.Runtime.InteropServices.UnmanagedFunctionPointer(RootSystem.Runtime.InteropServices.CallingConvention.Cdecl)]
165 + private delegate void _Windows_Data_PropertyChangedEventArgs_Delegate(RootSystem.IntPtr args, RootSystem.IntPtr pNative);
166 + private static Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs>>> Windows_Data_PropertyChangedEventArgs_Delegate_callbacks = new Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs>>>();
167 + [AOT.MonoPInvokeCallbackAttribute(typeof(_Windows_Data_PropertyChangedEventArgs_Delegate))]
168 + private static void Windows_Data_PropertyChangedEventArgs_Delegate_Handler(RootSystem.IntPtr result, RootSystem.IntPtr pNative)
169 + {
170 + List<RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs>> callbackList = null;
171 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryGetValue(pNative, out callbackList);
172 + lock(callbackList)
173 + {
174 + var objThis = Helper.NativeObjectCache.GetObject<BodyFrameSource>(pNative);
175 + var args = new Windows.Data.PropertyChangedEventArgs(result);
176 + foreach(var func in callbackList)
177 + {
178 + Helper.EventPump.Instance.Enqueue(() => { try { func(objThis, args); } catch { } });
179 + }
180 + }
181 + }
182 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
183 + private static extern void Windows_Kinect_BodyFrameSource_add_PropertyChanged(RootSystem.IntPtr pNative, _Windows_Data_PropertyChangedEventArgs_Delegate eventCallback, bool unsubscribe);
184 + public event RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs> PropertyChanged
185 + {
186 + add
187 + {
188 + Helper.EventPump.EnsureInitialized();
189 +
190 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
191 + var callbackList = Windows_Data_PropertyChangedEventArgs_Delegate_callbacks[_pNative];
192 + lock (callbackList)
193 + {
194 + callbackList.Add(value);
195 + if(callbackList.Count == 1)
196 + {
197 + var del = new _Windows_Data_PropertyChangedEventArgs_Delegate(Windows_Data_PropertyChangedEventArgs_Delegate_Handler);
198 + _Windows_Data_PropertyChangedEventArgs_Delegate_Handle = RootSystem.Runtime.InteropServices.GCHandle.Alloc(del);
199 + Windows_Kinect_BodyFrameSource_add_PropertyChanged(_pNative, del, false);
200 + }
201 + }
202 + }
203 + remove
204 + {
205 + if (_pNative == RootSystem.IntPtr.Zero)
206 + {
207 + return;
208 + }
209 +
210 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
211 + var callbackList = Windows_Data_PropertyChangedEventArgs_Delegate_callbacks[_pNative];
212 + lock (callbackList)
213 + {
214 + callbackList.Remove(value);
215 + if(callbackList.Count == 0)
216 + {
217 + Windows_Kinect_BodyFrameSource_add_PropertyChanged(_pNative, Windows_Data_PropertyChangedEventArgs_Delegate_Handler, true);
218 + _Windows_Data_PropertyChangedEventArgs_Delegate_Handle.Free();
219 + }
220 + }
221 + }
222 + }
223 +
224 +
225 + // Public Methods
226 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
227 + private static extern RootSystem.IntPtr Windows_Kinect_BodyFrameSource_OpenReader(RootSystem.IntPtr pNative);
228 + public Windows.Kinect.BodyFrameReader OpenReader()
229 + {
230 + if (_pNative == RootSystem.IntPtr.Zero)
231 + {
232 + throw new RootSystem.ObjectDisposedException("BodyFrameSource");
233 + }
234 +
235 + RootSystem.IntPtr objectPointer = Windows_Kinect_BodyFrameSource_OpenReader(_pNative);
236 + Helper.ExceptionHelper.CheckLastError();
237 + if (objectPointer == RootSystem.IntPtr.Zero)
238 + {
239 + return null;
240 + }
241 +
242 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.BodyFrameReader>(objectPointer, n => new Windows.Kinect.BodyFrameReader(n));
243 + }
244 +
245 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
246 + private static extern void Windows_Kinect_BodyFrameSource_OverrideHandTracking(RootSystem.IntPtr pNative, ulong trackingId);
247 + public void OverrideHandTracking(ulong trackingId)
248 + {
249 + if (_pNative == RootSystem.IntPtr.Zero)
250 + {
251 + throw new RootSystem.ObjectDisposedException("BodyFrameSource");
252 + }
253 +
254 + Windows_Kinect_BodyFrameSource_OverrideHandTracking(_pNative, trackingId);
255 + Helper.ExceptionHelper.CheckLastError();
256 + }
257 +
258 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
259 + private static extern void Windows_Kinect_BodyFrameSource_OverrideHandTracking_1(RootSystem.IntPtr pNative, ulong oldTrackingId, ulong newTrackingId);
260 + public void OverrideHandTracking(ulong oldTrackingId, ulong newTrackingId)
261 + {
262 + if (_pNative == RootSystem.IntPtr.Zero)
263 + {
264 + throw new RootSystem.ObjectDisposedException("BodyFrameSource");
265 + }
266 +
267 + Windows_Kinect_BodyFrameSource_OverrideHandTracking_1(_pNative, oldTrackingId, newTrackingId);
268 + Helper.ExceptionHelper.CheckLastError();
269 + }
270 +
271 + private void __EventCleanup()
272 + {
273 + {
274 + Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
275 + var callbackList = Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks[_pNative];
276 + lock (callbackList)
277 + {
278 + if (callbackList.Count > 0)
279 + {
280 + callbackList.Clear();
281 + if (_pNative != RootSystem.IntPtr.Zero)
282 + {
283 + Windows_Kinect_BodyFrameSource_add_FrameCaptured(_pNative, Windows_Kinect_FrameCapturedEventArgs_Delegate_Handler, true);
284 + }
285 + _Windows_Kinect_FrameCapturedEventArgs_Delegate_Handle.Free();
286 + }
287 + }
288 + }
289 + {
290 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
291 + var callbackList = Windows_Data_PropertyChangedEventArgs_Delegate_callbacks[_pNative];
292 + lock (callbackList)
293 + {
294 + if (callbackList.Count > 0)
295 + {
296 + callbackList.Clear();
297 + if (_pNative != RootSystem.IntPtr.Zero)
298 + {
299 + Windows_Kinect_BodyFrameSource_add_PropertyChanged(_pNative, Windows_Data_PropertyChangedEventArgs_Delegate_Handler, true);
300 + }
301 + _Windows_Data_PropertyChangedEventArgs_Delegate_Handle.Free();
302 + }
303 + }
304 + }
305 + }
306 + }
307 +
308 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.BodyIndexFrame
8 + //
9 + public sealed partial class BodyIndexFrame : RootSystem.IDisposable, Helper.INativeWrapper
10 +
11 + {
12 + internal RootSystem.IntPtr _pNative;
13 + RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
14 +
15 + // Constructors and Finalizers
16 + internal BodyIndexFrame(RootSystem.IntPtr pNative)
17 + {
18 + _pNative = pNative;
19 + Windows_Kinect_BodyIndexFrame_AddRefObject(ref _pNative);
20 + }
21 +
22 + ~BodyIndexFrame()
23 + {
24 + Dispose(false);
25 + }
26 +
27 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
28 + private static extern void Windows_Kinect_BodyIndexFrame_ReleaseObject(ref RootSystem.IntPtr pNative);
29 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
30 + private static extern void Windows_Kinect_BodyIndexFrame_AddRefObject(ref RootSystem.IntPtr pNative);
31 + private void Dispose(bool disposing)
32 + {
33 + if (_pNative == RootSystem.IntPtr.Zero)
34 + {
35 + return;
36 + }
37 +
38 + __EventCleanup();
39 +
40 + Helper.NativeObjectCache.RemoveObject<BodyIndexFrame>(_pNative);
41 +
42 + if (disposing)
43 + {
44 + Windows_Kinect_BodyIndexFrame_Dispose(_pNative);
45 + }
46 + Windows_Kinect_BodyIndexFrame_ReleaseObject(ref _pNative);
47 +
48 + _pNative = RootSystem.IntPtr.Zero;
49 + }
50 +
51 +
52 + // Public Properties
53 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
54 + private static extern RootSystem.IntPtr Windows_Kinect_BodyIndexFrame_get_BodyIndexFrameSource(RootSystem.IntPtr pNative);
55 + public Windows.Kinect.BodyIndexFrameSource BodyIndexFrameSource
56 + {
57 + get
58 + {
59 + if (_pNative == RootSystem.IntPtr.Zero)
60 + {
61 + throw new RootSystem.ObjectDisposedException("BodyIndexFrame");
62 + }
63 +
64 + RootSystem.IntPtr objectPointer = Windows_Kinect_BodyIndexFrame_get_BodyIndexFrameSource(_pNative);
65 + Helper.ExceptionHelper.CheckLastError();
66 + if (objectPointer == RootSystem.IntPtr.Zero)
67 + {
68 + return null;
69 + }
70 +
71 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.BodyIndexFrameSource>(objectPointer, n => new Windows.Kinect.BodyIndexFrameSource(n));
72 + }
73 + }
74 +
75 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
76 + private static extern RootSystem.IntPtr Windows_Kinect_BodyIndexFrame_get_FrameDescription(RootSystem.IntPtr pNative);
77 + public Windows.Kinect.FrameDescription FrameDescription
78 + {
79 + get
80 + {
81 + if (_pNative == RootSystem.IntPtr.Zero)
82 + {
83 + throw new RootSystem.ObjectDisposedException("BodyIndexFrame");
84 + }
85 +
86 + RootSystem.IntPtr objectPointer = Windows_Kinect_BodyIndexFrame_get_FrameDescription(_pNative);
87 + Helper.ExceptionHelper.CheckLastError();
88 + if (objectPointer == RootSystem.IntPtr.Zero)
89 + {
90 + return null;
91 + }
92 +
93 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.FrameDescription>(objectPointer, n => new Windows.Kinect.FrameDescription(n));
94 + }
95 + }
96 +
97 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
98 + private static extern long Windows_Kinect_BodyIndexFrame_get_RelativeTime(RootSystem.IntPtr pNative);
99 + public RootSystem.TimeSpan RelativeTime
100 + {
101 + get
102 + {
103 + if (_pNative == RootSystem.IntPtr.Zero)
104 + {
105 + throw new RootSystem.ObjectDisposedException("BodyIndexFrame");
106 + }
107 +
108 + return RootSystem.TimeSpan.FromMilliseconds(Windows_Kinect_BodyIndexFrame_get_RelativeTime(_pNative));
109 + }
110 + }
111 +
112 +
113 + // Public Methods
114 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
115 + private static extern void Windows_Kinect_BodyIndexFrame_CopyFrameDataToArray(RootSystem.IntPtr pNative, RootSystem.IntPtr frameData, int frameDataSize);
116 + public void CopyFrameDataToArray(byte[] frameData)
117 + {
118 + if (_pNative == RootSystem.IntPtr.Zero)
119 + {
120 + throw new RootSystem.ObjectDisposedException("BodyIndexFrame");
121 + }
122 +
123 + var frameDataSmartGCHandle = new Helper.SmartGCHandle(RootSystem.Runtime.InteropServices.GCHandle.Alloc(frameData, RootSystem.Runtime.InteropServices.GCHandleType.Pinned));
124 + var _frameData = frameDataSmartGCHandle.AddrOfPinnedObject();
125 + Windows_Kinect_BodyIndexFrame_CopyFrameDataToArray(_pNative, _frameData, frameData.Length);
126 + Helper.ExceptionHelper.CheckLastError();
127 + }
128 +
129 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
130 + private static extern void Windows_Kinect_BodyIndexFrame_Dispose(RootSystem.IntPtr pNative);
131 + public void Dispose()
132 + {
133 + if (_pNative == RootSystem.IntPtr.Zero)
134 + {
135 + return;
136 + }
137 +
138 + Dispose(true);
139 + RootSystem.GC.SuppressFinalize(this);
140 + }
141 +
142 + private void __EventCleanup()
143 + {
144 + }
145 + }
146 +
147 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.BodyIndexFrameArrivedEventArgs
8 + //
9 + public sealed partial class BodyIndexFrameArrivedEventArgs : RootSystem.EventArgs, Helper.INativeWrapper
10 +
11 + {
12 + internal RootSystem.IntPtr _pNative;
13 + RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
14 +
15 + // Constructors and Finalizers
16 + internal BodyIndexFrameArrivedEventArgs(RootSystem.IntPtr pNative)
17 + {
18 + _pNative = pNative;
19 + Windows_Kinect_BodyIndexFrameArrivedEventArgs_AddRefObject(ref _pNative);
20 + }
21 +
22 + ~BodyIndexFrameArrivedEventArgs()
23 + {
24 + Dispose(false);
25 + }
26 +
27 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
28 + private static extern void Windows_Kinect_BodyIndexFrameArrivedEventArgs_ReleaseObject(ref RootSystem.IntPtr pNative);
29 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
30 + private static extern void Windows_Kinect_BodyIndexFrameArrivedEventArgs_AddRefObject(ref RootSystem.IntPtr pNative);
31 + private void Dispose(bool disposing)
32 + {
33 + if (_pNative == RootSystem.IntPtr.Zero)
34 + {
35 + return;
36 + }
37 +
38 + __EventCleanup();
39 +
40 + Helper.NativeObjectCache.RemoveObject<BodyIndexFrameArrivedEventArgs>(_pNative);
41 + Windows_Kinect_BodyIndexFrameArrivedEventArgs_ReleaseObject(ref _pNative);
42 +
43 + _pNative = RootSystem.IntPtr.Zero;
44 + }
45 +
46 +
47 + // Public Properties
48 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
49 + private static extern RootSystem.IntPtr Windows_Kinect_BodyIndexFrameArrivedEventArgs_get_FrameReference(RootSystem.IntPtr pNative);
50 + public Windows.Kinect.BodyIndexFrameReference FrameReference
51 + {
52 + get
53 + {
54 + if (_pNative == RootSystem.IntPtr.Zero)
55 + {
56 + throw new RootSystem.ObjectDisposedException("BodyIndexFrameArrivedEventArgs");
57 + }
58 +
59 + RootSystem.IntPtr objectPointer = Windows_Kinect_BodyIndexFrameArrivedEventArgs_get_FrameReference(_pNative);
60 + Helper.ExceptionHelper.CheckLastError();
61 + if (objectPointer == RootSystem.IntPtr.Zero)
62 + {
63 + return null;
64 + }
65 +
66 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.BodyIndexFrameReference>(objectPointer, n => new Windows.Kinect.BodyIndexFrameReference(n));
67 + }
68 + }
69 +
70 + private void __EventCleanup()
71 + {
72 + }
73 + }
74 +
75 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.BodyIndexFrameReader
8 + //
9 + public sealed partial class BodyIndexFrameReader : RootSystem.IDisposable, Helper.INativeWrapper
10 +
11 + {
12 + internal RootSystem.IntPtr _pNative;
13 + RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
14 +
15 + // Constructors and Finalizers
16 + internal BodyIndexFrameReader(RootSystem.IntPtr pNative)
17 + {
18 + _pNative = pNative;
19 + Windows_Kinect_BodyIndexFrameReader_AddRefObject(ref _pNative);
20 + }
21 +
22 + ~BodyIndexFrameReader()
23 + {
24 + Dispose(false);
25 + }
26 +
27 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
28 + private static extern void Windows_Kinect_BodyIndexFrameReader_ReleaseObject(ref RootSystem.IntPtr pNative);
29 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
30 + private static extern void Windows_Kinect_BodyIndexFrameReader_AddRefObject(ref RootSystem.IntPtr pNative);
31 + private void Dispose(bool disposing)
32 + {
33 + if (_pNative == RootSystem.IntPtr.Zero)
34 + {
35 + return;
36 + }
37 +
38 + __EventCleanup();
39 +
40 + Helper.NativeObjectCache.RemoveObject<BodyIndexFrameReader>(_pNative);
41 +
42 + if (disposing)
43 + {
44 + Windows_Kinect_BodyIndexFrameReader_Dispose(_pNative);
45 + }
46 + Windows_Kinect_BodyIndexFrameReader_ReleaseObject(ref _pNative);
47 +
48 + _pNative = RootSystem.IntPtr.Zero;
49 + }
50 +
51 +
52 + // Public Properties
53 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
54 + private static extern RootSystem.IntPtr Windows_Kinect_BodyIndexFrameReader_get_BodyIndexFrameSource(RootSystem.IntPtr pNative);
55 + public Windows.Kinect.BodyIndexFrameSource BodyIndexFrameSource
56 + {
57 + get
58 + {
59 + if (_pNative == RootSystem.IntPtr.Zero)
60 + {
61 + throw new RootSystem.ObjectDisposedException("BodyIndexFrameReader");
62 + }
63 +
64 + RootSystem.IntPtr objectPointer = Windows_Kinect_BodyIndexFrameReader_get_BodyIndexFrameSource(_pNative);
65 + Helper.ExceptionHelper.CheckLastError();
66 + if (objectPointer == RootSystem.IntPtr.Zero)
67 + {
68 + return null;
69 + }
70 +
71 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.BodyIndexFrameSource>(objectPointer, n => new Windows.Kinect.BodyIndexFrameSource(n));
72 + }
73 + }
74 +
75 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
76 + private static extern bool Windows_Kinect_BodyIndexFrameReader_get_IsPaused(RootSystem.IntPtr pNative);
77 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
78 + private static extern void Windows_Kinect_BodyIndexFrameReader_put_IsPaused(RootSystem.IntPtr pNative, bool isPaused);
79 + public bool IsPaused
80 + {
81 + get
82 + {
83 + if (_pNative == RootSystem.IntPtr.Zero)
84 + {
85 + throw new RootSystem.ObjectDisposedException("BodyIndexFrameReader");
86 + }
87 +
88 + return Windows_Kinect_BodyIndexFrameReader_get_IsPaused(_pNative);
89 + }
90 + set
91 + {
92 + if (_pNative == RootSystem.IntPtr.Zero)
93 + {
94 + throw new RootSystem.ObjectDisposedException("BodyIndexFrameReader");
95 + }
96 +
97 + Windows_Kinect_BodyIndexFrameReader_put_IsPaused(_pNative, value);
98 + Helper.ExceptionHelper.CheckLastError();
99 + }
100 + }
101 +
102 +
103 + // Events
104 + private static RootSystem.Runtime.InteropServices.GCHandle _Windows_Kinect_BodyIndexFrameArrivedEventArgs_Delegate_Handle;
105 + [RootSystem.Runtime.InteropServices.UnmanagedFunctionPointer(RootSystem.Runtime.InteropServices.CallingConvention.Cdecl)]
106 + private delegate void _Windows_Kinect_BodyIndexFrameArrivedEventArgs_Delegate(RootSystem.IntPtr args, RootSystem.IntPtr pNative);
107 + private static Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Kinect.BodyIndexFrameArrivedEventArgs>>> Windows_Kinect_BodyIndexFrameArrivedEventArgs_Delegate_callbacks = new Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Kinect.BodyIndexFrameArrivedEventArgs>>>();
108 + [AOT.MonoPInvokeCallbackAttribute(typeof(_Windows_Kinect_BodyIndexFrameArrivedEventArgs_Delegate))]
109 + private static void Windows_Kinect_BodyIndexFrameArrivedEventArgs_Delegate_Handler(RootSystem.IntPtr result, RootSystem.IntPtr pNative)
110 + {
111 + List<RootSystem.EventHandler<Windows.Kinect.BodyIndexFrameArrivedEventArgs>> callbackList = null;
112 + Windows_Kinect_BodyIndexFrameArrivedEventArgs_Delegate_callbacks.TryGetValue(pNative, out callbackList);
113 + lock(callbackList)
114 + {
115 + var objThis = Helper.NativeObjectCache.GetObject<BodyIndexFrameReader>(pNative);
116 + var args = new Windows.Kinect.BodyIndexFrameArrivedEventArgs(result);
117 + foreach(var func in callbackList)
118 + {
119 + Helper.EventPump.Instance.Enqueue(() => { try { func(objThis, args); } catch { } });
120 + }
121 + }
122 + }
123 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
124 + private static extern void Windows_Kinect_BodyIndexFrameReader_add_FrameArrived(RootSystem.IntPtr pNative, _Windows_Kinect_BodyIndexFrameArrivedEventArgs_Delegate eventCallback, bool unsubscribe);
125 + public event RootSystem.EventHandler<Windows.Kinect.BodyIndexFrameArrivedEventArgs> FrameArrived
126 + {
127 + add
128 + {
129 + Helper.EventPump.EnsureInitialized();
130 +
131 + Windows_Kinect_BodyIndexFrameArrivedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
132 + var callbackList = Windows_Kinect_BodyIndexFrameArrivedEventArgs_Delegate_callbacks[_pNative];
133 + lock (callbackList)
134 + {
135 + callbackList.Add(value);
136 + if(callbackList.Count == 1)
137 + {
138 + var del = new _Windows_Kinect_BodyIndexFrameArrivedEventArgs_Delegate(Windows_Kinect_BodyIndexFrameArrivedEventArgs_Delegate_Handler);
139 + _Windows_Kinect_BodyIndexFrameArrivedEventArgs_Delegate_Handle = RootSystem.Runtime.InteropServices.GCHandle.Alloc(del);
140 + Windows_Kinect_BodyIndexFrameReader_add_FrameArrived(_pNative, del, false);
141 + }
142 + }
143 + }
144 + remove
145 + {
146 + if (_pNative == RootSystem.IntPtr.Zero)
147 + {
148 + return;
149 + }
150 +
151 + Windows_Kinect_BodyIndexFrameArrivedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
152 + var callbackList = Windows_Kinect_BodyIndexFrameArrivedEventArgs_Delegate_callbacks[_pNative];
153 + lock (callbackList)
154 + {
155 + callbackList.Remove(value);
156 + if(callbackList.Count == 0)
157 + {
158 + Windows_Kinect_BodyIndexFrameReader_add_FrameArrived(_pNative, Windows_Kinect_BodyIndexFrameArrivedEventArgs_Delegate_Handler, true);
159 + _Windows_Kinect_BodyIndexFrameArrivedEventArgs_Delegate_Handle.Free();
160 + }
161 + }
162 + }
163 + }
164 +
165 + private static RootSystem.Runtime.InteropServices.GCHandle _Windows_Data_PropertyChangedEventArgs_Delegate_Handle;
166 + [RootSystem.Runtime.InteropServices.UnmanagedFunctionPointer(RootSystem.Runtime.InteropServices.CallingConvention.Cdecl)]
167 + private delegate void _Windows_Data_PropertyChangedEventArgs_Delegate(RootSystem.IntPtr args, RootSystem.IntPtr pNative);
168 + private static Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs>>> Windows_Data_PropertyChangedEventArgs_Delegate_callbacks = new Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs>>>();
169 + [AOT.MonoPInvokeCallbackAttribute(typeof(_Windows_Data_PropertyChangedEventArgs_Delegate))]
170 + private static void Windows_Data_PropertyChangedEventArgs_Delegate_Handler(RootSystem.IntPtr result, RootSystem.IntPtr pNative)
171 + {
172 + List<RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs>> callbackList = null;
173 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryGetValue(pNative, out callbackList);
174 + lock(callbackList)
175 + {
176 + var objThis = Helper.NativeObjectCache.GetObject<BodyIndexFrameReader>(pNative);
177 + var args = new Windows.Data.PropertyChangedEventArgs(result);
178 + foreach(var func in callbackList)
179 + {
180 + Helper.EventPump.Instance.Enqueue(() => { try { func(objThis, args); } catch { } });
181 + }
182 + }
183 + }
184 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
185 + private static extern void Windows_Kinect_BodyIndexFrameReader_add_PropertyChanged(RootSystem.IntPtr pNative, _Windows_Data_PropertyChangedEventArgs_Delegate eventCallback, bool unsubscribe);
186 + public event RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs> PropertyChanged
187 + {
188 + add
189 + {
190 + Helper.EventPump.EnsureInitialized();
191 +
192 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
193 + var callbackList = Windows_Data_PropertyChangedEventArgs_Delegate_callbacks[_pNative];
194 + lock (callbackList)
195 + {
196 + callbackList.Add(value);
197 + if(callbackList.Count == 1)
198 + {
199 + var del = new _Windows_Data_PropertyChangedEventArgs_Delegate(Windows_Data_PropertyChangedEventArgs_Delegate_Handler);
200 + _Windows_Data_PropertyChangedEventArgs_Delegate_Handle = RootSystem.Runtime.InteropServices.GCHandle.Alloc(del);
201 + Windows_Kinect_BodyIndexFrameReader_add_PropertyChanged(_pNative, del, false);
202 + }
203 + }
204 + }
205 + remove
206 + {
207 + if (_pNative == RootSystem.IntPtr.Zero)
208 + {
209 + return;
210 + }
211 +
212 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
213 + var callbackList = Windows_Data_PropertyChangedEventArgs_Delegate_callbacks[_pNative];
214 + lock (callbackList)
215 + {
216 + callbackList.Remove(value);
217 + if(callbackList.Count == 0)
218 + {
219 + Windows_Kinect_BodyIndexFrameReader_add_PropertyChanged(_pNative, Windows_Data_PropertyChangedEventArgs_Delegate_Handler, true);
220 + _Windows_Data_PropertyChangedEventArgs_Delegate_Handle.Free();
221 + }
222 + }
223 + }
224 + }
225 +
226 +
227 + // Public Methods
228 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
229 + private static extern RootSystem.IntPtr Windows_Kinect_BodyIndexFrameReader_AcquireLatestFrame(RootSystem.IntPtr pNative);
230 + public Windows.Kinect.BodyIndexFrame AcquireLatestFrame()
231 + {
232 + if (_pNative == RootSystem.IntPtr.Zero)
233 + {
234 + throw new RootSystem.ObjectDisposedException("BodyIndexFrameReader");
235 + }
236 +
237 + RootSystem.IntPtr objectPointer = Windows_Kinect_BodyIndexFrameReader_AcquireLatestFrame(_pNative);
238 + Helper.ExceptionHelper.CheckLastError();
239 + if (objectPointer == RootSystem.IntPtr.Zero)
240 + {
241 + return null;
242 + }
243 +
244 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.BodyIndexFrame>(objectPointer, n => new Windows.Kinect.BodyIndexFrame(n));
245 + }
246 +
247 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
248 + private static extern void Windows_Kinect_BodyIndexFrameReader_Dispose(RootSystem.IntPtr pNative);
249 + public void Dispose()
250 + {
251 + if (_pNative == RootSystem.IntPtr.Zero)
252 + {
253 + return;
254 + }
255 +
256 + Dispose(true);
257 + RootSystem.GC.SuppressFinalize(this);
258 + }
259 +
260 + private void __EventCleanup()
261 + {
262 + {
263 + Windows_Kinect_BodyIndexFrameArrivedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
264 + var callbackList = Windows_Kinect_BodyIndexFrameArrivedEventArgs_Delegate_callbacks[_pNative];
265 + lock (callbackList)
266 + {
267 + if (callbackList.Count > 0)
268 + {
269 + callbackList.Clear();
270 + if (_pNative != RootSystem.IntPtr.Zero)
271 + {
272 + Windows_Kinect_BodyIndexFrameReader_add_FrameArrived(_pNative, Windows_Kinect_BodyIndexFrameArrivedEventArgs_Delegate_Handler, true);
273 + }
274 + _Windows_Kinect_BodyIndexFrameArrivedEventArgs_Delegate_Handle.Free();
275 + }
276 + }
277 + }
278 + {
279 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
280 + var callbackList = Windows_Data_PropertyChangedEventArgs_Delegate_callbacks[_pNative];
281 + lock (callbackList)
282 + {
283 + if (callbackList.Count > 0)
284 + {
285 + callbackList.Clear();
286 + if (_pNative != RootSystem.IntPtr.Zero)
287 + {
288 + Windows_Kinect_BodyIndexFrameReader_add_PropertyChanged(_pNative, Windows_Data_PropertyChangedEventArgs_Delegate_Handler, true);
289 + }
290 + _Windows_Data_PropertyChangedEventArgs_Delegate_Handle.Free();
291 + }
292 + }
293 + }
294 + }
295 + }
296 +
297 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.BodyIndexFrameReference
8 + //
9 + public sealed partial class BodyIndexFrameReference : Helper.INativeWrapper
10 +
11 + {
12 + internal RootSystem.IntPtr _pNative;
13 + RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
14 +
15 + // Constructors and Finalizers
16 + internal BodyIndexFrameReference(RootSystem.IntPtr pNative)
17 + {
18 + _pNative = pNative;
19 + Windows_Kinect_BodyIndexFrameReference_AddRefObject(ref _pNative);
20 + }
21 +
22 + ~BodyIndexFrameReference()
23 + {
24 + Dispose(false);
25 + }
26 +
27 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
28 + private static extern void Windows_Kinect_BodyIndexFrameReference_ReleaseObject(ref RootSystem.IntPtr pNative);
29 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
30 + private static extern void Windows_Kinect_BodyIndexFrameReference_AddRefObject(ref RootSystem.IntPtr pNative);
31 + private void Dispose(bool disposing)
32 + {
33 + if (_pNative == RootSystem.IntPtr.Zero)
34 + {
35 + return;
36 + }
37 +
38 + __EventCleanup();
39 +
40 + Helper.NativeObjectCache.RemoveObject<BodyIndexFrameReference>(_pNative);
41 + Windows_Kinect_BodyIndexFrameReference_ReleaseObject(ref _pNative);
42 +
43 + _pNative = RootSystem.IntPtr.Zero;
44 + }
45 +
46 +
47 + // Public Properties
48 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
49 + private static extern long Windows_Kinect_BodyIndexFrameReference_get_RelativeTime(RootSystem.IntPtr pNative);
50 + public RootSystem.TimeSpan RelativeTime
51 + {
52 + get
53 + {
54 + if (_pNative == RootSystem.IntPtr.Zero)
55 + {
56 + throw new RootSystem.ObjectDisposedException("BodyIndexFrameReference");
57 + }
58 +
59 + return RootSystem.TimeSpan.FromMilliseconds(Windows_Kinect_BodyIndexFrameReference_get_RelativeTime(_pNative));
60 + }
61 + }
62 +
63 +
64 + // Public Methods
65 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
66 + private static extern RootSystem.IntPtr Windows_Kinect_BodyIndexFrameReference_AcquireFrame(RootSystem.IntPtr pNative);
67 + public Windows.Kinect.BodyIndexFrame AcquireFrame()
68 + {
69 + if (_pNative == RootSystem.IntPtr.Zero)
70 + {
71 + throw new RootSystem.ObjectDisposedException("BodyIndexFrameReference");
72 + }
73 +
74 + RootSystem.IntPtr objectPointer = Windows_Kinect_BodyIndexFrameReference_AcquireFrame(_pNative);
75 + Helper.ExceptionHelper.CheckLastError();
76 + if (objectPointer == RootSystem.IntPtr.Zero)
77 + {
78 + return null;
79 + }
80 +
81 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.BodyIndexFrame>(objectPointer, n => new Windows.Kinect.BodyIndexFrame(n));
82 + }
83 +
84 + private void __EventCleanup()
85 + {
86 + }
87 + }
88 +
89 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.BodyIndexFrameSource
8 + //
9 + public sealed partial class BodyIndexFrameSource : Helper.INativeWrapper
10 +
11 + {
12 + internal RootSystem.IntPtr _pNative;
13 + RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
14 +
15 + // Constructors and Finalizers
16 + internal BodyIndexFrameSource(RootSystem.IntPtr pNative)
17 + {
18 + _pNative = pNative;
19 + Windows_Kinect_BodyIndexFrameSource_AddRefObject(ref _pNative);
20 + }
21 +
22 + ~BodyIndexFrameSource()
23 + {
24 + Dispose(false);
25 + }
26 +
27 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
28 + private static extern void Windows_Kinect_BodyIndexFrameSource_ReleaseObject(ref RootSystem.IntPtr pNative);
29 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
30 + private static extern void Windows_Kinect_BodyIndexFrameSource_AddRefObject(ref RootSystem.IntPtr pNative);
31 + private void Dispose(bool disposing)
32 + {
33 + if (_pNative == RootSystem.IntPtr.Zero)
34 + {
35 + return;
36 + }
37 +
38 + __EventCleanup();
39 +
40 + Helper.NativeObjectCache.RemoveObject<BodyIndexFrameSource>(_pNative);
41 + Windows_Kinect_BodyIndexFrameSource_ReleaseObject(ref _pNative);
42 +
43 + _pNative = RootSystem.IntPtr.Zero;
44 + }
45 +
46 +
47 + // Public Properties
48 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
49 + private static extern RootSystem.IntPtr Windows_Kinect_BodyIndexFrameSource_get_FrameDescription(RootSystem.IntPtr pNative);
50 + public Windows.Kinect.FrameDescription FrameDescription
51 + {
52 + get
53 + {
54 + if (_pNative == RootSystem.IntPtr.Zero)
55 + {
56 + throw new RootSystem.ObjectDisposedException("BodyIndexFrameSource");
57 + }
58 +
59 + RootSystem.IntPtr objectPointer = Windows_Kinect_BodyIndexFrameSource_get_FrameDescription(_pNative);
60 + Helper.ExceptionHelper.CheckLastError();
61 + if (objectPointer == RootSystem.IntPtr.Zero)
62 + {
63 + return null;
64 + }
65 +
66 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.FrameDescription>(objectPointer, n => new Windows.Kinect.FrameDescription(n));
67 + }
68 + }
69 +
70 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
71 + private static extern bool Windows_Kinect_BodyIndexFrameSource_get_IsActive(RootSystem.IntPtr pNative);
72 + public bool IsActive
73 + {
74 + get
75 + {
76 + if (_pNative == RootSystem.IntPtr.Zero)
77 + {
78 + throw new RootSystem.ObjectDisposedException("BodyIndexFrameSource");
79 + }
80 +
81 + return Windows_Kinect_BodyIndexFrameSource_get_IsActive(_pNative);
82 + }
83 + }
84 +
85 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
86 + private static extern RootSystem.IntPtr Windows_Kinect_BodyIndexFrameSource_get_KinectSensor(RootSystem.IntPtr pNative);
87 + public Windows.Kinect.KinectSensor KinectSensor
88 + {
89 + get
90 + {
91 + if (_pNative == RootSystem.IntPtr.Zero)
92 + {
93 + throw new RootSystem.ObjectDisposedException("BodyIndexFrameSource");
94 + }
95 +
96 + RootSystem.IntPtr objectPointer = Windows_Kinect_BodyIndexFrameSource_get_KinectSensor(_pNative);
97 + Helper.ExceptionHelper.CheckLastError();
98 + if (objectPointer == RootSystem.IntPtr.Zero)
99 + {
100 + return null;
101 + }
102 +
103 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.KinectSensor>(objectPointer, n => new Windows.Kinect.KinectSensor(n));
104 + }
105 + }
106 +
107 +
108 + // Events
109 + private static RootSystem.Runtime.InteropServices.GCHandle _Windows_Kinect_FrameCapturedEventArgs_Delegate_Handle;
110 + [RootSystem.Runtime.InteropServices.UnmanagedFunctionPointer(RootSystem.Runtime.InteropServices.CallingConvention.Cdecl)]
111 + private delegate void _Windows_Kinect_FrameCapturedEventArgs_Delegate(RootSystem.IntPtr args, RootSystem.IntPtr pNative);
112 + private static Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Kinect.FrameCapturedEventArgs>>> Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks = new Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Kinect.FrameCapturedEventArgs>>>();
113 + [AOT.MonoPInvokeCallbackAttribute(typeof(_Windows_Kinect_FrameCapturedEventArgs_Delegate))]
114 + private static void Windows_Kinect_FrameCapturedEventArgs_Delegate_Handler(RootSystem.IntPtr result, RootSystem.IntPtr pNative)
115 + {
116 + List<RootSystem.EventHandler<Windows.Kinect.FrameCapturedEventArgs>> callbackList = null;
117 + Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks.TryGetValue(pNative, out callbackList);
118 + lock(callbackList)
119 + {
120 + var objThis = Helper.NativeObjectCache.GetObject<BodyIndexFrameSource>(pNative);
121 + var args = new Windows.Kinect.FrameCapturedEventArgs(result);
122 + foreach(var func in callbackList)
123 + {
124 + Helper.EventPump.Instance.Enqueue(() => { try { func(objThis, args); } catch { } });
125 + }
126 + }
127 + }
128 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
129 + private static extern void Windows_Kinect_BodyIndexFrameSource_add_FrameCaptured(RootSystem.IntPtr pNative, _Windows_Kinect_FrameCapturedEventArgs_Delegate eventCallback, bool unsubscribe);
130 + public event RootSystem.EventHandler<Windows.Kinect.FrameCapturedEventArgs> FrameCaptured
131 + {
132 + add
133 + {
134 + Helper.EventPump.EnsureInitialized();
135 +
136 + Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
137 + var callbackList = Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks[_pNative];
138 + lock (callbackList)
139 + {
140 + callbackList.Add(value);
141 + if(callbackList.Count == 1)
142 + {
143 + var del = new _Windows_Kinect_FrameCapturedEventArgs_Delegate(Windows_Kinect_FrameCapturedEventArgs_Delegate_Handler);
144 + _Windows_Kinect_FrameCapturedEventArgs_Delegate_Handle = RootSystem.Runtime.InteropServices.GCHandle.Alloc(del);
145 + Windows_Kinect_BodyIndexFrameSource_add_FrameCaptured(_pNative, del, false);
146 + }
147 + }
148 + }
149 + remove
150 + {
151 + if (_pNative == RootSystem.IntPtr.Zero)
152 + {
153 + return;
154 + }
155 +
156 + Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
157 + var callbackList = Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks[_pNative];
158 + lock (callbackList)
159 + {
160 + callbackList.Remove(value);
161 + if(callbackList.Count == 0)
162 + {
163 + Windows_Kinect_BodyIndexFrameSource_add_FrameCaptured(_pNative, Windows_Kinect_FrameCapturedEventArgs_Delegate_Handler, true);
164 + _Windows_Kinect_FrameCapturedEventArgs_Delegate_Handle.Free();
165 + }
166 + }
167 + }
168 + }
169 +
170 + private static RootSystem.Runtime.InteropServices.GCHandle _Windows_Data_PropertyChangedEventArgs_Delegate_Handle;
171 + [RootSystem.Runtime.InteropServices.UnmanagedFunctionPointer(RootSystem.Runtime.InteropServices.CallingConvention.Cdecl)]
172 + private delegate void _Windows_Data_PropertyChangedEventArgs_Delegate(RootSystem.IntPtr args, RootSystem.IntPtr pNative);
173 + private static Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs>>> Windows_Data_PropertyChangedEventArgs_Delegate_callbacks = new Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs>>>();
174 + [AOT.MonoPInvokeCallbackAttribute(typeof(_Windows_Data_PropertyChangedEventArgs_Delegate))]
175 + private static void Windows_Data_PropertyChangedEventArgs_Delegate_Handler(RootSystem.IntPtr result, RootSystem.IntPtr pNative)
176 + {
177 + List<RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs>> callbackList = null;
178 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryGetValue(pNative, out callbackList);
179 + lock(callbackList)
180 + {
181 + var objThis = Helper.NativeObjectCache.GetObject<BodyIndexFrameSource>(pNative);
182 + var args = new Windows.Data.PropertyChangedEventArgs(result);
183 + foreach(var func in callbackList)
184 + {
185 + Helper.EventPump.Instance.Enqueue(() => { try { func(objThis, args); } catch { } });
186 + }
187 + }
188 + }
189 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
190 + private static extern void Windows_Kinect_BodyIndexFrameSource_add_PropertyChanged(RootSystem.IntPtr pNative, _Windows_Data_PropertyChangedEventArgs_Delegate eventCallback, bool unsubscribe);
191 + public event RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs> PropertyChanged
192 + {
193 + add
194 + {
195 + Helper.EventPump.EnsureInitialized();
196 +
197 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
198 + var callbackList = Windows_Data_PropertyChangedEventArgs_Delegate_callbacks[_pNative];
199 + lock (callbackList)
200 + {
201 + callbackList.Add(value);
202 + if(callbackList.Count == 1)
203 + {
204 + var del = new _Windows_Data_PropertyChangedEventArgs_Delegate(Windows_Data_PropertyChangedEventArgs_Delegate_Handler);
205 + _Windows_Data_PropertyChangedEventArgs_Delegate_Handle = RootSystem.Runtime.InteropServices.GCHandle.Alloc(del);
206 + Windows_Kinect_BodyIndexFrameSource_add_PropertyChanged(_pNative, del, false);
207 + }
208 + }
209 + }
210 + remove
211 + {
212 + if (_pNative == RootSystem.IntPtr.Zero)
213 + {
214 + return;
215 + }
216 +
217 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
218 + var callbackList = Windows_Data_PropertyChangedEventArgs_Delegate_callbacks[_pNative];
219 + lock (callbackList)
220 + {
221 + callbackList.Remove(value);
222 + if(callbackList.Count == 0)
223 + {
224 + Windows_Kinect_BodyIndexFrameSource_add_PropertyChanged(_pNative, Windows_Data_PropertyChangedEventArgs_Delegate_Handler, true);
225 + _Windows_Data_PropertyChangedEventArgs_Delegate_Handle.Free();
226 + }
227 + }
228 + }
229 + }
230 +
231 +
232 + // Public Methods
233 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
234 + private static extern RootSystem.IntPtr Windows_Kinect_BodyIndexFrameSource_OpenReader(RootSystem.IntPtr pNative);
235 + public Windows.Kinect.BodyIndexFrameReader OpenReader()
236 + {
237 + if (_pNative == RootSystem.IntPtr.Zero)
238 + {
239 + throw new RootSystem.ObjectDisposedException("BodyIndexFrameSource");
240 + }
241 +
242 + RootSystem.IntPtr objectPointer = Windows_Kinect_BodyIndexFrameSource_OpenReader(_pNative);
243 + Helper.ExceptionHelper.CheckLastError();
244 + if (objectPointer == RootSystem.IntPtr.Zero)
245 + {
246 + return null;
247 + }
248 +
249 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.BodyIndexFrameReader>(objectPointer, n => new Windows.Kinect.BodyIndexFrameReader(n));
250 + }
251 +
252 + private void __EventCleanup()
253 + {
254 + {
255 + Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
256 + var callbackList = Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks[_pNative];
257 + lock (callbackList)
258 + {
259 + if (callbackList.Count > 0)
260 + {
261 + callbackList.Clear();
262 + if (_pNative != RootSystem.IntPtr.Zero)
263 + {
264 + Windows_Kinect_BodyIndexFrameSource_add_FrameCaptured(_pNative, Windows_Kinect_FrameCapturedEventArgs_Delegate_Handler, true);
265 + }
266 + _Windows_Kinect_FrameCapturedEventArgs_Delegate_Handle.Free();
267 + }
268 + }
269 + }
270 + {
271 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
272 + var callbackList = Windows_Data_PropertyChangedEventArgs_Delegate_callbacks[_pNative];
273 + lock (callbackList)
274 + {
275 + if (callbackList.Count > 0)
276 + {
277 + callbackList.Clear();
278 + if (_pNative != RootSystem.IntPtr.Zero)
279 + {
280 + Windows_Kinect_BodyIndexFrameSource_add_PropertyChanged(_pNative, Windows_Data_PropertyChangedEventArgs_Delegate_Handler, true);
281 + }
282 + _Windows_Data_PropertyChangedEventArgs_Delegate_Handle.Free();
283 + }
284 + }
285 + }
286 + }
287 + }
288 +
289 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.CameraSpacePoint
8 + //
9 + [RootSystem.Runtime.InteropServices.StructLayout(RootSystem.Runtime.InteropServices.LayoutKind.Sequential)]
10 + public struct CameraSpacePoint
11 + {
12 + public float X { get; set; }
13 + public float Y { get; set; }
14 + public float Z { get; set; }
15 +
16 + public override int GetHashCode()
17 + {
18 + return X.GetHashCode() ^ Y.GetHashCode() ^ Z.GetHashCode();
19 + }
20 +
21 + public override bool Equals(object obj)
22 + {
23 + if (!(obj is CameraSpacePoint))
24 + {
25 + return false;
26 + }
27 +
28 + return this.Equals((CameraSpacePoint)obj);
29 + }
30 +
31 + public bool Equals(CameraSpacePoint obj)
32 + {
33 + return X.Equals(obj.X) && Y.Equals(obj.Y) && Z.Equals(obj.Z);
34 + }
35 +
36 + public static bool operator ==(CameraSpacePoint a, CameraSpacePoint b)
37 + {
38 + return a.Equals(b);
39 + }
40 +
41 + public static bool operator !=(CameraSpacePoint a, CameraSpacePoint b)
42 + {
43 + return !(a.Equals(b));
44 + }
45 + }
46 +
47 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.ColorCameraSettings
8 + //
9 + public sealed partial class ColorCameraSettings : Helper.INativeWrapper
10 +
11 + {
12 + internal RootSystem.IntPtr _pNative;
13 + RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
14 +
15 + // Constructors and Finalizers
16 + internal ColorCameraSettings(RootSystem.IntPtr pNative)
17 + {
18 + _pNative = pNative;
19 + Windows_Kinect_ColorCameraSettings_AddRefObject(ref _pNative);
20 + }
21 +
22 + ~ColorCameraSettings()
23 + {
24 + Dispose(false);
25 + }
26 +
27 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
28 + private static extern void Windows_Kinect_ColorCameraSettings_ReleaseObject(ref RootSystem.IntPtr pNative);
29 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
30 + private static extern void Windows_Kinect_ColorCameraSettings_AddRefObject(ref RootSystem.IntPtr pNative);
31 + private void Dispose(bool disposing)
32 + {
33 + if (_pNative == RootSystem.IntPtr.Zero)
34 + {
35 + return;
36 + }
37 +
38 + __EventCleanup();
39 +
40 + Helper.NativeObjectCache.RemoveObject<ColorCameraSettings>(_pNative);
41 + Windows_Kinect_ColorCameraSettings_ReleaseObject(ref _pNative);
42 +
43 + _pNative = RootSystem.IntPtr.Zero;
44 + }
45 +
46 +
47 + // Public Properties
48 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
49 + private static extern long Windows_Kinect_ColorCameraSettings_get_ExposureTime(RootSystem.IntPtr pNative);
50 + public RootSystem.TimeSpan ExposureTime
51 + {
52 + get
53 + {
54 + if (_pNative == RootSystem.IntPtr.Zero)
55 + {
56 + throw new RootSystem.ObjectDisposedException("ColorCameraSettings");
57 + }
58 +
59 + return RootSystem.TimeSpan.FromMilliseconds(Windows_Kinect_ColorCameraSettings_get_ExposureTime(_pNative));
60 + }
61 + }
62 +
63 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
64 + private static extern long Windows_Kinect_ColorCameraSettings_get_FrameInterval(RootSystem.IntPtr pNative);
65 + public RootSystem.TimeSpan FrameInterval
66 + {
67 + get
68 + {
69 + if (_pNative == RootSystem.IntPtr.Zero)
70 + {
71 + throw new RootSystem.ObjectDisposedException("ColorCameraSettings");
72 + }
73 +
74 + return RootSystem.TimeSpan.FromMilliseconds(Windows_Kinect_ColorCameraSettings_get_FrameInterval(_pNative));
75 + }
76 + }
77 +
78 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
79 + private static extern float Windows_Kinect_ColorCameraSettings_get_Gain(RootSystem.IntPtr pNative);
80 + public float Gain
81 + {
82 + get
83 + {
84 + if (_pNative == RootSystem.IntPtr.Zero)
85 + {
86 + throw new RootSystem.ObjectDisposedException("ColorCameraSettings");
87 + }
88 +
89 + return Windows_Kinect_ColorCameraSettings_get_Gain(_pNative);
90 + }
91 + }
92 +
93 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
94 + private static extern float Windows_Kinect_ColorCameraSettings_get_Gamma(RootSystem.IntPtr pNative);
95 + public float Gamma
96 + {
97 + get
98 + {
99 + if (_pNative == RootSystem.IntPtr.Zero)
100 + {
101 + throw new RootSystem.ObjectDisposedException("ColorCameraSettings");
102 + }
103 +
104 + return Windows_Kinect_ColorCameraSettings_get_Gamma(_pNative);
105 + }
106 + }
107 +
108 + private void __EventCleanup()
109 + {
110 + }
111 + }
112 +
113 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.ColorFrame
8 + //
9 + public sealed partial class ColorFrame : RootSystem.IDisposable, Helper.INativeWrapper
10 +
11 + {
12 + internal RootSystem.IntPtr _pNative;
13 + RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
14 +
15 + // Constructors and Finalizers
16 + internal ColorFrame(RootSystem.IntPtr pNative)
17 + {
18 + _pNative = pNative;
19 + Windows_Kinect_ColorFrame_AddRefObject(ref _pNative);
20 + }
21 +
22 + ~ColorFrame()
23 + {
24 + Dispose(false);
25 + }
26 +
27 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
28 + private static extern void Windows_Kinect_ColorFrame_ReleaseObject(ref RootSystem.IntPtr pNative);
29 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
30 + private static extern void Windows_Kinect_ColorFrame_AddRefObject(ref RootSystem.IntPtr pNative);
31 + private void Dispose(bool disposing)
32 + {
33 + if (_pNative == RootSystem.IntPtr.Zero)
34 + {
35 + return;
36 + }
37 +
38 + __EventCleanup();
39 +
40 + Helper.NativeObjectCache.RemoveObject<ColorFrame>(_pNative);
41 +
42 + if (disposing)
43 + {
44 + Windows_Kinect_ColorFrame_Dispose(_pNative);
45 + }
46 + Windows_Kinect_ColorFrame_ReleaseObject(ref _pNative);
47 +
48 + _pNative = RootSystem.IntPtr.Zero;
49 + }
50 +
51 +
52 + // Public Properties
53 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
54 + private static extern RootSystem.IntPtr Windows_Kinect_ColorFrame_get_ColorCameraSettings(RootSystem.IntPtr pNative);
55 + public Windows.Kinect.ColorCameraSettings ColorCameraSettings
56 + {
57 + get
58 + {
59 + if (_pNative == RootSystem.IntPtr.Zero)
60 + {
61 + throw new RootSystem.ObjectDisposedException("ColorFrame");
62 + }
63 +
64 + RootSystem.IntPtr objectPointer = Windows_Kinect_ColorFrame_get_ColorCameraSettings(_pNative);
65 + Helper.ExceptionHelper.CheckLastError();
66 + if (objectPointer == RootSystem.IntPtr.Zero)
67 + {
68 + return null;
69 + }
70 +
71 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.ColorCameraSettings>(objectPointer, n => new Windows.Kinect.ColorCameraSettings(n));
72 + }
73 + }
74 +
75 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
76 + private static extern RootSystem.IntPtr Windows_Kinect_ColorFrame_get_ColorFrameSource(RootSystem.IntPtr pNative);
77 + public Windows.Kinect.ColorFrameSource ColorFrameSource
78 + {
79 + get
80 + {
81 + if (_pNative == RootSystem.IntPtr.Zero)
82 + {
83 + throw new RootSystem.ObjectDisposedException("ColorFrame");
84 + }
85 +
86 + RootSystem.IntPtr objectPointer = Windows_Kinect_ColorFrame_get_ColorFrameSource(_pNative);
87 + Helper.ExceptionHelper.CheckLastError();
88 + if (objectPointer == RootSystem.IntPtr.Zero)
89 + {
90 + return null;
91 + }
92 +
93 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.ColorFrameSource>(objectPointer, n => new Windows.Kinect.ColorFrameSource(n));
94 + }
95 + }
96 +
97 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
98 + private static extern RootSystem.IntPtr Windows_Kinect_ColorFrame_get_FrameDescription(RootSystem.IntPtr pNative);
99 + public Windows.Kinect.FrameDescription FrameDescription
100 + {
101 + get
102 + {
103 + if (_pNative == RootSystem.IntPtr.Zero)
104 + {
105 + throw new RootSystem.ObjectDisposedException("ColorFrame");
106 + }
107 +
108 + RootSystem.IntPtr objectPointer = Windows_Kinect_ColorFrame_get_FrameDescription(_pNative);
109 + Helper.ExceptionHelper.CheckLastError();
110 + if (objectPointer == RootSystem.IntPtr.Zero)
111 + {
112 + return null;
113 + }
114 +
115 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.FrameDescription>(objectPointer, n => new Windows.Kinect.FrameDescription(n));
116 + }
117 + }
118 +
119 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
120 + private static extern Windows.Kinect.ColorImageFormat Windows_Kinect_ColorFrame_get_RawColorImageFormat(RootSystem.IntPtr pNative);
121 + public Windows.Kinect.ColorImageFormat RawColorImageFormat
122 + {
123 + get
124 + {
125 + if (_pNative == RootSystem.IntPtr.Zero)
126 + {
127 + throw new RootSystem.ObjectDisposedException("ColorFrame");
128 + }
129 +
130 + return Windows_Kinect_ColorFrame_get_RawColorImageFormat(_pNative);
131 + }
132 + }
133 +
134 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
135 + private static extern long Windows_Kinect_ColorFrame_get_RelativeTime(RootSystem.IntPtr pNative);
136 + public RootSystem.TimeSpan RelativeTime
137 + {
138 + get
139 + {
140 + if (_pNative == RootSystem.IntPtr.Zero)
141 + {
142 + throw new RootSystem.ObjectDisposedException("ColorFrame");
143 + }
144 +
145 + return RootSystem.TimeSpan.FromMilliseconds(Windows_Kinect_ColorFrame_get_RelativeTime(_pNative));
146 + }
147 + }
148 +
149 +
150 + // Public Methods
151 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
152 + private static extern void Windows_Kinect_ColorFrame_CopyRawFrameDataToArray(RootSystem.IntPtr pNative, RootSystem.IntPtr frameData, int frameDataSize);
153 + public void CopyRawFrameDataToArray(byte[] frameData)
154 + {
155 + if (_pNative == RootSystem.IntPtr.Zero)
156 + {
157 + throw new RootSystem.ObjectDisposedException("ColorFrame");
158 + }
159 +
160 + var frameDataSmartGCHandle = new Helper.SmartGCHandle(RootSystem.Runtime.InteropServices.GCHandle.Alloc(frameData, RootSystem.Runtime.InteropServices.GCHandleType.Pinned));
161 + var _frameData = frameDataSmartGCHandle.AddrOfPinnedObject();
162 + Windows_Kinect_ColorFrame_CopyRawFrameDataToArray(_pNative, _frameData, frameData.Length);
163 + Helper.ExceptionHelper.CheckLastError();
164 + }
165 +
166 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
167 + private static extern void Windows_Kinect_ColorFrame_CopyConvertedFrameDataToArray(RootSystem.IntPtr pNative, RootSystem.IntPtr frameData, int frameDataSize, Windows.Kinect.ColorImageFormat colorFormat);
168 + public void CopyConvertedFrameDataToArray(byte[] frameData, Windows.Kinect.ColorImageFormat colorFormat)
169 + {
170 + if (_pNative == RootSystem.IntPtr.Zero)
171 + {
172 + throw new RootSystem.ObjectDisposedException("ColorFrame");
173 + }
174 +
175 + var frameDataSmartGCHandle = new Helper.SmartGCHandle(RootSystem.Runtime.InteropServices.GCHandle.Alloc(frameData, RootSystem.Runtime.InteropServices.GCHandleType.Pinned));
176 + var _frameData = frameDataSmartGCHandle.AddrOfPinnedObject();
177 + Windows_Kinect_ColorFrame_CopyConvertedFrameDataToArray(_pNative, _frameData, frameData.Length, colorFormat);
178 + Helper.ExceptionHelper.CheckLastError();
179 + }
180 +
181 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
182 + private static extern RootSystem.IntPtr Windows_Kinect_ColorFrame_CreateFrameDescription(RootSystem.IntPtr pNative, Windows.Kinect.ColorImageFormat format);
183 + public Windows.Kinect.FrameDescription CreateFrameDescription(Windows.Kinect.ColorImageFormat format)
184 + {
185 + if (_pNative == RootSystem.IntPtr.Zero)
186 + {
187 + throw new RootSystem.ObjectDisposedException("ColorFrame");
188 + }
189 +
190 + RootSystem.IntPtr objectPointer = Windows_Kinect_ColorFrame_CreateFrameDescription(_pNative, format);
191 + Helper.ExceptionHelper.CheckLastError();
192 + if (objectPointer == RootSystem.IntPtr.Zero)
193 + {
194 + return null;
195 + }
196 +
197 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.FrameDescription>(objectPointer, n => new Windows.Kinect.FrameDescription(n));
198 + }
199 +
200 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
201 + private static extern void Windows_Kinect_ColorFrame_Dispose(RootSystem.IntPtr pNative);
202 + public void Dispose()
203 + {
204 + if (_pNative == RootSystem.IntPtr.Zero)
205 + {
206 + return;
207 + }
208 +
209 + Dispose(true);
210 + RootSystem.GC.SuppressFinalize(this);
211 + }
212 +
213 + private void __EventCleanup()
214 + {
215 + }
216 + }
217 +
218 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.ColorFrameArrivedEventArgs
8 + //
9 + public sealed partial class ColorFrameArrivedEventArgs : RootSystem.EventArgs, Helper.INativeWrapper
10 +
11 + {
12 + internal RootSystem.IntPtr _pNative;
13 + RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
14 +
15 + // Constructors and Finalizers
16 + internal ColorFrameArrivedEventArgs(RootSystem.IntPtr pNative)
17 + {
18 + _pNative = pNative;
19 + Windows_Kinect_ColorFrameArrivedEventArgs_AddRefObject(ref _pNative);
20 + }
21 +
22 + ~ColorFrameArrivedEventArgs()
23 + {
24 + Dispose(false);
25 + }
26 +
27 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
28 + private static extern void Windows_Kinect_ColorFrameArrivedEventArgs_ReleaseObject(ref RootSystem.IntPtr pNative);
29 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
30 + private static extern void Windows_Kinect_ColorFrameArrivedEventArgs_AddRefObject(ref RootSystem.IntPtr pNative);
31 + private void Dispose(bool disposing)
32 + {
33 + if (_pNative == RootSystem.IntPtr.Zero)
34 + {
35 + return;
36 + }
37 +
38 + __EventCleanup();
39 +
40 + Helper.NativeObjectCache.RemoveObject<ColorFrameArrivedEventArgs>(_pNative);
41 + Windows_Kinect_ColorFrameArrivedEventArgs_ReleaseObject(ref _pNative);
42 +
43 + _pNative = RootSystem.IntPtr.Zero;
44 + }
45 +
46 +
47 + // Public Properties
48 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
49 + private static extern RootSystem.IntPtr Windows_Kinect_ColorFrameArrivedEventArgs_get_FrameReference(RootSystem.IntPtr pNative);
50 + public Windows.Kinect.ColorFrameReference FrameReference
51 + {
52 + get
53 + {
54 + if (_pNative == RootSystem.IntPtr.Zero)
55 + {
56 + throw new RootSystem.ObjectDisposedException("ColorFrameArrivedEventArgs");
57 + }
58 +
59 + RootSystem.IntPtr objectPointer = Windows_Kinect_ColorFrameArrivedEventArgs_get_FrameReference(_pNative);
60 + Helper.ExceptionHelper.CheckLastError();
61 + if (objectPointer == RootSystem.IntPtr.Zero)
62 + {
63 + return null;
64 + }
65 +
66 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.ColorFrameReference>(objectPointer, n => new Windows.Kinect.ColorFrameReference(n));
67 + }
68 + }
69 +
70 + private void __EventCleanup()
71 + {
72 + }
73 + }
74 +
75 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.ColorFrameReader
8 + //
9 + public sealed partial class ColorFrameReader : RootSystem.IDisposable, Helper.INativeWrapper
10 +
11 + {
12 + internal RootSystem.IntPtr _pNative;
13 + RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
14 +
15 + // Constructors and Finalizers
16 + internal ColorFrameReader(RootSystem.IntPtr pNative)
17 + {
18 + _pNative = pNative;
19 + Windows_Kinect_ColorFrameReader_AddRefObject(ref _pNative);
20 + }
21 +
22 + ~ColorFrameReader()
23 + {
24 + Dispose(false);
25 + }
26 +
27 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
28 + private static extern void Windows_Kinect_ColorFrameReader_ReleaseObject(ref RootSystem.IntPtr pNative);
29 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
30 + private static extern void Windows_Kinect_ColorFrameReader_AddRefObject(ref RootSystem.IntPtr pNative);
31 + private void Dispose(bool disposing)
32 + {
33 + if (_pNative == RootSystem.IntPtr.Zero)
34 + {
35 + return;
36 + }
37 +
38 + __EventCleanup();
39 +
40 + Helper.NativeObjectCache.RemoveObject<ColorFrameReader>(_pNative);
41 +
42 + if (disposing)
43 + {
44 + Windows_Kinect_ColorFrameReader_Dispose(_pNative);
45 + }
46 + Windows_Kinect_ColorFrameReader_ReleaseObject(ref _pNative);
47 +
48 + _pNative = RootSystem.IntPtr.Zero;
49 + }
50 +
51 +
52 + // Public Properties
53 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
54 + private static extern RootSystem.IntPtr Windows_Kinect_ColorFrameReader_get_ColorFrameSource(RootSystem.IntPtr pNative);
55 + public Windows.Kinect.ColorFrameSource ColorFrameSource
56 + {
57 + get
58 + {
59 + if (_pNative == RootSystem.IntPtr.Zero)
60 + {
61 + throw new RootSystem.ObjectDisposedException("ColorFrameReader");
62 + }
63 +
64 + RootSystem.IntPtr objectPointer = Windows_Kinect_ColorFrameReader_get_ColorFrameSource(_pNative);
65 + Helper.ExceptionHelper.CheckLastError();
66 + if (objectPointer == RootSystem.IntPtr.Zero)
67 + {
68 + return null;
69 + }
70 +
71 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.ColorFrameSource>(objectPointer, n => new Windows.Kinect.ColorFrameSource(n));
72 + }
73 + }
74 +
75 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
76 + private static extern bool Windows_Kinect_ColorFrameReader_get_IsPaused(RootSystem.IntPtr pNative);
77 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
78 + private static extern void Windows_Kinect_ColorFrameReader_put_IsPaused(RootSystem.IntPtr pNative, bool isPaused);
79 + public bool IsPaused
80 + {
81 + get
82 + {
83 + if (_pNative == RootSystem.IntPtr.Zero)
84 + {
85 + throw new RootSystem.ObjectDisposedException("ColorFrameReader");
86 + }
87 +
88 + return Windows_Kinect_ColorFrameReader_get_IsPaused(_pNative);
89 + }
90 + set
91 + {
92 + if (_pNative == RootSystem.IntPtr.Zero)
93 + {
94 + throw new RootSystem.ObjectDisposedException("ColorFrameReader");
95 + }
96 +
97 + Windows_Kinect_ColorFrameReader_put_IsPaused(_pNative, value);
98 + Helper.ExceptionHelper.CheckLastError();
99 + }
100 + }
101 +
102 +
103 + // Events
104 + private static RootSystem.Runtime.InteropServices.GCHandle _Windows_Kinect_ColorFrameArrivedEventArgs_Delegate_Handle;
105 + [RootSystem.Runtime.InteropServices.UnmanagedFunctionPointer(RootSystem.Runtime.InteropServices.CallingConvention.Cdecl)]
106 + private delegate void _Windows_Kinect_ColorFrameArrivedEventArgs_Delegate(RootSystem.IntPtr args, RootSystem.IntPtr pNative);
107 + private static Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Kinect.ColorFrameArrivedEventArgs>>> Windows_Kinect_ColorFrameArrivedEventArgs_Delegate_callbacks = new Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Kinect.ColorFrameArrivedEventArgs>>>();
108 + [AOT.MonoPInvokeCallbackAttribute(typeof(_Windows_Kinect_ColorFrameArrivedEventArgs_Delegate))]
109 + private static void Windows_Kinect_ColorFrameArrivedEventArgs_Delegate_Handler(RootSystem.IntPtr result, RootSystem.IntPtr pNative)
110 + {
111 + List<RootSystem.EventHandler<Windows.Kinect.ColorFrameArrivedEventArgs>> callbackList = null;
112 + Windows_Kinect_ColorFrameArrivedEventArgs_Delegate_callbacks.TryGetValue(pNative, out callbackList);
113 + lock(callbackList)
114 + {
115 + var objThis = Helper.NativeObjectCache.GetObject<ColorFrameReader>(pNative);
116 + var args = new Windows.Kinect.ColorFrameArrivedEventArgs(result);
117 + foreach(var func in callbackList)
118 + {
119 + Helper.EventPump.Instance.Enqueue(() => { try { func(objThis, args); } catch { } });
120 + }
121 + }
122 + }
123 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
124 + private static extern void Windows_Kinect_ColorFrameReader_add_FrameArrived(RootSystem.IntPtr pNative, _Windows_Kinect_ColorFrameArrivedEventArgs_Delegate eventCallback, bool unsubscribe);
125 + public event RootSystem.EventHandler<Windows.Kinect.ColorFrameArrivedEventArgs> FrameArrived
126 + {
127 + add
128 + {
129 + Helper.EventPump.EnsureInitialized();
130 +
131 + Windows_Kinect_ColorFrameArrivedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
132 + var callbackList = Windows_Kinect_ColorFrameArrivedEventArgs_Delegate_callbacks[_pNative];
133 + lock (callbackList)
134 + {
135 + callbackList.Add(value);
136 + if(callbackList.Count == 1)
137 + {
138 + var del = new _Windows_Kinect_ColorFrameArrivedEventArgs_Delegate(Windows_Kinect_ColorFrameArrivedEventArgs_Delegate_Handler);
139 + _Windows_Kinect_ColorFrameArrivedEventArgs_Delegate_Handle = RootSystem.Runtime.InteropServices.GCHandle.Alloc(del);
140 + Windows_Kinect_ColorFrameReader_add_FrameArrived(_pNative, del, false);
141 + }
142 + }
143 + }
144 + remove
145 + {
146 + if (_pNative == RootSystem.IntPtr.Zero)
147 + {
148 + return;
149 + }
150 +
151 + Windows_Kinect_ColorFrameArrivedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
152 + var callbackList = Windows_Kinect_ColorFrameArrivedEventArgs_Delegate_callbacks[_pNative];
153 + lock (callbackList)
154 + {
155 + callbackList.Remove(value);
156 + if(callbackList.Count == 0)
157 + {
158 + Windows_Kinect_ColorFrameReader_add_FrameArrived(_pNative, Windows_Kinect_ColorFrameArrivedEventArgs_Delegate_Handler, true);
159 + _Windows_Kinect_ColorFrameArrivedEventArgs_Delegate_Handle.Free();
160 + }
161 + }
162 + }
163 + }
164 +
165 + private static RootSystem.Runtime.InteropServices.GCHandle _Windows_Data_PropertyChangedEventArgs_Delegate_Handle;
166 + [RootSystem.Runtime.InteropServices.UnmanagedFunctionPointer(RootSystem.Runtime.InteropServices.CallingConvention.Cdecl)]
167 + private delegate void _Windows_Data_PropertyChangedEventArgs_Delegate(RootSystem.IntPtr args, RootSystem.IntPtr pNative);
168 + private static Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs>>> Windows_Data_PropertyChangedEventArgs_Delegate_callbacks = new Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs>>>();
169 + [AOT.MonoPInvokeCallbackAttribute(typeof(_Windows_Data_PropertyChangedEventArgs_Delegate))]
170 + private static void Windows_Data_PropertyChangedEventArgs_Delegate_Handler(RootSystem.IntPtr result, RootSystem.IntPtr pNative)
171 + {
172 + List<RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs>> callbackList = null;
173 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryGetValue(pNative, out callbackList);
174 + lock(callbackList)
175 + {
176 + var objThis = Helper.NativeObjectCache.GetObject<ColorFrameReader>(pNative);
177 + var args = new Windows.Data.PropertyChangedEventArgs(result);
178 + foreach(var func in callbackList)
179 + {
180 + Helper.EventPump.Instance.Enqueue(() => { try { func(objThis, args); } catch { } });
181 + }
182 + }
183 + }
184 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
185 + private static extern void Windows_Kinect_ColorFrameReader_add_PropertyChanged(RootSystem.IntPtr pNative, _Windows_Data_PropertyChangedEventArgs_Delegate eventCallback, bool unsubscribe);
186 + public event RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs> PropertyChanged
187 + {
188 + add
189 + {
190 + Helper.EventPump.EnsureInitialized();
191 +
192 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
193 + var callbackList = Windows_Data_PropertyChangedEventArgs_Delegate_callbacks[_pNative];
194 + lock (callbackList)
195 + {
196 + callbackList.Add(value);
197 + if(callbackList.Count == 1)
198 + {
199 + var del = new _Windows_Data_PropertyChangedEventArgs_Delegate(Windows_Data_PropertyChangedEventArgs_Delegate_Handler);
200 + _Windows_Data_PropertyChangedEventArgs_Delegate_Handle = RootSystem.Runtime.InteropServices.GCHandle.Alloc(del);
201 + Windows_Kinect_ColorFrameReader_add_PropertyChanged(_pNative, del, false);
202 + }
203 + }
204 + }
205 + remove
206 + {
207 + if (_pNative == RootSystem.IntPtr.Zero)
208 + {
209 + return;
210 + }
211 +
212 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
213 + var callbackList = Windows_Data_PropertyChangedEventArgs_Delegate_callbacks[_pNative];
214 + lock (callbackList)
215 + {
216 + callbackList.Remove(value);
217 + if(callbackList.Count == 0)
218 + {
219 + Windows_Kinect_ColorFrameReader_add_PropertyChanged(_pNative, Windows_Data_PropertyChangedEventArgs_Delegate_Handler, true);
220 + _Windows_Data_PropertyChangedEventArgs_Delegate_Handle.Free();
221 + }
222 + }
223 + }
224 + }
225 +
226 +
227 + // Public Methods
228 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
229 + private static extern RootSystem.IntPtr Windows_Kinect_ColorFrameReader_AcquireLatestFrame(RootSystem.IntPtr pNative);
230 + public Windows.Kinect.ColorFrame AcquireLatestFrame()
231 + {
232 + if (_pNative == RootSystem.IntPtr.Zero)
233 + {
234 + throw new RootSystem.ObjectDisposedException("ColorFrameReader");
235 + }
236 +
237 + RootSystem.IntPtr objectPointer = Windows_Kinect_ColorFrameReader_AcquireLatestFrame(_pNative);
238 + Helper.ExceptionHelper.CheckLastError();
239 + if (objectPointer == RootSystem.IntPtr.Zero)
240 + {
241 + return null;
242 + }
243 +
244 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.ColorFrame>(objectPointer, n => new Windows.Kinect.ColorFrame(n));
245 + }
246 +
247 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
248 + private static extern void Windows_Kinect_ColorFrameReader_Dispose(RootSystem.IntPtr pNative);
249 + public void Dispose()
250 + {
251 + if (_pNative == RootSystem.IntPtr.Zero)
252 + {
253 + return;
254 + }
255 +
256 + Dispose(true);
257 + RootSystem.GC.SuppressFinalize(this);
258 + }
259 +
260 + private void __EventCleanup()
261 + {
262 + {
263 + Windows_Kinect_ColorFrameArrivedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
264 + var callbackList = Windows_Kinect_ColorFrameArrivedEventArgs_Delegate_callbacks[_pNative];
265 + lock (callbackList)
266 + {
267 + if (callbackList.Count > 0)
268 + {
269 + callbackList.Clear();
270 + if (_pNative != RootSystem.IntPtr.Zero)
271 + {
272 + Windows_Kinect_ColorFrameReader_add_FrameArrived(_pNative, Windows_Kinect_ColorFrameArrivedEventArgs_Delegate_Handler, true);
273 + }
274 + _Windows_Kinect_ColorFrameArrivedEventArgs_Delegate_Handle.Free();
275 + }
276 + }
277 + }
278 + {
279 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
280 + var callbackList = Windows_Data_PropertyChangedEventArgs_Delegate_callbacks[_pNative];
281 + lock (callbackList)
282 + {
283 + if (callbackList.Count > 0)
284 + {
285 + callbackList.Clear();
286 + if (_pNative != RootSystem.IntPtr.Zero)
287 + {
288 + Windows_Kinect_ColorFrameReader_add_PropertyChanged(_pNative, Windows_Data_PropertyChangedEventArgs_Delegate_Handler, true);
289 + }
290 + _Windows_Data_PropertyChangedEventArgs_Delegate_Handle.Free();
291 + }
292 + }
293 + }
294 + }
295 + }
296 +
297 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.ColorFrameReference
8 + //
9 + public sealed partial class ColorFrameReference : Helper.INativeWrapper
10 +
11 + {
12 + internal RootSystem.IntPtr _pNative;
13 + RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
14 +
15 + // Constructors and Finalizers
16 + internal ColorFrameReference(RootSystem.IntPtr pNative)
17 + {
18 + _pNative = pNative;
19 + Windows_Kinect_ColorFrameReference_AddRefObject(ref _pNative);
20 + }
21 +
22 + ~ColorFrameReference()
23 + {
24 + Dispose(false);
25 + }
26 +
27 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
28 + private static extern void Windows_Kinect_ColorFrameReference_ReleaseObject(ref RootSystem.IntPtr pNative);
29 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
30 + private static extern void Windows_Kinect_ColorFrameReference_AddRefObject(ref RootSystem.IntPtr pNative);
31 + private void Dispose(bool disposing)
32 + {
33 + if (_pNative == RootSystem.IntPtr.Zero)
34 + {
35 + return;
36 + }
37 +
38 + __EventCleanup();
39 +
40 + Helper.NativeObjectCache.RemoveObject<ColorFrameReference>(_pNative);
41 + Windows_Kinect_ColorFrameReference_ReleaseObject(ref _pNative);
42 +
43 + _pNative = RootSystem.IntPtr.Zero;
44 + }
45 +
46 +
47 + // Public Properties
48 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
49 + private static extern long Windows_Kinect_ColorFrameReference_get_RelativeTime(RootSystem.IntPtr pNative);
50 + public RootSystem.TimeSpan RelativeTime
51 + {
52 + get
53 + {
54 + if (_pNative == RootSystem.IntPtr.Zero)
55 + {
56 + throw new RootSystem.ObjectDisposedException("ColorFrameReference");
57 + }
58 +
59 + return RootSystem.TimeSpan.FromMilliseconds(Windows_Kinect_ColorFrameReference_get_RelativeTime(_pNative));
60 + }
61 + }
62 +
63 +
64 + // Public Methods
65 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
66 + private static extern RootSystem.IntPtr Windows_Kinect_ColorFrameReference_AcquireFrame(RootSystem.IntPtr pNative);
67 + public Windows.Kinect.ColorFrame AcquireFrame()
68 + {
69 + if (_pNative == RootSystem.IntPtr.Zero)
70 + {
71 + throw new RootSystem.ObjectDisposedException("ColorFrameReference");
72 + }
73 +
74 + RootSystem.IntPtr objectPointer = Windows_Kinect_ColorFrameReference_AcquireFrame(_pNative);
75 + Helper.ExceptionHelper.CheckLastError();
76 + if (objectPointer == RootSystem.IntPtr.Zero)
77 + {
78 + return null;
79 + }
80 +
81 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.ColorFrame>(objectPointer, n => new Windows.Kinect.ColorFrame(n));
82 + }
83 +
84 + private void __EventCleanup()
85 + {
86 + }
87 + }
88 +
89 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.ColorFrameSource
8 + //
9 + public sealed partial class ColorFrameSource : Helper.INativeWrapper
10 +
11 + {
12 + internal RootSystem.IntPtr _pNative;
13 + RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
14 +
15 + // Constructors and Finalizers
16 + internal ColorFrameSource(RootSystem.IntPtr pNative)
17 + {
18 + _pNative = pNative;
19 + Windows_Kinect_ColorFrameSource_AddRefObject(ref _pNative);
20 + }
21 +
22 + ~ColorFrameSource()
23 + {
24 + Dispose(false);
25 + }
26 +
27 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
28 + private static extern void Windows_Kinect_ColorFrameSource_ReleaseObject(ref RootSystem.IntPtr pNative);
29 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
30 + private static extern void Windows_Kinect_ColorFrameSource_AddRefObject(ref RootSystem.IntPtr pNative);
31 + private void Dispose(bool disposing)
32 + {
33 + if (_pNative == RootSystem.IntPtr.Zero)
34 + {
35 + return;
36 + }
37 +
38 + __EventCleanup();
39 +
40 + Helper.NativeObjectCache.RemoveObject<ColorFrameSource>(_pNative);
41 + Windows_Kinect_ColorFrameSource_ReleaseObject(ref _pNative);
42 +
43 + _pNative = RootSystem.IntPtr.Zero;
44 + }
45 +
46 +
47 + // Public Properties
48 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
49 + private static extern RootSystem.IntPtr Windows_Kinect_ColorFrameSource_get_FrameDescription(RootSystem.IntPtr pNative);
50 + public Windows.Kinect.FrameDescription FrameDescription
51 + {
52 + get
53 + {
54 + if (_pNative == RootSystem.IntPtr.Zero)
55 + {
56 + throw new RootSystem.ObjectDisposedException("ColorFrameSource");
57 + }
58 +
59 + RootSystem.IntPtr objectPointer = Windows_Kinect_ColorFrameSource_get_FrameDescription(_pNative);
60 + Helper.ExceptionHelper.CheckLastError();
61 + if (objectPointer == RootSystem.IntPtr.Zero)
62 + {
63 + return null;
64 + }
65 +
66 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.FrameDescription>(objectPointer, n => new Windows.Kinect.FrameDescription(n));
67 + }
68 + }
69 +
70 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
71 + private static extern bool Windows_Kinect_ColorFrameSource_get_IsActive(RootSystem.IntPtr pNative);
72 + public bool IsActive
73 + {
74 + get
75 + {
76 + if (_pNative == RootSystem.IntPtr.Zero)
77 + {
78 + throw new RootSystem.ObjectDisposedException("ColorFrameSource");
79 + }
80 +
81 + return Windows_Kinect_ColorFrameSource_get_IsActive(_pNative);
82 + }
83 + }
84 +
85 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
86 + private static extern RootSystem.IntPtr Windows_Kinect_ColorFrameSource_get_KinectSensor(RootSystem.IntPtr pNative);
87 + public Windows.Kinect.KinectSensor KinectSensor
88 + {
89 + get
90 + {
91 + if (_pNative == RootSystem.IntPtr.Zero)
92 + {
93 + throw new RootSystem.ObjectDisposedException("ColorFrameSource");
94 + }
95 +
96 + RootSystem.IntPtr objectPointer = Windows_Kinect_ColorFrameSource_get_KinectSensor(_pNative);
97 + Helper.ExceptionHelper.CheckLastError();
98 + if (objectPointer == RootSystem.IntPtr.Zero)
99 + {
100 + return null;
101 + }
102 +
103 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.KinectSensor>(objectPointer, n => new Windows.Kinect.KinectSensor(n));
104 + }
105 + }
106 +
107 +
108 + // Events
109 + private static RootSystem.Runtime.InteropServices.GCHandle _Windows_Kinect_FrameCapturedEventArgs_Delegate_Handle;
110 + [RootSystem.Runtime.InteropServices.UnmanagedFunctionPointer(RootSystem.Runtime.InteropServices.CallingConvention.Cdecl)]
111 + private delegate void _Windows_Kinect_FrameCapturedEventArgs_Delegate(RootSystem.IntPtr args, RootSystem.IntPtr pNative);
112 + private static Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Kinect.FrameCapturedEventArgs>>> Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks = new Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Kinect.FrameCapturedEventArgs>>>();
113 + [AOT.MonoPInvokeCallbackAttribute(typeof(_Windows_Kinect_FrameCapturedEventArgs_Delegate))]
114 + private static void Windows_Kinect_FrameCapturedEventArgs_Delegate_Handler(RootSystem.IntPtr result, RootSystem.IntPtr pNative)
115 + {
116 + List<RootSystem.EventHandler<Windows.Kinect.FrameCapturedEventArgs>> callbackList = null;
117 + Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks.TryGetValue(pNative, out callbackList);
118 + lock(callbackList)
119 + {
120 + var objThis = Helper.NativeObjectCache.GetObject<ColorFrameSource>(pNative);
121 + var args = new Windows.Kinect.FrameCapturedEventArgs(result);
122 + foreach(var func in callbackList)
123 + {
124 + Helper.EventPump.Instance.Enqueue(() => { try { func(objThis, args); } catch { } });
125 + }
126 + }
127 + }
128 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
129 + private static extern void Windows_Kinect_ColorFrameSource_add_FrameCaptured(RootSystem.IntPtr pNative, _Windows_Kinect_FrameCapturedEventArgs_Delegate eventCallback, bool unsubscribe);
130 + public event RootSystem.EventHandler<Windows.Kinect.FrameCapturedEventArgs> FrameCaptured
131 + {
132 + add
133 + {
134 + Helper.EventPump.EnsureInitialized();
135 +
136 + Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
137 + var callbackList = Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks[_pNative];
138 + lock (callbackList)
139 + {
140 + callbackList.Add(value);
141 + if(callbackList.Count == 1)
142 + {
143 + var del = new _Windows_Kinect_FrameCapturedEventArgs_Delegate(Windows_Kinect_FrameCapturedEventArgs_Delegate_Handler);
144 + _Windows_Kinect_FrameCapturedEventArgs_Delegate_Handle = RootSystem.Runtime.InteropServices.GCHandle.Alloc(del);
145 + Windows_Kinect_ColorFrameSource_add_FrameCaptured(_pNative, del, false);
146 + }
147 + }
148 + }
149 + remove
150 + {
151 + if (_pNative == RootSystem.IntPtr.Zero)
152 + {
153 + return;
154 + }
155 +
156 + Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
157 + var callbackList = Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks[_pNative];
158 + lock (callbackList)
159 + {
160 + callbackList.Remove(value);
161 + if(callbackList.Count == 0)
162 + {
163 + Windows_Kinect_ColorFrameSource_add_FrameCaptured(_pNative, Windows_Kinect_FrameCapturedEventArgs_Delegate_Handler, true);
164 + _Windows_Kinect_FrameCapturedEventArgs_Delegate_Handle.Free();
165 + }
166 + }
167 + }
168 + }
169 +
170 + private static RootSystem.Runtime.InteropServices.GCHandle _Windows_Data_PropertyChangedEventArgs_Delegate_Handle;
171 + [RootSystem.Runtime.InteropServices.UnmanagedFunctionPointer(RootSystem.Runtime.InteropServices.CallingConvention.Cdecl)]
172 + private delegate void _Windows_Data_PropertyChangedEventArgs_Delegate(RootSystem.IntPtr args, RootSystem.IntPtr pNative);
173 + private static Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs>>> Windows_Data_PropertyChangedEventArgs_Delegate_callbacks = new Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs>>>();
174 + [AOT.MonoPInvokeCallbackAttribute(typeof(_Windows_Data_PropertyChangedEventArgs_Delegate))]
175 + private static void Windows_Data_PropertyChangedEventArgs_Delegate_Handler(RootSystem.IntPtr result, RootSystem.IntPtr pNative)
176 + {
177 + List<RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs>> callbackList = null;
178 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryGetValue(pNative, out callbackList);
179 + lock(callbackList)
180 + {
181 + var objThis = Helper.NativeObjectCache.GetObject<ColorFrameSource>(pNative);
182 + var args = new Windows.Data.PropertyChangedEventArgs(result);
183 + foreach(var func in callbackList)
184 + {
185 + Helper.EventPump.Instance.Enqueue(() => { try { func(objThis, args); } catch { } });
186 + }
187 + }
188 + }
189 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
190 + private static extern void Windows_Kinect_ColorFrameSource_add_PropertyChanged(RootSystem.IntPtr pNative, _Windows_Data_PropertyChangedEventArgs_Delegate eventCallback, bool unsubscribe);
191 + public event RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs> PropertyChanged
192 + {
193 + add
194 + {
195 + Helper.EventPump.EnsureInitialized();
196 +
197 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
198 + var callbackList = Windows_Data_PropertyChangedEventArgs_Delegate_callbacks[_pNative];
199 + lock (callbackList)
200 + {
201 + callbackList.Add(value);
202 + if(callbackList.Count == 1)
203 + {
204 + var del = new _Windows_Data_PropertyChangedEventArgs_Delegate(Windows_Data_PropertyChangedEventArgs_Delegate_Handler);
205 + _Windows_Data_PropertyChangedEventArgs_Delegate_Handle = RootSystem.Runtime.InteropServices.GCHandle.Alloc(del);
206 + Windows_Kinect_ColorFrameSource_add_PropertyChanged(_pNative, del, false);
207 + }
208 + }
209 + }
210 + remove
211 + {
212 + if (_pNative == RootSystem.IntPtr.Zero)
213 + {
214 + return;
215 + }
216 +
217 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
218 + var callbackList = Windows_Data_PropertyChangedEventArgs_Delegate_callbacks[_pNative];
219 + lock (callbackList)
220 + {
221 + callbackList.Remove(value);
222 + if(callbackList.Count == 0)
223 + {
224 + Windows_Kinect_ColorFrameSource_add_PropertyChanged(_pNative, Windows_Data_PropertyChangedEventArgs_Delegate_Handler, true);
225 + _Windows_Data_PropertyChangedEventArgs_Delegate_Handle.Free();
226 + }
227 + }
228 + }
229 + }
230 +
231 +
232 + // Public Methods
233 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
234 + private static extern RootSystem.IntPtr Windows_Kinect_ColorFrameSource_OpenReader(RootSystem.IntPtr pNative);
235 + public Windows.Kinect.ColorFrameReader OpenReader()
236 + {
237 + if (_pNative == RootSystem.IntPtr.Zero)
238 + {
239 + throw new RootSystem.ObjectDisposedException("ColorFrameSource");
240 + }
241 +
242 + RootSystem.IntPtr objectPointer = Windows_Kinect_ColorFrameSource_OpenReader(_pNative);
243 + Helper.ExceptionHelper.CheckLastError();
244 + if (objectPointer == RootSystem.IntPtr.Zero)
245 + {
246 + return null;
247 + }
248 +
249 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.ColorFrameReader>(objectPointer, n => new Windows.Kinect.ColorFrameReader(n));
250 + }
251 +
252 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
253 + private static extern RootSystem.IntPtr Windows_Kinect_ColorFrameSource_CreateFrameDescription(RootSystem.IntPtr pNative, Windows.Kinect.ColorImageFormat format);
254 + public Windows.Kinect.FrameDescription CreateFrameDescription(Windows.Kinect.ColorImageFormat format)
255 + {
256 + if (_pNative == RootSystem.IntPtr.Zero)
257 + {
258 + throw new RootSystem.ObjectDisposedException("ColorFrameSource");
259 + }
260 +
261 + RootSystem.IntPtr objectPointer = Windows_Kinect_ColorFrameSource_CreateFrameDescription(_pNative, format);
262 + Helper.ExceptionHelper.CheckLastError();
263 + if (objectPointer == RootSystem.IntPtr.Zero)
264 + {
265 + return null;
266 + }
267 +
268 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.FrameDescription>(objectPointer, n => new Windows.Kinect.FrameDescription(n));
269 + }
270 +
271 + private void __EventCleanup()
272 + {
273 + {
274 + Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
275 + var callbackList = Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks[_pNative];
276 + lock (callbackList)
277 + {
278 + if (callbackList.Count > 0)
279 + {
280 + callbackList.Clear();
281 + if (_pNative != RootSystem.IntPtr.Zero)
282 + {
283 + Windows_Kinect_ColorFrameSource_add_FrameCaptured(_pNative, Windows_Kinect_FrameCapturedEventArgs_Delegate_Handler, true);
284 + }
285 + _Windows_Kinect_FrameCapturedEventArgs_Delegate_Handle.Free();
286 + }
287 + }
288 + }
289 + {
290 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
291 + var callbackList = Windows_Data_PropertyChangedEventArgs_Delegate_callbacks[_pNative];
292 + lock (callbackList)
293 + {
294 + if (callbackList.Count > 0)
295 + {
296 + callbackList.Clear();
297 + if (_pNative != RootSystem.IntPtr.Zero)
298 + {
299 + Windows_Kinect_ColorFrameSource_add_PropertyChanged(_pNative, Windows_Data_PropertyChangedEventArgs_Delegate_Handler, true);
300 + }
301 + _Windows_Data_PropertyChangedEventArgs_Delegate_Handle.Free();
302 + }
303 + }
304 + }
305 + }
306 + }
307 +
308 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.ColorImageFormat
8 + //
9 + public enum ColorImageFormat : int
10 + {
11 + None =0,
12 + Rgba =1,
13 + Yuv =2,
14 + Bgra =3,
15 + Bayer =4,
16 + Yuy2 =5,
17 + }
18 +
19 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.ColorSpacePoint
8 + //
9 + [RootSystem.Runtime.InteropServices.StructLayout(RootSystem.Runtime.InteropServices.LayoutKind.Sequential)]
10 + public struct ColorSpacePoint
11 + {
12 + public float X { get; set; }
13 + public float Y { get; set; }
14 +
15 + public override int GetHashCode()
16 + {
17 + return X.GetHashCode() ^ Y.GetHashCode();
18 + }
19 +
20 + public override bool Equals(object obj)
21 + {
22 + if (!(obj is ColorSpacePoint))
23 + {
24 + return false;
25 + }
26 +
27 + return this.Equals((ColorSpacePoint)obj);
28 + }
29 +
30 + public bool Equals(ColorSpacePoint obj)
31 + {
32 + return X.Equals(obj.X) && Y.Equals(obj.Y);
33 + }
34 +
35 + public static bool operator ==(ColorSpacePoint a, ColorSpacePoint b)
36 + {
37 + return a.Equals(b);
38 + }
39 +
40 + public static bool operator !=(ColorSpacePoint a, ColorSpacePoint b)
41 + {
42 + return !(a.Equals(b));
43 + }
44 + }
45 +
46 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.CoordinateMapper
8 + //
9 + public sealed partial class CoordinateMapper : Helper.INativeWrapper
10 +
11 + {
12 + internal RootSystem.IntPtr _pNative;
13 + RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
14 +
15 + // Constructors and Finalizers
16 + internal CoordinateMapper(RootSystem.IntPtr pNative)
17 + {
18 + _pNative = pNative;
19 + Windows_Kinect_CoordinateMapper_AddRefObject(ref _pNative);
20 + }
21 +
22 + ~CoordinateMapper()
23 + {
24 + Dispose(false);
25 + }
26 +
27 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
28 + private static extern void Windows_Kinect_CoordinateMapper_ReleaseObject(ref RootSystem.IntPtr pNative);
29 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
30 + private static extern void Windows_Kinect_CoordinateMapper_AddRefObject(ref RootSystem.IntPtr pNative);
31 + private void Dispose(bool disposing)
32 + {
33 + if (_pNative == RootSystem.IntPtr.Zero)
34 + {
35 + return;
36 + }
37 +
38 + __EventCleanup();
39 +
40 + Helper.NativeObjectCache.RemoveObject<CoordinateMapper>(_pNative);
41 + Windows_Kinect_CoordinateMapper_ReleaseObject(ref _pNative);
42 +
43 + _pNative = RootSystem.IntPtr.Zero;
44 + }
45 +
46 +
47 + // Events
48 + private static RootSystem.Runtime.InteropServices.GCHandle _Windows_Kinect_CoordinateMappingChangedEventArgs_Delegate_Handle;
49 + [RootSystem.Runtime.InteropServices.UnmanagedFunctionPointer(RootSystem.Runtime.InteropServices.CallingConvention.Cdecl)]
50 + private delegate void _Windows_Kinect_CoordinateMappingChangedEventArgs_Delegate(RootSystem.IntPtr args, RootSystem.IntPtr pNative);
51 + private static Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Kinect.CoordinateMappingChangedEventArgs>>> Windows_Kinect_CoordinateMappingChangedEventArgs_Delegate_callbacks = new Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Kinect.CoordinateMappingChangedEventArgs>>>();
52 + [AOT.MonoPInvokeCallbackAttribute(typeof(_Windows_Kinect_CoordinateMappingChangedEventArgs_Delegate))]
53 + private static void Windows_Kinect_CoordinateMappingChangedEventArgs_Delegate_Handler(RootSystem.IntPtr result, RootSystem.IntPtr pNative)
54 + {
55 + List<RootSystem.EventHandler<Windows.Kinect.CoordinateMappingChangedEventArgs>> callbackList = null;
56 + Windows_Kinect_CoordinateMappingChangedEventArgs_Delegate_callbacks.TryGetValue(pNative, out callbackList);
57 + lock(callbackList)
58 + {
59 + var objThis = Helper.NativeObjectCache.GetObject<CoordinateMapper>(pNative);
60 + var args = new Windows.Kinect.CoordinateMappingChangedEventArgs(result);
61 + foreach(var func in callbackList)
62 + {
63 + Helper.EventPump.Instance.Enqueue(() => { try { func(objThis, args); } catch { } });
64 + }
65 + }
66 + }
67 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
68 + private static extern void Windows_Kinect_CoordinateMapper_add_CoordinateMappingChanged(RootSystem.IntPtr pNative, _Windows_Kinect_CoordinateMappingChangedEventArgs_Delegate eventCallback, bool unsubscribe);
69 + public event RootSystem.EventHandler<Windows.Kinect.CoordinateMappingChangedEventArgs> CoordinateMappingChanged
70 + {
71 + add
72 + {
73 + Helper.EventPump.EnsureInitialized();
74 +
75 + Windows_Kinect_CoordinateMappingChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
76 + var callbackList = Windows_Kinect_CoordinateMappingChangedEventArgs_Delegate_callbacks[_pNative];
77 + lock (callbackList)
78 + {
79 + callbackList.Add(value);
80 + if(callbackList.Count == 1)
81 + {
82 + var del = new _Windows_Kinect_CoordinateMappingChangedEventArgs_Delegate(Windows_Kinect_CoordinateMappingChangedEventArgs_Delegate_Handler);
83 + _Windows_Kinect_CoordinateMappingChangedEventArgs_Delegate_Handle = RootSystem.Runtime.InteropServices.GCHandle.Alloc(del);
84 + Windows_Kinect_CoordinateMapper_add_CoordinateMappingChanged(_pNative, del, false);
85 + }
86 + }
87 + }
88 + remove
89 + {
90 + if (_pNative == RootSystem.IntPtr.Zero)
91 + {
92 + return;
93 + }
94 +
95 + Windows_Kinect_CoordinateMappingChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
96 + var callbackList = Windows_Kinect_CoordinateMappingChangedEventArgs_Delegate_callbacks[_pNative];
97 + lock (callbackList)
98 + {
99 + callbackList.Remove(value);
100 + if(callbackList.Count == 0)
101 + {
102 + Windows_Kinect_CoordinateMapper_add_CoordinateMappingChanged(_pNative, Windows_Kinect_CoordinateMappingChangedEventArgs_Delegate_Handler, true);
103 + _Windows_Kinect_CoordinateMappingChangedEventArgs_Delegate_Handle.Free();
104 + }
105 + }
106 + }
107 + }
108 +
109 +
110 + // Public Methods
111 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
112 + private static extern RootSystem.IntPtr Windows_Kinect_CoordinateMapper_MapCameraPointToDepthSpace(RootSystem.IntPtr pNative, Windows.Kinect.CameraSpacePoint cameraPoint);
113 + public Windows.Kinect.DepthSpacePoint MapCameraPointToDepthSpace(Windows.Kinect.CameraSpacePoint cameraPoint)
114 + {
115 + if (_pNative == RootSystem.IntPtr.Zero)
116 + {
117 + throw new RootSystem.ObjectDisposedException("CoordinateMapper");
118 + }
119 +
120 + var objectPointer = Windows_Kinect_CoordinateMapper_MapCameraPointToDepthSpace(_pNative, cameraPoint);
121 + Helper.ExceptionHelper.CheckLastError();
122 + var obj = (Windows.Kinect.DepthSpacePoint)RootSystem.Runtime.InteropServices.Marshal.PtrToStructure(objectPointer, typeof(Windows.Kinect.DepthSpacePoint));
123 + RootSystem.Runtime.InteropServices.Marshal.FreeHGlobal(objectPointer);
124 + return obj;
125 + }
126 +
127 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
128 + private static extern RootSystem.IntPtr Windows_Kinect_CoordinateMapper_MapCameraPointToColorSpace(RootSystem.IntPtr pNative, Windows.Kinect.CameraSpacePoint cameraPoint);
129 + public Windows.Kinect.ColorSpacePoint MapCameraPointToColorSpace(Windows.Kinect.CameraSpacePoint cameraPoint)
130 + {
131 + if (_pNative == RootSystem.IntPtr.Zero)
132 + {
133 + throw new RootSystem.ObjectDisposedException("CoordinateMapper");
134 + }
135 +
136 + var objectPointer = Windows_Kinect_CoordinateMapper_MapCameraPointToColorSpace(_pNative, cameraPoint);
137 + Helper.ExceptionHelper.CheckLastError();
138 + var obj = (Windows.Kinect.ColorSpacePoint)RootSystem.Runtime.InteropServices.Marshal.PtrToStructure(objectPointer, typeof(Windows.Kinect.ColorSpacePoint));
139 + RootSystem.Runtime.InteropServices.Marshal.FreeHGlobal(objectPointer);
140 + return obj;
141 + }
142 +
143 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
144 + private static extern RootSystem.IntPtr Windows_Kinect_CoordinateMapper_MapDepthPointToCameraSpace(RootSystem.IntPtr pNative, Windows.Kinect.DepthSpacePoint depthPoint, ushort depth);
145 + public Windows.Kinect.CameraSpacePoint MapDepthPointToCameraSpace(Windows.Kinect.DepthSpacePoint depthPoint, ushort depth)
146 + {
147 + if (_pNative == RootSystem.IntPtr.Zero)
148 + {
149 + throw new RootSystem.ObjectDisposedException("CoordinateMapper");
150 + }
151 +
152 + var objectPointer = Windows_Kinect_CoordinateMapper_MapDepthPointToCameraSpace(_pNative, depthPoint, depth);
153 + Helper.ExceptionHelper.CheckLastError();
154 + var obj = (Windows.Kinect.CameraSpacePoint)RootSystem.Runtime.InteropServices.Marshal.PtrToStructure(objectPointer, typeof(Windows.Kinect.CameraSpacePoint));
155 + RootSystem.Runtime.InteropServices.Marshal.FreeHGlobal(objectPointer);
156 + return obj;
157 + }
158 +
159 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
160 + private static extern RootSystem.IntPtr Windows_Kinect_CoordinateMapper_MapDepthPointToColorSpace(RootSystem.IntPtr pNative, Windows.Kinect.DepthSpacePoint depthPoint, ushort depth);
161 + public Windows.Kinect.ColorSpacePoint MapDepthPointToColorSpace(Windows.Kinect.DepthSpacePoint depthPoint, ushort depth)
162 + {
163 + if (_pNative == RootSystem.IntPtr.Zero)
164 + {
165 + throw new RootSystem.ObjectDisposedException("CoordinateMapper");
166 + }
167 +
168 + var objectPointer = Windows_Kinect_CoordinateMapper_MapDepthPointToColorSpace(_pNative, depthPoint, depth);
169 + Helper.ExceptionHelper.CheckLastError();
170 + var obj = (Windows.Kinect.ColorSpacePoint)RootSystem.Runtime.InteropServices.Marshal.PtrToStructure(objectPointer, typeof(Windows.Kinect.ColorSpacePoint));
171 + RootSystem.Runtime.InteropServices.Marshal.FreeHGlobal(objectPointer);
172 + return obj;
173 + }
174 +
175 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
176 + private static extern void Windows_Kinect_CoordinateMapper_MapCameraPointsToDepthSpace(RootSystem.IntPtr pNative, RootSystem.IntPtr cameraPoints, int cameraPointsSize, RootSystem.IntPtr depthPoints, int depthPointsSize);
177 + public void MapCameraPointsToDepthSpace(Windows.Kinect.CameraSpacePoint[] cameraPoints, Windows.Kinect.DepthSpacePoint[] depthPoints)
178 + {
179 + if (_pNative == RootSystem.IntPtr.Zero)
180 + {
181 + throw new RootSystem.ObjectDisposedException("CoordinateMapper");
182 + }
183 +
184 + var cameraPointsSmartGCHandle = new Helper.SmartGCHandle(RootSystem.Runtime.InteropServices.GCHandle.Alloc(cameraPoints, RootSystem.Runtime.InteropServices.GCHandleType.Pinned));
185 + var _cameraPoints = cameraPointsSmartGCHandle.AddrOfPinnedObject();
186 + var depthPointsSmartGCHandle = new Helper.SmartGCHandle(RootSystem.Runtime.InteropServices.GCHandle.Alloc(depthPoints, RootSystem.Runtime.InteropServices.GCHandleType.Pinned));
187 + var _depthPoints = depthPointsSmartGCHandle.AddrOfPinnedObject();
188 + Windows_Kinect_CoordinateMapper_MapCameraPointsToDepthSpace(_pNative, _cameraPoints, cameraPoints.Length, _depthPoints, depthPoints.Length);
189 + Helper.ExceptionHelper.CheckLastError();
190 + }
191 +
192 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
193 + private static extern void Windows_Kinect_CoordinateMapper_MapCameraPointsToColorSpace(RootSystem.IntPtr pNative, RootSystem.IntPtr cameraPoints, int cameraPointsSize, RootSystem.IntPtr colorPoints, int colorPointsSize);
194 + public void MapCameraPointsToColorSpace(Windows.Kinect.CameraSpacePoint[] cameraPoints, Windows.Kinect.ColorSpacePoint[] colorPoints)
195 + {
196 + if (_pNative == RootSystem.IntPtr.Zero)
197 + {
198 + throw new RootSystem.ObjectDisposedException("CoordinateMapper");
199 + }
200 +
201 + var cameraPointsSmartGCHandle = new Helper.SmartGCHandle(RootSystem.Runtime.InteropServices.GCHandle.Alloc(cameraPoints, RootSystem.Runtime.InteropServices.GCHandleType.Pinned));
202 + var _cameraPoints = cameraPointsSmartGCHandle.AddrOfPinnedObject();
203 + var colorPointsSmartGCHandle = new Helper.SmartGCHandle(RootSystem.Runtime.InteropServices.GCHandle.Alloc(colorPoints, RootSystem.Runtime.InteropServices.GCHandleType.Pinned));
204 + var _colorPoints = colorPointsSmartGCHandle.AddrOfPinnedObject();
205 + Windows_Kinect_CoordinateMapper_MapCameraPointsToColorSpace(_pNative, _cameraPoints, cameraPoints.Length, _colorPoints, colorPoints.Length);
206 + Helper.ExceptionHelper.CheckLastError();
207 + }
208 +
209 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
210 + private static extern void Windows_Kinect_CoordinateMapper_MapDepthPointsToCameraSpace(RootSystem.IntPtr pNative, RootSystem.IntPtr depthPoints, int depthPointsSize, RootSystem.IntPtr depths, int depthsSize, RootSystem.IntPtr cameraPoints, int cameraPointsSize);
211 + public void MapDepthPointsToCameraSpace(Windows.Kinect.DepthSpacePoint[] depthPoints, ushort[] depths, Windows.Kinect.CameraSpacePoint[] cameraPoints)
212 + {
213 + if (_pNative == RootSystem.IntPtr.Zero)
214 + {
215 + throw new RootSystem.ObjectDisposedException("CoordinateMapper");
216 + }
217 +
218 + var depthPointsSmartGCHandle = new Helper.SmartGCHandle(RootSystem.Runtime.InteropServices.GCHandle.Alloc(depthPoints, RootSystem.Runtime.InteropServices.GCHandleType.Pinned));
219 + var _depthPoints = depthPointsSmartGCHandle.AddrOfPinnedObject();
220 + var depthsSmartGCHandle = new Helper.SmartGCHandle(RootSystem.Runtime.InteropServices.GCHandle.Alloc(depths, RootSystem.Runtime.InteropServices.GCHandleType.Pinned));
221 + var _depths = depthsSmartGCHandle.AddrOfPinnedObject();
222 + var cameraPointsSmartGCHandle = new Helper.SmartGCHandle(RootSystem.Runtime.InteropServices.GCHandle.Alloc(cameraPoints, RootSystem.Runtime.InteropServices.GCHandleType.Pinned));
223 + var _cameraPoints = cameraPointsSmartGCHandle.AddrOfPinnedObject();
224 + Windows_Kinect_CoordinateMapper_MapDepthPointsToCameraSpace(_pNative, _depthPoints, depthPoints.Length, _depths, depths.Length, _cameraPoints, cameraPoints.Length);
225 + Helper.ExceptionHelper.CheckLastError();
226 + }
227 +
228 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
229 + private static extern void Windows_Kinect_CoordinateMapper_MapDepthPointsToColorSpace(RootSystem.IntPtr pNative, RootSystem.IntPtr depthPoints, int depthPointsSize, RootSystem.IntPtr depths, int depthsSize, RootSystem.IntPtr colorPoints, int colorPointsSize);
230 + public void MapDepthPointsToColorSpace(Windows.Kinect.DepthSpacePoint[] depthPoints, ushort[] depths, Windows.Kinect.ColorSpacePoint[] colorPoints)
231 + {
232 + if (_pNative == RootSystem.IntPtr.Zero)
233 + {
234 + throw new RootSystem.ObjectDisposedException("CoordinateMapper");
235 + }
236 +
237 + var depthPointsSmartGCHandle = new Helper.SmartGCHandle(RootSystem.Runtime.InteropServices.GCHandle.Alloc(depthPoints, RootSystem.Runtime.InteropServices.GCHandleType.Pinned));
238 + var _depthPoints = depthPointsSmartGCHandle.AddrOfPinnedObject();
239 + var depthsSmartGCHandle = new Helper.SmartGCHandle(RootSystem.Runtime.InteropServices.GCHandle.Alloc(depths, RootSystem.Runtime.InteropServices.GCHandleType.Pinned));
240 + var _depths = depthsSmartGCHandle.AddrOfPinnedObject();
241 + var colorPointsSmartGCHandle = new Helper.SmartGCHandle(RootSystem.Runtime.InteropServices.GCHandle.Alloc(colorPoints, RootSystem.Runtime.InteropServices.GCHandleType.Pinned));
242 + var _colorPoints = colorPointsSmartGCHandle.AddrOfPinnedObject();
243 + Windows_Kinect_CoordinateMapper_MapDepthPointsToColorSpace(_pNative, _depthPoints, depthPoints.Length, _depths, depths.Length, _colorPoints, colorPoints.Length);
244 + Helper.ExceptionHelper.CheckLastError();
245 + }
246 +
247 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
248 + private static extern void Windows_Kinect_CoordinateMapper_MapDepthFrameToCameraSpace(RootSystem.IntPtr pNative, RootSystem.IntPtr depthFrameData, int depthFrameDataSize, RootSystem.IntPtr cameraSpacePoints, int cameraSpacePointsSize);
249 + public void MapDepthFrameToCameraSpace(ushort[] depthFrameData, Windows.Kinect.CameraSpacePoint[] cameraSpacePoints)
250 + {
251 + if (_pNative == RootSystem.IntPtr.Zero)
252 + {
253 + throw new RootSystem.ObjectDisposedException("CoordinateMapper");
254 + }
255 +
256 + var depthFrameDataSmartGCHandle = new Helper.SmartGCHandle(RootSystem.Runtime.InteropServices.GCHandle.Alloc(depthFrameData, RootSystem.Runtime.InteropServices.GCHandleType.Pinned));
257 + var _depthFrameData = depthFrameDataSmartGCHandle.AddrOfPinnedObject();
258 + var cameraSpacePointsSmartGCHandle = new Helper.SmartGCHandle(RootSystem.Runtime.InteropServices.GCHandle.Alloc(cameraSpacePoints, RootSystem.Runtime.InteropServices.GCHandleType.Pinned));
259 + var _cameraSpacePoints = cameraSpacePointsSmartGCHandle.AddrOfPinnedObject();
260 + Windows_Kinect_CoordinateMapper_MapDepthFrameToCameraSpace(_pNative, _depthFrameData, depthFrameData.Length, _cameraSpacePoints, cameraSpacePoints.Length);
261 + Helper.ExceptionHelper.CheckLastError();
262 + }
263 +
264 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
265 + private static extern void Windows_Kinect_CoordinateMapper_MapDepthFrameToColorSpace(RootSystem.IntPtr pNative, RootSystem.IntPtr depthFrameData, int depthFrameDataSize, RootSystem.IntPtr colorSpacePoints, int colorSpacePointsSize);
266 + public void MapDepthFrameToColorSpace(ushort[] depthFrameData, Windows.Kinect.ColorSpacePoint[] colorSpacePoints)
267 + {
268 + if (_pNative == RootSystem.IntPtr.Zero)
269 + {
270 + throw new RootSystem.ObjectDisposedException("CoordinateMapper");
271 + }
272 +
273 + var depthFrameDataSmartGCHandle = new Helper.SmartGCHandle(RootSystem.Runtime.InteropServices.GCHandle.Alloc(depthFrameData, RootSystem.Runtime.InteropServices.GCHandleType.Pinned));
274 + var _depthFrameData = depthFrameDataSmartGCHandle.AddrOfPinnedObject();
275 + var colorSpacePointsSmartGCHandle = new Helper.SmartGCHandle(RootSystem.Runtime.InteropServices.GCHandle.Alloc(colorSpacePoints, RootSystem.Runtime.InteropServices.GCHandleType.Pinned));
276 + var _colorSpacePoints = colorSpacePointsSmartGCHandle.AddrOfPinnedObject();
277 + Windows_Kinect_CoordinateMapper_MapDepthFrameToColorSpace(_pNative, _depthFrameData, depthFrameData.Length, _colorSpacePoints, colorSpacePoints.Length);
278 + Helper.ExceptionHelper.CheckLastError();
279 + }
280 +
281 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
282 + private static extern void Windows_Kinect_CoordinateMapper_MapColorFrameToDepthSpace(RootSystem.IntPtr pNative, RootSystem.IntPtr depthFrameData, int depthFrameDataSize, RootSystem.IntPtr depthSpacePoints, int depthSpacePointsSize);
283 + public void MapColorFrameToDepthSpace(ushort[] depthFrameData, Windows.Kinect.DepthSpacePoint[] depthSpacePoints)
284 + {
285 + if (_pNative == RootSystem.IntPtr.Zero)
286 + {
287 + throw new RootSystem.ObjectDisposedException("CoordinateMapper");
288 + }
289 +
290 + var depthFrameDataSmartGCHandle = new Helper.SmartGCHandle(RootSystem.Runtime.InteropServices.GCHandle.Alloc(depthFrameData, RootSystem.Runtime.InteropServices.GCHandleType.Pinned));
291 + var _depthFrameData = depthFrameDataSmartGCHandle.AddrOfPinnedObject();
292 + var depthSpacePointsSmartGCHandle = new Helper.SmartGCHandle(RootSystem.Runtime.InteropServices.GCHandle.Alloc(depthSpacePoints, RootSystem.Runtime.InteropServices.GCHandleType.Pinned));
293 + var _depthSpacePoints = depthSpacePointsSmartGCHandle.AddrOfPinnedObject();
294 + Windows_Kinect_CoordinateMapper_MapColorFrameToDepthSpace(_pNative, _depthFrameData, depthFrameData.Length, _depthSpacePoints, depthSpacePoints.Length);
295 + Helper.ExceptionHelper.CheckLastError();
296 + }
297 +
298 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
299 + private static extern void Windows_Kinect_CoordinateMapper_MapColorFrameToCameraSpace(RootSystem.IntPtr pNative, RootSystem.IntPtr depthFrameData, int depthFrameDataSize, RootSystem.IntPtr cameraSpacePoints, int cameraSpacePointsSize);
300 + public void MapColorFrameToCameraSpace(ushort[] depthFrameData, Windows.Kinect.CameraSpacePoint[] cameraSpacePoints)
301 + {
302 + if (_pNative == RootSystem.IntPtr.Zero)
303 + {
304 + throw new RootSystem.ObjectDisposedException("CoordinateMapper");
305 + }
306 +
307 + var depthFrameDataSmartGCHandle = new Helper.SmartGCHandle(RootSystem.Runtime.InteropServices.GCHandle.Alloc(depthFrameData, RootSystem.Runtime.InteropServices.GCHandleType.Pinned));
308 + var _depthFrameData = depthFrameDataSmartGCHandle.AddrOfPinnedObject();
309 + var cameraSpacePointsSmartGCHandle = new Helper.SmartGCHandle(RootSystem.Runtime.InteropServices.GCHandle.Alloc(cameraSpacePoints, RootSystem.Runtime.InteropServices.GCHandleType.Pinned));
310 + var _cameraSpacePoints = cameraSpacePointsSmartGCHandle.AddrOfPinnedObject();
311 + Windows_Kinect_CoordinateMapper_MapColorFrameToCameraSpace(_pNative, _depthFrameData, depthFrameData.Length, _cameraSpacePoints, cameraSpacePoints.Length);
312 + Helper.ExceptionHelper.CheckLastError();
313 + }
314 +
315 + private void __EventCleanup()
316 + {
317 + {
318 + Windows_Kinect_CoordinateMappingChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
319 + var callbackList = Windows_Kinect_CoordinateMappingChangedEventArgs_Delegate_callbacks[_pNative];
320 + lock (callbackList)
321 + {
322 + if (callbackList.Count > 0)
323 + {
324 + callbackList.Clear();
325 + if (_pNative != RootSystem.IntPtr.Zero)
326 + {
327 + Windows_Kinect_CoordinateMapper_add_CoordinateMappingChanged(_pNative, Windows_Kinect_CoordinateMappingChangedEventArgs_Delegate_Handler, true);
328 + }
329 + _Windows_Kinect_CoordinateMappingChangedEventArgs_Delegate_Handle.Free();
330 + }
331 + }
332 + }
333 + }
334 + }
335 +
336 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.CoordinateMappingChangedEventArgs
8 + //
9 + public sealed partial class CoordinateMappingChangedEventArgs : RootSystem.EventArgs, Helper.INativeWrapper
10 +
11 + {
12 + internal RootSystem.IntPtr _pNative;
13 + RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
14 +
15 + // Constructors and Finalizers
16 + internal CoordinateMappingChangedEventArgs(RootSystem.IntPtr pNative)
17 + {
18 + _pNative = pNative;
19 + Windows_Kinect_CoordinateMappingChangedEventArgs_AddRefObject(ref _pNative);
20 + }
21 +
22 + ~CoordinateMappingChangedEventArgs()
23 + {
24 + Dispose(false);
25 + }
26 +
27 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
28 + private static extern void Windows_Kinect_CoordinateMappingChangedEventArgs_ReleaseObject(ref RootSystem.IntPtr pNative);
29 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
30 + private static extern void Windows_Kinect_CoordinateMappingChangedEventArgs_AddRefObject(ref RootSystem.IntPtr pNative);
31 + private void Dispose(bool disposing)
32 + {
33 + if (_pNative == RootSystem.IntPtr.Zero)
34 + {
35 + return;
36 + }
37 +
38 + __EventCleanup();
39 +
40 + Helper.NativeObjectCache.RemoveObject<CoordinateMappingChangedEventArgs>(_pNative);
41 + Windows_Kinect_CoordinateMappingChangedEventArgs_ReleaseObject(ref _pNative);
42 +
43 + _pNative = RootSystem.IntPtr.Zero;
44 + }
45 +
46 + private void __EventCleanup()
47 + {
48 + }
49 + }
50 +
51 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.DepthFrame
8 + //
9 + public sealed partial class DepthFrame : RootSystem.IDisposable, Helper.INativeWrapper
10 +
11 + {
12 + internal RootSystem.IntPtr _pNative;
13 + RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
14 +
15 + // Constructors and Finalizers
16 + internal DepthFrame(RootSystem.IntPtr pNative)
17 + {
18 + _pNative = pNative;
19 + Windows_Kinect_DepthFrame_AddRefObject(ref _pNative);
20 + }
21 +
22 + ~DepthFrame()
23 + {
24 + Dispose(false);
25 + }
26 +
27 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
28 + private static extern void Windows_Kinect_DepthFrame_ReleaseObject(ref RootSystem.IntPtr pNative);
29 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
30 + private static extern void Windows_Kinect_DepthFrame_AddRefObject(ref RootSystem.IntPtr pNative);
31 + private void Dispose(bool disposing)
32 + {
33 + if (_pNative == RootSystem.IntPtr.Zero)
34 + {
35 + return;
36 + }
37 +
38 + __EventCleanup();
39 +
40 + Helper.NativeObjectCache.RemoveObject<DepthFrame>(_pNative);
41 +
42 + if (disposing)
43 + {
44 + Windows_Kinect_DepthFrame_Dispose(_pNative);
45 + }
46 + Windows_Kinect_DepthFrame_ReleaseObject(ref _pNative);
47 +
48 + _pNative = RootSystem.IntPtr.Zero;
49 + }
50 +
51 +
52 + // Public Properties
53 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
54 + private static extern RootSystem.IntPtr Windows_Kinect_DepthFrame_get_DepthFrameSource(RootSystem.IntPtr pNative);
55 + public Windows.Kinect.DepthFrameSource DepthFrameSource
56 + {
57 + get
58 + {
59 + if (_pNative == RootSystem.IntPtr.Zero)
60 + {
61 + throw new RootSystem.ObjectDisposedException("DepthFrame");
62 + }
63 +
64 + RootSystem.IntPtr objectPointer = Windows_Kinect_DepthFrame_get_DepthFrameSource(_pNative);
65 + Helper.ExceptionHelper.CheckLastError();
66 + if (objectPointer == RootSystem.IntPtr.Zero)
67 + {
68 + return null;
69 + }
70 +
71 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.DepthFrameSource>(objectPointer, n => new Windows.Kinect.DepthFrameSource(n));
72 + }
73 + }
74 +
75 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
76 + private static extern ushort Windows_Kinect_DepthFrame_get_DepthMaxReliableDistance(RootSystem.IntPtr pNative);
77 + public ushort DepthMaxReliableDistance
78 + {
79 + get
80 + {
81 + if (_pNative == RootSystem.IntPtr.Zero)
82 + {
83 + throw new RootSystem.ObjectDisposedException("DepthFrame");
84 + }
85 +
86 + return Windows_Kinect_DepthFrame_get_DepthMaxReliableDistance(_pNative);
87 + }
88 + }
89 +
90 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
91 + private static extern ushort Windows_Kinect_DepthFrame_get_DepthMinReliableDistance(RootSystem.IntPtr pNative);
92 + public ushort DepthMinReliableDistance
93 + {
94 + get
95 + {
96 + if (_pNative == RootSystem.IntPtr.Zero)
97 + {
98 + throw new RootSystem.ObjectDisposedException("DepthFrame");
99 + }
100 +
101 + return Windows_Kinect_DepthFrame_get_DepthMinReliableDistance(_pNative);
102 + }
103 + }
104 +
105 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
106 + private static extern RootSystem.IntPtr Windows_Kinect_DepthFrame_get_FrameDescription(RootSystem.IntPtr pNative);
107 + public Windows.Kinect.FrameDescription FrameDescription
108 + {
109 + get
110 + {
111 + if (_pNative == RootSystem.IntPtr.Zero)
112 + {
113 + throw new RootSystem.ObjectDisposedException("DepthFrame");
114 + }
115 +
116 + RootSystem.IntPtr objectPointer = Windows_Kinect_DepthFrame_get_FrameDescription(_pNative);
117 + Helper.ExceptionHelper.CheckLastError();
118 + if (objectPointer == RootSystem.IntPtr.Zero)
119 + {
120 + return null;
121 + }
122 +
123 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.FrameDescription>(objectPointer, n => new Windows.Kinect.FrameDescription(n));
124 + }
125 + }
126 +
127 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
128 + private static extern long Windows_Kinect_DepthFrame_get_RelativeTime(RootSystem.IntPtr pNative);
129 + public RootSystem.TimeSpan RelativeTime
130 + {
131 + get
132 + {
133 + if (_pNative == RootSystem.IntPtr.Zero)
134 + {
135 + throw new RootSystem.ObjectDisposedException("DepthFrame");
136 + }
137 +
138 + return RootSystem.TimeSpan.FromMilliseconds(Windows_Kinect_DepthFrame_get_RelativeTime(_pNative));
139 + }
140 + }
141 +
142 +
143 + // Public Methods
144 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
145 + private static extern void Windows_Kinect_DepthFrame_CopyFrameDataToArray(RootSystem.IntPtr pNative, RootSystem.IntPtr frameData, int frameDataSize);
146 + public void CopyFrameDataToArray(ushort[] frameData)
147 + {
148 + if (_pNative == RootSystem.IntPtr.Zero)
149 + {
150 + throw new RootSystem.ObjectDisposedException("DepthFrame");
151 + }
152 +
153 + var frameDataSmartGCHandle = new Helper.SmartGCHandle(RootSystem.Runtime.InteropServices.GCHandle.Alloc(frameData, RootSystem.Runtime.InteropServices.GCHandleType.Pinned));
154 + var _frameData = frameDataSmartGCHandle.AddrOfPinnedObject();
155 + Windows_Kinect_DepthFrame_CopyFrameDataToArray(_pNative, _frameData, frameData.Length);
156 + Helper.ExceptionHelper.CheckLastError();
157 + }
158 +
159 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
160 + private static extern void Windows_Kinect_DepthFrame_Dispose(RootSystem.IntPtr pNative);
161 + public void Dispose()
162 + {
163 + if (_pNative == RootSystem.IntPtr.Zero)
164 + {
165 + return;
166 + }
167 +
168 + Dispose(true);
169 + RootSystem.GC.SuppressFinalize(this);
170 + }
171 +
172 + private void __EventCleanup()
173 + {
174 + }
175 + }
176 +
177 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.DepthFrameArrivedEventArgs
8 + //
9 + public sealed partial class DepthFrameArrivedEventArgs : RootSystem.EventArgs, Helper.INativeWrapper
10 +
11 + {
12 + internal RootSystem.IntPtr _pNative;
13 + RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
14 +
15 + // Constructors and Finalizers
16 + internal DepthFrameArrivedEventArgs(RootSystem.IntPtr pNative)
17 + {
18 + _pNative = pNative;
19 + Windows_Kinect_DepthFrameArrivedEventArgs_AddRefObject(ref _pNative);
20 + }
21 +
22 + ~DepthFrameArrivedEventArgs()
23 + {
24 + Dispose(false);
25 + }
26 +
27 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
28 + private static extern void Windows_Kinect_DepthFrameArrivedEventArgs_ReleaseObject(ref RootSystem.IntPtr pNative);
29 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
30 + private static extern void Windows_Kinect_DepthFrameArrivedEventArgs_AddRefObject(ref RootSystem.IntPtr pNative);
31 + private void Dispose(bool disposing)
32 + {
33 + if (_pNative == RootSystem.IntPtr.Zero)
34 + {
35 + return;
36 + }
37 +
38 + __EventCleanup();
39 +
40 + Helper.NativeObjectCache.RemoveObject<DepthFrameArrivedEventArgs>(_pNative);
41 + Windows_Kinect_DepthFrameArrivedEventArgs_ReleaseObject(ref _pNative);
42 +
43 + _pNative = RootSystem.IntPtr.Zero;
44 + }
45 +
46 +
47 + // Public Properties
48 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
49 + private static extern RootSystem.IntPtr Windows_Kinect_DepthFrameArrivedEventArgs_get_FrameReference(RootSystem.IntPtr pNative);
50 + public Windows.Kinect.DepthFrameReference FrameReference
51 + {
52 + get
53 + {
54 + if (_pNative == RootSystem.IntPtr.Zero)
55 + {
56 + throw new RootSystem.ObjectDisposedException("DepthFrameArrivedEventArgs");
57 + }
58 +
59 + RootSystem.IntPtr objectPointer = Windows_Kinect_DepthFrameArrivedEventArgs_get_FrameReference(_pNative);
60 + Helper.ExceptionHelper.CheckLastError();
61 + if (objectPointer == RootSystem.IntPtr.Zero)
62 + {
63 + return null;
64 + }
65 +
66 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.DepthFrameReference>(objectPointer, n => new Windows.Kinect.DepthFrameReference(n));
67 + }
68 + }
69 +
70 + private void __EventCleanup()
71 + {
72 + }
73 + }
74 +
75 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.DepthFrameReader
8 + //
9 + public sealed partial class DepthFrameReader : RootSystem.IDisposable, Helper.INativeWrapper
10 +
11 + {
12 + internal RootSystem.IntPtr _pNative;
13 + RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
14 +
15 + // Constructors and Finalizers
16 + internal DepthFrameReader(RootSystem.IntPtr pNative)
17 + {
18 + _pNative = pNative;
19 + Windows_Kinect_DepthFrameReader_AddRefObject(ref _pNative);
20 + }
21 +
22 + ~DepthFrameReader()
23 + {
24 + Dispose(false);
25 + }
26 +
27 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
28 + private static extern void Windows_Kinect_DepthFrameReader_ReleaseObject(ref RootSystem.IntPtr pNative);
29 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
30 + private static extern void Windows_Kinect_DepthFrameReader_AddRefObject(ref RootSystem.IntPtr pNative);
31 + private void Dispose(bool disposing)
32 + {
33 + if (_pNative == RootSystem.IntPtr.Zero)
34 + {
35 + return;
36 + }
37 +
38 + __EventCleanup();
39 +
40 + Helper.NativeObjectCache.RemoveObject<DepthFrameReader>(_pNative);
41 +
42 + if (disposing)
43 + {
44 + Windows_Kinect_DepthFrameReader_Dispose(_pNative);
45 + }
46 + Windows_Kinect_DepthFrameReader_ReleaseObject(ref _pNative);
47 +
48 + _pNative = RootSystem.IntPtr.Zero;
49 + }
50 +
51 +
52 + // Public Properties
53 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
54 + private static extern RootSystem.IntPtr Windows_Kinect_DepthFrameReader_get_DepthFrameSource(RootSystem.IntPtr pNative);
55 + public Windows.Kinect.DepthFrameSource DepthFrameSource
56 + {
57 + get
58 + {
59 + if (_pNative == RootSystem.IntPtr.Zero)
60 + {
61 + throw new RootSystem.ObjectDisposedException("DepthFrameReader");
62 + }
63 +
64 + RootSystem.IntPtr objectPointer = Windows_Kinect_DepthFrameReader_get_DepthFrameSource(_pNative);
65 + Helper.ExceptionHelper.CheckLastError();
66 + if (objectPointer == RootSystem.IntPtr.Zero)
67 + {
68 + return null;
69 + }
70 +
71 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.DepthFrameSource>(objectPointer, n => new Windows.Kinect.DepthFrameSource(n));
72 + }
73 + }
74 +
75 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
76 + private static extern bool Windows_Kinect_DepthFrameReader_get_IsPaused(RootSystem.IntPtr pNative);
77 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
78 + private static extern void Windows_Kinect_DepthFrameReader_put_IsPaused(RootSystem.IntPtr pNative, bool isPaused);
79 + public bool IsPaused
80 + {
81 + get
82 + {
83 + if (_pNative == RootSystem.IntPtr.Zero)
84 + {
85 + throw new RootSystem.ObjectDisposedException("DepthFrameReader");
86 + }
87 +
88 + return Windows_Kinect_DepthFrameReader_get_IsPaused(_pNative);
89 + }
90 + set
91 + {
92 + if (_pNative == RootSystem.IntPtr.Zero)
93 + {
94 + throw new RootSystem.ObjectDisposedException("DepthFrameReader");
95 + }
96 +
97 + Windows_Kinect_DepthFrameReader_put_IsPaused(_pNative, value);
98 + Helper.ExceptionHelper.CheckLastError();
99 + }
100 + }
101 +
102 +
103 + // Events
104 + private static RootSystem.Runtime.InteropServices.GCHandle _Windows_Kinect_DepthFrameArrivedEventArgs_Delegate_Handle;
105 + [RootSystem.Runtime.InteropServices.UnmanagedFunctionPointer(RootSystem.Runtime.InteropServices.CallingConvention.Cdecl)]
106 + private delegate void _Windows_Kinect_DepthFrameArrivedEventArgs_Delegate(RootSystem.IntPtr args, RootSystem.IntPtr pNative);
107 + private static Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Kinect.DepthFrameArrivedEventArgs>>> Windows_Kinect_DepthFrameArrivedEventArgs_Delegate_callbacks = new Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Kinect.DepthFrameArrivedEventArgs>>>();
108 + [AOT.MonoPInvokeCallbackAttribute(typeof(_Windows_Kinect_DepthFrameArrivedEventArgs_Delegate))]
109 + private static void Windows_Kinect_DepthFrameArrivedEventArgs_Delegate_Handler(RootSystem.IntPtr result, RootSystem.IntPtr pNative)
110 + {
111 + List<RootSystem.EventHandler<Windows.Kinect.DepthFrameArrivedEventArgs>> callbackList = null;
112 + Windows_Kinect_DepthFrameArrivedEventArgs_Delegate_callbacks.TryGetValue(pNative, out callbackList);
113 + lock(callbackList)
114 + {
115 + var objThis = Helper.NativeObjectCache.GetObject<DepthFrameReader>(pNative);
116 + var args = new Windows.Kinect.DepthFrameArrivedEventArgs(result);
117 + foreach(var func in callbackList)
118 + {
119 + Helper.EventPump.Instance.Enqueue(() => { try { func(objThis, args); } catch { } });
120 + }
121 + }
122 + }
123 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
124 + private static extern void Windows_Kinect_DepthFrameReader_add_FrameArrived(RootSystem.IntPtr pNative, _Windows_Kinect_DepthFrameArrivedEventArgs_Delegate eventCallback, bool unsubscribe);
125 + public event RootSystem.EventHandler<Windows.Kinect.DepthFrameArrivedEventArgs> FrameArrived
126 + {
127 + add
128 + {
129 + Helper.EventPump.EnsureInitialized();
130 +
131 + Windows_Kinect_DepthFrameArrivedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
132 + var callbackList = Windows_Kinect_DepthFrameArrivedEventArgs_Delegate_callbacks[_pNative];
133 + lock (callbackList)
134 + {
135 + callbackList.Add(value);
136 + if(callbackList.Count == 1)
137 + {
138 + var del = new _Windows_Kinect_DepthFrameArrivedEventArgs_Delegate(Windows_Kinect_DepthFrameArrivedEventArgs_Delegate_Handler);
139 + _Windows_Kinect_DepthFrameArrivedEventArgs_Delegate_Handle = RootSystem.Runtime.InteropServices.GCHandle.Alloc(del);
140 + Windows_Kinect_DepthFrameReader_add_FrameArrived(_pNative, del, false);
141 + }
142 + }
143 + }
144 + remove
145 + {
146 + if (_pNative == RootSystem.IntPtr.Zero)
147 + {
148 + return;
149 + }
150 +
151 + Windows_Kinect_DepthFrameArrivedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
152 + var callbackList = Windows_Kinect_DepthFrameArrivedEventArgs_Delegate_callbacks[_pNative];
153 + lock (callbackList)
154 + {
155 + callbackList.Remove(value);
156 + if(callbackList.Count == 0)
157 + {
158 + Windows_Kinect_DepthFrameReader_add_FrameArrived(_pNative, Windows_Kinect_DepthFrameArrivedEventArgs_Delegate_Handler, true);
159 + _Windows_Kinect_DepthFrameArrivedEventArgs_Delegate_Handle.Free();
160 + }
161 + }
162 + }
163 + }
164 +
165 + private static RootSystem.Runtime.InteropServices.GCHandle _Windows_Data_PropertyChangedEventArgs_Delegate_Handle;
166 + [RootSystem.Runtime.InteropServices.UnmanagedFunctionPointer(RootSystem.Runtime.InteropServices.CallingConvention.Cdecl)]
167 + private delegate void _Windows_Data_PropertyChangedEventArgs_Delegate(RootSystem.IntPtr args, RootSystem.IntPtr pNative);
168 + private static Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs>>> Windows_Data_PropertyChangedEventArgs_Delegate_callbacks = new Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs>>>();
169 + [AOT.MonoPInvokeCallbackAttribute(typeof(_Windows_Data_PropertyChangedEventArgs_Delegate))]
170 + private static void Windows_Data_PropertyChangedEventArgs_Delegate_Handler(RootSystem.IntPtr result, RootSystem.IntPtr pNative)
171 + {
172 + List<RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs>> callbackList = null;
173 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryGetValue(pNative, out callbackList);
174 + lock(callbackList)
175 + {
176 + var objThis = Helper.NativeObjectCache.GetObject<DepthFrameReader>(pNative);
177 + var args = new Windows.Data.PropertyChangedEventArgs(result);
178 + foreach(var func in callbackList)
179 + {
180 + Helper.EventPump.Instance.Enqueue(() => { try { func(objThis, args); } catch { } });
181 + }
182 + }
183 + }
184 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
185 + private static extern void Windows_Kinect_DepthFrameReader_add_PropertyChanged(RootSystem.IntPtr pNative, _Windows_Data_PropertyChangedEventArgs_Delegate eventCallback, bool unsubscribe);
186 + public event RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs> PropertyChanged
187 + {
188 + add
189 + {
190 + Helper.EventPump.EnsureInitialized();
191 +
192 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
193 + var callbackList = Windows_Data_PropertyChangedEventArgs_Delegate_callbacks[_pNative];
194 + lock (callbackList)
195 + {
196 + callbackList.Add(value);
197 + if(callbackList.Count == 1)
198 + {
199 + var del = new _Windows_Data_PropertyChangedEventArgs_Delegate(Windows_Data_PropertyChangedEventArgs_Delegate_Handler);
200 + _Windows_Data_PropertyChangedEventArgs_Delegate_Handle = RootSystem.Runtime.InteropServices.GCHandle.Alloc(del);
201 + Windows_Kinect_DepthFrameReader_add_PropertyChanged(_pNative, del, false);
202 + }
203 + }
204 + }
205 + remove
206 + {
207 + if (_pNative == RootSystem.IntPtr.Zero)
208 + {
209 + return;
210 + }
211 +
212 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
213 + var callbackList = Windows_Data_PropertyChangedEventArgs_Delegate_callbacks[_pNative];
214 + lock (callbackList)
215 + {
216 + callbackList.Remove(value);
217 + if(callbackList.Count == 0)
218 + {
219 + Windows_Kinect_DepthFrameReader_add_PropertyChanged(_pNative, Windows_Data_PropertyChangedEventArgs_Delegate_Handler, true);
220 + _Windows_Data_PropertyChangedEventArgs_Delegate_Handle.Free();
221 + }
222 + }
223 + }
224 + }
225 +
226 +
227 + // Public Methods
228 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
229 + private static extern RootSystem.IntPtr Windows_Kinect_DepthFrameReader_AcquireLatestFrame(RootSystem.IntPtr pNative);
230 + public Windows.Kinect.DepthFrame AcquireLatestFrame()
231 + {
232 + if (_pNative == RootSystem.IntPtr.Zero)
233 + {
234 + throw new RootSystem.ObjectDisposedException("DepthFrameReader");
235 + }
236 +
237 + RootSystem.IntPtr objectPointer = Windows_Kinect_DepthFrameReader_AcquireLatestFrame(_pNative);
238 + Helper.ExceptionHelper.CheckLastError();
239 + if (objectPointer == RootSystem.IntPtr.Zero)
240 + {
241 + return null;
242 + }
243 +
244 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.DepthFrame>(objectPointer, n => new Windows.Kinect.DepthFrame(n));
245 + }
246 +
247 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
248 + private static extern void Windows_Kinect_DepthFrameReader_Dispose(RootSystem.IntPtr pNative);
249 + public void Dispose()
250 + {
251 + if (_pNative == RootSystem.IntPtr.Zero)
252 + {
253 + return;
254 + }
255 +
256 + Dispose(true);
257 + RootSystem.GC.SuppressFinalize(this);
258 + }
259 +
260 + private void __EventCleanup()
261 + {
262 + {
263 + Windows_Kinect_DepthFrameArrivedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
264 + var callbackList = Windows_Kinect_DepthFrameArrivedEventArgs_Delegate_callbacks[_pNative];
265 + lock (callbackList)
266 + {
267 + if (callbackList.Count > 0)
268 + {
269 + callbackList.Clear();
270 + if (_pNative != RootSystem.IntPtr.Zero)
271 + {
272 + Windows_Kinect_DepthFrameReader_add_FrameArrived(_pNative, Windows_Kinect_DepthFrameArrivedEventArgs_Delegate_Handler, true);
273 + }
274 + _Windows_Kinect_DepthFrameArrivedEventArgs_Delegate_Handle.Free();
275 + }
276 + }
277 + }
278 + {
279 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
280 + var callbackList = Windows_Data_PropertyChangedEventArgs_Delegate_callbacks[_pNative];
281 + lock (callbackList)
282 + {
283 + if (callbackList.Count > 0)
284 + {
285 + callbackList.Clear();
286 + if (_pNative != RootSystem.IntPtr.Zero)
287 + {
288 + Windows_Kinect_DepthFrameReader_add_PropertyChanged(_pNative, Windows_Data_PropertyChangedEventArgs_Delegate_Handler, true);
289 + }
290 + _Windows_Data_PropertyChangedEventArgs_Delegate_Handle.Free();
291 + }
292 + }
293 + }
294 + }
295 + }
296 +
297 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.DepthFrameReference
8 + //
9 + public sealed partial class DepthFrameReference : Helper.INativeWrapper
10 +
11 + {
12 + internal RootSystem.IntPtr _pNative;
13 + RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
14 +
15 + // Constructors and Finalizers
16 + internal DepthFrameReference(RootSystem.IntPtr pNative)
17 + {
18 + _pNative = pNative;
19 + Windows_Kinect_DepthFrameReference_AddRefObject(ref _pNative);
20 + }
21 +
22 + ~DepthFrameReference()
23 + {
24 + Dispose(false);
25 + }
26 +
27 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
28 + private static extern void Windows_Kinect_DepthFrameReference_ReleaseObject(ref RootSystem.IntPtr pNative);
29 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
30 + private static extern void Windows_Kinect_DepthFrameReference_AddRefObject(ref RootSystem.IntPtr pNative);
31 + private void Dispose(bool disposing)
32 + {
33 + if (_pNative == RootSystem.IntPtr.Zero)
34 + {
35 + return;
36 + }
37 +
38 + __EventCleanup();
39 +
40 + Helper.NativeObjectCache.RemoveObject<DepthFrameReference>(_pNative);
41 + Windows_Kinect_DepthFrameReference_ReleaseObject(ref _pNative);
42 +
43 + _pNative = RootSystem.IntPtr.Zero;
44 + }
45 +
46 +
47 + // Public Properties
48 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
49 + private static extern long Windows_Kinect_DepthFrameReference_get_RelativeTime(RootSystem.IntPtr pNative);
50 + public RootSystem.TimeSpan RelativeTime
51 + {
52 + get
53 + {
54 + if (_pNative == RootSystem.IntPtr.Zero)
55 + {
56 + throw new RootSystem.ObjectDisposedException("DepthFrameReference");
57 + }
58 +
59 + return RootSystem.TimeSpan.FromMilliseconds(Windows_Kinect_DepthFrameReference_get_RelativeTime(_pNative));
60 + }
61 + }
62 +
63 +
64 + // Public Methods
65 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
66 + private static extern RootSystem.IntPtr Windows_Kinect_DepthFrameReference_AcquireFrame(RootSystem.IntPtr pNative);
67 + public Windows.Kinect.DepthFrame AcquireFrame()
68 + {
69 + if (_pNative == RootSystem.IntPtr.Zero)
70 + {
71 + throw new RootSystem.ObjectDisposedException("DepthFrameReference");
72 + }
73 +
74 + RootSystem.IntPtr objectPointer = Windows_Kinect_DepthFrameReference_AcquireFrame(_pNative);
75 + Helper.ExceptionHelper.CheckLastError();
76 + if (objectPointer == RootSystem.IntPtr.Zero)
77 + {
78 + return null;
79 + }
80 +
81 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.DepthFrame>(objectPointer, n => new Windows.Kinect.DepthFrame(n));
82 + }
83 +
84 + private void __EventCleanup()
85 + {
86 + }
87 + }
88 +
89 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.DepthFrameSource
8 + //
9 + public sealed partial class DepthFrameSource : Helper.INativeWrapper
10 +
11 + {
12 + internal RootSystem.IntPtr _pNative;
13 + RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
14 +
15 + // Constructors and Finalizers
16 + internal DepthFrameSource(RootSystem.IntPtr pNative)
17 + {
18 + _pNative = pNative;
19 + Windows_Kinect_DepthFrameSource_AddRefObject(ref _pNative);
20 + }
21 +
22 + ~DepthFrameSource()
23 + {
24 + Dispose(false);
25 + }
26 +
27 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
28 + private static extern void Windows_Kinect_DepthFrameSource_ReleaseObject(ref RootSystem.IntPtr pNative);
29 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
30 + private static extern void Windows_Kinect_DepthFrameSource_AddRefObject(ref RootSystem.IntPtr pNative);
31 + private void Dispose(bool disposing)
32 + {
33 + if (_pNative == RootSystem.IntPtr.Zero)
34 + {
35 + return;
36 + }
37 +
38 + __EventCleanup();
39 +
40 + Helper.NativeObjectCache.RemoveObject<DepthFrameSource>(_pNative);
41 + Windows_Kinect_DepthFrameSource_ReleaseObject(ref _pNative);
42 +
43 + _pNative = RootSystem.IntPtr.Zero;
44 + }
45 +
46 +
47 + // Public Properties
48 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
49 + private static extern ushort Windows_Kinect_DepthFrameSource_get_DepthMaxReliableDistance(RootSystem.IntPtr pNative);
50 + public ushort DepthMaxReliableDistance
51 + {
52 + get
53 + {
54 + if (_pNative == RootSystem.IntPtr.Zero)
55 + {
56 + throw new RootSystem.ObjectDisposedException("DepthFrameSource");
57 + }
58 +
59 + return Windows_Kinect_DepthFrameSource_get_DepthMaxReliableDistance(_pNative);
60 + }
61 + }
62 +
63 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
64 + private static extern ushort Windows_Kinect_DepthFrameSource_get_DepthMinReliableDistance(RootSystem.IntPtr pNative);
65 + public ushort DepthMinReliableDistance
66 + {
67 + get
68 + {
69 + if (_pNative == RootSystem.IntPtr.Zero)
70 + {
71 + throw new RootSystem.ObjectDisposedException("DepthFrameSource");
72 + }
73 +
74 + return Windows_Kinect_DepthFrameSource_get_DepthMinReliableDistance(_pNative);
75 + }
76 + }
77 +
78 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
79 + private static extern RootSystem.IntPtr Windows_Kinect_DepthFrameSource_get_FrameDescription(RootSystem.IntPtr pNative);
80 + public Windows.Kinect.FrameDescription FrameDescription
81 + {
82 + get
83 + {
84 + if (_pNative == RootSystem.IntPtr.Zero)
85 + {
86 + throw new RootSystem.ObjectDisposedException("DepthFrameSource");
87 + }
88 +
89 + RootSystem.IntPtr objectPointer = Windows_Kinect_DepthFrameSource_get_FrameDescription(_pNative);
90 + Helper.ExceptionHelper.CheckLastError();
91 + if (objectPointer == RootSystem.IntPtr.Zero)
92 + {
93 + return null;
94 + }
95 +
96 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.FrameDescription>(objectPointer, n => new Windows.Kinect.FrameDescription(n));
97 + }
98 + }
99 +
100 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
101 + private static extern bool Windows_Kinect_DepthFrameSource_get_IsActive(RootSystem.IntPtr pNative);
102 + public bool IsActive
103 + {
104 + get
105 + {
106 + if (_pNative == RootSystem.IntPtr.Zero)
107 + {
108 + throw new RootSystem.ObjectDisposedException("DepthFrameSource");
109 + }
110 +
111 + return Windows_Kinect_DepthFrameSource_get_IsActive(_pNative);
112 + }
113 + }
114 +
115 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
116 + private static extern RootSystem.IntPtr Windows_Kinect_DepthFrameSource_get_KinectSensor(RootSystem.IntPtr pNative);
117 + public Windows.Kinect.KinectSensor KinectSensor
118 + {
119 + get
120 + {
121 + if (_pNative == RootSystem.IntPtr.Zero)
122 + {
123 + throw new RootSystem.ObjectDisposedException("DepthFrameSource");
124 + }
125 +
126 + RootSystem.IntPtr objectPointer = Windows_Kinect_DepthFrameSource_get_KinectSensor(_pNative);
127 + Helper.ExceptionHelper.CheckLastError();
128 + if (objectPointer == RootSystem.IntPtr.Zero)
129 + {
130 + return null;
131 + }
132 +
133 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.KinectSensor>(objectPointer, n => new Windows.Kinect.KinectSensor(n));
134 + }
135 + }
136 +
137 +
138 + // Events
139 + private static RootSystem.Runtime.InteropServices.GCHandle _Windows_Kinect_FrameCapturedEventArgs_Delegate_Handle;
140 + [RootSystem.Runtime.InteropServices.UnmanagedFunctionPointer(RootSystem.Runtime.InteropServices.CallingConvention.Cdecl)]
141 + private delegate void _Windows_Kinect_FrameCapturedEventArgs_Delegate(RootSystem.IntPtr args, RootSystem.IntPtr pNative);
142 + private static Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Kinect.FrameCapturedEventArgs>>> Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks = new Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Kinect.FrameCapturedEventArgs>>>();
143 + [AOT.MonoPInvokeCallbackAttribute(typeof(_Windows_Kinect_FrameCapturedEventArgs_Delegate))]
144 + private static void Windows_Kinect_FrameCapturedEventArgs_Delegate_Handler(RootSystem.IntPtr result, RootSystem.IntPtr pNative)
145 + {
146 + List<RootSystem.EventHandler<Windows.Kinect.FrameCapturedEventArgs>> callbackList = null;
147 + Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks.TryGetValue(pNative, out callbackList);
148 + lock(callbackList)
149 + {
150 + var objThis = Helper.NativeObjectCache.GetObject<DepthFrameSource>(pNative);
151 + var args = new Windows.Kinect.FrameCapturedEventArgs(result);
152 + foreach(var func in callbackList)
153 + {
154 + Helper.EventPump.Instance.Enqueue(() => { try { func(objThis, args); } catch { } });
155 + }
156 + }
157 + }
158 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
159 + private static extern void Windows_Kinect_DepthFrameSource_add_FrameCaptured(RootSystem.IntPtr pNative, _Windows_Kinect_FrameCapturedEventArgs_Delegate eventCallback, bool unsubscribe);
160 + public event RootSystem.EventHandler<Windows.Kinect.FrameCapturedEventArgs> FrameCaptured
161 + {
162 + add
163 + {
164 + Helper.EventPump.EnsureInitialized();
165 +
166 + Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
167 + var callbackList = Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks[_pNative];
168 + lock (callbackList)
169 + {
170 + callbackList.Add(value);
171 + if(callbackList.Count == 1)
172 + {
173 + var del = new _Windows_Kinect_FrameCapturedEventArgs_Delegate(Windows_Kinect_FrameCapturedEventArgs_Delegate_Handler);
174 + _Windows_Kinect_FrameCapturedEventArgs_Delegate_Handle = RootSystem.Runtime.InteropServices.GCHandle.Alloc(del);
175 + Windows_Kinect_DepthFrameSource_add_FrameCaptured(_pNative, del, false);
176 + }
177 + }
178 + }
179 + remove
180 + {
181 + if (_pNative == RootSystem.IntPtr.Zero)
182 + {
183 + return;
184 + }
185 +
186 + Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
187 + var callbackList = Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks[_pNative];
188 + lock (callbackList)
189 + {
190 + callbackList.Remove(value);
191 + if(callbackList.Count == 0)
192 + {
193 + Windows_Kinect_DepthFrameSource_add_FrameCaptured(_pNative, Windows_Kinect_FrameCapturedEventArgs_Delegate_Handler, true);
194 + _Windows_Kinect_FrameCapturedEventArgs_Delegate_Handle.Free();
195 + }
196 + }
197 + }
198 + }
199 +
200 + private static RootSystem.Runtime.InteropServices.GCHandle _Windows_Data_PropertyChangedEventArgs_Delegate_Handle;
201 + [RootSystem.Runtime.InteropServices.UnmanagedFunctionPointer(RootSystem.Runtime.InteropServices.CallingConvention.Cdecl)]
202 + private delegate void _Windows_Data_PropertyChangedEventArgs_Delegate(RootSystem.IntPtr args, RootSystem.IntPtr pNative);
203 + private static Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs>>> Windows_Data_PropertyChangedEventArgs_Delegate_callbacks = new Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs>>>();
204 + [AOT.MonoPInvokeCallbackAttribute(typeof(_Windows_Data_PropertyChangedEventArgs_Delegate))]
205 + private static void Windows_Data_PropertyChangedEventArgs_Delegate_Handler(RootSystem.IntPtr result, RootSystem.IntPtr pNative)
206 + {
207 + List<RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs>> callbackList = null;
208 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryGetValue(pNative, out callbackList);
209 + lock(callbackList)
210 + {
211 + var objThis = Helper.NativeObjectCache.GetObject<DepthFrameSource>(pNative);
212 + var args = new Windows.Data.PropertyChangedEventArgs(result);
213 + foreach(var func in callbackList)
214 + {
215 + Helper.EventPump.Instance.Enqueue(() => { try { func(objThis, args); } catch { } });
216 + }
217 + }
218 + }
219 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
220 + private static extern void Windows_Kinect_DepthFrameSource_add_PropertyChanged(RootSystem.IntPtr pNative, _Windows_Data_PropertyChangedEventArgs_Delegate eventCallback, bool unsubscribe);
221 + public event RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs> PropertyChanged
222 + {
223 + add
224 + {
225 + Helper.EventPump.EnsureInitialized();
226 +
227 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
228 + var callbackList = Windows_Data_PropertyChangedEventArgs_Delegate_callbacks[_pNative];
229 + lock (callbackList)
230 + {
231 + callbackList.Add(value);
232 + if(callbackList.Count == 1)
233 + {
234 + var del = new _Windows_Data_PropertyChangedEventArgs_Delegate(Windows_Data_PropertyChangedEventArgs_Delegate_Handler);
235 + _Windows_Data_PropertyChangedEventArgs_Delegate_Handle = RootSystem.Runtime.InteropServices.GCHandle.Alloc(del);
236 + Windows_Kinect_DepthFrameSource_add_PropertyChanged(_pNative, del, false);
237 + }
238 + }
239 + }
240 + remove
241 + {
242 + if (_pNative == RootSystem.IntPtr.Zero)
243 + {
244 + return;
245 + }
246 +
247 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
248 + var callbackList = Windows_Data_PropertyChangedEventArgs_Delegate_callbacks[_pNative];
249 + lock (callbackList)
250 + {
251 + callbackList.Remove(value);
252 + if(callbackList.Count == 0)
253 + {
254 + Windows_Kinect_DepthFrameSource_add_PropertyChanged(_pNative, Windows_Data_PropertyChangedEventArgs_Delegate_Handler, true);
255 + _Windows_Data_PropertyChangedEventArgs_Delegate_Handle.Free();
256 + }
257 + }
258 + }
259 + }
260 +
261 +
262 + // Public Methods
263 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
264 + private static extern RootSystem.IntPtr Windows_Kinect_DepthFrameSource_OpenReader(RootSystem.IntPtr pNative);
265 + public Windows.Kinect.DepthFrameReader OpenReader()
266 + {
267 + if (_pNative == RootSystem.IntPtr.Zero)
268 + {
269 + throw new RootSystem.ObjectDisposedException("DepthFrameSource");
270 + }
271 +
272 + RootSystem.IntPtr objectPointer = Windows_Kinect_DepthFrameSource_OpenReader(_pNative);
273 + Helper.ExceptionHelper.CheckLastError();
274 + if (objectPointer == RootSystem.IntPtr.Zero)
275 + {
276 + return null;
277 + }
278 +
279 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.DepthFrameReader>(objectPointer, n => new Windows.Kinect.DepthFrameReader(n));
280 + }
281 +
282 + private void __EventCleanup()
283 + {
284 + {
285 + Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
286 + var callbackList = Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks[_pNative];
287 + lock (callbackList)
288 + {
289 + if (callbackList.Count > 0)
290 + {
291 + callbackList.Clear();
292 + if (_pNative != RootSystem.IntPtr.Zero)
293 + {
294 + Windows_Kinect_DepthFrameSource_add_FrameCaptured(_pNative, Windows_Kinect_FrameCapturedEventArgs_Delegate_Handler, true);
295 + }
296 + _Windows_Kinect_FrameCapturedEventArgs_Delegate_Handle.Free();
297 + }
298 + }
299 + }
300 + {
301 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
302 + var callbackList = Windows_Data_PropertyChangedEventArgs_Delegate_callbacks[_pNative];
303 + lock (callbackList)
304 + {
305 + if (callbackList.Count > 0)
306 + {
307 + callbackList.Clear();
308 + if (_pNative != RootSystem.IntPtr.Zero)
309 + {
310 + Windows_Kinect_DepthFrameSource_add_PropertyChanged(_pNative, Windows_Data_PropertyChangedEventArgs_Delegate_Handler, true);
311 + }
312 + _Windows_Data_PropertyChangedEventArgs_Delegate_Handle.Free();
313 + }
314 + }
315 + }
316 + }
317 + }
318 +
319 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.DepthSpacePoint
8 + //
9 + [RootSystem.Runtime.InteropServices.StructLayout(RootSystem.Runtime.InteropServices.LayoutKind.Sequential)]
10 + public struct DepthSpacePoint
11 + {
12 + public float X { get; set; }
13 + public float Y { get; set; }
14 +
15 + public override int GetHashCode()
16 + {
17 + return X.GetHashCode() ^ Y.GetHashCode();
18 + }
19 +
20 + public override bool Equals(object obj)
21 + {
22 + if (!(obj is DepthSpacePoint))
23 + {
24 + return false;
25 + }
26 +
27 + return this.Equals((DepthSpacePoint)obj);
28 + }
29 +
30 + public bool Equals(DepthSpacePoint obj)
31 + {
32 + return X.Equals(obj.X) && Y.Equals(obj.Y);
33 + }
34 +
35 + public static bool operator ==(DepthSpacePoint a, DepthSpacePoint b)
36 + {
37 + return a.Equals(b);
38 + }
39 +
40 + public static bool operator !=(DepthSpacePoint a, DepthSpacePoint b)
41 + {
42 + return !(a.Equals(b));
43 + }
44 + }
45 +
46 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.DetectionResult
8 + //
9 + public enum DetectionResult : int
10 + {
11 + Unknown =0,
12 + No =1,
13 + Maybe =2,
14 + Yes =3,
15 + }
16 +
17 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.Expression
8 + //
9 + public enum Expression : int
10 + {
11 + Neutral =0,
12 + Happy =1,
13 + }
14 +
15 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.FrameCapturedEventArgs
8 + //
9 + public sealed partial class FrameCapturedEventArgs : RootSystem.EventArgs, Helper.INativeWrapper
10 +
11 + {
12 + internal RootSystem.IntPtr _pNative;
13 + RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
14 +
15 + // Constructors and Finalizers
16 + internal FrameCapturedEventArgs(RootSystem.IntPtr pNative)
17 + {
18 + _pNative = pNative;
19 + Windows_Kinect_FrameCapturedEventArgs_AddRefObject(ref _pNative);
20 + }
21 +
22 + ~FrameCapturedEventArgs()
23 + {
24 + Dispose(false);
25 + }
26 +
27 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
28 + private static extern void Windows_Kinect_FrameCapturedEventArgs_ReleaseObject(ref RootSystem.IntPtr pNative);
29 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
30 + private static extern void Windows_Kinect_FrameCapturedEventArgs_AddRefObject(ref RootSystem.IntPtr pNative);
31 + private void Dispose(bool disposing)
32 + {
33 + if (_pNative == RootSystem.IntPtr.Zero)
34 + {
35 + return;
36 + }
37 +
38 + __EventCleanup();
39 +
40 + Helper.NativeObjectCache.RemoveObject<FrameCapturedEventArgs>(_pNative);
41 + Windows_Kinect_FrameCapturedEventArgs_ReleaseObject(ref _pNative);
42 +
43 + _pNative = RootSystem.IntPtr.Zero;
44 + }
45 +
46 +
47 + // Public Properties
48 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
49 + private static extern Windows.Kinect.FrameCapturedStatus Windows_Kinect_FrameCapturedEventArgs_get_FrameStatus(RootSystem.IntPtr pNative);
50 + public Windows.Kinect.FrameCapturedStatus FrameStatus
51 + {
52 + get
53 + {
54 + if (_pNative == RootSystem.IntPtr.Zero)
55 + {
56 + throw new RootSystem.ObjectDisposedException("FrameCapturedEventArgs");
57 + }
58 +
59 + return Windows_Kinect_FrameCapturedEventArgs_get_FrameStatus(_pNative);
60 + }
61 + }
62 +
63 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
64 + private static extern Windows.Kinect.FrameSourceTypes Windows_Kinect_FrameCapturedEventArgs_get_FrameType(RootSystem.IntPtr pNative);
65 + public Windows.Kinect.FrameSourceTypes FrameType
66 + {
67 + get
68 + {
69 + if (_pNative == RootSystem.IntPtr.Zero)
70 + {
71 + throw new RootSystem.ObjectDisposedException("FrameCapturedEventArgs");
72 + }
73 +
74 + return Windows_Kinect_FrameCapturedEventArgs_get_FrameType(_pNative);
75 + }
76 + }
77 +
78 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
79 + private static extern long Windows_Kinect_FrameCapturedEventArgs_get_RelativeTime(RootSystem.IntPtr pNative);
80 + public RootSystem.TimeSpan RelativeTime
81 + {
82 + get
83 + {
84 + if (_pNative == RootSystem.IntPtr.Zero)
85 + {
86 + throw new RootSystem.ObjectDisposedException("FrameCapturedEventArgs");
87 + }
88 +
89 + return RootSystem.TimeSpan.FromMilliseconds(Windows_Kinect_FrameCapturedEventArgs_get_RelativeTime(_pNative));
90 + }
91 + }
92 +
93 + private void __EventCleanup()
94 + {
95 + }
96 + }
97 +
98 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.FrameCapturedStatus
8 + //
9 + public enum FrameCapturedStatus : int
10 + {
11 + Unknown =0,
12 + Queued =1,
13 + Dropped =2,
14 + }
15 +
16 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.FrameDescription
8 + //
9 + public sealed partial class FrameDescription : Helper.INativeWrapper
10 +
11 + {
12 + internal RootSystem.IntPtr _pNative;
13 + RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
14 +
15 + // Constructors and Finalizers
16 + internal FrameDescription(RootSystem.IntPtr pNative)
17 + {
18 + _pNative = pNative;
19 + Windows_Kinect_FrameDescription_AddRefObject(ref _pNative);
20 + }
21 +
22 + ~FrameDescription()
23 + {
24 + Dispose(false);
25 + }
26 +
27 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
28 + private static extern void Windows_Kinect_FrameDescription_ReleaseObject(ref RootSystem.IntPtr pNative);
29 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
30 + private static extern void Windows_Kinect_FrameDescription_AddRefObject(ref RootSystem.IntPtr pNative);
31 + private void Dispose(bool disposing)
32 + {
33 + if (_pNative == RootSystem.IntPtr.Zero)
34 + {
35 + return;
36 + }
37 +
38 + __EventCleanup();
39 +
40 + Helper.NativeObjectCache.RemoveObject<FrameDescription>(_pNative);
41 + Windows_Kinect_FrameDescription_ReleaseObject(ref _pNative);
42 +
43 + _pNative = RootSystem.IntPtr.Zero;
44 + }
45 +
46 +
47 + // Public Properties
48 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
49 + private static extern uint Windows_Kinect_FrameDescription_get_BytesPerPixel(RootSystem.IntPtr pNative);
50 + public uint BytesPerPixel
51 + {
52 + get
53 + {
54 + if (_pNative == RootSystem.IntPtr.Zero)
55 + {
56 + throw new RootSystem.ObjectDisposedException("FrameDescription");
57 + }
58 +
59 + return Windows_Kinect_FrameDescription_get_BytesPerPixel(_pNative);
60 + }
61 + }
62 +
63 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
64 + private static extern float Windows_Kinect_FrameDescription_get_DiagonalFieldOfView(RootSystem.IntPtr pNative);
65 + public float DiagonalFieldOfView
66 + {
67 + get
68 + {
69 + if (_pNative == RootSystem.IntPtr.Zero)
70 + {
71 + throw new RootSystem.ObjectDisposedException("FrameDescription");
72 + }
73 +
74 + return Windows_Kinect_FrameDescription_get_DiagonalFieldOfView(_pNative);
75 + }
76 + }
77 +
78 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
79 + private static extern int Windows_Kinect_FrameDescription_get_Height(RootSystem.IntPtr pNative);
80 + public int Height
81 + {
82 + get
83 + {
84 + if (_pNative == RootSystem.IntPtr.Zero)
85 + {
86 + throw new RootSystem.ObjectDisposedException("FrameDescription");
87 + }
88 +
89 + return Windows_Kinect_FrameDescription_get_Height(_pNative);
90 + }
91 + }
92 +
93 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
94 + private static extern float Windows_Kinect_FrameDescription_get_HorizontalFieldOfView(RootSystem.IntPtr pNative);
95 + public float HorizontalFieldOfView
96 + {
97 + get
98 + {
99 + if (_pNative == RootSystem.IntPtr.Zero)
100 + {
101 + throw new RootSystem.ObjectDisposedException("FrameDescription");
102 + }
103 +
104 + return Windows_Kinect_FrameDescription_get_HorizontalFieldOfView(_pNative);
105 + }
106 + }
107 +
108 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
109 + private static extern uint Windows_Kinect_FrameDescription_get_LengthInPixels(RootSystem.IntPtr pNative);
110 + public uint LengthInPixels
111 + {
112 + get
113 + {
114 + if (_pNative == RootSystem.IntPtr.Zero)
115 + {
116 + throw new RootSystem.ObjectDisposedException("FrameDescription");
117 + }
118 +
119 + return Windows_Kinect_FrameDescription_get_LengthInPixels(_pNative);
120 + }
121 + }
122 +
123 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
124 + private static extern float Windows_Kinect_FrameDescription_get_VerticalFieldOfView(RootSystem.IntPtr pNative);
125 + public float VerticalFieldOfView
126 + {
127 + get
128 + {
129 + if (_pNative == RootSystem.IntPtr.Zero)
130 + {
131 + throw new RootSystem.ObjectDisposedException("FrameDescription");
132 + }
133 +
134 + return Windows_Kinect_FrameDescription_get_VerticalFieldOfView(_pNative);
135 + }
136 + }
137 +
138 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
139 + private static extern int Windows_Kinect_FrameDescription_get_Width(RootSystem.IntPtr pNative);
140 + public int Width
141 + {
142 + get
143 + {
144 + if (_pNative == RootSystem.IntPtr.Zero)
145 + {
146 + throw new RootSystem.ObjectDisposedException("FrameDescription");
147 + }
148 +
149 + return Windows_Kinect_FrameDescription_get_Width(_pNative);
150 + }
151 + }
152 +
153 + private void __EventCleanup()
154 + {
155 + }
156 + }
157 +
158 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.FrameEdges
8 + //
9 + [RootSystem.Flags]
10 + public enum FrameEdges : uint
11 + {
12 + None =0,
13 + Right =1,
14 + Left =2,
15 + Top =4,
16 + Bottom =8,
17 + }
18 +
19 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.FrameSourceTypes
8 + //
9 + [RootSystem.Flags]
10 + public enum FrameSourceTypes : uint
11 + {
12 + None =0,
13 + Color =1,
14 + Infrared =2,
15 + LongExposureInfrared =4,
16 + Depth =8,
17 + BodyIndex =16,
18 + Body =32,
19 + Audio =64,
20 + }
21 +
22 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.HandState
8 + //
9 + public enum HandState : int
10 + {
11 + Unknown =0,
12 + NotTracked =1,
13 + Open =2,
14 + Closed =3,
15 + Lasso =4,
16 + }
17 +
18 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.InfraredFrame
8 + //
9 + public sealed partial class InfraredFrame : RootSystem.IDisposable, Helper.INativeWrapper
10 +
11 + {
12 + internal RootSystem.IntPtr _pNative;
13 + RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
14 +
15 + // Constructors and Finalizers
16 + internal InfraredFrame(RootSystem.IntPtr pNative)
17 + {
18 + _pNative = pNative;
19 + Windows_Kinect_InfraredFrame_AddRefObject(ref _pNative);
20 + }
21 +
22 + ~InfraredFrame()
23 + {
24 + Dispose(false);
25 + }
26 +
27 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
28 + private static extern void Windows_Kinect_InfraredFrame_ReleaseObject(ref RootSystem.IntPtr pNative);
29 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
30 + private static extern void Windows_Kinect_InfraredFrame_AddRefObject(ref RootSystem.IntPtr pNative);
31 + private void Dispose(bool disposing)
32 + {
33 + if (_pNative == RootSystem.IntPtr.Zero)
34 + {
35 + return;
36 + }
37 +
38 + __EventCleanup();
39 +
40 + Helper.NativeObjectCache.RemoveObject<InfraredFrame>(_pNative);
41 +
42 + if (disposing)
43 + {
44 + Windows_Kinect_InfraredFrame_Dispose(_pNative);
45 + }
46 + Windows_Kinect_InfraredFrame_ReleaseObject(ref _pNative);
47 +
48 + _pNative = RootSystem.IntPtr.Zero;
49 + }
50 +
51 +
52 + // Public Properties
53 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
54 + private static extern RootSystem.IntPtr Windows_Kinect_InfraredFrame_get_FrameDescription(RootSystem.IntPtr pNative);
55 + public Windows.Kinect.FrameDescription FrameDescription
56 + {
57 + get
58 + {
59 + if (_pNative == RootSystem.IntPtr.Zero)
60 + {
61 + throw new RootSystem.ObjectDisposedException("InfraredFrame");
62 + }
63 +
64 + RootSystem.IntPtr objectPointer = Windows_Kinect_InfraredFrame_get_FrameDescription(_pNative);
65 + Helper.ExceptionHelper.CheckLastError();
66 + if (objectPointer == RootSystem.IntPtr.Zero)
67 + {
68 + return null;
69 + }
70 +
71 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.FrameDescription>(objectPointer, n => new Windows.Kinect.FrameDescription(n));
72 + }
73 + }
74 +
75 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
76 + private static extern RootSystem.IntPtr Windows_Kinect_InfraredFrame_get_InfraredFrameSource(RootSystem.IntPtr pNative);
77 + public Windows.Kinect.InfraredFrameSource InfraredFrameSource
78 + {
79 + get
80 + {
81 + if (_pNative == RootSystem.IntPtr.Zero)
82 + {
83 + throw new RootSystem.ObjectDisposedException("InfraredFrame");
84 + }
85 +
86 + RootSystem.IntPtr objectPointer = Windows_Kinect_InfraredFrame_get_InfraredFrameSource(_pNative);
87 + Helper.ExceptionHelper.CheckLastError();
88 + if (objectPointer == RootSystem.IntPtr.Zero)
89 + {
90 + return null;
91 + }
92 +
93 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.InfraredFrameSource>(objectPointer, n => new Windows.Kinect.InfraredFrameSource(n));
94 + }
95 + }
96 +
97 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
98 + private static extern long Windows_Kinect_InfraredFrame_get_RelativeTime(RootSystem.IntPtr pNative);
99 + public RootSystem.TimeSpan RelativeTime
100 + {
101 + get
102 + {
103 + if (_pNative == RootSystem.IntPtr.Zero)
104 + {
105 + throw new RootSystem.ObjectDisposedException("InfraredFrame");
106 + }
107 +
108 + return RootSystem.TimeSpan.FromMilliseconds(Windows_Kinect_InfraredFrame_get_RelativeTime(_pNative));
109 + }
110 + }
111 +
112 +
113 + // Public Methods
114 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
115 + private static extern void Windows_Kinect_InfraredFrame_CopyFrameDataToArray(RootSystem.IntPtr pNative, RootSystem.IntPtr frameData, int frameDataSize);
116 + public void CopyFrameDataToArray(ushort[] frameData)
117 + {
118 + if (_pNative == RootSystem.IntPtr.Zero)
119 + {
120 + throw new RootSystem.ObjectDisposedException("InfraredFrame");
121 + }
122 +
123 + var frameDataSmartGCHandle = new Helper.SmartGCHandle(RootSystem.Runtime.InteropServices.GCHandle.Alloc(frameData, RootSystem.Runtime.InteropServices.GCHandleType.Pinned));
124 + var _frameData = frameDataSmartGCHandle.AddrOfPinnedObject();
125 + Windows_Kinect_InfraredFrame_CopyFrameDataToArray(_pNative, _frameData, frameData.Length);
126 + Helper.ExceptionHelper.CheckLastError();
127 + }
128 +
129 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
130 + private static extern void Windows_Kinect_InfraredFrame_Dispose(RootSystem.IntPtr pNative);
131 + public void Dispose()
132 + {
133 + if (_pNative == RootSystem.IntPtr.Zero)
134 + {
135 + return;
136 + }
137 +
138 + Dispose(true);
139 + RootSystem.GC.SuppressFinalize(this);
140 + }
141 +
142 + private void __EventCleanup()
143 + {
144 + }
145 + }
146 +
147 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.InfraredFrameArrivedEventArgs
8 + //
9 + public sealed partial class InfraredFrameArrivedEventArgs : RootSystem.EventArgs, Helper.INativeWrapper
10 +
11 + {
12 + internal RootSystem.IntPtr _pNative;
13 + RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
14 +
15 + // Constructors and Finalizers
16 + internal InfraredFrameArrivedEventArgs(RootSystem.IntPtr pNative)
17 + {
18 + _pNative = pNative;
19 + Windows_Kinect_InfraredFrameArrivedEventArgs_AddRefObject(ref _pNative);
20 + }
21 +
22 + ~InfraredFrameArrivedEventArgs()
23 + {
24 + Dispose(false);
25 + }
26 +
27 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
28 + private static extern void Windows_Kinect_InfraredFrameArrivedEventArgs_ReleaseObject(ref RootSystem.IntPtr pNative);
29 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
30 + private static extern void Windows_Kinect_InfraredFrameArrivedEventArgs_AddRefObject(ref RootSystem.IntPtr pNative);
31 + private void Dispose(bool disposing)
32 + {
33 + if (_pNative == RootSystem.IntPtr.Zero)
34 + {
35 + return;
36 + }
37 +
38 + __EventCleanup();
39 +
40 + Helper.NativeObjectCache.RemoveObject<InfraredFrameArrivedEventArgs>(_pNative);
41 + Windows_Kinect_InfraredFrameArrivedEventArgs_ReleaseObject(ref _pNative);
42 +
43 + _pNative = RootSystem.IntPtr.Zero;
44 + }
45 +
46 +
47 + // Public Properties
48 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
49 + private static extern RootSystem.IntPtr Windows_Kinect_InfraredFrameArrivedEventArgs_get_FrameReference(RootSystem.IntPtr pNative);
50 + public Windows.Kinect.InfraredFrameReference FrameReference
51 + {
52 + get
53 + {
54 + if (_pNative == RootSystem.IntPtr.Zero)
55 + {
56 + throw new RootSystem.ObjectDisposedException("InfraredFrameArrivedEventArgs");
57 + }
58 +
59 + RootSystem.IntPtr objectPointer = Windows_Kinect_InfraredFrameArrivedEventArgs_get_FrameReference(_pNative);
60 + Helper.ExceptionHelper.CheckLastError();
61 + if (objectPointer == RootSystem.IntPtr.Zero)
62 + {
63 + return null;
64 + }
65 +
66 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.InfraredFrameReference>(objectPointer, n => new Windows.Kinect.InfraredFrameReference(n));
67 + }
68 + }
69 +
70 + private void __EventCleanup()
71 + {
72 + }
73 + }
74 +
75 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.InfraredFrameReader
8 + //
9 + public sealed partial class InfraredFrameReader : RootSystem.IDisposable, Helper.INativeWrapper
10 +
11 + {
12 + internal RootSystem.IntPtr _pNative;
13 + RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
14 +
15 + // Constructors and Finalizers
16 + internal InfraredFrameReader(RootSystem.IntPtr pNative)
17 + {
18 + _pNative = pNative;
19 + Windows_Kinect_InfraredFrameReader_AddRefObject(ref _pNative);
20 + }
21 +
22 + ~InfraredFrameReader()
23 + {
24 + Dispose(false);
25 + }
26 +
27 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
28 + private static extern void Windows_Kinect_InfraredFrameReader_ReleaseObject(ref RootSystem.IntPtr pNative);
29 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
30 + private static extern void Windows_Kinect_InfraredFrameReader_AddRefObject(ref RootSystem.IntPtr pNative);
31 + private void Dispose(bool disposing)
32 + {
33 + if (_pNative == RootSystem.IntPtr.Zero)
34 + {
35 + return;
36 + }
37 +
38 + __EventCleanup();
39 +
40 + Helper.NativeObjectCache.RemoveObject<InfraredFrameReader>(_pNative);
41 +
42 + if (disposing)
43 + {
44 + Windows_Kinect_InfraredFrameReader_Dispose(_pNative);
45 + }
46 + Windows_Kinect_InfraredFrameReader_ReleaseObject(ref _pNative);
47 +
48 + _pNative = RootSystem.IntPtr.Zero;
49 + }
50 +
51 +
52 + // Public Properties
53 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
54 + private static extern RootSystem.IntPtr Windows_Kinect_InfraredFrameReader_get_InfraredFrameSource(RootSystem.IntPtr pNative);
55 + public Windows.Kinect.InfraredFrameSource InfraredFrameSource
56 + {
57 + get
58 + {
59 + if (_pNative == RootSystem.IntPtr.Zero)
60 + {
61 + throw new RootSystem.ObjectDisposedException("InfraredFrameReader");
62 + }
63 +
64 + RootSystem.IntPtr objectPointer = Windows_Kinect_InfraredFrameReader_get_InfraredFrameSource(_pNative);
65 + Helper.ExceptionHelper.CheckLastError();
66 + if (objectPointer == RootSystem.IntPtr.Zero)
67 + {
68 + return null;
69 + }
70 +
71 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.InfraredFrameSource>(objectPointer, n => new Windows.Kinect.InfraredFrameSource(n));
72 + }
73 + }
74 +
75 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
76 + private static extern bool Windows_Kinect_InfraredFrameReader_get_IsPaused(RootSystem.IntPtr pNative);
77 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
78 + private static extern void Windows_Kinect_InfraredFrameReader_put_IsPaused(RootSystem.IntPtr pNative, bool isPaused);
79 + public bool IsPaused
80 + {
81 + get
82 + {
83 + if (_pNative == RootSystem.IntPtr.Zero)
84 + {
85 + throw new RootSystem.ObjectDisposedException("InfraredFrameReader");
86 + }
87 +
88 + return Windows_Kinect_InfraredFrameReader_get_IsPaused(_pNative);
89 + }
90 + set
91 + {
92 + if (_pNative == RootSystem.IntPtr.Zero)
93 + {
94 + throw new RootSystem.ObjectDisposedException("InfraredFrameReader");
95 + }
96 +
97 + Windows_Kinect_InfraredFrameReader_put_IsPaused(_pNative, value);
98 + Helper.ExceptionHelper.CheckLastError();
99 + }
100 + }
101 +
102 +
103 + // Events
104 + private static RootSystem.Runtime.InteropServices.GCHandle _Windows_Kinect_InfraredFrameArrivedEventArgs_Delegate_Handle;
105 + [RootSystem.Runtime.InteropServices.UnmanagedFunctionPointer(RootSystem.Runtime.InteropServices.CallingConvention.Cdecl)]
106 + private delegate void _Windows_Kinect_InfraredFrameArrivedEventArgs_Delegate(RootSystem.IntPtr args, RootSystem.IntPtr pNative);
107 + private static Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Kinect.InfraredFrameArrivedEventArgs>>> Windows_Kinect_InfraredFrameArrivedEventArgs_Delegate_callbacks = new Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Kinect.InfraredFrameArrivedEventArgs>>>();
108 + [AOT.MonoPInvokeCallbackAttribute(typeof(_Windows_Kinect_InfraredFrameArrivedEventArgs_Delegate))]
109 + private static void Windows_Kinect_InfraredFrameArrivedEventArgs_Delegate_Handler(RootSystem.IntPtr result, RootSystem.IntPtr pNative)
110 + {
111 + List<RootSystem.EventHandler<Windows.Kinect.InfraredFrameArrivedEventArgs>> callbackList = null;
112 + Windows_Kinect_InfraredFrameArrivedEventArgs_Delegate_callbacks.TryGetValue(pNative, out callbackList);
113 + lock(callbackList)
114 + {
115 + var objThis = Helper.NativeObjectCache.GetObject<InfraredFrameReader>(pNative);
116 + var args = new Windows.Kinect.InfraredFrameArrivedEventArgs(result);
117 + foreach(var func in callbackList)
118 + {
119 + Helper.EventPump.Instance.Enqueue(() => { try { func(objThis, args); } catch { } });
120 + }
121 + }
122 + }
123 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
124 + private static extern void Windows_Kinect_InfraredFrameReader_add_FrameArrived(RootSystem.IntPtr pNative, _Windows_Kinect_InfraredFrameArrivedEventArgs_Delegate eventCallback, bool unsubscribe);
125 + public event RootSystem.EventHandler<Windows.Kinect.InfraredFrameArrivedEventArgs> FrameArrived
126 + {
127 + add
128 + {
129 + Helper.EventPump.EnsureInitialized();
130 +
131 + Windows_Kinect_InfraredFrameArrivedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
132 + var callbackList = Windows_Kinect_InfraredFrameArrivedEventArgs_Delegate_callbacks[_pNative];
133 + lock (callbackList)
134 + {
135 + callbackList.Add(value);
136 + if(callbackList.Count == 1)
137 + {
138 + var del = new _Windows_Kinect_InfraredFrameArrivedEventArgs_Delegate(Windows_Kinect_InfraredFrameArrivedEventArgs_Delegate_Handler);
139 + _Windows_Kinect_InfraredFrameArrivedEventArgs_Delegate_Handle = RootSystem.Runtime.InteropServices.GCHandle.Alloc(del);
140 + Windows_Kinect_InfraredFrameReader_add_FrameArrived(_pNative, del, false);
141 + }
142 + }
143 + }
144 + remove
145 + {
146 + if (_pNative == RootSystem.IntPtr.Zero)
147 + {
148 + return;
149 + }
150 +
151 + Windows_Kinect_InfraredFrameArrivedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
152 + var callbackList = Windows_Kinect_InfraredFrameArrivedEventArgs_Delegate_callbacks[_pNative];
153 + lock (callbackList)
154 + {
155 + callbackList.Remove(value);
156 + if(callbackList.Count == 0)
157 + {
158 + Windows_Kinect_InfraredFrameReader_add_FrameArrived(_pNative, Windows_Kinect_InfraredFrameArrivedEventArgs_Delegate_Handler, true);
159 + _Windows_Kinect_InfraredFrameArrivedEventArgs_Delegate_Handle.Free();
160 + }
161 + }
162 + }
163 + }
164 +
165 + private static RootSystem.Runtime.InteropServices.GCHandle _Windows_Data_PropertyChangedEventArgs_Delegate_Handle;
166 + [RootSystem.Runtime.InteropServices.UnmanagedFunctionPointer(RootSystem.Runtime.InteropServices.CallingConvention.Cdecl)]
167 + private delegate void _Windows_Data_PropertyChangedEventArgs_Delegate(RootSystem.IntPtr args, RootSystem.IntPtr pNative);
168 + private static Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs>>> Windows_Data_PropertyChangedEventArgs_Delegate_callbacks = new Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs>>>();
169 + [AOT.MonoPInvokeCallbackAttribute(typeof(_Windows_Data_PropertyChangedEventArgs_Delegate))]
170 + private static void Windows_Data_PropertyChangedEventArgs_Delegate_Handler(RootSystem.IntPtr result, RootSystem.IntPtr pNative)
171 + {
172 + List<RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs>> callbackList = null;
173 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryGetValue(pNative, out callbackList);
174 + lock(callbackList)
175 + {
176 + var objThis = Helper.NativeObjectCache.GetObject<InfraredFrameReader>(pNative);
177 + var args = new Windows.Data.PropertyChangedEventArgs(result);
178 + foreach(var func in callbackList)
179 + {
180 + Helper.EventPump.Instance.Enqueue(() => { try { func(objThis, args); } catch { } });
181 + }
182 + }
183 + }
184 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
185 + private static extern void Windows_Kinect_InfraredFrameReader_add_PropertyChanged(RootSystem.IntPtr pNative, _Windows_Data_PropertyChangedEventArgs_Delegate eventCallback, bool unsubscribe);
186 + public event RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs> PropertyChanged
187 + {
188 + add
189 + {
190 + Helper.EventPump.EnsureInitialized();
191 +
192 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
193 + var callbackList = Windows_Data_PropertyChangedEventArgs_Delegate_callbacks[_pNative];
194 + lock (callbackList)
195 + {
196 + callbackList.Add(value);
197 + if(callbackList.Count == 1)
198 + {
199 + var del = new _Windows_Data_PropertyChangedEventArgs_Delegate(Windows_Data_PropertyChangedEventArgs_Delegate_Handler);
200 + _Windows_Data_PropertyChangedEventArgs_Delegate_Handle = RootSystem.Runtime.InteropServices.GCHandle.Alloc(del);
201 + Windows_Kinect_InfraredFrameReader_add_PropertyChanged(_pNative, del, false);
202 + }
203 + }
204 + }
205 + remove
206 + {
207 + if (_pNative == RootSystem.IntPtr.Zero)
208 + {
209 + return;
210 + }
211 +
212 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
213 + var callbackList = Windows_Data_PropertyChangedEventArgs_Delegate_callbacks[_pNative];
214 + lock (callbackList)
215 + {
216 + callbackList.Remove(value);
217 + if(callbackList.Count == 0)
218 + {
219 + Windows_Kinect_InfraredFrameReader_add_PropertyChanged(_pNative, Windows_Data_PropertyChangedEventArgs_Delegate_Handler, true);
220 + _Windows_Data_PropertyChangedEventArgs_Delegate_Handle.Free();
221 + }
222 + }
223 + }
224 + }
225 +
226 +
227 + // Public Methods
228 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
229 + private static extern RootSystem.IntPtr Windows_Kinect_InfraredFrameReader_AcquireLatestFrame(RootSystem.IntPtr pNative);
230 + public Windows.Kinect.InfraredFrame AcquireLatestFrame()
231 + {
232 + if (_pNative == RootSystem.IntPtr.Zero)
233 + {
234 + throw new RootSystem.ObjectDisposedException("InfraredFrameReader");
235 + }
236 +
237 + RootSystem.IntPtr objectPointer = Windows_Kinect_InfraredFrameReader_AcquireLatestFrame(_pNative);
238 + Helper.ExceptionHelper.CheckLastError();
239 + if (objectPointer == RootSystem.IntPtr.Zero)
240 + {
241 + return null;
242 + }
243 +
244 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.InfraredFrame>(objectPointer, n => new Windows.Kinect.InfraredFrame(n));
245 + }
246 +
247 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
248 + private static extern void Windows_Kinect_InfraredFrameReader_Dispose(RootSystem.IntPtr pNative);
249 + public void Dispose()
250 + {
251 + if (_pNative == RootSystem.IntPtr.Zero)
252 + {
253 + return;
254 + }
255 +
256 + Dispose(true);
257 + RootSystem.GC.SuppressFinalize(this);
258 + }
259 +
260 + private void __EventCleanup()
261 + {
262 + {
263 + Windows_Kinect_InfraredFrameArrivedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
264 + var callbackList = Windows_Kinect_InfraredFrameArrivedEventArgs_Delegate_callbacks[_pNative];
265 + lock (callbackList)
266 + {
267 + if (callbackList.Count > 0)
268 + {
269 + callbackList.Clear();
270 + if (_pNative != RootSystem.IntPtr.Zero)
271 + {
272 + Windows_Kinect_InfraredFrameReader_add_FrameArrived(_pNative, Windows_Kinect_InfraredFrameArrivedEventArgs_Delegate_Handler, true);
273 + }
274 + _Windows_Kinect_InfraredFrameArrivedEventArgs_Delegate_Handle.Free();
275 + }
276 + }
277 + }
278 + {
279 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
280 + var callbackList = Windows_Data_PropertyChangedEventArgs_Delegate_callbacks[_pNative];
281 + lock (callbackList)
282 + {
283 + if (callbackList.Count > 0)
284 + {
285 + callbackList.Clear();
286 + if (_pNative != RootSystem.IntPtr.Zero)
287 + {
288 + Windows_Kinect_InfraredFrameReader_add_PropertyChanged(_pNative, Windows_Data_PropertyChangedEventArgs_Delegate_Handler, true);
289 + }
290 + _Windows_Data_PropertyChangedEventArgs_Delegate_Handle.Free();
291 + }
292 + }
293 + }
294 + }
295 + }
296 +
297 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.InfraredFrameReference
8 + //
9 + public sealed partial class InfraredFrameReference : Helper.INativeWrapper
10 +
11 + {
12 + internal RootSystem.IntPtr _pNative;
13 + RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
14 +
15 + // Constructors and Finalizers
16 + internal InfraredFrameReference(RootSystem.IntPtr pNative)
17 + {
18 + _pNative = pNative;
19 + Windows_Kinect_InfraredFrameReference_AddRefObject(ref _pNative);
20 + }
21 +
22 + ~InfraredFrameReference()
23 + {
24 + Dispose(false);
25 + }
26 +
27 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
28 + private static extern void Windows_Kinect_InfraredFrameReference_ReleaseObject(ref RootSystem.IntPtr pNative);
29 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
30 + private static extern void Windows_Kinect_InfraredFrameReference_AddRefObject(ref RootSystem.IntPtr pNative);
31 + private void Dispose(bool disposing)
32 + {
33 + if (_pNative == RootSystem.IntPtr.Zero)
34 + {
35 + return;
36 + }
37 +
38 + __EventCleanup();
39 +
40 + Helper.NativeObjectCache.RemoveObject<InfraredFrameReference>(_pNative);
41 + Windows_Kinect_InfraredFrameReference_ReleaseObject(ref _pNative);
42 +
43 + _pNative = RootSystem.IntPtr.Zero;
44 + }
45 +
46 +
47 + // Public Properties
48 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
49 + private static extern long Windows_Kinect_InfraredFrameReference_get_RelativeTime(RootSystem.IntPtr pNative);
50 + public RootSystem.TimeSpan RelativeTime
51 + {
52 + get
53 + {
54 + if (_pNative == RootSystem.IntPtr.Zero)
55 + {
56 + throw new RootSystem.ObjectDisposedException("InfraredFrameReference");
57 + }
58 +
59 + return RootSystem.TimeSpan.FromMilliseconds(Windows_Kinect_InfraredFrameReference_get_RelativeTime(_pNative));
60 + }
61 + }
62 +
63 +
64 + // Public Methods
65 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
66 + private static extern RootSystem.IntPtr Windows_Kinect_InfraredFrameReference_AcquireFrame(RootSystem.IntPtr pNative);
67 + public Windows.Kinect.InfraredFrame AcquireFrame()
68 + {
69 + if (_pNative == RootSystem.IntPtr.Zero)
70 + {
71 + throw new RootSystem.ObjectDisposedException("InfraredFrameReference");
72 + }
73 +
74 + RootSystem.IntPtr objectPointer = Windows_Kinect_InfraredFrameReference_AcquireFrame(_pNative);
75 + Helper.ExceptionHelper.CheckLastError();
76 + if (objectPointer == RootSystem.IntPtr.Zero)
77 + {
78 + return null;
79 + }
80 +
81 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.InfraredFrame>(objectPointer, n => new Windows.Kinect.InfraredFrame(n));
82 + }
83 +
84 + private void __EventCleanup()
85 + {
86 + }
87 + }
88 +
89 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.InfraredFrameSource
8 + //
9 + public sealed partial class InfraredFrameSource : Helper.INativeWrapper
10 +
11 + {
12 + internal RootSystem.IntPtr _pNative;
13 + RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
14 +
15 + // Constructors and Finalizers
16 + internal InfraredFrameSource(RootSystem.IntPtr pNative)
17 + {
18 + _pNative = pNative;
19 + Windows_Kinect_InfraredFrameSource_AddRefObject(ref _pNative);
20 + }
21 +
22 + ~InfraredFrameSource()
23 + {
24 + Dispose(false);
25 + }
26 +
27 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
28 + private static extern void Windows_Kinect_InfraredFrameSource_ReleaseObject(ref RootSystem.IntPtr pNative);
29 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
30 + private static extern void Windows_Kinect_InfraredFrameSource_AddRefObject(ref RootSystem.IntPtr pNative);
31 + private void Dispose(bool disposing)
32 + {
33 + if (_pNative == RootSystem.IntPtr.Zero)
34 + {
35 + return;
36 + }
37 +
38 + __EventCleanup();
39 +
40 + Helper.NativeObjectCache.RemoveObject<InfraredFrameSource>(_pNative);
41 + Windows_Kinect_InfraredFrameSource_ReleaseObject(ref _pNative);
42 +
43 + _pNative = RootSystem.IntPtr.Zero;
44 + }
45 +
46 +
47 + // Public Properties
48 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
49 + private static extern RootSystem.IntPtr Windows_Kinect_InfraredFrameSource_get_FrameDescription(RootSystem.IntPtr pNative);
50 + public Windows.Kinect.FrameDescription FrameDescription
51 + {
52 + get
53 + {
54 + if (_pNative == RootSystem.IntPtr.Zero)
55 + {
56 + throw new RootSystem.ObjectDisposedException("InfraredFrameSource");
57 + }
58 +
59 + RootSystem.IntPtr objectPointer = Windows_Kinect_InfraredFrameSource_get_FrameDescription(_pNative);
60 + Helper.ExceptionHelper.CheckLastError();
61 + if (objectPointer == RootSystem.IntPtr.Zero)
62 + {
63 + return null;
64 + }
65 +
66 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.FrameDescription>(objectPointer, n => new Windows.Kinect.FrameDescription(n));
67 + }
68 + }
69 +
70 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
71 + private static extern bool Windows_Kinect_InfraredFrameSource_get_IsActive(RootSystem.IntPtr pNative);
72 + public bool IsActive
73 + {
74 + get
75 + {
76 + if (_pNative == RootSystem.IntPtr.Zero)
77 + {
78 + throw new RootSystem.ObjectDisposedException("InfraredFrameSource");
79 + }
80 +
81 + return Windows_Kinect_InfraredFrameSource_get_IsActive(_pNative);
82 + }
83 + }
84 +
85 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
86 + private static extern RootSystem.IntPtr Windows_Kinect_InfraredFrameSource_get_KinectSensor(RootSystem.IntPtr pNative);
87 + public Windows.Kinect.KinectSensor KinectSensor
88 + {
89 + get
90 + {
91 + if (_pNative == RootSystem.IntPtr.Zero)
92 + {
93 + throw new RootSystem.ObjectDisposedException("InfraredFrameSource");
94 + }
95 +
96 + RootSystem.IntPtr objectPointer = Windows_Kinect_InfraredFrameSource_get_KinectSensor(_pNative);
97 + Helper.ExceptionHelper.CheckLastError();
98 + if (objectPointer == RootSystem.IntPtr.Zero)
99 + {
100 + return null;
101 + }
102 +
103 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.KinectSensor>(objectPointer, n => new Windows.Kinect.KinectSensor(n));
104 + }
105 + }
106 +
107 +
108 + // Events
109 + private static RootSystem.Runtime.InteropServices.GCHandle _Windows_Kinect_FrameCapturedEventArgs_Delegate_Handle;
110 + [RootSystem.Runtime.InteropServices.UnmanagedFunctionPointer(RootSystem.Runtime.InteropServices.CallingConvention.Cdecl)]
111 + private delegate void _Windows_Kinect_FrameCapturedEventArgs_Delegate(RootSystem.IntPtr args, RootSystem.IntPtr pNative);
112 + private static Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Kinect.FrameCapturedEventArgs>>> Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks = new Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Kinect.FrameCapturedEventArgs>>>();
113 + [AOT.MonoPInvokeCallbackAttribute(typeof(_Windows_Kinect_FrameCapturedEventArgs_Delegate))]
114 + private static void Windows_Kinect_FrameCapturedEventArgs_Delegate_Handler(RootSystem.IntPtr result, RootSystem.IntPtr pNative)
115 + {
116 + List<RootSystem.EventHandler<Windows.Kinect.FrameCapturedEventArgs>> callbackList = null;
117 + Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks.TryGetValue(pNative, out callbackList);
118 + lock(callbackList)
119 + {
120 + var objThis = Helper.NativeObjectCache.GetObject<InfraredFrameSource>(pNative);
121 + var args = new Windows.Kinect.FrameCapturedEventArgs(result);
122 + foreach(var func in callbackList)
123 + {
124 + Helper.EventPump.Instance.Enqueue(() => { try { func(objThis, args); } catch { } });
125 + }
126 + }
127 + }
128 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
129 + private static extern void Windows_Kinect_InfraredFrameSource_add_FrameCaptured(RootSystem.IntPtr pNative, _Windows_Kinect_FrameCapturedEventArgs_Delegate eventCallback, bool unsubscribe);
130 + public event RootSystem.EventHandler<Windows.Kinect.FrameCapturedEventArgs> FrameCaptured
131 + {
132 + add
133 + {
134 + Helper.EventPump.EnsureInitialized();
135 +
136 + Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
137 + var callbackList = Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks[_pNative];
138 + lock (callbackList)
139 + {
140 + callbackList.Add(value);
141 + if(callbackList.Count == 1)
142 + {
143 + var del = new _Windows_Kinect_FrameCapturedEventArgs_Delegate(Windows_Kinect_FrameCapturedEventArgs_Delegate_Handler);
144 + _Windows_Kinect_FrameCapturedEventArgs_Delegate_Handle = RootSystem.Runtime.InteropServices.GCHandle.Alloc(del);
145 + Windows_Kinect_InfraredFrameSource_add_FrameCaptured(_pNative, del, false);
146 + }
147 + }
148 + }
149 + remove
150 + {
151 + if (_pNative == RootSystem.IntPtr.Zero)
152 + {
153 + return;
154 + }
155 +
156 + Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
157 + var callbackList = Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks[_pNative];
158 + lock (callbackList)
159 + {
160 + callbackList.Remove(value);
161 + if(callbackList.Count == 0)
162 + {
163 + Windows_Kinect_InfraredFrameSource_add_FrameCaptured(_pNative, Windows_Kinect_FrameCapturedEventArgs_Delegate_Handler, true);
164 + _Windows_Kinect_FrameCapturedEventArgs_Delegate_Handle.Free();
165 + }
166 + }
167 + }
168 + }
169 +
170 + private static RootSystem.Runtime.InteropServices.GCHandle _Windows_Data_PropertyChangedEventArgs_Delegate_Handle;
171 + [RootSystem.Runtime.InteropServices.UnmanagedFunctionPointer(RootSystem.Runtime.InteropServices.CallingConvention.Cdecl)]
172 + private delegate void _Windows_Data_PropertyChangedEventArgs_Delegate(RootSystem.IntPtr args, RootSystem.IntPtr pNative);
173 + private static Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs>>> Windows_Data_PropertyChangedEventArgs_Delegate_callbacks = new Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs>>>();
174 + [AOT.MonoPInvokeCallbackAttribute(typeof(_Windows_Data_PropertyChangedEventArgs_Delegate))]
175 + private static void Windows_Data_PropertyChangedEventArgs_Delegate_Handler(RootSystem.IntPtr result, RootSystem.IntPtr pNative)
176 + {
177 + List<RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs>> callbackList = null;
178 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryGetValue(pNative, out callbackList);
179 + lock(callbackList)
180 + {
181 + var objThis = Helper.NativeObjectCache.GetObject<InfraredFrameSource>(pNative);
182 + var args = new Windows.Data.PropertyChangedEventArgs(result);
183 + foreach(var func in callbackList)
184 + {
185 + Helper.EventPump.Instance.Enqueue(() => { try { func(objThis, args); } catch { } });
186 + }
187 + }
188 + }
189 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
190 + private static extern void Windows_Kinect_InfraredFrameSource_add_PropertyChanged(RootSystem.IntPtr pNative, _Windows_Data_PropertyChangedEventArgs_Delegate eventCallback, bool unsubscribe);
191 + public event RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs> PropertyChanged
192 + {
193 + add
194 + {
195 + Helper.EventPump.EnsureInitialized();
196 +
197 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
198 + var callbackList = Windows_Data_PropertyChangedEventArgs_Delegate_callbacks[_pNative];
199 + lock (callbackList)
200 + {
201 + callbackList.Add(value);
202 + if(callbackList.Count == 1)
203 + {
204 + var del = new _Windows_Data_PropertyChangedEventArgs_Delegate(Windows_Data_PropertyChangedEventArgs_Delegate_Handler);
205 + _Windows_Data_PropertyChangedEventArgs_Delegate_Handle = RootSystem.Runtime.InteropServices.GCHandle.Alloc(del);
206 + Windows_Kinect_InfraredFrameSource_add_PropertyChanged(_pNative, del, false);
207 + }
208 + }
209 + }
210 + remove
211 + {
212 + if (_pNative == RootSystem.IntPtr.Zero)
213 + {
214 + return;
215 + }
216 +
217 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
218 + var callbackList = Windows_Data_PropertyChangedEventArgs_Delegate_callbacks[_pNative];
219 + lock (callbackList)
220 + {
221 + callbackList.Remove(value);
222 + if(callbackList.Count == 0)
223 + {
224 + Windows_Kinect_InfraredFrameSource_add_PropertyChanged(_pNative, Windows_Data_PropertyChangedEventArgs_Delegate_Handler, true);
225 + _Windows_Data_PropertyChangedEventArgs_Delegate_Handle.Free();
226 + }
227 + }
228 + }
229 + }
230 +
231 +
232 + // Public Methods
233 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
234 + private static extern RootSystem.IntPtr Windows_Kinect_InfraredFrameSource_OpenReader(RootSystem.IntPtr pNative);
235 + public Windows.Kinect.InfraredFrameReader OpenReader()
236 + {
237 + if (_pNative == RootSystem.IntPtr.Zero)
238 + {
239 + throw new RootSystem.ObjectDisposedException("InfraredFrameSource");
240 + }
241 +
242 + RootSystem.IntPtr objectPointer = Windows_Kinect_InfraredFrameSource_OpenReader(_pNative);
243 + Helper.ExceptionHelper.CheckLastError();
244 + if (objectPointer == RootSystem.IntPtr.Zero)
245 + {
246 + return null;
247 + }
248 +
249 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.InfraredFrameReader>(objectPointer, n => new Windows.Kinect.InfraredFrameReader(n));
250 + }
251 +
252 + private void __EventCleanup()
253 + {
254 + {
255 + Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
256 + var callbackList = Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks[_pNative];
257 + lock (callbackList)
258 + {
259 + if (callbackList.Count > 0)
260 + {
261 + callbackList.Clear();
262 + if (_pNative != RootSystem.IntPtr.Zero)
263 + {
264 + Windows_Kinect_InfraredFrameSource_add_FrameCaptured(_pNative, Windows_Kinect_FrameCapturedEventArgs_Delegate_Handler, true);
265 + }
266 + _Windows_Kinect_FrameCapturedEventArgs_Delegate_Handle.Free();
267 + }
268 + }
269 + }
270 + {
271 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
272 + var callbackList = Windows_Data_PropertyChangedEventArgs_Delegate_callbacks[_pNative];
273 + lock (callbackList)
274 + {
275 + if (callbackList.Count > 0)
276 + {
277 + callbackList.Clear();
278 + if (_pNative != RootSystem.IntPtr.Zero)
279 + {
280 + Windows_Kinect_InfraredFrameSource_add_PropertyChanged(_pNative, Windows_Data_PropertyChangedEventArgs_Delegate_Handler, true);
281 + }
282 + _Windows_Data_PropertyChangedEventArgs_Delegate_Handle.Free();
283 + }
284 + }
285 + }
286 + }
287 + }
288 +
289 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.IsAvailableChangedEventArgs
8 + //
9 + public sealed partial class IsAvailableChangedEventArgs : RootSystem.EventArgs, Helper.INativeWrapper
10 +
11 + {
12 + internal RootSystem.IntPtr _pNative;
13 + RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
14 +
15 + // Constructors and Finalizers
16 + internal IsAvailableChangedEventArgs(RootSystem.IntPtr pNative)
17 + {
18 + _pNative = pNative;
19 + Windows_Kinect_IsAvailableChangedEventArgs_AddRefObject(ref _pNative);
20 + }
21 +
22 + ~IsAvailableChangedEventArgs()
23 + {
24 + Dispose(false);
25 + }
26 +
27 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
28 + private static extern void Windows_Kinect_IsAvailableChangedEventArgs_ReleaseObject(ref RootSystem.IntPtr pNative);
29 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
30 + private static extern void Windows_Kinect_IsAvailableChangedEventArgs_AddRefObject(ref RootSystem.IntPtr pNative);
31 + private void Dispose(bool disposing)
32 + {
33 + if (_pNative == RootSystem.IntPtr.Zero)
34 + {
35 + return;
36 + }
37 +
38 + __EventCleanup();
39 +
40 + Helper.NativeObjectCache.RemoveObject<IsAvailableChangedEventArgs>(_pNative);
41 + Windows_Kinect_IsAvailableChangedEventArgs_ReleaseObject(ref _pNative);
42 +
43 + _pNative = RootSystem.IntPtr.Zero;
44 + }
45 +
46 +
47 + // Public Properties
48 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
49 + private static extern bool Windows_Kinect_IsAvailableChangedEventArgs_get_IsAvailable(RootSystem.IntPtr pNative);
50 + public bool IsAvailable
51 + {
52 + get
53 + {
54 + if (_pNative == RootSystem.IntPtr.Zero)
55 + {
56 + throw new RootSystem.ObjectDisposedException("IsAvailableChangedEventArgs");
57 + }
58 +
59 + return Windows_Kinect_IsAvailableChangedEventArgs_get_IsAvailable(_pNative);
60 + }
61 + }
62 +
63 + private void __EventCleanup()
64 + {
65 + }
66 + }
67 +
68 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.Joint
8 + //
9 + [RootSystem.Runtime.InteropServices.StructLayout(RootSystem.Runtime.InteropServices.LayoutKind.Sequential)]
10 + public struct Joint
11 + {
12 + public Windows.Kinect.JointType JointType { get; set; }
13 + public Windows.Kinect.CameraSpacePoint Position { get; set; }
14 + public Windows.Kinect.TrackingState TrackingState { get; set; }
15 +
16 + public override int GetHashCode()
17 + {
18 + return JointType.GetHashCode() ^ Position.GetHashCode() ^ TrackingState.GetHashCode();
19 + }
20 +
21 + public override bool Equals(object obj)
22 + {
23 + if (!(obj is Joint))
24 + {
25 + return false;
26 + }
27 +
28 + return this.Equals((Joint)obj);
29 + }
30 +
31 + public bool Equals(Joint obj)
32 + {
33 + return JointType.Equals(obj.JointType) && Position.Equals(obj.Position) && TrackingState.Equals(obj.TrackingState);
34 + }
35 +
36 + public static bool operator ==(Joint a, Joint b)
37 + {
38 + return a.Equals(b);
39 + }
40 +
41 + public static bool operator !=(Joint a, Joint b)
42 + {
43 + return !(a.Equals(b));
44 + }
45 + }
46 +
47 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.JointOrientation
8 + //
9 + [RootSystem.Runtime.InteropServices.StructLayout(RootSystem.Runtime.InteropServices.LayoutKind.Sequential)]
10 + public struct JointOrientation
11 + {
12 + public Windows.Kinect.JointType JointType { get; set; }
13 + public Windows.Kinect.Vector4 Orientation { get; set; }
14 +
15 + public override int GetHashCode()
16 + {
17 + return JointType.GetHashCode() ^ Orientation.GetHashCode();
18 + }
19 +
20 + public override bool Equals(object obj)
21 + {
22 + if (!(obj is JointOrientation))
23 + {
24 + return false;
25 + }
26 +
27 + return this.Equals((JointOrientation)obj);
28 + }
29 +
30 + public bool Equals(JointOrientation obj)
31 + {
32 + return JointType.Equals(obj.JointType) && Orientation.Equals(obj.Orientation);
33 + }
34 +
35 + public static bool operator ==(JointOrientation a, JointOrientation b)
36 + {
37 + return a.Equals(b);
38 + }
39 +
40 + public static bool operator !=(JointOrientation a, JointOrientation b)
41 + {
42 + return !(a.Equals(b));
43 + }
44 + }
45 +
46 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.JointType
8 + //
9 + public enum JointType : int
10 + {
11 + SpineBase =0,
12 + SpineMid =1,
13 + Neck =2,
14 + Head =3,
15 + ShoulderLeft =4,
16 + ElbowLeft =5,
17 + WristLeft =6,
18 + HandLeft =7,
19 + ShoulderRight =8,
20 + ElbowRight =9,
21 + WristRight =10,
22 + HandRight =11,
23 + HipLeft =12,
24 + KneeLeft =13,
25 + AnkleLeft =14,
26 + FootLeft =15,
27 + HipRight =16,
28 + KneeRight =17,
29 + AnkleRight =18,
30 + FootRight =19,
31 + SpineShoulder =20,
32 + HandTipLeft =21,
33 + ThumbLeft =22,
34 + HandTipRight =23,
35 + ThumbRight =24,
36 + }
37 +
38 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.KinectAudioCalibrationState
8 + //
9 + public enum KinectAudioCalibrationState : int
10 + {
11 + Unknown =0,
12 + CalibrationRequired =1,
13 + Calibrated =2,
14 + }
15 +
16 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.KinectCapabilities
8 + //
9 + [RootSystem.Flags]
10 + public enum KinectCapabilities : uint
11 + {
12 + None =0,
13 + Vision =1,
14 + Audio =2,
15 + Face =4,
16 + Expressions =8,
17 + Gamechat =16,
18 + }
19 +
20 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.KinectSensor
8 + //
9 + public sealed partial class KinectSensor : Helper.INativeWrapper
10 +
11 + {
12 + internal RootSystem.IntPtr _pNative;
13 + RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
14 +
15 + // Constructors and Finalizers
16 + internal KinectSensor(RootSystem.IntPtr pNative)
17 + {
18 + _pNative = pNative;
19 + Windows_Kinect_KinectSensor_AddRefObject(ref _pNative);
20 + }
21 +
22 + ~KinectSensor()
23 + {
24 + Dispose(false);
25 + }
26 +
27 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
28 + private static extern void Windows_Kinect_KinectSensor_ReleaseObject(ref RootSystem.IntPtr pNative);
29 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
30 + private static extern void Windows_Kinect_KinectSensor_AddRefObject(ref RootSystem.IntPtr pNative);
31 +
32 + // Public Properties
33 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
34 + private static extern RootSystem.IntPtr Windows_Kinect_KinectSensor_get_AudioSource(RootSystem.IntPtr pNative);
35 + public Windows.Kinect.AudioSource AudioSource
36 + {
37 + get
38 + {
39 + if (_pNative == RootSystem.IntPtr.Zero)
40 + {
41 + throw new RootSystem.ObjectDisposedException("KinectSensor");
42 + }
43 +
44 + RootSystem.IntPtr objectPointer = Windows_Kinect_KinectSensor_get_AudioSource(_pNative);
45 + Helper.ExceptionHelper.CheckLastError();
46 + if (objectPointer == RootSystem.IntPtr.Zero)
47 + {
48 + return null;
49 + }
50 +
51 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.AudioSource>(objectPointer, n => new Windows.Kinect.AudioSource(n));
52 + }
53 + }
54 +
55 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
56 + private static extern RootSystem.IntPtr Windows_Kinect_KinectSensor_get_BodyFrameSource(RootSystem.IntPtr pNative);
57 + public Windows.Kinect.BodyFrameSource BodyFrameSource
58 + {
59 + get
60 + {
61 + if (_pNative == RootSystem.IntPtr.Zero)
62 + {
63 + throw new RootSystem.ObjectDisposedException("KinectSensor");
64 + }
65 +
66 + RootSystem.IntPtr objectPointer = Windows_Kinect_KinectSensor_get_BodyFrameSource(_pNative);
67 + Helper.ExceptionHelper.CheckLastError();
68 + if (objectPointer == RootSystem.IntPtr.Zero)
69 + {
70 + return null;
71 + }
72 +
73 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.BodyFrameSource>(objectPointer, n => new Windows.Kinect.BodyFrameSource(n));
74 + }
75 + }
76 +
77 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
78 + private static extern RootSystem.IntPtr Windows_Kinect_KinectSensor_get_BodyIndexFrameSource(RootSystem.IntPtr pNative);
79 + public Windows.Kinect.BodyIndexFrameSource BodyIndexFrameSource
80 + {
81 + get
82 + {
83 + if (_pNative == RootSystem.IntPtr.Zero)
84 + {
85 + throw new RootSystem.ObjectDisposedException("KinectSensor");
86 + }
87 +
88 + RootSystem.IntPtr objectPointer = Windows_Kinect_KinectSensor_get_BodyIndexFrameSource(_pNative);
89 + Helper.ExceptionHelper.CheckLastError();
90 + if (objectPointer == RootSystem.IntPtr.Zero)
91 + {
92 + return null;
93 + }
94 +
95 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.BodyIndexFrameSource>(objectPointer, n => new Windows.Kinect.BodyIndexFrameSource(n));
96 + }
97 + }
98 +
99 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
100 + private static extern RootSystem.IntPtr Windows_Kinect_KinectSensor_get_ColorFrameSource(RootSystem.IntPtr pNative);
101 + public Windows.Kinect.ColorFrameSource ColorFrameSource
102 + {
103 + get
104 + {
105 + if (_pNative == RootSystem.IntPtr.Zero)
106 + {
107 + throw new RootSystem.ObjectDisposedException("KinectSensor");
108 + }
109 +
110 + RootSystem.IntPtr objectPointer = Windows_Kinect_KinectSensor_get_ColorFrameSource(_pNative);
111 + Helper.ExceptionHelper.CheckLastError();
112 + if (objectPointer == RootSystem.IntPtr.Zero)
113 + {
114 + return null;
115 + }
116 +
117 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.ColorFrameSource>(objectPointer, n => new Windows.Kinect.ColorFrameSource(n));
118 + }
119 + }
120 +
121 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
122 + private static extern RootSystem.IntPtr Windows_Kinect_KinectSensor_get_CoordinateMapper(RootSystem.IntPtr pNative);
123 + public Windows.Kinect.CoordinateMapper CoordinateMapper
124 + {
125 + get
126 + {
127 + if (_pNative == RootSystem.IntPtr.Zero)
128 + {
129 + throw new RootSystem.ObjectDisposedException("KinectSensor");
130 + }
131 +
132 + RootSystem.IntPtr objectPointer = Windows_Kinect_KinectSensor_get_CoordinateMapper(_pNative);
133 + Helper.ExceptionHelper.CheckLastError();
134 + if (objectPointer == RootSystem.IntPtr.Zero)
135 + {
136 + return null;
137 + }
138 +
139 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.CoordinateMapper>(objectPointer, n => new Windows.Kinect.CoordinateMapper(n));
140 + }
141 + }
142 +
143 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
144 + private static extern RootSystem.IntPtr Windows_Kinect_KinectSensor_get_DepthFrameSource(RootSystem.IntPtr pNative);
145 + public Windows.Kinect.DepthFrameSource DepthFrameSource
146 + {
147 + get
148 + {
149 + if (_pNative == RootSystem.IntPtr.Zero)
150 + {
151 + throw new RootSystem.ObjectDisposedException("KinectSensor");
152 + }
153 +
154 + RootSystem.IntPtr objectPointer = Windows_Kinect_KinectSensor_get_DepthFrameSource(_pNative);
155 + Helper.ExceptionHelper.CheckLastError();
156 + if (objectPointer == RootSystem.IntPtr.Zero)
157 + {
158 + return null;
159 + }
160 +
161 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.DepthFrameSource>(objectPointer, n => new Windows.Kinect.DepthFrameSource(n));
162 + }
163 + }
164 +
165 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
166 + private static extern RootSystem.IntPtr Windows_Kinect_KinectSensor_get_InfraredFrameSource(RootSystem.IntPtr pNative);
167 + public Windows.Kinect.InfraredFrameSource InfraredFrameSource
168 + {
169 + get
170 + {
171 + if (_pNative == RootSystem.IntPtr.Zero)
172 + {
173 + throw new RootSystem.ObjectDisposedException("KinectSensor");
174 + }
175 +
176 + RootSystem.IntPtr objectPointer = Windows_Kinect_KinectSensor_get_InfraredFrameSource(_pNative);
177 + Helper.ExceptionHelper.CheckLastError();
178 + if (objectPointer == RootSystem.IntPtr.Zero)
179 + {
180 + return null;
181 + }
182 +
183 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.InfraredFrameSource>(objectPointer, n => new Windows.Kinect.InfraredFrameSource(n));
184 + }
185 + }
186 +
187 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
188 + private static extern bool Windows_Kinect_KinectSensor_get_IsAvailable(RootSystem.IntPtr pNative);
189 + public bool IsAvailable
190 + {
191 + get
192 + {
193 + if (_pNative == RootSystem.IntPtr.Zero)
194 + {
195 + throw new RootSystem.ObjectDisposedException("KinectSensor");
196 + }
197 +
198 + return Windows_Kinect_KinectSensor_get_IsAvailable(_pNative);
199 + }
200 + }
201 +
202 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
203 + private static extern bool Windows_Kinect_KinectSensor_get_IsOpen(RootSystem.IntPtr pNative);
204 + public bool IsOpen
205 + {
206 + get
207 + {
208 + if (_pNative == RootSystem.IntPtr.Zero)
209 + {
210 + throw new RootSystem.ObjectDisposedException("KinectSensor");
211 + }
212 +
213 + return Windows_Kinect_KinectSensor_get_IsOpen(_pNative);
214 + }
215 + }
216 +
217 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
218 + private static extern Windows.Kinect.KinectCapabilities Windows_Kinect_KinectSensor_get_KinectCapabilities(RootSystem.IntPtr pNative);
219 + public Windows.Kinect.KinectCapabilities KinectCapabilities
220 + {
221 + get
222 + {
223 + if (_pNative == RootSystem.IntPtr.Zero)
224 + {
225 + throw new RootSystem.ObjectDisposedException("KinectSensor");
226 + }
227 +
228 + return Windows_Kinect_KinectSensor_get_KinectCapabilities(_pNative);
229 + }
230 + }
231 +
232 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
233 + private static extern RootSystem.IntPtr Windows_Kinect_KinectSensor_get_LongExposureInfraredFrameSource(RootSystem.IntPtr pNative);
234 + public Windows.Kinect.LongExposureInfraredFrameSource LongExposureInfraredFrameSource
235 + {
236 + get
237 + {
238 + if (_pNative == RootSystem.IntPtr.Zero)
239 + {
240 + throw new RootSystem.ObjectDisposedException("KinectSensor");
241 + }
242 +
243 + RootSystem.IntPtr objectPointer = Windows_Kinect_KinectSensor_get_LongExposureInfraredFrameSource(_pNative);
244 + Helper.ExceptionHelper.CheckLastError();
245 + if (objectPointer == RootSystem.IntPtr.Zero)
246 + {
247 + return null;
248 + }
249 +
250 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.LongExposureInfraredFrameSource>(objectPointer, n => new Windows.Kinect.LongExposureInfraredFrameSource(n));
251 + }
252 + }
253 +
254 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
255 + private static extern RootSystem.IntPtr Windows_Kinect_KinectSensor_get_UniqueKinectId(RootSystem.IntPtr pNative);
256 + public string UniqueKinectId
257 + {
258 + get
259 + {
260 + if (_pNative == RootSystem.IntPtr.Zero)
261 + {
262 + throw new RootSystem.ObjectDisposedException("KinectSensor");
263 + }
264 +
265 + RootSystem.IntPtr objectPointer = Windows_Kinect_KinectSensor_get_UniqueKinectId(_pNative);
266 + Helper.ExceptionHelper.CheckLastError();
267 +
268 + var managedString = RootSystem.Runtime.InteropServices.Marshal.PtrToStringUni(objectPointer);
269 + RootSystem.Runtime.InteropServices.Marshal.FreeCoTaskMem(objectPointer);
270 + return managedString;
271 + }
272 + }
273 +
274 +
275 + // Events
276 + private static RootSystem.Runtime.InteropServices.GCHandle _Windows_Kinect_IsAvailableChangedEventArgs_Delegate_Handle;
277 + [RootSystem.Runtime.InteropServices.UnmanagedFunctionPointer(RootSystem.Runtime.InteropServices.CallingConvention.Cdecl)]
278 + private delegate void _Windows_Kinect_IsAvailableChangedEventArgs_Delegate(RootSystem.IntPtr args, RootSystem.IntPtr pNative);
279 + private static Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Kinect.IsAvailableChangedEventArgs>>> Windows_Kinect_IsAvailableChangedEventArgs_Delegate_callbacks = new Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Kinect.IsAvailableChangedEventArgs>>>();
280 + [AOT.MonoPInvokeCallbackAttribute(typeof(_Windows_Kinect_IsAvailableChangedEventArgs_Delegate))]
281 + private static void Windows_Kinect_IsAvailableChangedEventArgs_Delegate_Handler(RootSystem.IntPtr result, RootSystem.IntPtr pNative)
282 + {
283 + List<RootSystem.EventHandler<Windows.Kinect.IsAvailableChangedEventArgs>> callbackList = null;
284 + Windows_Kinect_IsAvailableChangedEventArgs_Delegate_callbacks.TryGetValue(pNative, out callbackList);
285 + lock(callbackList)
286 + {
287 + var objThis = Helper.NativeObjectCache.GetObject<KinectSensor>(pNative);
288 + var args = new Windows.Kinect.IsAvailableChangedEventArgs(result);
289 + foreach(var func in callbackList)
290 + {
291 + Helper.EventPump.Instance.Enqueue(() => { try { func(objThis, args); } catch { } });
292 + }
293 + }
294 + }
295 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
296 + private static extern void Windows_Kinect_KinectSensor_add_IsAvailableChanged(RootSystem.IntPtr pNative, _Windows_Kinect_IsAvailableChangedEventArgs_Delegate eventCallback, bool unsubscribe);
297 + public event RootSystem.EventHandler<Windows.Kinect.IsAvailableChangedEventArgs> IsAvailableChanged
298 + {
299 + add
300 + {
301 + Helper.EventPump.EnsureInitialized();
302 +
303 + Windows_Kinect_IsAvailableChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
304 + var callbackList = Windows_Kinect_IsAvailableChangedEventArgs_Delegate_callbacks[_pNative];
305 + lock (callbackList)
306 + {
307 + callbackList.Add(value);
308 + if(callbackList.Count == 1)
309 + {
310 + var del = new _Windows_Kinect_IsAvailableChangedEventArgs_Delegate(Windows_Kinect_IsAvailableChangedEventArgs_Delegate_Handler);
311 + _Windows_Kinect_IsAvailableChangedEventArgs_Delegate_Handle = RootSystem.Runtime.InteropServices.GCHandle.Alloc(del);
312 + Windows_Kinect_KinectSensor_add_IsAvailableChanged(_pNative, del, false);
313 + }
314 + }
315 + }
316 + remove
317 + {
318 + if (_pNative == RootSystem.IntPtr.Zero)
319 + {
320 + return;
321 + }
322 +
323 + Windows_Kinect_IsAvailableChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
324 + var callbackList = Windows_Kinect_IsAvailableChangedEventArgs_Delegate_callbacks[_pNative];
325 + lock (callbackList)
326 + {
327 + callbackList.Remove(value);
328 + if(callbackList.Count == 0)
329 + {
330 + Windows_Kinect_KinectSensor_add_IsAvailableChanged(_pNative, Windows_Kinect_IsAvailableChangedEventArgs_Delegate_Handler, true);
331 + _Windows_Kinect_IsAvailableChangedEventArgs_Delegate_Handle.Free();
332 + }
333 + }
334 + }
335 + }
336 +
337 + private static RootSystem.Runtime.InteropServices.GCHandle _Windows_Data_PropertyChangedEventArgs_Delegate_Handle;
338 + [RootSystem.Runtime.InteropServices.UnmanagedFunctionPointer(RootSystem.Runtime.InteropServices.CallingConvention.Cdecl)]
339 + private delegate void _Windows_Data_PropertyChangedEventArgs_Delegate(RootSystem.IntPtr args, RootSystem.IntPtr pNative);
340 + private static Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs>>> Windows_Data_PropertyChangedEventArgs_Delegate_callbacks = new Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs>>>();
341 + [AOT.MonoPInvokeCallbackAttribute(typeof(_Windows_Data_PropertyChangedEventArgs_Delegate))]
342 + private static void Windows_Data_PropertyChangedEventArgs_Delegate_Handler(RootSystem.IntPtr result, RootSystem.IntPtr pNative)
343 + {
344 + List<RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs>> callbackList = null;
345 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryGetValue(pNative, out callbackList);
346 + lock(callbackList)
347 + {
348 + var objThis = Helper.NativeObjectCache.GetObject<KinectSensor>(pNative);
349 + var args = new Windows.Data.PropertyChangedEventArgs(result);
350 + foreach(var func in callbackList)
351 + {
352 + Helper.EventPump.Instance.Enqueue(() => { try { func(objThis, args); } catch { } });
353 + }
354 + }
355 + }
356 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
357 + private static extern void Windows_Kinect_KinectSensor_add_PropertyChanged(RootSystem.IntPtr pNative, _Windows_Data_PropertyChangedEventArgs_Delegate eventCallback, bool unsubscribe);
358 + public event RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs> PropertyChanged
359 + {
360 + add
361 + {
362 + Helper.EventPump.EnsureInitialized();
363 +
364 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
365 + var callbackList = Windows_Data_PropertyChangedEventArgs_Delegate_callbacks[_pNative];
366 + lock (callbackList)
367 + {
368 + callbackList.Add(value);
369 + if(callbackList.Count == 1)
370 + {
371 + var del = new _Windows_Data_PropertyChangedEventArgs_Delegate(Windows_Data_PropertyChangedEventArgs_Delegate_Handler);
372 + _Windows_Data_PropertyChangedEventArgs_Delegate_Handle = RootSystem.Runtime.InteropServices.GCHandle.Alloc(del);
373 + Windows_Kinect_KinectSensor_add_PropertyChanged(_pNative, del, false);
374 + }
375 + }
376 + }
377 + remove
378 + {
379 + if (_pNative == RootSystem.IntPtr.Zero)
380 + {
381 + return;
382 + }
383 +
384 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
385 + var callbackList = Windows_Data_PropertyChangedEventArgs_Delegate_callbacks[_pNative];
386 + lock (callbackList)
387 + {
388 + callbackList.Remove(value);
389 + if(callbackList.Count == 0)
390 + {
391 + Windows_Kinect_KinectSensor_add_PropertyChanged(_pNative, Windows_Data_PropertyChangedEventArgs_Delegate_Handler, true);
392 + _Windows_Data_PropertyChangedEventArgs_Delegate_Handle.Free();
393 + }
394 + }
395 + }
396 + }
397 +
398 +
399 + // Static Methods
400 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
401 + private static extern RootSystem.IntPtr Windows_Kinect_KinectSensor_GetDefault();
402 + public static Windows.Kinect.KinectSensor GetDefault()
403 + {
404 + RootSystem.IntPtr objectPointer = Windows_Kinect_KinectSensor_GetDefault();
405 + Helper.ExceptionHelper.CheckLastError();
406 + if (objectPointer == RootSystem.IntPtr.Zero)
407 + {
408 + return null;
409 + }
410 +
411 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.KinectSensor>(objectPointer, n => new Windows.Kinect.KinectSensor(n));
412 + }
413 +
414 +
415 + // Public Methods
416 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
417 + private static extern void Windows_Kinect_KinectSensor_Open(RootSystem.IntPtr pNative);
418 + public void Open()
419 + {
420 + if (_pNative == RootSystem.IntPtr.Zero)
421 + {
422 + throw new RootSystem.ObjectDisposedException("KinectSensor");
423 + }
424 +
425 + Windows_Kinect_KinectSensor_Open(_pNative);
426 + Helper.ExceptionHelper.CheckLastError();
427 + }
428 +
429 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
430 + private static extern void Windows_Kinect_KinectSensor_Close(RootSystem.IntPtr pNative);
431 + public void Close()
432 + {
433 + if (_pNative == RootSystem.IntPtr.Zero)
434 + {
435 + throw new RootSystem.ObjectDisposedException("KinectSensor");
436 + }
437 +
438 + Windows_Kinect_KinectSensor_Close(_pNative);
439 + Helper.ExceptionHelper.CheckLastError();
440 + }
441 +
442 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
443 + private static extern RootSystem.IntPtr Windows_Kinect_KinectSensor_OpenMultiSourceFrameReader(RootSystem.IntPtr pNative, Windows.Kinect.FrameSourceTypes enabledFrameSourceTypes);
444 + public Windows.Kinect.MultiSourceFrameReader OpenMultiSourceFrameReader(Windows.Kinect.FrameSourceTypes enabledFrameSourceTypes)
445 + {
446 + if (_pNative == RootSystem.IntPtr.Zero)
447 + {
448 + throw new RootSystem.ObjectDisposedException("KinectSensor");
449 + }
450 +
451 + RootSystem.IntPtr objectPointer = Windows_Kinect_KinectSensor_OpenMultiSourceFrameReader(_pNative, enabledFrameSourceTypes);
452 + Helper.ExceptionHelper.CheckLastError();
453 + if (objectPointer == RootSystem.IntPtr.Zero)
454 + {
455 + return null;
456 + }
457 +
458 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.MultiSourceFrameReader>(objectPointer, n => new Windows.Kinect.MultiSourceFrameReader(n));
459 + }
460 +
461 + private void __EventCleanup()
462 + {
463 + {
464 + Windows_Kinect_IsAvailableChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
465 + var callbackList = Windows_Kinect_IsAvailableChangedEventArgs_Delegate_callbacks[_pNative];
466 + lock (callbackList)
467 + {
468 + if (callbackList.Count > 0)
469 + {
470 + callbackList.Clear();
471 + if (_pNative != RootSystem.IntPtr.Zero)
472 + {
473 + Windows_Kinect_KinectSensor_add_IsAvailableChanged(_pNative, Windows_Kinect_IsAvailableChangedEventArgs_Delegate_Handler, true);
474 + }
475 + _Windows_Kinect_IsAvailableChangedEventArgs_Delegate_Handle.Free();
476 + }
477 + }
478 + }
479 + {
480 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
481 + var callbackList = Windows_Data_PropertyChangedEventArgs_Delegate_callbacks[_pNative];
482 + lock (callbackList)
483 + {
484 + if (callbackList.Count > 0)
485 + {
486 + callbackList.Clear();
487 + if (_pNative != RootSystem.IntPtr.Zero)
488 + {
489 + Windows_Kinect_KinectSensor_add_PropertyChanged(_pNative, Windows_Data_PropertyChangedEventArgs_Delegate_Handler, true);
490 + }
491 + _Windows_Data_PropertyChangedEventArgs_Delegate_Handle.Free();
492 + }
493 + }
494 + }
495 + }
496 + }
497 +
498 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.KinectUnityAddinUtils
8 + //
9 + public sealed partial class KinectUnityAddinUtils
10 + {
11 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
12 + private static extern void KinectUnityAddin_FreeMemory(RootSystem.IntPtr pToDealloc);
13 + public static void FreeMemory(RootSystem.IntPtr pToDealloc)
14 + {
15 + KinectUnityAddin_FreeMemory(pToDealloc);
16 + }
17 + }
18 +
19 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.LongExposureInfraredFrame
8 + //
9 + public sealed partial class LongExposureInfraredFrame : RootSystem.IDisposable, Helper.INativeWrapper
10 +
11 + {
12 + internal RootSystem.IntPtr _pNative;
13 + RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
14 +
15 + // Constructors and Finalizers
16 + internal LongExposureInfraredFrame(RootSystem.IntPtr pNative)
17 + {
18 + _pNative = pNative;
19 + Windows_Kinect_LongExposureInfraredFrame_AddRefObject(ref _pNative);
20 + }
21 +
22 + ~LongExposureInfraredFrame()
23 + {
24 + Dispose(false);
25 + }
26 +
27 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
28 + private static extern void Windows_Kinect_LongExposureInfraredFrame_ReleaseObject(ref RootSystem.IntPtr pNative);
29 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
30 + private static extern void Windows_Kinect_LongExposureInfraredFrame_AddRefObject(ref RootSystem.IntPtr pNative);
31 + private void Dispose(bool disposing)
32 + {
33 + if (_pNative == RootSystem.IntPtr.Zero)
34 + {
35 + return;
36 + }
37 +
38 + __EventCleanup();
39 +
40 + Helper.NativeObjectCache.RemoveObject<LongExposureInfraredFrame>(_pNative);
41 +
42 + if (disposing)
43 + {
44 + Windows_Kinect_LongExposureInfraredFrame_Dispose(_pNative);
45 + }
46 + Windows_Kinect_LongExposureInfraredFrame_ReleaseObject(ref _pNative);
47 +
48 + _pNative = RootSystem.IntPtr.Zero;
49 + }
50 +
51 +
52 + // Public Properties
53 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
54 + private static extern RootSystem.IntPtr Windows_Kinect_LongExposureInfraredFrame_get_FrameDescription(RootSystem.IntPtr pNative);
55 + public Windows.Kinect.FrameDescription FrameDescription
56 + {
57 + get
58 + {
59 + if (_pNative == RootSystem.IntPtr.Zero)
60 + {
61 + throw new RootSystem.ObjectDisposedException("LongExposureInfraredFrame");
62 + }
63 +
64 + RootSystem.IntPtr objectPointer = Windows_Kinect_LongExposureInfraredFrame_get_FrameDescription(_pNative);
65 + Helper.ExceptionHelper.CheckLastError();
66 + if (objectPointer == RootSystem.IntPtr.Zero)
67 + {
68 + return null;
69 + }
70 +
71 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.FrameDescription>(objectPointer, n => new Windows.Kinect.FrameDescription(n));
72 + }
73 + }
74 +
75 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
76 + private static extern RootSystem.IntPtr Windows_Kinect_LongExposureInfraredFrame_get_LongExposureInfraredFrameSource(RootSystem.IntPtr pNative);
77 + public Windows.Kinect.LongExposureInfraredFrameSource LongExposureInfraredFrameSource
78 + {
79 + get
80 + {
81 + if (_pNative == RootSystem.IntPtr.Zero)
82 + {
83 + throw new RootSystem.ObjectDisposedException("LongExposureInfraredFrame");
84 + }
85 +
86 + RootSystem.IntPtr objectPointer = Windows_Kinect_LongExposureInfraredFrame_get_LongExposureInfraredFrameSource(_pNative);
87 + Helper.ExceptionHelper.CheckLastError();
88 + if (objectPointer == RootSystem.IntPtr.Zero)
89 + {
90 + return null;
91 + }
92 +
93 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.LongExposureInfraredFrameSource>(objectPointer, n => new Windows.Kinect.LongExposureInfraredFrameSource(n));
94 + }
95 + }
96 +
97 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
98 + private static extern long Windows_Kinect_LongExposureInfraredFrame_get_RelativeTime(RootSystem.IntPtr pNative);
99 + public RootSystem.TimeSpan RelativeTime
100 + {
101 + get
102 + {
103 + if (_pNative == RootSystem.IntPtr.Zero)
104 + {
105 + throw new RootSystem.ObjectDisposedException("LongExposureInfraredFrame");
106 + }
107 +
108 + return RootSystem.TimeSpan.FromMilliseconds(Windows_Kinect_LongExposureInfraredFrame_get_RelativeTime(_pNative));
109 + }
110 + }
111 +
112 +
113 + // Public Methods
114 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
115 + private static extern void Windows_Kinect_LongExposureInfraredFrame_CopyFrameDataToArray(RootSystem.IntPtr pNative, RootSystem.IntPtr frameData, int frameDataSize);
116 + public void CopyFrameDataToArray(ushort[] frameData)
117 + {
118 + if (_pNative == RootSystem.IntPtr.Zero)
119 + {
120 + throw new RootSystem.ObjectDisposedException("LongExposureInfraredFrame");
121 + }
122 +
123 + var frameDataSmartGCHandle = new Helper.SmartGCHandle(RootSystem.Runtime.InteropServices.GCHandle.Alloc(frameData, RootSystem.Runtime.InteropServices.GCHandleType.Pinned));
124 + var _frameData = frameDataSmartGCHandle.AddrOfPinnedObject();
125 + Windows_Kinect_LongExposureInfraredFrame_CopyFrameDataToArray(_pNative, _frameData, frameData.Length);
126 + Helper.ExceptionHelper.CheckLastError();
127 + }
128 +
129 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
130 + private static extern void Windows_Kinect_LongExposureInfraredFrame_Dispose(RootSystem.IntPtr pNative);
131 + public void Dispose()
132 + {
133 + if (_pNative == RootSystem.IntPtr.Zero)
134 + {
135 + return;
136 + }
137 +
138 + Dispose(true);
139 + RootSystem.GC.SuppressFinalize(this);
140 + }
141 +
142 + private void __EventCleanup()
143 + {
144 + }
145 + }
146 +
147 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.LongExposureInfraredFrameArrivedEventArgs
8 + //
9 + public sealed partial class LongExposureInfraredFrameArrivedEventArgs : RootSystem.EventArgs, Helper.INativeWrapper
10 +
11 + {
12 + internal RootSystem.IntPtr _pNative;
13 + RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
14 +
15 + // Constructors and Finalizers
16 + internal LongExposureInfraredFrameArrivedEventArgs(RootSystem.IntPtr pNative)
17 + {
18 + _pNative = pNative;
19 + Windows_Kinect_LongExposureInfraredFrameArrivedEventArgs_AddRefObject(ref _pNative);
20 + }
21 +
22 + ~LongExposureInfraredFrameArrivedEventArgs()
23 + {
24 + Dispose(false);
25 + }
26 +
27 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
28 + private static extern void Windows_Kinect_LongExposureInfraredFrameArrivedEventArgs_ReleaseObject(ref RootSystem.IntPtr pNative);
29 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
30 + private static extern void Windows_Kinect_LongExposureInfraredFrameArrivedEventArgs_AddRefObject(ref RootSystem.IntPtr pNative);
31 + private void Dispose(bool disposing)
32 + {
33 + if (_pNative == RootSystem.IntPtr.Zero)
34 + {
35 + return;
36 + }
37 +
38 + __EventCleanup();
39 +
40 + Helper.NativeObjectCache.RemoveObject<LongExposureInfraredFrameArrivedEventArgs>(_pNative);
41 + Windows_Kinect_LongExposureInfraredFrameArrivedEventArgs_ReleaseObject(ref _pNative);
42 +
43 + _pNative = RootSystem.IntPtr.Zero;
44 + }
45 +
46 +
47 + // Public Properties
48 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
49 + private static extern RootSystem.IntPtr Windows_Kinect_LongExposureInfraredFrameArrivedEventArgs_get_FrameReference(RootSystem.IntPtr pNative);
50 + public Windows.Kinect.LongExposureInfraredFrameReference FrameReference
51 + {
52 + get
53 + {
54 + if (_pNative == RootSystem.IntPtr.Zero)
55 + {
56 + throw new RootSystem.ObjectDisposedException("LongExposureInfraredFrameArrivedEventArgs");
57 + }
58 +
59 + RootSystem.IntPtr objectPointer = Windows_Kinect_LongExposureInfraredFrameArrivedEventArgs_get_FrameReference(_pNative);
60 + Helper.ExceptionHelper.CheckLastError();
61 + if (objectPointer == RootSystem.IntPtr.Zero)
62 + {
63 + return null;
64 + }
65 +
66 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.LongExposureInfraredFrameReference>(objectPointer, n => new Windows.Kinect.LongExposureInfraredFrameReference(n));
67 + }
68 + }
69 +
70 + private void __EventCleanup()
71 + {
72 + }
73 + }
74 +
75 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.LongExposureInfraredFrameReader
8 + //
9 + public sealed partial class LongExposureInfraredFrameReader : RootSystem.IDisposable, Helper.INativeWrapper
10 +
11 + {
12 + internal RootSystem.IntPtr _pNative;
13 + RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
14 +
15 + // Constructors and Finalizers
16 + internal LongExposureInfraredFrameReader(RootSystem.IntPtr pNative)
17 + {
18 + _pNative = pNative;
19 + Windows_Kinect_LongExposureInfraredFrameReader_AddRefObject(ref _pNative);
20 + }
21 +
22 + ~LongExposureInfraredFrameReader()
23 + {
24 + Dispose(false);
25 + }
26 +
27 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
28 + private static extern void Windows_Kinect_LongExposureInfraredFrameReader_ReleaseObject(ref RootSystem.IntPtr pNative);
29 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
30 + private static extern void Windows_Kinect_LongExposureInfraredFrameReader_AddRefObject(ref RootSystem.IntPtr pNative);
31 + private void Dispose(bool disposing)
32 + {
33 + if (_pNative == RootSystem.IntPtr.Zero)
34 + {
35 + return;
36 + }
37 +
38 + __EventCleanup();
39 +
40 + Helper.NativeObjectCache.RemoveObject<LongExposureInfraredFrameReader>(_pNative);
41 +
42 + if (disposing)
43 + {
44 + Windows_Kinect_LongExposureInfraredFrameReader_Dispose(_pNative);
45 + }
46 + Windows_Kinect_LongExposureInfraredFrameReader_ReleaseObject(ref _pNative);
47 +
48 + _pNative = RootSystem.IntPtr.Zero;
49 + }
50 +
51 +
52 + // Public Properties
53 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
54 + private static extern bool Windows_Kinect_LongExposureInfraredFrameReader_get_IsPaused(RootSystem.IntPtr pNative);
55 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
56 + private static extern void Windows_Kinect_LongExposureInfraredFrameReader_put_IsPaused(RootSystem.IntPtr pNative, bool isPaused);
57 + public bool IsPaused
58 + {
59 + get
60 + {
61 + if (_pNative == RootSystem.IntPtr.Zero)
62 + {
63 + throw new RootSystem.ObjectDisposedException("LongExposureInfraredFrameReader");
64 + }
65 +
66 + return Windows_Kinect_LongExposureInfraredFrameReader_get_IsPaused(_pNative);
67 + }
68 + set
69 + {
70 + if (_pNative == RootSystem.IntPtr.Zero)
71 + {
72 + throw new RootSystem.ObjectDisposedException("LongExposureInfraredFrameReader");
73 + }
74 +
75 + Windows_Kinect_LongExposureInfraredFrameReader_put_IsPaused(_pNative, value);
76 + Helper.ExceptionHelper.CheckLastError();
77 + }
78 + }
79 +
80 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
81 + private static extern RootSystem.IntPtr Windows_Kinect_LongExposureInfraredFrameReader_get_LongExposureInfraredFrameSource(RootSystem.IntPtr pNative);
82 + public Windows.Kinect.LongExposureInfraredFrameSource LongExposureInfraredFrameSource
83 + {
84 + get
85 + {
86 + if (_pNative == RootSystem.IntPtr.Zero)
87 + {
88 + throw new RootSystem.ObjectDisposedException("LongExposureInfraredFrameReader");
89 + }
90 +
91 + RootSystem.IntPtr objectPointer = Windows_Kinect_LongExposureInfraredFrameReader_get_LongExposureInfraredFrameSource(_pNative);
92 + Helper.ExceptionHelper.CheckLastError();
93 + if (objectPointer == RootSystem.IntPtr.Zero)
94 + {
95 + return null;
96 + }
97 +
98 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.LongExposureInfraredFrameSource>(objectPointer, n => new Windows.Kinect.LongExposureInfraredFrameSource(n));
99 + }
100 + }
101 +
102 +
103 + // Events
104 + private static RootSystem.Runtime.InteropServices.GCHandle _Windows_Kinect_LongExposureInfraredFrameArrivedEventArgs_Delegate_Handle;
105 + [RootSystem.Runtime.InteropServices.UnmanagedFunctionPointer(RootSystem.Runtime.InteropServices.CallingConvention.Cdecl)]
106 + private delegate void _Windows_Kinect_LongExposureInfraredFrameArrivedEventArgs_Delegate(RootSystem.IntPtr args, RootSystem.IntPtr pNative);
107 + private static Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Kinect.LongExposureInfraredFrameArrivedEventArgs>>> Windows_Kinect_LongExposureInfraredFrameArrivedEventArgs_Delegate_callbacks = new Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Kinect.LongExposureInfraredFrameArrivedEventArgs>>>();
108 + [AOT.MonoPInvokeCallbackAttribute(typeof(_Windows_Kinect_LongExposureInfraredFrameArrivedEventArgs_Delegate))]
109 + private static void Windows_Kinect_LongExposureInfraredFrameArrivedEventArgs_Delegate_Handler(RootSystem.IntPtr result, RootSystem.IntPtr pNative)
110 + {
111 + List<RootSystem.EventHandler<Windows.Kinect.LongExposureInfraredFrameArrivedEventArgs>> callbackList = null;
112 + Windows_Kinect_LongExposureInfraredFrameArrivedEventArgs_Delegate_callbacks.TryGetValue(pNative, out callbackList);
113 + lock(callbackList)
114 + {
115 + var objThis = Helper.NativeObjectCache.GetObject<LongExposureInfraredFrameReader>(pNative);
116 + var args = new Windows.Kinect.LongExposureInfraredFrameArrivedEventArgs(result);
117 + foreach(var func in callbackList)
118 + {
119 + Helper.EventPump.Instance.Enqueue(() => { try { func(objThis, args); } catch { } });
120 + }
121 + }
122 + }
123 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
124 + private static extern void Windows_Kinect_LongExposureInfraredFrameReader_add_FrameArrived(RootSystem.IntPtr pNative, _Windows_Kinect_LongExposureInfraredFrameArrivedEventArgs_Delegate eventCallback, bool unsubscribe);
125 + public event RootSystem.EventHandler<Windows.Kinect.LongExposureInfraredFrameArrivedEventArgs> FrameArrived
126 + {
127 + add
128 + {
129 + Helper.EventPump.EnsureInitialized();
130 +
131 + Windows_Kinect_LongExposureInfraredFrameArrivedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
132 + var callbackList = Windows_Kinect_LongExposureInfraredFrameArrivedEventArgs_Delegate_callbacks[_pNative];
133 + lock (callbackList)
134 + {
135 + callbackList.Add(value);
136 + if(callbackList.Count == 1)
137 + {
138 + var del = new _Windows_Kinect_LongExposureInfraredFrameArrivedEventArgs_Delegate(Windows_Kinect_LongExposureInfraredFrameArrivedEventArgs_Delegate_Handler);
139 + _Windows_Kinect_LongExposureInfraredFrameArrivedEventArgs_Delegate_Handle = RootSystem.Runtime.InteropServices.GCHandle.Alloc(del);
140 + Windows_Kinect_LongExposureInfraredFrameReader_add_FrameArrived(_pNative, del, false);
141 + }
142 + }
143 + }
144 + remove
145 + {
146 + if (_pNative == RootSystem.IntPtr.Zero)
147 + {
148 + return;
149 + }
150 +
151 + Windows_Kinect_LongExposureInfraredFrameArrivedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
152 + var callbackList = Windows_Kinect_LongExposureInfraredFrameArrivedEventArgs_Delegate_callbacks[_pNative];
153 + lock (callbackList)
154 + {
155 + callbackList.Remove(value);
156 + if(callbackList.Count == 0)
157 + {
158 + Windows_Kinect_LongExposureInfraredFrameReader_add_FrameArrived(_pNative, Windows_Kinect_LongExposureInfraredFrameArrivedEventArgs_Delegate_Handler, true);
159 + _Windows_Kinect_LongExposureInfraredFrameArrivedEventArgs_Delegate_Handle.Free();
160 + }
161 + }
162 + }
163 + }
164 +
165 + private static RootSystem.Runtime.InteropServices.GCHandle _Windows_Data_PropertyChangedEventArgs_Delegate_Handle;
166 + [RootSystem.Runtime.InteropServices.UnmanagedFunctionPointer(RootSystem.Runtime.InteropServices.CallingConvention.Cdecl)]
167 + private delegate void _Windows_Data_PropertyChangedEventArgs_Delegate(RootSystem.IntPtr args, RootSystem.IntPtr pNative);
168 + private static Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs>>> Windows_Data_PropertyChangedEventArgs_Delegate_callbacks = new Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs>>>();
169 + [AOT.MonoPInvokeCallbackAttribute(typeof(_Windows_Data_PropertyChangedEventArgs_Delegate))]
170 + private static void Windows_Data_PropertyChangedEventArgs_Delegate_Handler(RootSystem.IntPtr result, RootSystem.IntPtr pNative)
171 + {
172 + List<RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs>> callbackList = null;
173 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryGetValue(pNative, out callbackList);
174 + lock(callbackList)
175 + {
176 + var objThis = Helper.NativeObjectCache.GetObject<LongExposureInfraredFrameReader>(pNative);
177 + var args = new Windows.Data.PropertyChangedEventArgs(result);
178 + foreach(var func in callbackList)
179 + {
180 + Helper.EventPump.Instance.Enqueue(() => { try { func(objThis, args); } catch { } });
181 + }
182 + }
183 + }
184 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
185 + private static extern void Windows_Kinect_LongExposureInfraredFrameReader_add_PropertyChanged(RootSystem.IntPtr pNative, _Windows_Data_PropertyChangedEventArgs_Delegate eventCallback, bool unsubscribe);
186 + public event RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs> PropertyChanged
187 + {
188 + add
189 + {
190 + Helper.EventPump.EnsureInitialized();
191 +
192 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
193 + var callbackList = Windows_Data_PropertyChangedEventArgs_Delegate_callbacks[_pNative];
194 + lock (callbackList)
195 + {
196 + callbackList.Add(value);
197 + if(callbackList.Count == 1)
198 + {
199 + var del = new _Windows_Data_PropertyChangedEventArgs_Delegate(Windows_Data_PropertyChangedEventArgs_Delegate_Handler);
200 + _Windows_Data_PropertyChangedEventArgs_Delegate_Handle = RootSystem.Runtime.InteropServices.GCHandle.Alloc(del);
201 + Windows_Kinect_LongExposureInfraredFrameReader_add_PropertyChanged(_pNative, del, false);
202 + }
203 + }
204 + }
205 + remove
206 + {
207 + if (_pNative == RootSystem.IntPtr.Zero)
208 + {
209 + return;
210 + }
211 +
212 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
213 + var callbackList = Windows_Data_PropertyChangedEventArgs_Delegate_callbacks[_pNative];
214 + lock (callbackList)
215 + {
216 + callbackList.Remove(value);
217 + if(callbackList.Count == 0)
218 + {
219 + Windows_Kinect_LongExposureInfraredFrameReader_add_PropertyChanged(_pNative, Windows_Data_PropertyChangedEventArgs_Delegate_Handler, true);
220 + _Windows_Data_PropertyChangedEventArgs_Delegate_Handle.Free();
221 + }
222 + }
223 + }
224 + }
225 +
226 +
227 + // Public Methods
228 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
229 + private static extern RootSystem.IntPtr Windows_Kinect_LongExposureInfraredFrameReader_AcquireLatestFrame(RootSystem.IntPtr pNative);
230 + public Windows.Kinect.LongExposureInfraredFrame AcquireLatestFrame()
231 + {
232 + if (_pNative == RootSystem.IntPtr.Zero)
233 + {
234 + throw new RootSystem.ObjectDisposedException("LongExposureInfraredFrameReader");
235 + }
236 +
237 + RootSystem.IntPtr objectPointer = Windows_Kinect_LongExposureInfraredFrameReader_AcquireLatestFrame(_pNative);
238 + Helper.ExceptionHelper.CheckLastError();
239 + if (objectPointer == RootSystem.IntPtr.Zero)
240 + {
241 + return null;
242 + }
243 +
244 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.LongExposureInfraredFrame>(objectPointer, n => new Windows.Kinect.LongExposureInfraredFrame(n));
245 + }
246 +
247 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
248 + private static extern void Windows_Kinect_LongExposureInfraredFrameReader_Dispose(RootSystem.IntPtr pNative);
249 + public void Dispose()
250 + {
251 + if (_pNative == RootSystem.IntPtr.Zero)
252 + {
253 + return;
254 + }
255 +
256 + Dispose(true);
257 + RootSystem.GC.SuppressFinalize(this);
258 + }
259 +
260 + private void __EventCleanup()
261 + {
262 + {
263 + Windows_Kinect_LongExposureInfraredFrameArrivedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
264 + var callbackList = Windows_Kinect_LongExposureInfraredFrameArrivedEventArgs_Delegate_callbacks[_pNative];
265 + lock (callbackList)
266 + {
267 + if (callbackList.Count > 0)
268 + {
269 + callbackList.Clear();
270 + if (_pNative != RootSystem.IntPtr.Zero)
271 + {
272 + Windows_Kinect_LongExposureInfraredFrameReader_add_FrameArrived(_pNative, Windows_Kinect_LongExposureInfraredFrameArrivedEventArgs_Delegate_Handler, true);
273 + }
274 + _Windows_Kinect_LongExposureInfraredFrameArrivedEventArgs_Delegate_Handle.Free();
275 + }
276 + }
277 + }
278 + {
279 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
280 + var callbackList = Windows_Data_PropertyChangedEventArgs_Delegate_callbacks[_pNative];
281 + lock (callbackList)
282 + {
283 + if (callbackList.Count > 0)
284 + {
285 + callbackList.Clear();
286 + if (_pNative != RootSystem.IntPtr.Zero)
287 + {
288 + Windows_Kinect_LongExposureInfraredFrameReader_add_PropertyChanged(_pNative, Windows_Data_PropertyChangedEventArgs_Delegate_Handler, true);
289 + }
290 + _Windows_Data_PropertyChangedEventArgs_Delegate_Handle.Free();
291 + }
292 + }
293 + }
294 + }
295 + }
296 +
297 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.LongExposureInfraredFrameReference
8 + //
9 + public sealed partial class LongExposureInfraredFrameReference : Helper.INativeWrapper
10 +
11 + {
12 + internal RootSystem.IntPtr _pNative;
13 + RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
14 +
15 + // Constructors and Finalizers
16 + internal LongExposureInfraredFrameReference(RootSystem.IntPtr pNative)
17 + {
18 + _pNative = pNative;
19 + Windows_Kinect_LongExposureInfraredFrameReference_AddRefObject(ref _pNative);
20 + }
21 +
22 + ~LongExposureInfraredFrameReference()
23 + {
24 + Dispose(false);
25 + }
26 +
27 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
28 + private static extern void Windows_Kinect_LongExposureInfraredFrameReference_ReleaseObject(ref RootSystem.IntPtr pNative);
29 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
30 + private static extern void Windows_Kinect_LongExposureInfraredFrameReference_AddRefObject(ref RootSystem.IntPtr pNative);
31 + private void Dispose(bool disposing)
32 + {
33 + if (_pNative == RootSystem.IntPtr.Zero)
34 + {
35 + return;
36 + }
37 +
38 + __EventCleanup();
39 +
40 + Helper.NativeObjectCache.RemoveObject<LongExposureInfraredFrameReference>(_pNative);
41 + Windows_Kinect_LongExposureInfraredFrameReference_ReleaseObject(ref _pNative);
42 +
43 + _pNative = RootSystem.IntPtr.Zero;
44 + }
45 +
46 +
47 + // Public Properties
48 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
49 + private static extern long Windows_Kinect_LongExposureInfraredFrameReference_get_RelativeTime(RootSystem.IntPtr pNative);
50 + public RootSystem.TimeSpan RelativeTime
51 + {
52 + get
53 + {
54 + if (_pNative == RootSystem.IntPtr.Zero)
55 + {
56 + throw new RootSystem.ObjectDisposedException("LongExposureInfraredFrameReference");
57 + }
58 +
59 + return RootSystem.TimeSpan.FromMilliseconds(Windows_Kinect_LongExposureInfraredFrameReference_get_RelativeTime(_pNative));
60 + }
61 + }
62 +
63 +
64 + // Public Methods
65 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
66 + private static extern RootSystem.IntPtr Windows_Kinect_LongExposureInfraredFrameReference_AcquireFrame(RootSystem.IntPtr pNative);
67 + public Windows.Kinect.LongExposureInfraredFrame AcquireFrame()
68 + {
69 + if (_pNative == RootSystem.IntPtr.Zero)
70 + {
71 + throw new RootSystem.ObjectDisposedException("LongExposureInfraredFrameReference");
72 + }
73 +
74 + RootSystem.IntPtr objectPointer = Windows_Kinect_LongExposureInfraredFrameReference_AcquireFrame(_pNative);
75 + Helper.ExceptionHelper.CheckLastError();
76 + if (objectPointer == RootSystem.IntPtr.Zero)
77 + {
78 + return null;
79 + }
80 +
81 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.LongExposureInfraredFrame>(objectPointer, n => new Windows.Kinect.LongExposureInfraredFrame(n));
82 + }
83 +
84 + private void __EventCleanup()
85 + {
86 + }
87 + }
88 +
89 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.LongExposureInfraredFrameSource
8 + //
9 + public sealed partial class LongExposureInfraredFrameSource : Helper.INativeWrapper
10 +
11 + {
12 + internal RootSystem.IntPtr _pNative;
13 + RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
14 +
15 + // Constructors and Finalizers
16 + internal LongExposureInfraredFrameSource(RootSystem.IntPtr pNative)
17 + {
18 + _pNative = pNative;
19 + Windows_Kinect_LongExposureInfraredFrameSource_AddRefObject(ref _pNative);
20 + }
21 +
22 + ~LongExposureInfraredFrameSource()
23 + {
24 + Dispose(false);
25 + }
26 +
27 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
28 + private static extern void Windows_Kinect_LongExposureInfraredFrameSource_ReleaseObject(ref RootSystem.IntPtr pNative);
29 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
30 + private static extern void Windows_Kinect_LongExposureInfraredFrameSource_AddRefObject(ref RootSystem.IntPtr pNative);
31 + private void Dispose(bool disposing)
32 + {
33 + if (_pNative == RootSystem.IntPtr.Zero)
34 + {
35 + return;
36 + }
37 +
38 + __EventCleanup();
39 +
40 + Helper.NativeObjectCache.RemoveObject<LongExposureInfraredFrameSource>(_pNative);
41 + Windows_Kinect_LongExposureInfraredFrameSource_ReleaseObject(ref _pNative);
42 +
43 + _pNative = RootSystem.IntPtr.Zero;
44 + }
45 +
46 +
47 + // Public Properties
48 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
49 + private static extern RootSystem.IntPtr Windows_Kinect_LongExposureInfraredFrameSource_get_FrameDescription(RootSystem.IntPtr pNative);
50 + public Windows.Kinect.FrameDescription FrameDescription
51 + {
52 + get
53 + {
54 + if (_pNative == RootSystem.IntPtr.Zero)
55 + {
56 + throw new RootSystem.ObjectDisposedException("LongExposureInfraredFrameSource");
57 + }
58 +
59 + RootSystem.IntPtr objectPointer = Windows_Kinect_LongExposureInfraredFrameSource_get_FrameDescription(_pNative);
60 + Helper.ExceptionHelper.CheckLastError();
61 + if (objectPointer == RootSystem.IntPtr.Zero)
62 + {
63 + return null;
64 + }
65 +
66 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.FrameDescription>(objectPointer, n => new Windows.Kinect.FrameDescription(n));
67 + }
68 + }
69 +
70 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
71 + private static extern bool Windows_Kinect_LongExposureInfraredFrameSource_get_IsActive(RootSystem.IntPtr pNative);
72 + public bool IsActive
73 + {
74 + get
75 + {
76 + if (_pNative == RootSystem.IntPtr.Zero)
77 + {
78 + throw new RootSystem.ObjectDisposedException("LongExposureInfraredFrameSource");
79 + }
80 +
81 + return Windows_Kinect_LongExposureInfraredFrameSource_get_IsActive(_pNative);
82 + }
83 + }
84 +
85 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
86 + private static extern RootSystem.IntPtr Windows_Kinect_LongExposureInfraredFrameSource_get_KinectSensor(RootSystem.IntPtr pNative);
87 + public Windows.Kinect.KinectSensor KinectSensor
88 + {
89 + get
90 + {
91 + if (_pNative == RootSystem.IntPtr.Zero)
92 + {
93 + throw new RootSystem.ObjectDisposedException("LongExposureInfraredFrameSource");
94 + }
95 +
96 + RootSystem.IntPtr objectPointer = Windows_Kinect_LongExposureInfraredFrameSource_get_KinectSensor(_pNative);
97 + Helper.ExceptionHelper.CheckLastError();
98 + if (objectPointer == RootSystem.IntPtr.Zero)
99 + {
100 + return null;
101 + }
102 +
103 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.KinectSensor>(objectPointer, n => new Windows.Kinect.KinectSensor(n));
104 + }
105 + }
106 +
107 +
108 + // Events
109 + private static RootSystem.Runtime.InteropServices.GCHandle _Windows_Kinect_FrameCapturedEventArgs_Delegate_Handle;
110 + [RootSystem.Runtime.InteropServices.UnmanagedFunctionPointer(RootSystem.Runtime.InteropServices.CallingConvention.Cdecl)]
111 + private delegate void _Windows_Kinect_FrameCapturedEventArgs_Delegate(RootSystem.IntPtr args, RootSystem.IntPtr pNative);
112 + private static Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Kinect.FrameCapturedEventArgs>>> Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks = new Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Kinect.FrameCapturedEventArgs>>>();
113 + [AOT.MonoPInvokeCallbackAttribute(typeof(_Windows_Kinect_FrameCapturedEventArgs_Delegate))]
114 + private static void Windows_Kinect_FrameCapturedEventArgs_Delegate_Handler(RootSystem.IntPtr result, RootSystem.IntPtr pNative)
115 + {
116 + List<RootSystem.EventHandler<Windows.Kinect.FrameCapturedEventArgs>> callbackList = null;
117 + Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks.TryGetValue(pNative, out callbackList);
118 + lock(callbackList)
119 + {
120 + var objThis = Helper.NativeObjectCache.GetObject<LongExposureInfraredFrameSource>(pNative);
121 + var args = new Windows.Kinect.FrameCapturedEventArgs(result);
122 + foreach(var func in callbackList)
123 + {
124 + Helper.EventPump.Instance.Enqueue(() => { try { func(objThis, args); } catch { } });
125 + }
126 + }
127 + }
128 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
129 + private static extern void Windows_Kinect_LongExposureInfraredFrameSource_add_FrameCaptured(RootSystem.IntPtr pNative, _Windows_Kinect_FrameCapturedEventArgs_Delegate eventCallback, bool unsubscribe);
130 + public event RootSystem.EventHandler<Windows.Kinect.FrameCapturedEventArgs> FrameCaptured
131 + {
132 + add
133 + {
134 + Helper.EventPump.EnsureInitialized();
135 +
136 + Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
137 + var callbackList = Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks[_pNative];
138 + lock (callbackList)
139 + {
140 + callbackList.Add(value);
141 + if(callbackList.Count == 1)
142 + {
143 + var del = new _Windows_Kinect_FrameCapturedEventArgs_Delegate(Windows_Kinect_FrameCapturedEventArgs_Delegate_Handler);
144 + _Windows_Kinect_FrameCapturedEventArgs_Delegate_Handle = RootSystem.Runtime.InteropServices.GCHandle.Alloc(del);
145 + Windows_Kinect_LongExposureInfraredFrameSource_add_FrameCaptured(_pNative, del, false);
146 + }
147 + }
148 + }
149 + remove
150 + {
151 + if (_pNative == RootSystem.IntPtr.Zero)
152 + {
153 + return;
154 + }
155 +
156 + Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
157 + var callbackList = Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks[_pNative];
158 + lock (callbackList)
159 + {
160 + callbackList.Remove(value);
161 + if(callbackList.Count == 0)
162 + {
163 + Windows_Kinect_LongExposureInfraredFrameSource_add_FrameCaptured(_pNative, Windows_Kinect_FrameCapturedEventArgs_Delegate_Handler, true);
164 + _Windows_Kinect_FrameCapturedEventArgs_Delegate_Handle.Free();
165 + }
166 + }
167 + }
168 + }
169 +
170 + private static RootSystem.Runtime.InteropServices.GCHandle _Windows_Data_PropertyChangedEventArgs_Delegate_Handle;
171 + [RootSystem.Runtime.InteropServices.UnmanagedFunctionPointer(RootSystem.Runtime.InteropServices.CallingConvention.Cdecl)]
172 + private delegate void _Windows_Data_PropertyChangedEventArgs_Delegate(RootSystem.IntPtr args, RootSystem.IntPtr pNative);
173 + private static Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs>>> Windows_Data_PropertyChangedEventArgs_Delegate_callbacks = new Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs>>>();
174 + [AOT.MonoPInvokeCallbackAttribute(typeof(_Windows_Data_PropertyChangedEventArgs_Delegate))]
175 + private static void Windows_Data_PropertyChangedEventArgs_Delegate_Handler(RootSystem.IntPtr result, RootSystem.IntPtr pNative)
176 + {
177 + List<RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs>> callbackList = null;
178 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryGetValue(pNative, out callbackList);
179 + lock(callbackList)
180 + {
181 + var objThis = Helper.NativeObjectCache.GetObject<LongExposureInfraredFrameSource>(pNative);
182 + var args = new Windows.Data.PropertyChangedEventArgs(result);
183 + foreach(var func in callbackList)
184 + {
185 + Helper.EventPump.Instance.Enqueue(() => { try { func(objThis, args); } catch { } });
186 + }
187 + }
188 + }
189 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
190 + private static extern void Windows_Kinect_LongExposureInfraredFrameSource_add_PropertyChanged(RootSystem.IntPtr pNative, _Windows_Data_PropertyChangedEventArgs_Delegate eventCallback, bool unsubscribe);
191 + public event RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs> PropertyChanged
192 + {
193 + add
194 + {
195 + Helper.EventPump.EnsureInitialized();
196 +
197 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
198 + var callbackList = Windows_Data_PropertyChangedEventArgs_Delegate_callbacks[_pNative];
199 + lock (callbackList)
200 + {
201 + callbackList.Add(value);
202 + if(callbackList.Count == 1)
203 + {
204 + var del = new _Windows_Data_PropertyChangedEventArgs_Delegate(Windows_Data_PropertyChangedEventArgs_Delegate_Handler);
205 + _Windows_Data_PropertyChangedEventArgs_Delegate_Handle = RootSystem.Runtime.InteropServices.GCHandle.Alloc(del);
206 + Windows_Kinect_LongExposureInfraredFrameSource_add_PropertyChanged(_pNative, del, false);
207 + }
208 + }
209 + }
210 + remove
211 + {
212 + if (_pNative == RootSystem.IntPtr.Zero)
213 + {
214 + return;
215 + }
216 +
217 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
218 + var callbackList = Windows_Data_PropertyChangedEventArgs_Delegate_callbacks[_pNative];
219 + lock (callbackList)
220 + {
221 + callbackList.Remove(value);
222 + if(callbackList.Count == 0)
223 + {
224 + Windows_Kinect_LongExposureInfraredFrameSource_add_PropertyChanged(_pNative, Windows_Data_PropertyChangedEventArgs_Delegate_Handler, true);
225 + _Windows_Data_PropertyChangedEventArgs_Delegate_Handle.Free();
226 + }
227 + }
228 + }
229 + }
230 +
231 +
232 + // Public Methods
233 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
234 + private static extern RootSystem.IntPtr Windows_Kinect_LongExposureInfraredFrameSource_OpenReader(RootSystem.IntPtr pNative);
235 + public Windows.Kinect.LongExposureInfraredFrameReader OpenReader()
236 + {
237 + if (_pNative == RootSystem.IntPtr.Zero)
238 + {
239 + throw new RootSystem.ObjectDisposedException("LongExposureInfraredFrameSource");
240 + }
241 +
242 + RootSystem.IntPtr objectPointer = Windows_Kinect_LongExposureInfraredFrameSource_OpenReader(_pNative);
243 + Helper.ExceptionHelper.CheckLastError();
244 + if (objectPointer == RootSystem.IntPtr.Zero)
245 + {
246 + return null;
247 + }
248 +
249 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.LongExposureInfraredFrameReader>(objectPointer, n => new Windows.Kinect.LongExposureInfraredFrameReader(n));
250 + }
251 +
252 + private void __EventCleanup()
253 + {
254 + {
255 + Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
256 + var callbackList = Windows_Kinect_FrameCapturedEventArgs_Delegate_callbacks[_pNative];
257 + lock (callbackList)
258 + {
259 + if (callbackList.Count > 0)
260 + {
261 + callbackList.Clear();
262 + if (_pNative != RootSystem.IntPtr.Zero)
263 + {
264 + Windows_Kinect_LongExposureInfraredFrameSource_add_FrameCaptured(_pNative, Windows_Kinect_FrameCapturedEventArgs_Delegate_Handler, true);
265 + }
266 + _Windows_Kinect_FrameCapturedEventArgs_Delegate_Handle.Free();
267 + }
268 + }
269 + }
270 + {
271 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
272 + var callbackList = Windows_Data_PropertyChangedEventArgs_Delegate_callbacks[_pNative];
273 + lock (callbackList)
274 + {
275 + if (callbackList.Count > 0)
276 + {
277 + callbackList.Clear();
278 + if (_pNative != RootSystem.IntPtr.Zero)
279 + {
280 + Windows_Kinect_LongExposureInfraredFrameSource_add_PropertyChanged(_pNative, Windows_Data_PropertyChangedEventArgs_Delegate_Handler, true);
281 + }
282 + _Windows_Data_PropertyChangedEventArgs_Delegate_Handle.Free();
283 + }
284 + }
285 + }
286 + }
287 + }
288 +
289 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.MultiSourceFrame
8 + //
9 + public sealed partial class MultiSourceFrame : Helper.INativeWrapper
10 +
11 + {
12 + internal RootSystem.IntPtr _pNative;
13 + RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
14 +
15 + // Constructors and Finalizers
16 + internal MultiSourceFrame(RootSystem.IntPtr pNative)
17 + {
18 + _pNative = pNative;
19 + Windows_Kinect_MultiSourceFrame_AddRefObject(ref _pNative);
20 + }
21 +
22 + ~MultiSourceFrame()
23 + {
24 + Dispose(false);
25 + }
26 +
27 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
28 + private static extern void Windows_Kinect_MultiSourceFrame_ReleaseObject(ref RootSystem.IntPtr pNative);
29 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
30 + private static extern void Windows_Kinect_MultiSourceFrame_AddRefObject(ref RootSystem.IntPtr pNative);
31 + private void Dispose(bool disposing)
32 + {
33 + if (_pNative == RootSystem.IntPtr.Zero)
34 + {
35 + return;
36 + }
37 +
38 + __EventCleanup();
39 +
40 + Helper.NativeObjectCache.RemoveObject<MultiSourceFrame>(_pNative);
41 + Windows_Kinect_MultiSourceFrame_ReleaseObject(ref _pNative);
42 +
43 + _pNative = RootSystem.IntPtr.Zero;
44 + }
45 +
46 +
47 + // Public Properties
48 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
49 + private static extern RootSystem.IntPtr Windows_Kinect_MultiSourceFrame_get_BodyFrameReference(RootSystem.IntPtr pNative);
50 + public Windows.Kinect.BodyFrameReference BodyFrameReference
51 + {
52 + get
53 + {
54 + if (_pNative == RootSystem.IntPtr.Zero)
55 + {
56 + throw new RootSystem.ObjectDisposedException("MultiSourceFrame");
57 + }
58 +
59 + RootSystem.IntPtr objectPointer = Windows_Kinect_MultiSourceFrame_get_BodyFrameReference(_pNative);
60 + Helper.ExceptionHelper.CheckLastError();
61 + if (objectPointer == RootSystem.IntPtr.Zero)
62 + {
63 + return null;
64 + }
65 +
66 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.BodyFrameReference>(objectPointer, n => new Windows.Kinect.BodyFrameReference(n));
67 + }
68 + }
69 +
70 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
71 + private static extern RootSystem.IntPtr Windows_Kinect_MultiSourceFrame_get_BodyIndexFrameReference(RootSystem.IntPtr pNative);
72 + public Windows.Kinect.BodyIndexFrameReference BodyIndexFrameReference
73 + {
74 + get
75 + {
76 + if (_pNative == RootSystem.IntPtr.Zero)
77 + {
78 + throw new RootSystem.ObjectDisposedException("MultiSourceFrame");
79 + }
80 +
81 + RootSystem.IntPtr objectPointer = Windows_Kinect_MultiSourceFrame_get_BodyIndexFrameReference(_pNative);
82 + Helper.ExceptionHelper.CheckLastError();
83 + if (objectPointer == RootSystem.IntPtr.Zero)
84 + {
85 + return null;
86 + }
87 +
88 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.BodyIndexFrameReference>(objectPointer, n => new Windows.Kinect.BodyIndexFrameReference(n));
89 + }
90 + }
91 +
92 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
93 + private static extern RootSystem.IntPtr Windows_Kinect_MultiSourceFrame_get_ColorFrameReference(RootSystem.IntPtr pNative);
94 + public Windows.Kinect.ColorFrameReference ColorFrameReference
95 + {
96 + get
97 + {
98 + if (_pNative == RootSystem.IntPtr.Zero)
99 + {
100 + throw new RootSystem.ObjectDisposedException("MultiSourceFrame");
101 + }
102 +
103 + RootSystem.IntPtr objectPointer = Windows_Kinect_MultiSourceFrame_get_ColorFrameReference(_pNative);
104 + Helper.ExceptionHelper.CheckLastError();
105 + if (objectPointer == RootSystem.IntPtr.Zero)
106 + {
107 + return null;
108 + }
109 +
110 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.ColorFrameReference>(objectPointer, n => new Windows.Kinect.ColorFrameReference(n));
111 + }
112 + }
113 +
114 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
115 + private static extern RootSystem.IntPtr Windows_Kinect_MultiSourceFrame_get_DepthFrameReference(RootSystem.IntPtr pNative);
116 + public Windows.Kinect.DepthFrameReference DepthFrameReference
117 + {
118 + get
119 + {
120 + if (_pNative == RootSystem.IntPtr.Zero)
121 + {
122 + throw new RootSystem.ObjectDisposedException("MultiSourceFrame");
123 + }
124 +
125 + RootSystem.IntPtr objectPointer = Windows_Kinect_MultiSourceFrame_get_DepthFrameReference(_pNative);
126 + Helper.ExceptionHelper.CheckLastError();
127 + if (objectPointer == RootSystem.IntPtr.Zero)
128 + {
129 + return null;
130 + }
131 +
132 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.DepthFrameReference>(objectPointer, n => new Windows.Kinect.DepthFrameReference(n));
133 + }
134 + }
135 +
136 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
137 + private static extern RootSystem.IntPtr Windows_Kinect_MultiSourceFrame_get_InfraredFrameReference(RootSystem.IntPtr pNative);
138 + public Windows.Kinect.InfraredFrameReference InfraredFrameReference
139 + {
140 + get
141 + {
142 + if (_pNative == RootSystem.IntPtr.Zero)
143 + {
144 + throw new RootSystem.ObjectDisposedException("MultiSourceFrame");
145 + }
146 +
147 + RootSystem.IntPtr objectPointer = Windows_Kinect_MultiSourceFrame_get_InfraredFrameReference(_pNative);
148 + Helper.ExceptionHelper.CheckLastError();
149 + if (objectPointer == RootSystem.IntPtr.Zero)
150 + {
151 + return null;
152 + }
153 +
154 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.InfraredFrameReference>(objectPointer, n => new Windows.Kinect.InfraredFrameReference(n));
155 + }
156 + }
157 +
158 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
159 + private static extern RootSystem.IntPtr Windows_Kinect_MultiSourceFrame_get_LongExposureInfraredFrameReference(RootSystem.IntPtr pNative);
160 + public Windows.Kinect.LongExposureInfraredFrameReference LongExposureInfraredFrameReference
161 + {
162 + get
163 + {
164 + if (_pNative == RootSystem.IntPtr.Zero)
165 + {
166 + throw new RootSystem.ObjectDisposedException("MultiSourceFrame");
167 + }
168 +
169 + RootSystem.IntPtr objectPointer = Windows_Kinect_MultiSourceFrame_get_LongExposureInfraredFrameReference(_pNative);
170 + Helper.ExceptionHelper.CheckLastError();
171 + if (objectPointer == RootSystem.IntPtr.Zero)
172 + {
173 + return null;
174 + }
175 +
176 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.LongExposureInfraredFrameReference>(objectPointer, n => new Windows.Kinect.LongExposureInfraredFrameReference(n));
177 + }
178 + }
179 +
180 +
181 + // Public Methods
182 + private void __EventCleanup()
183 + {
184 + }
185 + }
186 +
187 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.MultiSourceFrameArrivedEventArgs
8 + //
9 + public sealed partial class MultiSourceFrameArrivedEventArgs : RootSystem.EventArgs, Helper.INativeWrapper
10 +
11 + {
12 + internal RootSystem.IntPtr _pNative;
13 + RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
14 +
15 + // Constructors and Finalizers
16 + internal MultiSourceFrameArrivedEventArgs(RootSystem.IntPtr pNative)
17 + {
18 + _pNative = pNative;
19 + Windows_Kinect_MultiSourceFrameArrivedEventArgs_AddRefObject(ref _pNative);
20 + }
21 +
22 + ~MultiSourceFrameArrivedEventArgs()
23 + {
24 + Dispose(false);
25 + }
26 +
27 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
28 + private static extern void Windows_Kinect_MultiSourceFrameArrivedEventArgs_ReleaseObject(ref RootSystem.IntPtr pNative);
29 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
30 + private static extern void Windows_Kinect_MultiSourceFrameArrivedEventArgs_AddRefObject(ref RootSystem.IntPtr pNative);
31 + private void Dispose(bool disposing)
32 + {
33 + if (_pNative == RootSystem.IntPtr.Zero)
34 + {
35 + return;
36 + }
37 +
38 + __EventCleanup();
39 +
40 + Helper.NativeObjectCache.RemoveObject<MultiSourceFrameArrivedEventArgs>(_pNative);
41 + Windows_Kinect_MultiSourceFrameArrivedEventArgs_ReleaseObject(ref _pNative);
42 +
43 + _pNative = RootSystem.IntPtr.Zero;
44 + }
45 +
46 +
47 + // Public Properties
48 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
49 + private static extern RootSystem.IntPtr Windows_Kinect_MultiSourceFrameArrivedEventArgs_get_FrameReference(RootSystem.IntPtr pNative);
50 + public Windows.Kinect.MultiSourceFrameReference FrameReference
51 + {
52 + get
53 + {
54 + if (_pNative == RootSystem.IntPtr.Zero)
55 + {
56 + throw new RootSystem.ObjectDisposedException("MultiSourceFrameArrivedEventArgs");
57 + }
58 +
59 + RootSystem.IntPtr objectPointer = Windows_Kinect_MultiSourceFrameArrivedEventArgs_get_FrameReference(_pNative);
60 + Helper.ExceptionHelper.CheckLastError();
61 + if (objectPointer == RootSystem.IntPtr.Zero)
62 + {
63 + return null;
64 + }
65 +
66 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.MultiSourceFrameReference>(objectPointer, n => new Windows.Kinect.MultiSourceFrameReference(n));
67 + }
68 + }
69 +
70 + private void __EventCleanup()
71 + {
72 + }
73 + }
74 +
75 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.MultiSourceFrameReader
8 + //
9 + public sealed partial class MultiSourceFrameReader : RootSystem.IDisposable, Helper.INativeWrapper
10 +
11 + {
12 + internal RootSystem.IntPtr _pNative;
13 + RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
14 +
15 + // Constructors and Finalizers
16 + internal MultiSourceFrameReader(RootSystem.IntPtr pNative)
17 + {
18 + _pNative = pNative;
19 + Windows_Kinect_MultiSourceFrameReader_AddRefObject(ref _pNative);
20 + }
21 +
22 + ~MultiSourceFrameReader()
23 + {
24 + Dispose(false);
25 + }
26 +
27 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
28 + private static extern void Windows_Kinect_MultiSourceFrameReader_ReleaseObject(ref RootSystem.IntPtr pNative);
29 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
30 + private static extern void Windows_Kinect_MultiSourceFrameReader_AddRefObject(ref RootSystem.IntPtr pNative);
31 + private void Dispose(bool disposing)
32 + {
33 + if (_pNative == RootSystem.IntPtr.Zero)
34 + {
35 + return;
36 + }
37 +
38 + __EventCleanup();
39 +
40 + Helper.NativeObjectCache.RemoveObject<MultiSourceFrameReader>(_pNative);
41 +
42 + if (disposing)
43 + {
44 + Windows_Kinect_MultiSourceFrameReader_Dispose(_pNative);
45 + }
46 + Windows_Kinect_MultiSourceFrameReader_ReleaseObject(ref _pNative);
47 +
48 + _pNative = RootSystem.IntPtr.Zero;
49 + }
50 +
51 +
52 + // Public Properties
53 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
54 + private static extern Windows.Kinect.FrameSourceTypes Windows_Kinect_MultiSourceFrameReader_get_FrameSourceTypes(RootSystem.IntPtr pNative);
55 + public Windows.Kinect.FrameSourceTypes FrameSourceTypes
56 + {
57 + get
58 + {
59 + if (_pNative == RootSystem.IntPtr.Zero)
60 + {
61 + throw new RootSystem.ObjectDisposedException("MultiSourceFrameReader");
62 + }
63 +
64 + return Windows_Kinect_MultiSourceFrameReader_get_FrameSourceTypes(_pNative);
65 + }
66 + }
67 +
68 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
69 + private static extern bool Windows_Kinect_MultiSourceFrameReader_get_IsPaused(RootSystem.IntPtr pNative);
70 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
71 + private static extern void Windows_Kinect_MultiSourceFrameReader_put_IsPaused(RootSystem.IntPtr pNative, bool isPaused);
72 + public bool IsPaused
73 + {
74 + get
75 + {
76 + if (_pNative == RootSystem.IntPtr.Zero)
77 + {
78 + throw new RootSystem.ObjectDisposedException("MultiSourceFrameReader");
79 + }
80 +
81 + return Windows_Kinect_MultiSourceFrameReader_get_IsPaused(_pNative);
82 + }
83 + set
84 + {
85 + if (_pNative == RootSystem.IntPtr.Zero)
86 + {
87 + throw new RootSystem.ObjectDisposedException("MultiSourceFrameReader");
88 + }
89 +
90 + Windows_Kinect_MultiSourceFrameReader_put_IsPaused(_pNative, value);
91 + Helper.ExceptionHelper.CheckLastError();
92 + }
93 + }
94 +
95 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
96 + private static extern RootSystem.IntPtr Windows_Kinect_MultiSourceFrameReader_get_KinectSensor(RootSystem.IntPtr pNative);
97 + public Windows.Kinect.KinectSensor KinectSensor
98 + {
99 + get
100 + {
101 + if (_pNative == RootSystem.IntPtr.Zero)
102 + {
103 + throw new RootSystem.ObjectDisposedException("MultiSourceFrameReader");
104 + }
105 +
106 + RootSystem.IntPtr objectPointer = Windows_Kinect_MultiSourceFrameReader_get_KinectSensor(_pNative);
107 + Helper.ExceptionHelper.CheckLastError();
108 + if (objectPointer == RootSystem.IntPtr.Zero)
109 + {
110 + return null;
111 + }
112 +
113 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.KinectSensor>(objectPointer, n => new Windows.Kinect.KinectSensor(n));
114 + }
115 + }
116 +
117 +
118 + // Events
119 + private static RootSystem.Runtime.InteropServices.GCHandle _Windows_Kinect_MultiSourceFrameArrivedEventArgs_Delegate_Handle;
120 + [RootSystem.Runtime.InteropServices.UnmanagedFunctionPointer(RootSystem.Runtime.InteropServices.CallingConvention.Cdecl)]
121 + private delegate void _Windows_Kinect_MultiSourceFrameArrivedEventArgs_Delegate(RootSystem.IntPtr args, RootSystem.IntPtr pNative);
122 + private static Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Kinect.MultiSourceFrameArrivedEventArgs>>> Windows_Kinect_MultiSourceFrameArrivedEventArgs_Delegate_callbacks = new Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Kinect.MultiSourceFrameArrivedEventArgs>>>();
123 + [AOT.MonoPInvokeCallbackAttribute(typeof(_Windows_Kinect_MultiSourceFrameArrivedEventArgs_Delegate))]
124 + private static void Windows_Kinect_MultiSourceFrameArrivedEventArgs_Delegate_Handler(RootSystem.IntPtr result, RootSystem.IntPtr pNative)
125 + {
126 + List<RootSystem.EventHandler<Windows.Kinect.MultiSourceFrameArrivedEventArgs>> callbackList = null;
127 + Windows_Kinect_MultiSourceFrameArrivedEventArgs_Delegate_callbacks.TryGetValue(pNative, out callbackList);
128 + lock(callbackList)
129 + {
130 + var objThis = Helper.NativeObjectCache.GetObject<MultiSourceFrameReader>(pNative);
131 + var args = new Windows.Kinect.MultiSourceFrameArrivedEventArgs(result);
132 + foreach(var func in callbackList)
133 + {
134 + Helper.EventPump.Instance.Enqueue(() => { try { func(objThis, args); } catch { } });
135 + }
136 + }
137 + }
138 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
139 + private static extern void Windows_Kinect_MultiSourceFrameReader_add_MultiSourceFrameArrived(RootSystem.IntPtr pNative, _Windows_Kinect_MultiSourceFrameArrivedEventArgs_Delegate eventCallback, bool unsubscribe);
140 + public event RootSystem.EventHandler<Windows.Kinect.MultiSourceFrameArrivedEventArgs> MultiSourceFrameArrived
141 + {
142 + add
143 + {
144 + Helper.EventPump.EnsureInitialized();
145 +
146 + Windows_Kinect_MultiSourceFrameArrivedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
147 + var callbackList = Windows_Kinect_MultiSourceFrameArrivedEventArgs_Delegate_callbacks[_pNative];
148 + lock (callbackList)
149 + {
150 + callbackList.Add(value);
151 + if(callbackList.Count == 1)
152 + {
153 + var del = new _Windows_Kinect_MultiSourceFrameArrivedEventArgs_Delegate(Windows_Kinect_MultiSourceFrameArrivedEventArgs_Delegate_Handler);
154 + _Windows_Kinect_MultiSourceFrameArrivedEventArgs_Delegate_Handle = RootSystem.Runtime.InteropServices.GCHandle.Alloc(del);
155 + Windows_Kinect_MultiSourceFrameReader_add_MultiSourceFrameArrived(_pNative, del, false);
156 + }
157 + }
158 + }
159 + remove
160 + {
161 + if (_pNative == RootSystem.IntPtr.Zero)
162 + {
163 + return;
164 + }
165 +
166 + Windows_Kinect_MultiSourceFrameArrivedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
167 + var callbackList = Windows_Kinect_MultiSourceFrameArrivedEventArgs_Delegate_callbacks[_pNative];
168 + lock (callbackList)
169 + {
170 + callbackList.Remove(value);
171 + if(callbackList.Count == 0)
172 + {
173 + Windows_Kinect_MultiSourceFrameReader_add_MultiSourceFrameArrived(_pNative, Windows_Kinect_MultiSourceFrameArrivedEventArgs_Delegate_Handler, true);
174 + _Windows_Kinect_MultiSourceFrameArrivedEventArgs_Delegate_Handle.Free();
175 + }
176 + }
177 + }
178 + }
179 +
180 + private static RootSystem.Runtime.InteropServices.GCHandle _Windows_Data_PropertyChangedEventArgs_Delegate_Handle;
181 + [RootSystem.Runtime.InteropServices.UnmanagedFunctionPointer(RootSystem.Runtime.InteropServices.CallingConvention.Cdecl)]
182 + private delegate void _Windows_Data_PropertyChangedEventArgs_Delegate(RootSystem.IntPtr args, RootSystem.IntPtr pNative);
183 + private static Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs>>> Windows_Data_PropertyChangedEventArgs_Delegate_callbacks = new Helper.CollectionMap<RootSystem.IntPtr, List<RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs>>>();
184 + [AOT.MonoPInvokeCallbackAttribute(typeof(_Windows_Data_PropertyChangedEventArgs_Delegate))]
185 + private static void Windows_Data_PropertyChangedEventArgs_Delegate_Handler(RootSystem.IntPtr result, RootSystem.IntPtr pNative)
186 + {
187 + List<RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs>> callbackList = null;
188 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryGetValue(pNative, out callbackList);
189 + lock(callbackList)
190 + {
191 + var objThis = Helper.NativeObjectCache.GetObject<MultiSourceFrameReader>(pNative);
192 + var args = new Windows.Data.PropertyChangedEventArgs(result);
193 + foreach(var func in callbackList)
194 + {
195 + Helper.EventPump.Instance.Enqueue(() => { try { func(objThis, args); } catch { } });
196 + }
197 + }
198 + }
199 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
200 + private static extern void Windows_Kinect_MultiSourceFrameReader_add_PropertyChanged(RootSystem.IntPtr pNative, _Windows_Data_PropertyChangedEventArgs_Delegate eventCallback, bool unsubscribe);
201 + public event RootSystem.EventHandler<Windows.Data.PropertyChangedEventArgs> PropertyChanged
202 + {
203 + add
204 + {
205 + Helper.EventPump.EnsureInitialized();
206 +
207 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
208 + var callbackList = Windows_Data_PropertyChangedEventArgs_Delegate_callbacks[_pNative];
209 + lock (callbackList)
210 + {
211 + callbackList.Add(value);
212 + if(callbackList.Count == 1)
213 + {
214 + var del = new _Windows_Data_PropertyChangedEventArgs_Delegate(Windows_Data_PropertyChangedEventArgs_Delegate_Handler);
215 + _Windows_Data_PropertyChangedEventArgs_Delegate_Handle = RootSystem.Runtime.InteropServices.GCHandle.Alloc(del);
216 + Windows_Kinect_MultiSourceFrameReader_add_PropertyChanged(_pNative, del, false);
217 + }
218 + }
219 + }
220 + remove
221 + {
222 + if (_pNative == RootSystem.IntPtr.Zero)
223 + {
224 + return;
225 + }
226 +
227 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
228 + var callbackList = Windows_Data_PropertyChangedEventArgs_Delegate_callbacks[_pNative];
229 + lock (callbackList)
230 + {
231 + callbackList.Remove(value);
232 + if(callbackList.Count == 0)
233 + {
234 + Windows_Kinect_MultiSourceFrameReader_add_PropertyChanged(_pNative, Windows_Data_PropertyChangedEventArgs_Delegate_Handler, true);
235 + _Windows_Data_PropertyChangedEventArgs_Delegate_Handle.Free();
236 + }
237 + }
238 + }
239 + }
240 +
241 +
242 + // Public Methods
243 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
244 + private static extern RootSystem.IntPtr Windows_Kinect_MultiSourceFrameReader_AcquireLatestFrame(RootSystem.IntPtr pNative);
245 + public Windows.Kinect.MultiSourceFrame AcquireLatestFrame()
246 + {
247 + if (_pNative == RootSystem.IntPtr.Zero)
248 + {
249 + throw new RootSystem.ObjectDisposedException("MultiSourceFrameReader");
250 + }
251 +
252 + RootSystem.IntPtr objectPointer = Windows_Kinect_MultiSourceFrameReader_AcquireLatestFrame(_pNative);
253 + Helper.ExceptionHelper.CheckLastError();
254 + if (objectPointer == RootSystem.IntPtr.Zero)
255 + {
256 + return null;
257 + }
258 +
259 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.MultiSourceFrame>(objectPointer, n => new Windows.Kinect.MultiSourceFrame(n));
260 + }
261 +
262 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
263 + private static extern void Windows_Kinect_MultiSourceFrameReader_Dispose(RootSystem.IntPtr pNative);
264 + public void Dispose()
265 + {
266 + if (_pNative == RootSystem.IntPtr.Zero)
267 + {
268 + return;
269 + }
270 +
271 + Dispose(true);
272 + RootSystem.GC.SuppressFinalize(this);
273 + }
274 +
275 + private void __EventCleanup()
276 + {
277 + {
278 + Windows_Kinect_MultiSourceFrameArrivedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
279 + var callbackList = Windows_Kinect_MultiSourceFrameArrivedEventArgs_Delegate_callbacks[_pNative];
280 + lock (callbackList)
281 + {
282 + if (callbackList.Count > 0)
283 + {
284 + callbackList.Clear();
285 + if (_pNative != RootSystem.IntPtr.Zero)
286 + {
287 + Windows_Kinect_MultiSourceFrameReader_add_MultiSourceFrameArrived(_pNative, Windows_Kinect_MultiSourceFrameArrivedEventArgs_Delegate_Handler, true);
288 + }
289 + _Windows_Kinect_MultiSourceFrameArrivedEventArgs_Delegate_Handle.Free();
290 + }
291 + }
292 + }
293 + {
294 + Windows_Data_PropertyChangedEventArgs_Delegate_callbacks.TryAddDefault(_pNative);
295 + var callbackList = Windows_Data_PropertyChangedEventArgs_Delegate_callbacks[_pNative];
296 + lock (callbackList)
297 + {
298 + if (callbackList.Count > 0)
299 + {
300 + callbackList.Clear();
301 + if (_pNative != RootSystem.IntPtr.Zero)
302 + {
303 + Windows_Kinect_MultiSourceFrameReader_add_PropertyChanged(_pNative, Windows_Data_PropertyChangedEventArgs_Delegate_Handler, true);
304 + }
305 + _Windows_Data_PropertyChangedEventArgs_Delegate_Handle.Free();
306 + }
307 + }
308 + }
309 + }
310 + }
311 +
312 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.MultiSourceFrameReference
8 + //
9 + public sealed partial class MultiSourceFrameReference : Helper.INativeWrapper
10 +
11 + {
12 + internal RootSystem.IntPtr _pNative;
13 + RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
14 +
15 + // Constructors and Finalizers
16 + internal MultiSourceFrameReference(RootSystem.IntPtr pNative)
17 + {
18 + _pNative = pNative;
19 + Windows_Kinect_MultiSourceFrameReference_AddRefObject(ref _pNative);
20 + }
21 +
22 + ~MultiSourceFrameReference()
23 + {
24 + Dispose(false);
25 + }
26 +
27 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
28 + private static extern void Windows_Kinect_MultiSourceFrameReference_ReleaseObject(ref RootSystem.IntPtr pNative);
29 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
30 + private static extern void Windows_Kinect_MultiSourceFrameReference_AddRefObject(ref RootSystem.IntPtr pNative);
31 + private void Dispose(bool disposing)
32 + {
33 + if (_pNative == RootSystem.IntPtr.Zero)
34 + {
35 + return;
36 + }
37 +
38 + __EventCleanup();
39 +
40 + Helper.NativeObjectCache.RemoveObject<MultiSourceFrameReference>(_pNative);
41 + Windows_Kinect_MultiSourceFrameReference_ReleaseObject(ref _pNative);
42 +
43 + _pNative = RootSystem.IntPtr.Zero;
44 + }
45 +
46 +
47 + // Public Methods
48 + [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
49 + private static extern RootSystem.IntPtr Windows_Kinect_MultiSourceFrameReference_AcquireFrame(RootSystem.IntPtr pNative);
50 + public Windows.Kinect.MultiSourceFrame AcquireFrame()
51 + {
52 + if (_pNative == RootSystem.IntPtr.Zero)
53 + {
54 + throw new RootSystem.ObjectDisposedException("MultiSourceFrameReference");
55 + }
56 +
57 + RootSystem.IntPtr objectPointer = Windows_Kinect_MultiSourceFrameReference_AcquireFrame(_pNative);
58 + Helper.ExceptionHelper.CheckLastError();
59 + if (objectPointer == RootSystem.IntPtr.Zero)
60 + {
61 + return null;
62 + }
63 +
64 + return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.MultiSourceFrame>(objectPointer, n => new Windows.Kinect.MultiSourceFrame(n));
65 + }
66 +
67 + private void __EventCleanup()
68 + {
69 + }
70 + }
71 +
72 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.TrackingConfidence
8 + //
9 + public enum TrackingConfidence : int
10 + {
11 + Low =0,
12 + High =1,
13 + }
14 +
15 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.TrackingState
8 + //
9 + public enum TrackingState : int
10 + {
11 + NotTracked =0,
12 + Inferred =1,
13 + Tracked =2,
14 + }
15 +
16 +}
1 +using RootSystem = System;
2 +using System.Linq;
3 +using System.Collections.Generic;
4 +namespace Windows.Kinect
5 +{
6 + //
7 + // Windows.Kinect.Vector4
8 + //
9 + [RootSystem.Runtime.InteropServices.StructLayout(RootSystem.Runtime.InteropServices.LayoutKind.Sequential)]
10 + public struct Vector4
11 + {
12 + public float X { get; set; }
13 + public float Y { get; set; }
14 + public float Z { get; set; }
15 + public float W { get; set; }
16 +
17 + public override int GetHashCode()
18 + {
19 + return X.GetHashCode() ^ Y.GetHashCode() ^ Z.GetHashCode() ^ W.GetHashCode();
20 + }
21 +
22 + public override bool Equals(object obj)
23 + {
24 + if (!(obj is Vector4))
25 + {
26 + return false;
27 + }
28 +
29 + return this.Equals((Vector4)obj);
30 + }
31 +
32 + public bool Equals(Vector4 obj)
33 + {
34 + return X.Equals(obj.X) && Y.Equals(obj.Y) && Z.Equals(obj.Z) && W.Equals(obj.W);
35 + }
36 +
37 + public static bool operator ==(Vector4 a, Vector4 b)
38 + {
39 + return a.Equals(b);
40 + }
41 +
42 + public static bool operator !=(Vector4 a, Vector4 b)
43 + {
44 + return !(a.Equals(b));
45 + }
46 + }
47 +
48 +}
1 +%YAML 1.1
2 +%TAG !u! tag:unity3d.com,2011:
3 +--- !u!1107 &-3831123534373382056
4 +AnimatorStateMachine:
5 + serializedVersion: 5
6 + m_ObjectHideFlags: 1
7 + m_CorrespondingSourceObject: {fileID: 0}
8 + m_PrefabInstance: {fileID: 0}
9 + m_PrefabAsset: {fileID: 0}
10 + m_Name: Base Layer
11 + m_ChildStates: []
12 + m_ChildStateMachines: []
13 + m_AnyStateTransitions: []
14 + m_EntryTransitions: []
15 + m_StateMachineTransitions: {}
16 + m_StateMachineBehaviours:
17 + - {fileID: 7076032577301773451}
18 + m_AnyStatePosition: {x: 50, y: 20, z: 0}
19 + m_EntryPosition: {x: 50, y: 120, z: 0}
20 + m_ExitPosition: {x: 800, y: 120, z: 0}
21 + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
22 + m_DefaultState: {fileID: 0}
23 +--- !u!91 &9100000
24 +AnimatorController:
25 + m_ObjectHideFlags: 0
26 + m_CorrespondingSourceObject: {fileID: 0}
27 + m_PrefabInstance: {fileID: 0}
28 + m_PrefabAsset: {fileID: 0}
29 + m_Name: TestRun
30 + serializedVersion: 5
31 + m_AnimatorParameters: []
32 + m_AnimatorLayers:
33 + - serializedVersion: 5
34 + m_Name: Base Layer
35 + m_StateMachine: {fileID: -3831123534373382056}
36 + m_Mask: {fileID: 0}
37 + m_Motions: []
38 + m_Behaviours: []
39 + m_BlendingMode: 0
40 + m_SyncedLayerIndex: -1
41 + m_DefaultWeight: 0
42 + m_IKPass: 0
43 + m_SyncedLayerAffectsTiming: 0
44 + m_Controller: {fileID: 9100000}
45 +--- !u!114 &7076032577301773451
46 +MonoBehaviour:
47 + m_ObjectHideFlags: 1
48 + m_CorrespondingSourceObject: {fileID: 0}
49 + m_PrefabInstance: {fileID: 0}
50 + m_PrefabAsset: {fileID: 0}
51 + m_GameObject: {fileID: 0}
52 + m_Enabled: 1
53 + m_EditorHideFlags: 0
54 + m_Script: {fileID: 11500000, guid: 3709b75a3e1f5724090fd84e57d011b9, type: 3}
55 + m_Name:
56 + m_EditorClassIdentifier:
No preview for this file type
1 +{
2 + "dependencies": {
3 + "com.unity.collab-proxy": "1.2.16",
4 + "com.unity.ide.rider": "1.1.4",
5 + "com.unity.ide.vscode": "1.1.4",
6 + "com.unity.quicksearch": "1.6.0-preview.7",
7 + "com.unity.test-framework": "1.1.13",
8 + "com.unity.textmeshpro": "2.0.1",
9 + "com.unity.timeline": "1.2.14",
10 + "com.unity.ugui": "1.0.0",
11 + "com.unity.modules.ai": "1.0.0",
12 + "com.unity.modules.androidjni": "1.0.0",
13 + "com.unity.modules.animation": "1.0.0",
14 + "com.unity.modules.assetbundle": "1.0.0",
15 + "com.unity.modules.audio": "1.0.0",
16 + "com.unity.modules.cloth": "1.0.0",
17 + "com.unity.modules.director": "1.0.0",
18 + "com.unity.modules.imageconversion": "1.0.0",
19 + "com.unity.modules.imgui": "1.0.0",
20 + "com.unity.modules.jsonserialize": "1.0.0",
21 + "com.unity.modules.particlesystem": "1.0.0",
22 + "com.unity.modules.physics": "1.0.0",
23 + "com.unity.modules.physics2d": "1.0.0",
24 + "com.unity.modules.screencapture": "1.0.0",
25 + "com.unity.modules.terrain": "1.0.0",
26 + "com.unity.modules.terrainphysics": "1.0.0",
27 + "com.unity.modules.tilemap": "1.0.0",
28 + "com.unity.modules.ui": "1.0.0",
29 + "com.unity.modules.uielements": "1.0.0",
30 + "com.unity.modules.umbra": "1.0.0",
31 + "com.unity.modules.unityanalytics": "1.0.0",
32 + "com.unity.modules.unitywebrequest": "1.0.0",
33 + "com.unity.modules.unitywebrequestassetbundle": "1.0.0",
34 + "com.unity.modules.unitywebrequestaudio": "1.0.0",
35 + "com.unity.modules.unitywebrequesttexture": "1.0.0",
36 + "com.unity.modules.unitywebrequestwww": "1.0.0",
37 + "com.unity.modules.vehicles": "1.0.0",
38 + "com.unity.modules.video": "1.0.0",
39 + "com.unity.modules.vr": "1.0.0",
40 + "com.unity.modules.wind": "1.0.0",
41 + "com.unity.modules.xr": "1.0.0"
42 + }
43 +}
1 +%YAML 1.1
2 +%TAG !u! tag:unity3d.com,2011:
3 +--- !u!11 &1
4 +AudioManager:
5 + m_ObjectHideFlags: 0
6 + serializedVersion: 2
7 + m_Volume: 1
8 + Rolloff Scale: 1
9 + Doppler Factor: 1
10 + Default Speaker Mode: 2
11 + m_SampleRate: 0
12 + m_DSPBufferSize: 1024
13 + m_VirtualVoiceCount: 512
14 + m_RealVoiceCount: 32
15 + m_SpatializerPlugin:
16 + m_AmbisonicDecoderPlugin:
17 + m_DisableAudio: 0
18 + m_VirtualizeEffects: 1
19 + m_RequestedDSPBufferSize: 1024
1 +%YAML 1.1
2 +%TAG !u! tag:unity3d.com,2011:
3 +--- !u!236 &1
4 +ClusterInputManager:
5 + m_ObjectHideFlags: 0
6 + m_Inputs: []
1 +%YAML 1.1
2 +%TAG !u! tag:unity3d.com,2011:
3 +--- !u!55 &1
4 +PhysicsManager:
5 + m_ObjectHideFlags: 0
6 + serializedVersion: 11
7 + m_Gravity: {x: 0, y: -9.81, z: 0}
8 + m_DefaultMaterial: {fileID: 0}
9 + m_BounceThreshold: 2
10 + m_SleepThreshold: 0.005
11 + m_DefaultContactOffset: 0.01
12 + m_DefaultSolverIterations: 6
13 + m_DefaultSolverVelocityIterations: 1
14 + m_QueriesHitBackfaces: 0
15 + m_QueriesHitTriggers: 1
16 + m_EnableAdaptiveForce: 0
17 + m_ClothInterCollisionDistance: 0
18 + m_ClothInterCollisionStiffness: 0
19 + m_ContactsGeneration: 1
20 + m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
21 + m_AutoSimulation: 1
22 + m_AutoSyncTransforms: 0
23 + m_ReuseCollisionCallbacks: 1
24 + m_ClothInterCollisionSettingsToggle: 0
25 + m_ContactPairsMode: 0
26 + m_BroadphaseType: 0
27 + m_WorldBounds:
28 + m_Center: {x: 0, y: 0, z: 0}
29 + m_Extent: {x: 250, y: 250, z: 250}
30 + m_WorldSubdivisions: 8
31 + m_FrictionType: 0
32 + m_EnableEnhancedDeterminism: 0
33 + m_EnableUnifiedHeightmaps: 1
34 + m_DefaultMaxAngluarSpeed: 7
1 +%YAML 1.1
2 +%TAG !u! tag:unity3d.com,2011:
3 +--- !u!1045 &1
4 +EditorBuildSettings:
5 + m_ObjectHideFlags: 0
6 + serializedVersion: 2
7 + m_Scenes: []
8 + m_configObjects: {}
1 +%YAML 1.1
2 +%TAG !u! tag:unity3d.com,2011:
3 +--- !u!159 &1
4 +EditorSettings:
5 + m_ObjectHideFlags: 0
6 + serializedVersion: 9
7 + m_ExternalVersionControlSupport: Visible Meta Files
8 + m_SerializationMode: 2
9 + m_LineEndingsForNewScripts: 0
10 + m_DefaultBehaviorMode: 0
11 + m_PrefabRegularEnvironment: {fileID: 0}
12 + m_PrefabUIEnvironment: {fileID: 0}
13 + m_SpritePackerMode: 0
14 + m_SpritePackerPaddingPower: 1
15 + m_EtcTextureCompressorBehavior: 1
16 + m_EtcTextureFastCompressor: 1
17 + m_EtcTextureNormalCompressor: 2
18 + m_EtcTextureBestCompressor: 4
19 + m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp;asmref
20 + m_ProjectGenerationRootNamespace:
21 + m_CollabEditorSettings:
22 + inProgressEnabled: 1
23 + m_EnableTextureStreamingInEditMode: 1
24 + m_EnableTextureStreamingInPlayMode: 1
25 + m_AsyncShaderCompilation: 1
26 + m_EnterPlayModeOptionsEnabled: 0
27 + m_EnterPlayModeOptions: 3
28 + m_ShowLightmapResolutionOverlay: 1
29 + m_UseLegacyProbeSampleCount: 0
30 + m_AssetPipelineMode: 1
31 + m_CacheServerMode: 0
32 + m_CacheServerEndpoint:
33 + m_CacheServerNamespacePrefix: default
34 + m_CacheServerEnableDownload: 1
35 + m_CacheServerEnableUpload: 1
1 +%YAML 1.1
2 +%TAG !u! tag:unity3d.com,2011:
3 +--- !u!30 &1
4 +GraphicsSettings:
5 + m_ObjectHideFlags: 0
6 + serializedVersion: 13
7 + m_Deferred:
8 + m_Mode: 1
9 + m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0}
10 + m_DeferredReflections:
11 + m_Mode: 1
12 + m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0}
13 + m_ScreenSpaceShadows:
14 + m_Mode: 1
15 + m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0}
16 + m_LegacyDeferred:
17 + m_Mode: 1
18 + m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0}
19 + m_DepthNormals:
20 + m_Mode: 1
21 + m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0}
22 + m_MotionVectors:
23 + m_Mode: 1
24 + m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0}
25 + m_LightHalo:
26 + m_Mode: 1
27 + m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0}
28 + m_LensFlare:
29 + m_Mode: 1
30 + m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0}
31 + m_AlwaysIncludedShaders:
32 + - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0}
33 + - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0}
34 + - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0}
35 + - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0}
36 + - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0}
37 + - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0}
38 + m_PreloadedShaders: []
39 + m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000,
40 + type: 0}
41 + m_CustomRenderPipeline: {fileID: 0}
42 + m_TransparencySortMode: 0
43 + m_TransparencySortAxis: {x: 0, y: 0, z: 1}
44 + m_DefaultRenderingPath: 1
45 + m_DefaultMobileRenderingPath: 1
46 + m_TierSettings: []
47 + m_LightmapStripping: 0
48 + m_FogStripping: 0
49 + m_InstancingStripping: 0
50 + m_LightmapKeepPlain: 1
51 + m_LightmapKeepDirCombined: 1
52 + m_LightmapKeepDynamicPlain: 1
53 + m_LightmapKeepDynamicDirCombined: 1
54 + m_LightmapKeepShadowMask: 1
55 + m_LightmapKeepSubtractive: 1
56 + m_FogKeepLinear: 1
57 + m_FogKeepExp: 1
58 + m_FogKeepExp2: 1
59 + m_AlbedoSwatchInfos: []
60 + m_LightsUseLinearIntensity: 0
61 + m_LightsUseColorTemperature: 0
62 + m_LogWhenShaderIsCompiled: 0
63 + m_AllowEnlightenSupportForUpgradedProject: 0
1 +%YAML 1.1
2 +%TAG !u! tag:unity3d.com,2011:
3 +--- !u!13 &1
4 +InputManager:
5 + m_ObjectHideFlags: 0
6 + serializedVersion: 2
7 + m_Axes:
8 + - serializedVersion: 3
9 + m_Name: Horizontal
10 + descriptiveName:
11 + descriptiveNegativeName:
12 + negativeButton: left
13 + positiveButton: right
14 + altNegativeButton: a
15 + altPositiveButton: d
16 + gravity: 3
17 + dead: 0.001
18 + sensitivity: 3
19 + snap: 1
20 + invert: 0
21 + type: 0
22 + axis: 0
23 + joyNum: 0
24 + - serializedVersion: 3
25 + m_Name: Vertical
26 + descriptiveName:
27 + descriptiveNegativeName:
28 + negativeButton: down
29 + positiveButton: up
30 + altNegativeButton: s
31 + altPositiveButton: w
32 + gravity: 3
33 + dead: 0.001
34 + sensitivity: 3
35 + snap: 1
36 + invert: 0
37 + type: 0
38 + axis: 0
39 + joyNum: 0
40 + - serializedVersion: 3
41 + m_Name: Fire1
42 + descriptiveName:
43 + descriptiveNegativeName:
44 + negativeButton:
45 + positiveButton: left ctrl
46 + altNegativeButton:
47 + altPositiveButton: mouse 0
48 + gravity: 1000
49 + dead: 0.001
50 + sensitivity: 1000
51 + snap: 0
52 + invert: 0
53 + type: 0
54 + axis: 0
55 + joyNum: 0
56 + - serializedVersion: 3
57 + m_Name: Fire2
58 + descriptiveName:
59 + descriptiveNegativeName:
60 + negativeButton:
61 + positiveButton: left alt
62 + altNegativeButton:
63 + altPositiveButton: mouse 1
64 + gravity: 1000
65 + dead: 0.001
66 + sensitivity: 1000
67 + snap: 0
68 + invert: 0
69 + type: 0
70 + axis: 0
71 + joyNum: 0
72 + - serializedVersion: 3
73 + m_Name: Fire3
74 + descriptiveName:
75 + descriptiveNegativeName:
76 + negativeButton:
77 + positiveButton: left shift
78 + altNegativeButton:
79 + altPositiveButton: mouse 2
80 + gravity: 1000
81 + dead: 0.001
82 + sensitivity: 1000
83 + snap: 0
84 + invert: 0
85 + type: 0
86 + axis: 0
87 + joyNum: 0
88 + - serializedVersion: 3
89 + m_Name: Jump
90 + descriptiveName:
91 + descriptiveNegativeName:
92 + negativeButton:
93 + positiveButton: space
94 + altNegativeButton:
95 + altPositiveButton:
96 + gravity: 1000
97 + dead: 0.001
98 + sensitivity: 1000
99 + snap: 0
100 + invert: 0
101 + type: 0
102 + axis: 0
103 + joyNum: 0
104 + - serializedVersion: 3
105 + m_Name: Mouse X
106 + descriptiveName:
107 + descriptiveNegativeName:
108 + negativeButton:
109 + positiveButton:
110 + altNegativeButton:
111 + altPositiveButton:
112 + gravity: 0
113 + dead: 0
114 + sensitivity: 0.1
115 + snap: 0
116 + invert: 0
117 + type: 1
118 + axis: 0
119 + joyNum: 0
120 + - serializedVersion: 3
121 + m_Name: Mouse Y
122 + descriptiveName:
123 + descriptiveNegativeName:
124 + negativeButton:
125 + positiveButton:
126 + altNegativeButton:
127 + altPositiveButton:
128 + gravity: 0
129 + dead: 0
130 + sensitivity: 0.1
131 + snap: 0
132 + invert: 0
133 + type: 1
134 + axis: 1
135 + joyNum: 0
136 + - serializedVersion: 3
137 + m_Name: Mouse ScrollWheel
138 + descriptiveName:
139 + descriptiveNegativeName:
140 + negativeButton:
141 + positiveButton:
142 + altNegativeButton:
143 + altPositiveButton:
144 + gravity: 0
145 + dead: 0
146 + sensitivity: 0.1
147 + snap: 0
148 + invert: 0
149 + type: 1
150 + axis: 2
151 + joyNum: 0
152 + - serializedVersion: 3
153 + m_Name: Horizontal
154 + descriptiveName:
155 + descriptiveNegativeName:
156 + negativeButton:
157 + positiveButton:
158 + altNegativeButton:
159 + altPositiveButton:
160 + gravity: 0
161 + dead: 0.19
162 + sensitivity: 1
163 + snap: 0
164 + invert: 0
165 + type: 2
166 + axis: 0
167 + joyNum: 0
168 + - serializedVersion: 3
169 + m_Name: Vertical
170 + descriptiveName:
171 + descriptiveNegativeName:
172 + negativeButton:
173 + positiveButton:
174 + altNegativeButton:
175 + altPositiveButton:
176 + gravity: 0
177 + dead: 0.19
178 + sensitivity: 1
179 + snap: 0
180 + invert: 1
181 + type: 2
182 + axis: 1
183 + joyNum: 0
184 + - serializedVersion: 3
185 + m_Name: Fire1
186 + descriptiveName:
187 + descriptiveNegativeName:
188 + negativeButton:
189 + positiveButton: joystick button 0
190 + altNegativeButton:
191 + altPositiveButton:
192 + gravity: 1000
193 + dead: 0.001
194 + sensitivity: 1000
195 + snap: 0
196 + invert: 0
197 + type: 0
198 + axis: 0
199 + joyNum: 0
200 + - serializedVersion: 3
201 + m_Name: Fire2
202 + descriptiveName:
203 + descriptiveNegativeName:
204 + negativeButton:
205 + positiveButton: joystick button 1
206 + altNegativeButton:
207 + altPositiveButton:
208 + gravity: 1000
209 + dead: 0.001
210 + sensitivity: 1000
211 + snap: 0
212 + invert: 0
213 + type: 0
214 + axis: 0
215 + joyNum: 0
216 + - serializedVersion: 3
217 + m_Name: Fire3
218 + descriptiveName:
219 + descriptiveNegativeName:
220 + negativeButton:
221 + positiveButton: joystick button 2
222 + altNegativeButton:
223 + altPositiveButton:
224 + gravity: 1000
225 + dead: 0.001
226 + sensitivity: 1000
227 + snap: 0
228 + invert: 0
229 + type: 0
230 + axis: 0
231 + joyNum: 0
232 + - serializedVersion: 3
233 + m_Name: Jump
234 + descriptiveName:
235 + descriptiveNegativeName:
236 + negativeButton:
237 + positiveButton: joystick button 3
238 + altNegativeButton:
239 + altPositiveButton:
240 + gravity: 1000
241 + dead: 0.001
242 + sensitivity: 1000
243 + snap: 0
244 + invert: 0
245 + type: 0
246 + axis: 0
247 + joyNum: 0
248 + - serializedVersion: 3
249 + m_Name: Submit
250 + descriptiveName:
251 + descriptiveNegativeName:
252 + negativeButton:
253 + positiveButton: return
254 + altNegativeButton:
255 + altPositiveButton: joystick button 0
256 + gravity: 1000
257 + dead: 0.001
258 + sensitivity: 1000
259 + snap: 0
260 + invert: 0
261 + type: 0
262 + axis: 0
263 + joyNum: 0
264 + - serializedVersion: 3
265 + m_Name: Submit
266 + descriptiveName:
267 + descriptiveNegativeName:
268 + negativeButton:
269 + positiveButton: enter
270 + altNegativeButton:
271 + altPositiveButton: space
272 + gravity: 1000
273 + dead: 0.001
274 + sensitivity: 1000
275 + snap: 0
276 + invert: 0
277 + type: 0
278 + axis: 0
279 + joyNum: 0
280 + - serializedVersion: 3
281 + m_Name: Cancel
282 + descriptiveName:
283 + descriptiveNegativeName:
284 + negativeButton:
285 + positiveButton: escape
286 + altNegativeButton:
287 + altPositiveButton: joystick button 1
288 + gravity: 1000
289 + dead: 0.001
290 + sensitivity: 1000
291 + snap: 0
292 + invert: 0
293 + type: 0
294 + axis: 0
295 + joyNum: 0
1 +%YAML 1.1
2 +%TAG !u! tag:unity3d.com,2011:
3 +--- !u!126 &1
4 +NavMeshProjectSettings:
5 + m_ObjectHideFlags: 0
6 + serializedVersion: 2
7 + areas:
8 + - name: Walkable
9 + cost: 1
10 + - name: Not Walkable
11 + cost: 1
12 + - name: Jump
13 + cost: 2
14 + - name:
15 + cost: 1
16 + - name:
17 + cost: 1
18 + - name:
19 + cost: 1
20 + - name:
21 + cost: 1
22 + - name:
23 + cost: 1
24 + - name:
25 + cost: 1
26 + - name:
27 + cost: 1
28 + - name:
29 + cost: 1
30 + - name:
31 + cost: 1
32 + - name:
33 + cost: 1
34 + - name:
35 + cost: 1
36 + - name:
37 + cost: 1
38 + - name:
39 + cost: 1
40 + - name:
41 + cost: 1
42 + - name:
43 + cost: 1
44 + - name:
45 + cost: 1
46 + - name:
47 + cost: 1
48 + - name:
49 + cost: 1
50 + - name:
51 + cost: 1
52 + - name:
53 + cost: 1
54 + - name:
55 + cost: 1
56 + - name:
57 + cost: 1
58 + - name:
59 + cost: 1
60 + - name:
61 + cost: 1
62 + - name:
63 + cost: 1
64 + - name:
65 + cost: 1
66 + - name:
67 + cost: 1
68 + - name:
69 + cost: 1
70 + - name:
71 + cost: 1
72 + m_LastAgentTypeID: -887442657
73 + m_Settings:
74 + - serializedVersion: 2
75 + agentTypeID: 0
76 + agentRadius: 0.5
77 + agentHeight: 2
78 + agentSlope: 45
79 + agentClimb: 0.75
80 + ledgeDropHeight: 0
81 + maxJumpAcrossDistance: 0
82 + minRegionArea: 2
83 + manualCellSize: 0
84 + cellSize: 0.16666667
85 + manualTileSize: 0
86 + tileSize: 256
87 + accuratePlacement: 0
88 + debug:
89 + m_Flags: 0
90 + m_SettingNames:
91 + - Humanoid
1 +%YAML 1.1
2 +%TAG !u! tag:unity3d.com,2011:
3 +--- !u!19 &1
4 +Physics2DSettings:
5 + m_ObjectHideFlags: 0
6 + serializedVersion: 4
7 + m_Gravity: {x: 0, y: -9.81}
8 + m_DefaultMaterial: {fileID: 0}
9 + m_VelocityIterations: 8
10 + m_PositionIterations: 3
11 + m_VelocityThreshold: 1
12 + m_MaxLinearCorrection: 0.2
13 + m_MaxAngularCorrection: 8
14 + m_MaxTranslationSpeed: 100
15 + m_MaxRotationSpeed: 360
16 + m_BaumgarteScale: 0.2
17 + m_BaumgarteTimeOfImpactScale: 0.75
18 + m_TimeToSleep: 0.5
19 + m_LinearSleepTolerance: 0.01
20 + m_AngularSleepTolerance: 2
21 + m_DefaultContactOffset: 0.01
22 + m_JobOptions:
23 + serializedVersion: 2
24 + useMultithreading: 0
25 + useConsistencySorting: 0
26 + m_InterpolationPosesPerJob: 100
27 + m_NewContactsPerJob: 30
28 + m_CollideContactsPerJob: 100
29 + m_ClearFlagsPerJob: 200
30 + m_ClearBodyForcesPerJob: 200
31 + m_SyncDiscreteFixturesPerJob: 50
32 + m_SyncContinuousFixturesPerJob: 50
33 + m_FindNearestContactsPerJob: 100
34 + m_UpdateTriggerContactsPerJob: 100
35 + m_IslandSolverCostThreshold: 100
36 + m_IslandSolverBodyCostScale: 1
37 + m_IslandSolverContactCostScale: 10
38 + m_IslandSolverJointCostScale: 10
39 + m_IslandSolverBodiesPerJob: 50
40 + m_IslandSolverContactsPerJob: 50
41 + m_AutoSimulation: 1
42 + m_QueriesHitTriggers: 1
43 + m_QueriesStartInColliders: 1
44 + m_CallbacksOnDisable: 1
45 + m_ReuseCollisionCallbacks: 1
46 + m_AutoSyncTransforms: 0
47 + m_AlwaysShowColliders: 0
48 + m_ShowColliderSleep: 1
49 + m_ShowColliderContacts: 0
50 + m_ShowColliderAABB: 0
51 + m_ContactArrowScale: 0.2
52 + m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412}
53 + m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432}
54 + m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745}
55 + m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804}
56 + m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
1 +%YAML 1.1
2 +%TAG !u! tag:unity3d.com,2011:
3 +--- !u!1386491679 &1
4 +PresetManager:
5 + m_ObjectHideFlags: 0
6 + serializedVersion: 2
7 + m_DefaultPresets: {}
1 +%YAML 1.1
2 +%TAG !u! tag:unity3d.com,2011:
3 +--- !u!129 &1
4 +PlayerSettings:
5 + m_ObjectHideFlags: 0
6 + serializedVersion: 20
7 + productGUID: 639be6b48c1dd9b4b92b0b271a06260a
8 + AndroidProfiler: 0
9 + AndroidFilterTouchesWhenObscured: 0
10 + AndroidEnableSustainedPerformanceMode: 0
11 + defaultScreenOrientation: 4
12 + targetDevice: 2
13 + useOnDemandResources: 0
14 + accelerometerFrequency: 60
15 + companyName: DefaultCompany
16 + productName: capstone
17 + defaultCursor: {fileID: 0}
18 + cursorHotspot: {x: 0, y: 0}
19 + m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1}
20 + m_ShowUnitySplashScreen: 1
21 + m_ShowUnitySplashLogo: 1
22 + m_SplashScreenOverlayOpacity: 1
23 + m_SplashScreenAnimation: 1
24 + m_SplashScreenLogoStyle: 1
25 + m_SplashScreenDrawMode: 0
26 + m_SplashScreenBackgroundAnimationZoom: 1
27 + m_SplashScreenLogoAnimationZoom: 1
28 + m_SplashScreenBackgroundLandscapeAspect: 1
29 + m_SplashScreenBackgroundPortraitAspect: 1
30 + m_SplashScreenBackgroundLandscapeUvs:
31 + serializedVersion: 2
32 + x: 0
33 + y: 0
34 + width: 1
35 + height: 1
36 + m_SplashScreenBackgroundPortraitUvs:
37 + serializedVersion: 2
38 + x: 0
39 + y: 0
40 + width: 1
41 + height: 1
42 + m_SplashScreenLogos: []
43 + m_VirtualRealitySplashScreen: {fileID: 0}
44 + m_HolographicTrackingLossScreen: {fileID: 0}
45 + defaultScreenWidth: 1024
46 + defaultScreenHeight: 768
47 + defaultScreenWidthWeb: 960
48 + defaultScreenHeightWeb: 600
49 + m_StereoRenderingPath: 0
50 + m_ActiveColorSpace: 0
51 + m_MTRendering: 1
52 + m_StackTraceTypes: 010000000100000001000000010000000100000001000000
53 + iosShowActivityIndicatorOnLoading: -1
54 + androidShowActivityIndicatorOnLoading: -1
55 + iosUseCustomAppBackgroundBehavior: 0
56 + iosAllowHTTPDownload: 1
57 + allowedAutorotateToPortrait: 1
58 + allowedAutorotateToPortraitUpsideDown: 1
59 + allowedAutorotateToLandscapeRight: 1
60 + allowedAutorotateToLandscapeLeft: 1
61 + useOSAutorotation: 1
62 + use32BitDisplayBuffer: 1
63 + preserveFramebufferAlpha: 0
64 + disableDepthAndStencilBuffers: 0
65 + androidStartInFullscreen: 1
66 + androidRenderOutsideSafeArea: 1
67 + androidUseSwappy: 0
68 + androidBlitType: 0
69 + defaultIsNativeResolution: 1
70 + macRetinaSupport: 1
71 + runInBackground: 1
72 + captureSingleScreen: 0
73 + muteOtherAudioSources: 0
74 + Prepare IOS For Recording: 0
75 + Force IOS Speakers When Recording: 0
76 + deferSystemGesturesMode: 0
77 + hideHomeButton: 0
78 + submitAnalytics: 1
79 + usePlayerLog: 1
80 + bakeCollisionMeshes: 0
81 + forceSingleInstance: 0
82 + useFlipModelSwapchain: 1
83 + resizableWindow: 0
84 + useMacAppStoreValidation: 0
85 + macAppStoreCategory: public.app-category.games
86 + gpuSkinning: 1
87 + xboxPIXTextureCapture: 0
88 + xboxEnableAvatar: 0
89 + xboxEnableKinect: 0
90 + xboxEnableKinectAutoTracking: 0
91 + xboxEnableFitness: 0
92 + visibleInBackground: 1
93 + allowFullscreenSwitch: 1
94 + fullscreenMode: 1
95 + xboxSpeechDB: 0
96 + xboxEnableHeadOrientation: 0
97 + xboxEnableGuest: 0
98 + xboxEnablePIXSampling: 0
99 + metalFramebufferOnly: 0
100 + xboxOneResolution: 0
101 + xboxOneSResolution: 0
102 + xboxOneXResolution: 3
103 + xboxOneMonoLoggingLevel: 0
104 + xboxOneLoggingLevel: 1
105 + xboxOneDisableEsram: 0
106 + xboxOneEnableTypeOptimization: 0
107 + xboxOnePresentImmediateThreshold: 0
108 + switchQueueCommandMemory: 0
109 + switchQueueControlMemory: 16384
110 + switchQueueComputeMemory: 262144
111 + switchNVNShaderPoolsGranularity: 33554432
112 + switchNVNDefaultPoolsGranularity: 16777216
113 + switchNVNOtherPoolsGranularity: 16777216
114 + vulkanNumSwapchainBuffers: 3
115 + vulkanEnableSetSRGBWrite: 0
116 + m_SupportedAspectRatios:
117 + 4:3: 1
118 + 5:4: 1
119 + 16:10: 1
120 + 16:9: 1
121 + Others: 1
122 + bundleVersion: 0.1
123 + preloadedAssets: []
124 + metroInputSource: 0
125 + wsaTransparentSwapchain: 0
126 + m_HolographicPauseOnTrackingLoss: 1
127 + xboxOneDisableKinectGpuReservation: 1
128 + xboxOneEnable7thCore: 1
129 + vrSettings:
130 + cardboard:
131 + depthFormat: 0
132 + enableTransitionView: 0
133 + daydream:
134 + depthFormat: 0
135 + useSustainedPerformanceMode: 0
136 + enableVideoLayer: 0
137 + useProtectedVideoMemory: 0
138 + minimumSupportedHeadTracking: 0
139 + maximumSupportedHeadTracking: 1
140 + hololens:
141 + depthFormat: 1
142 + depthBufferSharingEnabled: 1
143 + lumin:
144 + depthFormat: 0
145 + frameTiming: 2
146 + enableGLCache: 0
147 + glCacheMaxBlobSize: 524288
148 + glCacheMaxFileSize: 8388608
149 + oculus:
150 + sharedDepthBuffer: 1
151 + dashSupport: 1
152 + lowOverheadMode: 0
153 + protectedContext: 0
154 + v2Signing: 1
155 + enable360StereoCapture: 0
156 + isWsaHolographicRemotingEnabled: 0
157 + enableFrameTimingStats: 0
158 + useHDRDisplay: 0
159 + D3DHDRBitDepth: 0
160 + m_ColorGamuts: 00000000
161 + targetPixelDensity: 30
162 + resolutionScalingMode: 0
163 + androidSupportedAspectRatio: 1
164 + androidMaxAspectRatio: 2.1
165 + applicationIdentifier: {}
166 + buildNumber: {}
167 + AndroidBundleVersionCode: 1
168 + AndroidMinSdkVersion: 19
169 + AndroidTargetSdkVersion: 0
170 + AndroidPreferredInstallLocation: 1
171 + aotOptions:
172 + stripEngineCode: 1
173 + iPhoneStrippingLevel: 0
174 + iPhoneScriptCallOptimization: 0
175 + ForceInternetPermission: 0
176 + ForceSDCardPermission: 0
177 + CreateWallpaper: 0
178 + APKExpansionFiles: 0
179 + keepLoadedShadersAlive: 0
180 + StripUnusedMeshComponents: 1
181 + VertexChannelCompressionMask: 4054
182 + iPhoneSdkVersion: 988
183 + iOSTargetOSVersionString: 10.0
184 + tvOSSdkVersion: 0
185 + tvOSRequireExtendedGameController: 0
186 + tvOSTargetOSVersionString: 10.0
187 + uIPrerenderedIcon: 0
188 + uIRequiresPersistentWiFi: 0
189 + uIRequiresFullScreen: 1
190 + uIStatusBarHidden: 1
191 + uIExitOnSuspend: 0
192 + uIStatusBarStyle: 0
193 + iPhoneSplashScreen: {fileID: 0}
194 + iPhoneHighResSplashScreen: {fileID: 0}
195 + iPhoneTallHighResSplashScreen: {fileID: 0}
196 + iPhone47inSplashScreen: {fileID: 0}
197 + iPhone55inPortraitSplashScreen: {fileID: 0}
198 + iPhone55inLandscapeSplashScreen: {fileID: 0}
199 + iPhone58inPortraitSplashScreen: {fileID: 0}
200 + iPhone58inLandscapeSplashScreen: {fileID: 0}
201 + iPadPortraitSplashScreen: {fileID: 0}
202 + iPadHighResPortraitSplashScreen: {fileID: 0}
203 + iPadLandscapeSplashScreen: {fileID: 0}
204 + iPadHighResLandscapeSplashScreen: {fileID: 0}
205 + iPhone65inPortraitSplashScreen: {fileID: 0}
206 + iPhone65inLandscapeSplashScreen: {fileID: 0}
207 + iPhone61inPortraitSplashScreen: {fileID: 0}
208 + iPhone61inLandscapeSplashScreen: {fileID: 0}
209 + appleTVSplashScreen: {fileID: 0}
210 + appleTVSplashScreen2x: {fileID: 0}
211 + tvOSSmallIconLayers: []
212 + tvOSSmallIconLayers2x: []
213 + tvOSLargeIconLayers: []
214 + tvOSLargeIconLayers2x: []
215 + tvOSTopShelfImageLayers: []
216 + tvOSTopShelfImageLayers2x: []
217 + tvOSTopShelfImageWideLayers: []
218 + tvOSTopShelfImageWideLayers2x: []
219 + iOSLaunchScreenType: 0
220 + iOSLaunchScreenPortrait: {fileID: 0}
221 + iOSLaunchScreenLandscape: {fileID: 0}
222 + iOSLaunchScreenBackgroundColor:
223 + serializedVersion: 2
224 + rgba: 0
225 + iOSLaunchScreenFillPct: 100
226 + iOSLaunchScreenSize: 100
227 + iOSLaunchScreenCustomXibPath:
228 + iOSLaunchScreeniPadType: 0
229 + iOSLaunchScreeniPadImage: {fileID: 0}
230 + iOSLaunchScreeniPadBackgroundColor:
231 + serializedVersion: 2
232 + rgba: 0
233 + iOSLaunchScreeniPadFillPct: 100
234 + iOSLaunchScreeniPadSize: 100
235 + iOSLaunchScreeniPadCustomXibPath:
236 + iOSUseLaunchScreenStoryboard: 0
237 + iOSLaunchScreenCustomStoryboardPath:
238 + iOSDeviceRequirements: []
239 + iOSURLSchemes: []
240 + iOSBackgroundModes: 0
241 + iOSMetalForceHardShadows: 0
242 + metalEditorSupport: 1
243 + metalAPIValidation: 1
244 + iOSRenderExtraFrameOnPause: 0
245 + appleDeveloperTeamID:
246 + iOSManualSigningProvisioningProfileID:
247 + tvOSManualSigningProvisioningProfileID:
248 + iOSManualSigningProvisioningProfileType: 0
249 + tvOSManualSigningProvisioningProfileType: 0
250 + appleEnableAutomaticSigning: 0
251 + iOSRequireARKit: 0
252 + iOSAutomaticallyDetectAndAddCapabilities: 1
253 + appleEnableProMotion: 0
254 + clonedFromGUID: c0afd0d1d80e3634a9dac47e8a0426ea
255 + templatePackageId: com.unity.template.3d@4.2.8
256 + templateDefaultScene: Assets/Scenes/SampleScene.unity
257 + AndroidTargetArchitectures: 1
258 + AndroidSplashScreenScale: 0
259 + androidSplashScreen: {fileID: 0}
260 + AndroidKeystoreName:
261 + AndroidKeyaliasName:
262 + AndroidBuildApkPerCpuArchitecture: 0
263 + AndroidTVCompatibility: 0
264 + AndroidIsGame: 1
265 + AndroidEnableTango: 0
266 + androidEnableBanner: 1
267 + androidUseLowAccuracyLocation: 0
268 + androidUseCustomKeystore: 0
269 + m_AndroidBanners:
270 + - width: 320
271 + height: 180
272 + banner: {fileID: 0}
273 + androidGamepadSupportLevel: 0
274 + AndroidValidateAppBundleSize: 1
275 + AndroidAppBundleSizeToValidate: 150
276 + m_BuildTargetIcons: []
277 + m_BuildTargetPlatformIcons: []
278 + m_BuildTargetBatching:
279 + - m_BuildTarget: Standalone
280 + m_StaticBatching: 1
281 + m_DynamicBatching: 0
282 + - m_BuildTarget: tvOS
283 + m_StaticBatching: 1
284 + m_DynamicBatching: 0
285 + - m_BuildTarget: Android
286 + m_StaticBatching: 1
287 + m_DynamicBatching: 0
288 + - m_BuildTarget: iPhone
289 + m_StaticBatching: 1
290 + m_DynamicBatching: 0
291 + - m_BuildTarget: WebGL
292 + m_StaticBatching: 0
293 + m_DynamicBatching: 0
294 + m_BuildTargetGraphicsJobs:
295 + - m_BuildTarget: MacStandaloneSupport
296 + m_GraphicsJobs: 0
297 + - m_BuildTarget: Switch
298 + m_GraphicsJobs: 1
299 + - m_BuildTarget: MetroSupport
300 + m_GraphicsJobs: 1
301 + - m_BuildTarget: AppleTVSupport
302 + m_GraphicsJobs: 0
303 + - m_BuildTarget: BJMSupport
304 + m_GraphicsJobs: 1
305 + - m_BuildTarget: LinuxStandaloneSupport
306 + m_GraphicsJobs: 1
307 + - m_BuildTarget: PS4Player
308 + m_GraphicsJobs: 1
309 + - m_BuildTarget: iOSSupport
310 + m_GraphicsJobs: 0
311 + - m_BuildTarget: WindowsStandaloneSupport
312 + m_GraphicsJobs: 1
313 + - m_BuildTarget: XboxOnePlayer
314 + m_GraphicsJobs: 1
315 + - m_BuildTarget: LuminSupport
316 + m_GraphicsJobs: 0
317 + - m_BuildTarget: AndroidPlayer
318 + m_GraphicsJobs: 0
319 + - m_BuildTarget: WebGLSupport
320 + m_GraphicsJobs: 0
321 + m_BuildTargetGraphicsJobMode:
322 + - m_BuildTarget: PS4Player
323 + m_GraphicsJobMode: 0
324 + - m_BuildTarget: XboxOnePlayer
325 + m_GraphicsJobMode: 0
326 + m_BuildTargetGraphicsAPIs:
327 + - m_BuildTarget: AndroidPlayer
328 + m_APIs: 150000000b000000
329 + m_Automatic: 0
330 + - m_BuildTarget: iOSSupport
331 + m_APIs: 10000000
332 + m_Automatic: 1
333 + - m_BuildTarget: AppleTVSupport
334 + m_APIs: 10000000
335 + m_Automatic: 0
336 + - m_BuildTarget: WebGLSupport
337 + m_APIs: 0b000000
338 + m_Automatic: 1
339 + m_BuildTargetVRSettings:
340 + - m_BuildTarget: Standalone
341 + m_Enabled: 0
342 + m_Devices:
343 + - Oculus
344 + - OpenVR
345 + openGLRequireES31: 0
346 + openGLRequireES31AEP: 0
347 + openGLRequireES32: 0
348 + m_TemplateCustomTags: {}
349 + mobileMTRendering:
350 + Android: 1
351 + iPhone: 1
352 + tvOS: 1
353 + m_BuildTargetGroupLightmapEncodingQuality: []
354 + m_BuildTargetGroupLightmapSettings: []
355 + playModeTestRunnerEnabled: 0
356 + runPlayModeTestAsEditModeTest: 0
357 + actionOnDotNetUnhandledException: 1
358 + enableInternalProfiler: 0
359 + logObjCUncaughtExceptions: 1
360 + enableCrashReportAPI: 0
361 + cameraUsageDescription:
362 + locationUsageDescription:
363 + microphoneUsageDescription:
364 + switchNetLibKey:
365 + switchSocketMemoryPoolSize: 6144
366 + switchSocketAllocatorPoolSize: 128
367 + switchSocketConcurrencyLimit: 14
368 + switchScreenResolutionBehavior: 2
369 + switchUseCPUProfiler: 0
370 + switchApplicationID: 0x01004b9000490000
371 + switchNSODependencies:
372 + switchTitleNames_0:
373 + switchTitleNames_1:
374 + switchTitleNames_2:
375 + switchTitleNames_3:
376 + switchTitleNames_4:
377 + switchTitleNames_5:
378 + switchTitleNames_6:
379 + switchTitleNames_7:
380 + switchTitleNames_8:
381 + switchTitleNames_9:
382 + switchTitleNames_10:
383 + switchTitleNames_11:
384 + switchTitleNames_12:
385 + switchTitleNames_13:
386 + switchTitleNames_14:
387 + switchPublisherNames_0:
388 + switchPublisherNames_1:
389 + switchPublisherNames_2:
390 + switchPublisherNames_3:
391 + switchPublisherNames_4:
392 + switchPublisherNames_5:
393 + switchPublisherNames_6:
394 + switchPublisherNames_7:
395 + switchPublisherNames_8:
396 + switchPublisherNames_9:
397 + switchPublisherNames_10:
398 + switchPublisherNames_11:
399 + switchPublisherNames_12:
400 + switchPublisherNames_13:
401 + switchPublisherNames_14:
402 + switchIcons_0: {fileID: 0}
403 + switchIcons_1: {fileID: 0}
404 + switchIcons_2: {fileID: 0}
405 + switchIcons_3: {fileID: 0}
406 + switchIcons_4: {fileID: 0}
407 + switchIcons_5: {fileID: 0}
408 + switchIcons_6: {fileID: 0}
409 + switchIcons_7: {fileID: 0}
410 + switchIcons_8: {fileID: 0}
411 + switchIcons_9: {fileID: 0}
412 + switchIcons_10: {fileID: 0}
413 + switchIcons_11: {fileID: 0}
414 + switchIcons_12: {fileID: 0}
415 + switchIcons_13: {fileID: 0}
416 + switchIcons_14: {fileID: 0}
417 + switchSmallIcons_0: {fileID: 0}
418 + switchSmallIcons_1: {fileID: 0}
419 + switchSmallIcons_2: {fileID: 0}
420 + switchSmallIcons_3: {fileID: 0}
421 + switchSmallIcons_4: {fileID: 0}
422 + switchSmallIcons_5: {fileID: 0}
423 + switchSmallIcons_6: {fileID: 0}
424 + switchSmallIcons_7: {fileID: 0}
425 + switchSmallIcons_8: {fileID: 0}
426 + switchSmallIcons_9: {fileID: 0}
427 + switchSmallIcons_10: {fileID: 0}
428 + switchSmallIcons_11: {fileID: 0}
429 + switchSmallIcons_12: {fileID: 0}
430 + switchSmallIcons_13: {fileID: 0}
431 + switchSmallIcons_14: {fileID: 0}
432 + switchManualHTML:
433 + switchAccessibleURLs:
434 + switchLegalInformation:
435 + switchMainThreadStackSize: 1048576
436 + switchPresenceGroupId:
437 + switchLogoHandling: 0
438 + switchReleaseVersion: 0
439 + switchDisplayVersion: 1.0.0
440 + switchStartupUserAccount: 0
441 + switchTouchScreenUsage: 0
442 + switchSupportedLanguagesMask: 0
443 + switchLogoType: 0
444 + switchApplicationErrorCodeCategory:
445 + switchUserAccountSaveDataSize: 0
446 + switchUserAccountSaveDataJournalSize: 0
447 + switchApplicationAttribute: 0
448 + switchCardSpecSize: -1
449 + switchCardSpecClock: -1
450 + switchRatingsMask: 0
451 + switchRatingsInt_0: 0
452 + switchRatingsInt_1: 0
453 + switchRatingsInt_2: 0
454 + switchRatingsInt_3: 0
455 + switchRatingsInt_4: 0
456 + switchRatingsInt_5: 0
457 + switchRatingsInt_6: 0
458 + switchRatingsInt_7: 0
459 + switchRatingsInt_8: 0
460 + switchRatingsInt_9: 0
461 + switchRatingsInt_10: 0
462 + switchRatingsInt_11: 0
463 + switchRatingsInt_12: 0
464 + switchLocalCommunicationIds_0:
465 + switchLocalCommunicationIds_1:
466 + switchLocalCommunicationIds_2:
467 + switchLocalCommunicationIds_3:
468 + switchLocalCommunicationIds_4:
469 + switchLocalCommunicationIds_5:
470 + switchLocalCommunicationIds_6:
471 + switchLocalCommunicationIds_7:
472 + switchParentalControl: 0
473 + switchAllowsScreenshot: 1
474 + switchAllowsVideoCapturing: 1
475 + switchAllowsRuntimeAddOnContentInstall: 0
476 + switchDataLossConfirmation: 0
477 + switchUserAccountLockEnabled: 0
478 + switchSystemResourceMemory: 16777216
479 + switchSupportedNpadStyles: 22
480 + switchNativeFsCacheSize: 32
481 + switchIsHoldTypeHorizontal: 0
482 + switchSupportedNpadCount: 8
483 + switchSocketConfigEnabled: 0
484 + switchTcpInitialSendBufferSize: 32
485 + switchTcpInitialReceiveBufferSize: 64
486 + switchTcpAutoSendBufferSizeMax: 256
487 + switchTcpAutoReceiveBufferSizeMax: 256
488 + switchUdpSendBufferSize: 9
489 + switchUdpReceiveBufferSize: 42
490 + switchSocketBufferEfficiency: 4
491 + switchSocketInitializeEnabled: 1
492 + switchNetworkInterfaceManagerInitializeEnabled: 1
493 + switchPlayerConnectionEnabled: 1
494 + ps4NPAgeRating: 12
495 + ps4NPTitleSecret:
496 + ps4NPTrophyPackPath:
497 + ps4ParentalLevel: 11
498 + ps4ContentID: ED1633-NPXX51362_00-0000000000000000
499 + ps4Category: 0
500 + ps4MasterVersion: 01.00
501 + ps4AppVersion: 01.00
502 + ps4AppType: 0
503 + ps4ParamSfxPath:
504 + ps4VideoOutPixelFormat: 0
505 + ps4VideoOutInitialWidth: 1920
506 + ps4VideoOutBaseModeInitialWidth: 1920
507 + ps4VideoOutReprojectionRate: 60
508 + ps4PronunciationXMLPath:
509 + ps4PronunciationSIGPath:
510 + ps4BackgroundImagePath:
511 + ps4StartupImagePath:
512 + ps4StartupImagesFolder:
513 + ps4IconImagesFolder:
514 + ps4SaveDataImagePath:
515 + ps4SdkOverride:
516 + ps4BGMPath:
517 + ps4ShareFilePath:
518 + ps4ShareOverlayImagePath:
519 + ps4PrivacyGuardImagePath:
520 + ps4NPtitleDatPath:
521 + ps4RemotePlayKeyAssignment: -1
522 + ps4RemotePlayKeyMappingDir:
523 + ps4PlayTogetherPlayerCount: 0
524 + ps4EnterButtonAssignment: 1
525 + ps4ApplicationParam1: 0
526 + ps4ApplicationParam2: 0
527 + ps4ApplicationParam3: 0
528 + ps4ApplicationParam4: 0
529 + ps4DownloadDataSize: 0
530 + ps4GarlicHeapSize: 2048
531 + ps4ProGarlicHeapSize: 2560
532 + playerPrefsMaxSize: 32768
533 + ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ
534 + ps4pnSessions: 1
535 + ps4pnPresence: 1
536 + ps4pnFriends: 1
537 + ps4pnGameCustomData: 1
538 + playerPrefsSupport: 0
539 + enableApplicationExit: 0
540 + resetTempFolder: 1
541 + restrictedAudioUsageRights: 0
542 + ps4UseResolutionFallback: 0
543 + ps4ReprojectionSupport: 0
544 + ps4UseAudio3dBackend: 0
545 + ps4UseLowGarlicFragmentationMode: 1
546 + ps4SocialScreenEnabled: 0
547 + ps4ScriptOptimizationLevel: 0
548 + ps4Audio3dVirtualSpeakerCount: 14
549 + ps4attribCpuUsage: 0
550 + ps4PatchPkgPath:
551 + ps4PatchLatestPkgPath:
552 + ps4PatchChangeinfoPath:
553 + ps4PatchDayOne: 0
554 + ps4attribUserManagement: 0
555 + ps4attribMoveSupport: 0
556 + ps4attrib3DSupport: 0
557 + ps4attribShareSupport: 0
558 + ps4attribExclusiveVR: 0
559 + ps4disableAutoHideSplash: 0
560 + ps4videoRecordingFeaturesUsed: 0
561 + ps4contentSearchFeaturesUsed: 0
562 + ps4attribEyeToEyeDistanceSettingVR: 0
563 + ps4IncludedModules: []
564 + ps4attribVROutputEnabled: 0
565 + monoEnv:
566 + splashScreenBackgroundSourceLandscape: {fileID: 0}
567 + splashScreenBackgroundSourcePortrait: {fileID: 0}
568 + blurSplashScreenBackground: 1
569 + spritePackerPolicy:
570 + webGLMemorySize: 16
571 + webGLExceptionSupport: 1
572 + webGLNameFilesAsHashes: 0
573 + webGLDataCaching: 1
574 + webGLDebugSymbols: 0
575 + webGLEmscriptenArgs:
576 + webGLModulesDirectory:
577 + webGLTemplate: APPLICATION:Default
578 + webGLAnalyzeBuildSize: 0
579 + webGLUseEmbeddedResources: 0
580 + webGLCompressionFormat: 1
581 + webGLLinkerTarget: 1
582 + webGLThreadsSupport: 0
583 + webGLWasmStreaming: 0
584 + scriptingDefineSymbols: {}
585 + platformArchitecture: {}
586 + scriptingBackend: {}
587 + il2cppCompilerConfiguration: {}
588 + managedStrippingLevel: {}
589 + incrementalIl2cppBuild: {}
590 + allowUnsafeCode: 0
591 + additionalIl2CppArgs:
592 + scriptingRuntimeVersion: 1
593 + gcIncremental: 0
594 + gcWBarrierValidation: 0
595 + apiCompatibilityLevelPerPlatform: {}
596 + m_RenderingPath: 1
597 + m_MobileRenderingPath: 1
598 + metroPackageName: Template_3D
599 + metroPackageVersion:
600 + metroCertificatePath:
601 + metroCertificatePassword:
602 + metroCertificateSubject:
603 + metroCertificateIssuer:
604 + metroCertificateNotAfter: 0000000000000000
605 + metroApplicationDescription: Template_3D
606 + wsaImages: {}
607 + metroTileShortName:
608 + metroTileShowName: 0
609 + metroMediumTileShowName: 0
610 + metroLargeTileShowName: 0
611 + metroWideTileShowName: 0
612 + metroSupportStreamingInstall: 0
613 + metroLastRequiredScene: 0
614 + metroDefaultTileSize: 1
615 + metroTileForegroundText: 2
616 + metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0}
617 + metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628,
618 + a: 1}
619 + metroSplashScreenUseBackgroundColor: 0
620 + platformCapabilities: {}
621 + metroTargetDeviceFamilies: {}
622 + metroFTAName:
623 + metroFTAFileTypes: []
624 + metroProtocolName:
625 + XboxOneProductId:
626 + XboxOneUpdateKey:
627 + XboxOneSandboxId:
628 + XboxOneContentId:
629 + XboxOneTitleId:
630 + XboxOneSCId:
631 + XboxOneGameOsOverridePath:
632 + XboxOnePackagingOverridePath:
633 + XboxOneAppManifestOverridePath:
634 + XboxOneVersion: 1.0.0.0
635 + XboxOnePackageEncryption: 0
636 + XboxOnePackageUpdateGranularity: 2
637 + XboxOneDescription:
638 + XboxOneLanguage:
639 + - enus
640 + XboxOneCapability: []
641 + XboxOneGameRating: {}
642 + XboxOneIsContentPackage: 0
643 + XboxOneEnableGPUVariability: 1
644 + XboxOneSockets: {}
645 + XboxOneSplashScreen: {fileID: 0}
646 + XboxOneAllowedProductIds: []
647 + XboxOnePersistentLocalStorageSize: 0
648 + XboxOneXTitleMemory: 8
649 + XboxOneOverrideIdentityName:
650 + XboxOneOverrideIdentityPublisher:
651 + vrEditorSettings:
652 + daydream:
653 + daydreamIconForeground: {fileID: 0}
654 + daydreamIconBackground: {fileID: 0}
655 + cloudServicesEnabled:
656 + UNet: 1
657 + luminIcon:
658 + m_Name:
659 + m_ModelFolderPath:
660 + m_PortalFolderPath:
661 + luminCert:
662 + m_CertPath:
663 + m_SignPackage: 1
664 + luminIsChannelApp: 0
665 + luminVersion:
666 + m_VersionCode: 1
667 + m_VersionName:
668 + apiCompatibilityLevel: 6
669 + cloudProjectId:
670 + framebufferDepthMemorylessMode: 0
671 + projectName:
672 + organizationId:
673 + cloudEnabled: 0
674 + enableNativePlatformBackendsForNewInputSystem: 0
675 + disableOldInputManagerSupport: 0
676 + legacyClampBlendShapeWeights: 0
1 +m_EditorVersion: 2019.3.11f1
2 +m_EditorVersionWithRevision: 2019.3.11f1 (ceef2d848e70)
1 +%YAML 1.1
2 +%TAG !u! tag:unity3d.com,2011:
3 +--- !u!47 &1
4 +QualitySettings:
5 + m_ObjectHideFlags: 0
6 + serializedVersion: 5
7 + m_CurrentQuality: 5
8 + m_QualitySettings:
9 + - serializedVersion: 2
10 + name: Very Low
11 + pixelLightCount: 0
12 + shadows: 0
13 + shadowResolution: 0
14 + shadowProjection: 1
15 + shadowCascades: 1
16 + shadowDistance: 15
17 + shadowNearPlaneOffset: 3
18 + shadowCascade2Split: 0.33333334
19 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
20 + shadowmaskMode: 0
21 + blendWeights: 1
22 + textureQuality: 1
23 + anisotropicTextures: 0
24 + antiAliasing: 0
25 + softParticles: 0
26 + softVegetation: 0
27 + realtimeReflectionProbes: 0
28 + billboardsFaceCameraPosition: 0
29 + vSyncCount: 0
30 + lodBias: 0.3
31 + maximumLODLevel: 0
32 + streamingMipmapsActive: 0
33 + streamingMipmapsAddAllCameras: 1
34 + streamingMipmapsMemoryBudget: 512
35 + streamingMipmapsRenderersPerFrame: 512
36 + streamingMipmapsMaxLevelReduction: 2
37 + streamingMipmapsMaxFileIORequests: 1024
38 + particleRaycastBudget: 4
39 + asyncUploadTimeSlice: 2
40 + asyncUploadBufferSize: 16
41 + asyncUploadPersistentBuffer: 1
42 + resolutionScalingFixedDPIFactor: 1
43 + excludedTargetPlatforms: []
44 + - serializedVersion: 2
45 + name: Low
46 + pixelLightCount: 0
47 + shadows: 0
48 + shadowResolution: 0
49 + shadowProjection: 1
50 + shadowCascades: 1
51 + shadowDistance: 20
52 + shadowNearPlaneOffset: 3
53 + shadowCascade2Split: 0.33333334
54 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
55 + shadowmaskMode: 0
56 + blendWeights: 2
57 + textureQuality: 0
58 + anisotropicTextures: 0
59 + antiAliasing: 0
60 + softParticles: 0
61 + softVegetation: 0
62 + realtimeReflectionProbes: 0
63 + billboardsFaceCameraPosition: 0
64 + vSyncCount: 0
65 + lodBias: 0.4
66 + maximumLODLevel: 0
67 + streamingMipmapsActive: 0
68 + streamingMipmapsAddAllCameras: 1
69 + streamingMipmapsMemoryBudget: 512
70 + streamingMipmapsRenderersPerFrame: 512
71 + streamingMipmapsMaxLevelReduction: 2
72 + streamingMipmapsMaxFileIORequests: 1024
73 + particleRaycastBudget: 16
74 + asyncUploadTimeSlice: 2
75 + asyncUploadBufferSize: 16
76 + asyncUploadPersistentBuffer: 1
77 + resolutionScalingFixedDPIFactor: 1
78 + excludedTargetPlatforms: []
79 + - serializedVersion: 2
80 + name: Medium
81 + pixelLightCount: 1
82 + shadows: 1
83 + shadowResolution: 0
84 + shadowProjection: 1
85 + shadowCascades: 1
86 + shadowDistance: 20
87 + shadowNearPlaneOffset: 3
88 + shadowCascade2Split: 0.33333334
89 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
90 + shadowmaskMode: 0
91 + blendWeights: 2
92 + textureQuality: 0
93 + anisotropicTextures: 1
94 + antiAliasing: 0
95 + softParticles: 0
96 + softVegetation: 0
97 + realtimeReflectionProbes: 0
98 + billboardsFaceCameraPosition: 0
99 + vSyncCount: 1
100 + lodBias: 0.7
101 + maximumLODLevel: 0
102 + streamingMipmapsActive: 0
103 + streamingMipmapsAddAllCameras: 1
104 + streamingMipmapsMemoryBudget: 512
105 + streamingMipmapsRenderersPerFrame: 512
106 + streamingMipmapsMaxLevelReduction: 2
107 + streamingMipmapsMaxFileIORequests: 1024
108 + particleRaycastBudget: 64
109 + asyncUploadTimeSlice: 2
110 + asyncUploadBufferSize: 16
111 + asyncUploadPersistentBuffer: 1
112 + resolutionScalingFixedDPIFactor: 1
113 + excludedTargetPlatforms: []
114 + - serializedVersion: 2
115 + name: High
116 + pixelLightCount: 2
117 + shadows: 2
118 + shadowResolution: 1
119 + shadowProjection: 1
120 + shadowCascades: 2
121 + shadowDistance: 40
122 + shadowNearPlaneOffset: 3
123 + shadowCascade2Split: 0.33333334
124 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
125 + shadowmaskMode: 1
126 + blendWeights: 2
127 + textureQuality: 0
128 + anisotropicTextures: 1
129 + antiAliasing: 0
130 + softParticles: 0
131 + softVegetation: 1
132 + realtimeReflectionProbes: 1
133 + billboardsFaceCameraPosition: 1
134 + vSyncCount: 1
135 + lodBias: 1
136 + maximumLODLevel: 0
137 + streamingMipmapsActive: 0
138 + streamingMipmapsAddAllCameras: 1
139 + streamingMipmapsMemoryBudget: 512
140 + streamingMipmapsRenderersPerFrame: 512
141 + streamingMipmapsMaxLevelReduction: 2
142 + streamingMipmapsMaxFileIORequests: 1024
143 + particleRaycastBudget: 256
144 + asyncUploadTimeSlice: 2
145 + asyncUploadBufferSize: 16
146 + asyncUploadPersistentBuffer: 1
147 + resolutionScalingFixedDPIFactor: 1
148 + excludedTargetPlatforms: []
149 + - serializedVersion: 2
150 + name: Very High
151 + pixelLightCount: 3
152 + shadows: 2
153 + shadowResolution: 2
154 + shadowProjection: 1
155 + shadowCascades: 2
156 + shadowDistance: 70
157 + shadowNearPlaneOffset: 3
158 + shadowCascade2Split: 0.33333334
159 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
160 + shadowmaskMode: 1
161 + blendWeights: 4
162 + textureQuality: 0
163 + anisotropicTextures: 2
164 + antiAliasing: 2
165 + softParticles: 1
166 + softVegetation: 1
167 + realtimeReflectionProbes: 1
168 + billboardsFaceCameraPosition: 1
169 + vSyncCount: 1
170 + lodBias: 1.5
171 + maximumLODLevel: 0
172 + streamingMipmapsActive: 0
173 + streamingMipmapsAddAllCameras: 1
174 + streamingMipmapsMemoryBudget: 512
175 + streamingMipmapsRenderersPerFrame: 512
176 + streamingMipmapsMaxLevelReduction: 2
177 + streamingMipmapsMaxFileIORequests: 1024
178 + particleRaycastBudget: 1024
179 + asyncUploadTimeSlice: 2
180 + asyncUploadBufferSize: 16
181 + asyncUploadPersistentBuffer: 1
182 + resolutionScalingFixedDPIFactor: 1
183 + excludedTargetPlatforms: []
184 + - serializedVersion: 2
185 + name: Ultra
186 + pixelLightCount: 4
187 + shadows: 2
188 + shadowResolution: 2
189 + shadowProjection: 1
190 + shadowCascades: 4
191 + shadowDistance: 150
192 + shadowNearPlaneOffset: 3
193 + shadowCascade2Split: 0.33333334
194 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
195 + shadowmaskMode: 1
196 + blendWeights: 4
197 + textureQuality: 0
198 + anisotropicTextures: 2
199 + antiAliasing: 2
200 + softParticles: 1
201 + softVegetation: 1
202 + realtimeReflectionProbes: 1
203 + billboardsFaceCameraPosition: 1
204 + vSyncCount: 1
205 + lodBias: 2
206 + maximumLODLevel: 0
207 + streamingMipmapsActive: 0
208 + streamingMipmapsAddAllCameras: 1
209 + streamingMipmapsMemoryBudget: 512
210 + streamingMipmapsRenderersPerFrame: 512
211 + streamingMipmapsMaxLevelReduction: 2
212 + streamingMipmapsMaxFileIORequests: 1024
213 + particleRaycastBudget: 4096
214 + asyncUploadTimeSlice: 2
215 + asyncUploadBufferSize: 16
216 + asyncUploadPersistentBuffer: 1
217 + resolutionScalingFixedDPIFactor: 1
218 + excludedTargetPlatforms: []
219 + m_PerPlatformDefaultQuality:
220 + Android: 2
221 + Lumin: 5
222 + Nintendo 3DS: 5
223 + Nintendo Switch: 5
224 + PS4: 5
225 + PSP2: 2
226 + Stadia: 5
227 + Standalone: 5
228 + WebGL: 3
229 + Windows Store Apps: 5
230 + XboxOne: 5
231 + iPhone: 2
232 + tvOS: 2
1 +%YAML 1.1
2 +%TAG !u! tag:unity3d.com,2011:
3 +--- !u!78 &1
4 +TagManager:
5 + serializedVersion: 2
6 + tags: []
7 + layers:
8 + - Default
9 + - TransparentFX
10 + - Ignore Raycast
11 + -
12 + - Water
13 + - UI
14 + -
15 + -
16 + -
17 + -
18 + -
19 + -
20 + -
21 + -
22 + -
23 + -
24 + -
25 + -
26 + -
27 + -
28 + -
29 + -
30 + -
31 + -
32 + -
33 + -
34 + -
35 + -
36 + -
37 + -
38 + -
39 + -
40 + m_SortingLayers:
41 + - name: Default
42 + uniqueID: 0
43 + locked: 0
1 +%YAML 1.1
2 +%TAG !u! tag:unity3d.com,2011:
3 +--- !u!5 &1
4 +TimeManager:
5 + m_ObjectHideFlags: 0
6 + Fixed Timestep: 0.02
7 + Maximum Allowed Timestep: 0.33333334
8 + m_TimeScale: 1
9 + Maximum Particle Timestep: 0.03
1 +%YAML 1.1
2 +%TAG !u! tag:unity3d.com,2011:
3 +--- !u!310 &1
4 +UnityConnectSettings:
5 + m_ObjectHideFlags: 0
6 + serializedVersion: 1
7 + m_Enabled: 0
8 + m_TestMode: 0
9 + m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events
10 + m_EventUrl: https://cdp.cloud.unity3d.com/v1/events
11 + m_ConfigUrl: https://config.uca.cloud.unity3d.com
12 + m_TestInitMode: 0
13 + CrashReportingSettings:
14 + m_EventUrl: https://perf-events.cloud.unity3d.com
15 + m_Enabled: 0
16 + m_LogBufferSize: 10
17 + m_CaptureEditorExceptions: 1
18 + UnityPurchasingSettings:
19 + m_Enabled: 0
20 + m_TestMode: 0
21 + UnityAnalyticsSettings:
22 + m_Enabled: 0
23 + m_TestMode: 0
24 + m_InitializeOnStartup: 1
25 + UnityAdsSettings:
26 + m_Enabled: 0
27 + m_InitializeOnStartup: 1
28 + m_TestMode: 0
29 + m_IosGameId:
30 + m_AndroidGameId:
31 + m_GameIds: {}
32 + m_GameId:
33 + PerformanceReportingSettings:
34 + m_Enabled: 0
1 +%YAML 1.1
2 +%TAG !u! tag:unity3d.com,2011:
3 +--- !u!937362698 &1
4 +VFXManager:
5 + m_ObjectHideFlags: 0
6 + m_IndirectShader: {fileID: 0}
7 + m_CopyBufferShader: {fileID: 0}
8 + m_SortShader: {fileID: 0}
9 + m_StripUpdateShader: {fileID: 0}
10 + m_RenderPipeSettingsPath:
11 + m_FixedTimeStep: 0.016666668
12 + m_MaxDeltaTime: 0.05
1 +{
2 + "m_SettingKeys": [
3 + "VR Device Disabled",
4 + "VR Device User Alert"
5 + ],
6 + "m_SettingValues": [
7 + "False",
8 + "False"
9 + ]
10 +}
...\ No newline at end of file ...\ No newline at end of file