Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
ButtonPusher
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Button Pusher
ButtonPusher
Commits
a55d35a9
Commit
a55d35a9
authored
Feb 04, 2018
by
16이상민
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Separate files by module, class, interface, and enum
parent
ab583dbc
Changes
33
Hide whitespace changes
Inline
Side-by-side
Showing
33 changed files
with
954 additions
and
688 deletions
+954
-688
NewFolder1.meta
Assets/NewFolder1.meta
+10
-0
EndGame.cs
Assets/Script/EndGame.cs
+5
-12
InputManager.cs
Assets/Script/InputManager.cs
+54
-297
JudgeManager.cs
Assets/Script/JudgeManager.cs
+2
-2
KinectModule.meta
Assets/Script/KinectModule.meta
+10
-0
IBody.cs.meta
Assets/Script/KinectModule/IBody.cs.meta
+13
-0
IBodyFrame.cs.meta
Assets/Script/KinectModule/IBodyFrame.cs.meta
+13
-0
IBodyIndexFrame.cs.meta
Assets/Script/KinectModule/IBodyIndexFrame.cs.meta
+13
-0
IColorFrame.cs.meta
Assets/Script/KinectModule/IColorFrame.cs.meta
+13
-0
IDepthFrame.cs.meta
Assets/Script/KinectModule/IDepthFrame.cs.meta
+13
-0
IJoint.cs.meta
Assets/Script/KinectModule/IJoint.cs.meta
+13
-0
IMultiSourceFrame.cs.meta
Assets/Script/KinectModule/IMultiSourceFrame.cs.meta
+13
-0
KinectAccessManager.cs.meta
Assets/Script/KinectModule/KinectAccessManager.cs.meta
+13
-0
KinectConstants.cs.meta
Assets/Script/KinectModule/KinectConstants.cs.meta
+13
-0
RealBody.cs.meta
Assets/Script/KinectModule/RealBody.cs.meta
+13
-0
RealBodyFrame.cs.meta
Assets/Script/KinectModule/RealBodyFrame.cs.meta
+13
-0
RealBodyIndexFrame.cs.meta
Assets/Script/KinectModule/RealBodyIndexFrame.cs.meta
+13
-0
RealColorFrame.cs.meta
Assets/Script/KinectModule/RealColorFrame.cs.meta
+13
-0
RealDepthFrame.cs.meta
Assets/Script/KinectModule/RealDepthFrame.cs.meta
+13
-0
RealJoint.cs.meta
Assets/Script/KinectModule/RealJoint.cs.meta
+13
-0
RealMultiSourceFrame.cs.meta
Assets/Script/KinectModule/RealMultiSourceFrame.cs.meta
+13
-0
SourceBuffer.cs.meta
Assets/Script/KinectModule/SourceBuffer.cs.meta
+13
-0
DistItvExtractor.cs
Assets/Script/MotionAnalysis/DistItvExtractor.cs
+180
-0
MotionDiscriminator.cs
Assets/Script/MotionAnalysis/MotionDiscriminator.cs
+181
-0
MotionState.cs
Assets/Script/MotionAnalysis/MotionState.cs
+29
-0
MotionSampleDisplay.cs
Assets/Script/MotionSampleDisplay.cs
+41
-23
MotionView.cs
Assets/Script/MotionView.cs
+32
-323
ScoreDisplayManager.cs
Assets/Script/ScoreDisplayManager.cs
+15
-21
ButtonStatusGetter.cs
Assets/Script/StatusConvert/ButtonStatusGetter.cs
+16
-0
InputStatus.cs
Assets/Script/StatusConvert/InputStatus.cs
+10
-0
MotionStatus.cs
Assets/Script/StatusConvert/MotionStatus.cs
+12
-0
MotionStatusExtractor.cs
Assets/Script/StatusConvert/MotionStatusExtractor.cs
+132
-0
TitleManager.cs
Assets/Script/TitleManager.cs
+4
-10
No files found.
Assets/NewFolder1.meta
0 → 100644
View file @
a55d35a9
fileFormatVersion: 2
guid: 8e735ca2f8a25aa49a7719128cd95047
folderAsset: yes
timeCreated: 1517593123
licenseType: Free
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Assets/Script/EndGame.cs
View file @
a55d35a9
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
using
UnityEngine
;
public
class
EndGame
:
MonoBehaviour
{
// Use this for initialization
void
Start
()
{
}
// Update is called once per frame
void
Update
()
{
public
class
EndGame
:
MonoBehaviour
{
void
Update
()
{
if
(
Input
.
GetKeyDown
(
KeyCode
.
P
))
{
Destroy
(
this
);
...
...
Assets/Script/InputManager.cs
View file @
a55d35a9
using
System
;
using
MotionAnalysis
;
using
StatusConvert
;
using
System.Linq
;
using
UnityEngine
;
public
class
InputManager
:
MonoBehaviour
{
private
bool
IsButtonDownPrev
{
get
;
set
;
}
private
bool
IsButtonDown
{
get
{
return
Input
.
GetKey
(
KeyCode
.
Space
)
||
Input
.
GetKey
(
KeyCode
.
Joystick1Button0
);
}
}
private
bool
IsButtonDown
{
get
;
set
;
}
private
MotionState
PrevMotionState
{
get
;
set
;
}
public
MotionState
CurrentMotionState
{
get
;
set
;
}
public
MotionState
CurrentMotionState
{
private
get
;
set
;
}
public
InputStatus
ShortButtonStat
{
...
...
@@ -42,19 +43,24 @@ public class InputManager : MonoBehaviour
{
get
{
if
(
ShortMotionToInput
(
"Clap"
)
==
InputStatus
.
Entered
||
ShortMotionToInput
(
"Jump"
)
==
InputStatus
.
Entered
||
ShortMotionToInput
(
"PushUpLeft"
)
==
InputStatus
.
Entered
||
ShortMotionToInput
(
"PushUpRight"
)
==
InputStatus
.
Entered
||
ShortMotionToInput
(
"PushUpBoth"
)
==
InputStatus
.
Entered
||
ShortMotionToInput
(
"JumpPushUpLeft"
)
==
InputStatus
.
Entered
||
ShortMotionToInput
(
"JumpPushUpRight"
)
==
InputStatus
.
Entered
||
ShortMotionToInput
(
"JumpPushUpBoth"
)
==
InputStatus
.
Entered
||
ShortMotionToInput
(
"GuardLeft"
)
==
InputStatus
.
Entered
||
ShortMotionToInput
(
"GuardRight"
)
==
InputStatus
.
Entered
||
ShortMotionToInput
(
"GuardBoth"
)
==
InputStatus
.
Entered
)
return
InputStatus
.
Entered
;
return
InputStatus
.
None
;
if
((
new
string
[]
{
"Clap"
,
"Jump"
,
"PushUpLeft"
,
"PushUpRight"
,
"PushUpBoth"
,
"JumpPushUpLeft"
,
"JumpPushUpRight"
,
"JumpPushUpBoth"
,
"GuardLeft"
,
"GuardRight"
,
"GuardBoth"
}).
Select
(
x
=>
MotionToInput
(
x
,
"short"
))
.
Where
(
x
=>
x
==
InputStatus
.
Entered
)
.
Count
()
==
0
)
return
InputStatus
.
None
;
return
InputStatus
.
Entered
;
}
}
...
...
@@ -62,30 +68,25 @@ public class InputManager : MonoBehaviour
{
get
{
if
(
LongMotionToInput
(
"HandUpLeft"
)
==
InputStatus
.
Entered
||
LongMotionToInput
(
"HandUpLeft"
)
==
InputStatus
.
Continuing
||
LongMotionToInput
(
"HandUpRight"
)
==
InputStatus
.
Entered
||
LongMotionToInput
(
"HandUpRight"
)
==
InputStatus
.
Continuing
||
LongMotionToInput
(
"HandUpBoth"
)
==
InputStatus
.
Entered
||
LongMotionToInput
(
"HandUpBoth"
)
==
InputStatus
.
Continuing
||
LongMotionToInput
(
"HandDownLeft"
)
==
InputStatus
.
Entered
||
LongMotionToInput
(
"HandDownLeft"
)
==
InputStatus
.
Continuing
||
LongMotionToInput
(
"HandDownRight"
)
==
InputStatus
.
Entered
||
LongMotionToInput
(
"HandDownRight"
)
==
InputStatus
.
Continuing
||
LongMotionToInput
(
"HandDownBoth"
)
==
InputStatus
.
Entered
||
LongMotionToInput
(
"HandDownBoth"
)
==
InputStatus
.
Continuing
||
LongMotionToInput
(
"Jesus"
)
==
InputStatus
.
Entered
||
LongMotionToInput
(
"Jesus"
)
==
InputStatus
.
Continuing
||
LongMotionToInput
(
"HeadphoneLeft"
)
==
InputStatus
.
Entered
||
LongMotionToInput
(
"HeadphoneLeft"
)
==
InputStatus
.
Continuing
||
LongMotionToInput
(
"HeadphoneRight"
)
==
InputStatus
.
Entered
||
LongMotionToInput
(
"HeadphoneRight"
)
==
InputStatus
.
Continuing
||
LongMotionToInput
(
"HeadphoneBoth"
)
==
InputStatus
.
Entered
||
LongMotionToInput
(
"HeadphoneBoth"
)
==
InputStatus
.
Continuing
||
LongMotionToInput
(
"OnTheTable"
)
==
InputStatus
.
Entered
||
LongMotionToInput
(
"OnTheTable"
)
==
InputStatus
.
Continuing
)
return
InputStatus
.
Entered
;
return
InputStatus
.
None
;
if
((
new
string
[]
{
"HandUpLeft"
,
"HandUpRight"
,
"HandUpBoth"
,
"HandDownLeft"
,
"HandDownRight"
,
"HandDownBoth"
,
"Jesus"
,
"HeadphoneLeft"
,
"HeadphoneRight"
,
"HeadphoneBoth"
,
"OnTheTable"
}).
Select
(
x
=>
MotionToInput
(
x
,
"long"
))
.
Where
(
x
=>
x
==
InputStatus
.
Entered
||
x
==
InputStatus
.
Continuing
)
.
Count
()
==
0
)
return
InputStatus
.
None
;
return
InputStatus
.
Entered
;
}
}
...
...
@@ -93,27 +94,30 @@ public class InputManager : MonoBehaviour
{
IsButtonDownPrev
=
IsButtonDown
;
PrevMotionState
=
CurrentMotionState
;
IsButtonDown
=
ButtonStatusGetter
.
IsButtonDown
;
}
public
InputStatus
LongMotionToInput
(
string
nam
e
)
public
InputStatus
MotionToInput
(
string
name
,
string
typ
e
)
{
if
(
name
.
Contains
(
"Both"
))
{
var
tmpname
=
name
.
Substring
(
0
,
name
.
IndexOf
(
"Both"
));
var
left
=
LongMotionToInput
(
tmpname
+
"Left"
);
var
right
=
LongMotionToInput
(
tmpname
+
"Right"
);
var
left
=
MotionToInput
(
tmpname
+
"Left"
,
type
);
var
right
=
MotionToInput
(
tmpname
+
"Right"
,
type
);
return
left
==
right
?
left
:
InputStatus
.
None
;
}
Func
<
MotionState
,
MotionStatus
>
extractor
=
MotionStatusExtractor
.
GetExtractor
(
name
);
if
(
extractor
==
null
)
return
InputStatus
.
None
;
MotionStatus
prev
=
MotionStatusExtractor
.
Extract
(
name
,
PrevMotionState
),
curr
=
MotionStatusExtractor
.
Extract
(
name
,
CurrentMotionState
);
MotionStatus
prev
=
extractor
(
PrevMotionState
),
curr
=
extractor
(
CurrentMotionState
);
return
type
.
Equals
(
"long"
)
?
LongMotionStatus
(
prev
,
curr
)
:
ShortMotionStatus
(
prev
,
curr
);
}
private
InputStatus
LongMotionStatus
(
MotionStatus
prev
,
MotionStatus
curr
)
{
if
(
prev
==
MotionStatus
.
None
&&
(
curr
&
MotionStatus
.
Prepared
)
!=
MotionStatus
.
None
)
return
InputStatus
.
Entered
;
...
...
@@ -127,259 +131,12 @@ public class InputManager : MonoBehaviour
return
InputStatus
.
None
;
}
p
ublic
InputStatus
ShortMotionToInput
(
string
name
)
p
rivate
InputStatus
ShortMotionStatus
(
MotionStatus
prev
,
MotionStatus
curr
)
{
if
(
name
.
Contains
(
"Both"
))
{
var
tmpname
=
name
.
Substring
(
0
,
name
.
IndexOf
(
"Both"
));
var
left
=
ShortMotionToInput
(
tmpname
+
"Left"
);
var
right
=
ShortMotionToInput
(
tmpname
+
"Right"
);
return
left
==
right
?
left
:
InputStatus
.
None
;
}
Func
<
MotionState
,
MotionStatus
>
extractor
=
MotionStatusExtractor
.
GetExtractor
(
name
);
if
(
extractor
==
null
)
return
InputStatus
.
None
;
MotionStatus
prev
=
extractor
(
PrevMotionState
),
curr
=
extractor
(
CurrentMotionState
);
if
(
prev
==
MotionStatus
.
Prepared
&&
curr
==
MotionStatus
.
Done
)
return
InputStatus
.
Entered
;
return
InputStatus
.
None
;
}
private
static
class
MotionStatusExtractor
{
private
static
bool
IsContain
(
MotionState
target
,
MotionState
motion
)
{
return
(
target
&
motion
)
==
motion
;
}
// SHORT NOTES
private
static
MotionStatus
ExtractClap
(
MotionState
state
)
{
if
(
IsContain
(
state
,
MotionState
.
CLAP_PREPARE
))
return
MotionStatus
.
Prepared
;
if
(
IsContain
(
state
,
MotionState
.
CLAP_DONE
))
return
MotionStatus
.
Done
;
return
MotionStatus
.
None
;
}
private
static
MotionStatus
ExtractJump
(
MotionState
state
)
{
if
(
IsContain
(
state
,
MotionState
.
JUMP_PREPARE
))
return
MotionStatus
.
Prepared
;
if
(
IsContain
(
state
,
MotionState
.
JUMP_DONE
))
return
MotionStatus
.
Done
;
return
MotionStatus
.
None
;
}
private
static
MotionStatus
ExtractPushUpLeft
(
MotionState
state
)
{
if
(
IsContain
(
state
,
MotionState
.
HURRAY
)
&&
IsContain
(
state
,
MotionState
.
HAND_MOVE_UP_LEFT
))
return
MotionStatus
.
Prepared
;
if
(
IsContain
(
state
,
MotionState
.
HURRAY
)
&&
IsContain
(
state
,
MotionState
.
HAND_MOVE_DOWN_LEFT
))
return
MotionStatus
.
Done
;
return
MotionStatus
.
None
;
}
private
static
MotionStatus
ExtractPushUpRight
(
MotionState
state
)
{
if
(
IsContain
(
state
,
MotionState
.
HURRAY
)
&&
IsContain
(
state
,
MotionState
.
HAND_MOVE_UP_RIGHT
))
return
MotionStatus
.
Prepared
;
if
(
IsContain
(
state
,
MotionState
.
HURRAY
)
&&
IsContain
(
state
,
MotionState
.
HAND_MOVE_DOWN_RIGHT
))
return
MotionStatus
.
Done
;
return
MotionStatus
.
None
;
}
private
static
MotionStatus
ExtractJumpPushUpLeft
(
MotionState
state
)
{
if
(
ExtractJump
(
state
)
==
MotionStatus
.
Prepared
&&
ExtractPushUpLeft
(
state
)
==
MotionStatus
.
Prepared
)
return
MotionStatus
.
Prepared
;
if
(
ExtractJump
(
state
)
==
MotionStatus
.
Done
&&
ExtractPushUpLeft
(
state
)
==
MotionStatus
.
Done
)
return
MotionStatus
.
Done
;
return
MotionStatus
.
None
;
}
private
static
MotionStatus
ExtractJumpPushUpRight
(
MotionState
state
)
{
if
(
ExtractJump
(
state
)
==
MotionStatus
.
Prepared
&&
ExtractPushUpRight
(
state
)
==
MotionStatus
.
Prepared
)
return
MotionStatus
.
Prepared
;
if
(
ExtractJump
(
state
)
==
MotionStatus
.
Done
&&
ExtractPushUpRight
(
state
)
==
MotionStatus
.
Done
)
return
MotionStatus
.
Done
;
return
MotionStatus
.
None
;
}
private
static
MotionStatus
ExtractGuardLeft
(
MotionState
state
)
{
if
(
IsContain
(
state
,
MotionState
.
GUARD_BASE_LEFT
)
&&
IsContain
(
state
,
MotionState
.
HAND_MOVE_UP_LEFT
))
return
MotionStatus
.
Prepared
;
if
(
IsContain
(
state
,
MotionState
.
GUARD_BASE_LEFT
)
&&
IsContain
(
state
,
MotionState
.
HAND_MOVE_DOWN_LEFT
))
return
MotionStatus
.
Done
;
return
MotionStatus
.
None
;
}
private
static
MotionStatus
ExtractGuardRight
(
MotionState
state
)
{
if
(
IsContain
(
state
,
MotionState
.
GUARD_BASE_RIGHT
)
&&
IsContain
(
state
,
MotionState
.
HAND_MOVE_UP_RIGHT
))
return
MotionStatus
.
Prepared
;
if
(
IsContain
(
state
,
MotionState
.
GUARD_BASE_RIGHT
)
&&
IsContain
(
state
,
MotionState
.
HAND_MOVE_DOWN_RIGHT
))
return
MotionStatus
.
Done
;
return
MotionStatus
.
None
;
}
// LONG NOTES
private
static
MotionStatus
ExtractHandUpLeft
(
MotionState
state
)
{
if
(
IsContain
(
state
,
MotionState
.
HAND_UP_LEFT
))
return
MotionStatus
.
Prepared
|
MotionStatus
.
Done
;
return
MotionStatus
.
None
;
}
private
static
MotionStatus
ExtractHandUpRight
(
MotionState
state
)
{
if
(
IsContain
(
state
,
MotionState
.
HAND_UP_RIGHT
))
return
MotionStatus
.
Prepared
|
MotionStatus
.
Done
;
return
MotionStatus
.
None
;
}
private
static
MotionStatus
ExtractHandDownLeft
(
MotionState
state
)
{
if
(
IsContain
(
state
,
MotionState
.
HAND_DOWN_LEFT
))
return
MotionStatus
.
Prepared
|
MotionStatus
.
Done
;
return
MotionStatus
.
None
;
}
private
static
MotionStatus
ExtractHandDownRight
(
MotionState
state
)
{
if
(
IsContain
(
state
,
MotionState
.
HAND_DOWN_RIGHT
))
return
MotionStatus
.
Prepared
|
MotionStatus
.
Done
;
return
MotionStatus
.
None
;
}
private
static
MotionStatus
ExtractJesus
(
MotionState
state
)
{
if
(
IsContain
(
state
,
MotionState
.
JESUS
))
return
MotionStatus
.
Prepared
|
MotionStatus
.
Done
;
return
MotionStatus
.
None
;
}
private
static
MotionStatus
ExtractHeadphoneLeft
(
MotionState
state
)
{
if
(
IsContain
(
state
,
MotionState
.
HEADPHONE_LEFT
))
return
MotionStatus
.
Prepared
|
MotionStatus
.
Done
;
return
MotionStatus
.
None
;
}
private
static
MotionStatus
ExtractHeadphoneRight
(
MotionState
state
)
{
if
(
IsContain
(
state
,
MotionState
.
HEADPHONE_RIGHT
))
return
MotionStatus
.
Prepared
|
MotionStatus
.
Done
;
return
MotionStatus
.
None
;
}
private
static
MotionStatus
ExtractOnTheTable
(
MotionState
state
)
{
if
(
IsContain
(
state
,
MotionState
.
ON_THE_TABLE
))
return
MotionStatus
.
Prepared
|
MotionStatus
.
Done
;
return
MotionStatus
.
None
;
}
public
static
Func
<
MotionState
,
MotionStatus
>
GetExtractor
(
string
name
)
{
if
(
name
.
Equals
(
"Clap"
))
return
ExtractClap
;
if
(
name
.
Equals
(
"Jump"
))
return
ExtractJump
;
if
(
name
.
Equals
(
"PushUpLeft"
))
return
ExtractPushUpLeft
;
if
(
name
.
Equals
(
"PushUpRight"
))
return
ExtractPushUpRight
;
if
(
name
.
Equals
(
"JumpPushUpLeft"
))
return
ExtractJumpPushUpLeft
;
if
(
name
.
Equals
(
"JumpPushUpRight"
))
return
ExtractJumpPushUpRight
;
if
(
name
.
Equals
(
"GuardLeft"
))
return
ExtractGuardLeft
;
if
(
name
.
Equals
(
"GuardRight"
))
return
ExtractGuardRight
;
if
(
name
.
Equals
(
"HandUpLeft"
))
return
ExtractHandUpLeft
;
if
(
name
.
Equals
(
"HandUpRight"
))
return
ExtractHandUpRight
;
if
(
name
.
Equals
(
"HandDownLeft"
))
return
ExtractHandDownLeft
;
if
(
name
.
Equals
(
"HandDownRight"
))
return
ExtractHandDownRight
;
if
(
name
.
Equals
(
"Jesus"
))
return
ExtractJesus
;
if
(
name
.
Equals
(
"HeadphoneLeft"
))
return
ExtractHeadphoneLeft
;
if
(
name
.
Equals
(
"HeadphoneRight"
))
return
ExtractHeadphoneRight
;
if
(
name
.
Equals
(
"OnTheTable"
))
return
ExtractOnTheTable
;
return
null
;
}
}
}
public
enum
ButtonStatus
{
Pressed
,
Released
,
Holding
}
[
Flags
]
public
enum
MotionStatus
:
uint
{
Prepared
=
0x1
,
Done
=
0x2
,
None
=
0x0
}
public
enum
InputStatus
{
Entered
,
Continuing
,
Stopped
,
None
}
internal
interface
IButtonDownGetter
{
bool
IsButtonDown
{
get
;
}
}
internal
class
ButtonDownGetter
{
}
Assets/Script/JudgeManager.cs
View file @
a55d35a9
...
...
@@ -304,8 +304,8 @@ public class JudgeManager : MonoBehaviour
if
(
note
is
MotionNote
)
return
new
Dictionary
<
string
,
InputStatus
>
{
{
"short"
,
manager
.
ShortMotionToInput
((
note
as
MotionNote
).
MotionName
)
},
{
"long"
,
manager
.
LongMotionToInput
((
note
as
MotionNote
).
MotionName
)
}
{
"short"
,
manager
.
MotionToInput
((
note
as
MotionNote
).
MotionName
,
"short"
)
},
{
"long"
,
manager
.
MotionToInput
((
note
as
MotionNote
).
MotionName
,
"long"
)
}
};
return
new
Dictionary
<
string
,
InputStatus
>
{
...
...
Assets/Script/KinectModule.meta
0 → 100644
View file @
a55d35a9
fileFormatVersion: 2
guid: d5629aaa548340d48a6877356736e5a6
folderAsset: yes
timeCreated: 1517593124
licenseType: Free
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Assets/Script/KinectModule/IBody.cs.meta
0 → 100644
View file @
a55d35a9
fileFormatVersion: 2
guid: 59d43b88d0fb21f4da54ec629bb98793
timeCreated: 1517593124
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Assets/Script/KinectModule/IBodyFrame.cs.meta
0 → 100644
View file @
a55d35a9
fileFormatVersion: 2
guid: 3c626913a08bfb54989ed1f1ace8f2b1
timeCreated: 1517593124
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Assets/Script/KinectModule/IBodyIndexFrame.cs.meta
0 → 100644
View file @
a55d35a9
fileFormatVersion: 2
guid: 1475ca97298ef8040a26ff123c838cf4
timeCreated: 1517593124
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Assets/Script/KinectModule/IColorFrame.cs.meta
0 → 100644
View file @
a55d35a9
fileFormatVersion: 2
guid: 20b1c91ce7e841a4aa5435c018b37331
timeCreated: 1517593124
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Assets/Script/KinectModule/IDepthFrame.cs.meta
0 → 100644
View file @
a55d35a9
fileFormatVersion: 2
guid: b992cf88f91b6534d8ebab686c8108a8
timeCreated: 1517593124
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Assets/Script/KinectModule/IJoint.cs.meta
0 → 100644
View file @
a55d35a9
fileFormatVersion: 2
guid: 76ee3dfb85d1e0340adda58794495c67
timeCreated: 1517593124
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Assets/Script/KinectModule/IMultiSourceFrame.cs.meta
0 → 100644
View file @
a55d35a9
fileFormatVersion: 2
guid: c599a29004a22814186c943d2b205ee2
timeCreated: 1517593124
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Assets/Script/KinectModule/KinectAccessManager.cs.meta
0 → 100644
View file @
a55d35a9
fileFormatVersion: 2
guid: 93822df6478d4524e9bff554afb85feb
timeCreated: 1517593124
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Assets/Script/KinectModule/KinectConstants.cs.meta
0 → 100644
View file @
a55d35a9
fileFormatVersion: 2
guid: 1b3586758ca78db40b58283201d51651
timeCreated: 1517593124
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Assets/Script/KinectModule/RealBody.cs.meta
0 → 100644
View file @
a55d35a9
fileFormatVersion: 2
guid: d963083924fd19d48a6d292467d762d1
timeCreated: 1517593125
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Assets/Script/KinectModule/RealBodyFrame.cs.meta
0 → 100644
View file @
a55d35a9
fileFormatVersion: 2
guid: 4b915aa7c39181c4fa6babcc04aa6762
timeCreated: 1517593124
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Assets/Script/KinectModule/RealBodyIndexFrame.cs.meta
0 → 100644
View file @
a55d35a9
fileFormatVersion: 2
guid: dc1744118325c8b4a8031b8a323b51e9
timeCreated: 1517593125
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Assets/Script/KinectModule/RealColorFrame.cs.meta
0 → 100644
View file @
a55d35a9
fileFormatVersion: 2
guid: 4d4ebc163c8b0f64ea3c88954abd9c1d
timeCreated: 1517593124
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Assets/Script/KinectModule/RealDepthFrame.cs.meta
0 → 100644
View file @
a55d35a9
fileFormatVersion: 2
guid: 49669bc530f699b4190b9eed031580af
timeCreated: 1517593124
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Assets/Script/KinectModule/RealJoint.cs.meta
0 → 100644
View file @
a55d35a9
fileFormatVersion: 2
guid: 7947bea575f347e4599985a563d3941e
timeCreated: 1517593124
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Assets/Script/KinectModule/RealMultiSourceFrame.cs.meta
0 → 100644
View file @
a55d35a9
fileFormatVersion: 2
guid: ca6a04f9e32114f429b9beaf2232d237
timeCreated: 1517593124
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Assets/Script/KinectModule/SourceBuffer.cs.meta
0 → 100644
View file @
a55d35a9
fileFormatVersion: 2
guid: b0c48f58fdc6b3d4eb9ad052fe8e1ed6
timeCreated: 1517593124
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Assets/Script/MotionAnalysis/DistItvExtractor.cs
0 → 100644
View file @
a55d35a9
using
UnityEngine
;
using
Windows.Kinect
;
namespace
MotionAnalysis
{
public
class
DistItvExtractor
{
private
CameraSpacePoint
Head
,
HandLeft
,
HandRight
,
SpineShoulder
,
SpineMid
,
ElbowLeft
,
ElbowRight
,
KneeLeft
,
KneeRight
,
SpineMidRecent
,
HandLeftRecent
,
HandRightRecent
;
private
float
Table
;
public
float
DistHandBaseSpineShoulder
{
get
;
private
set
;
}
public
float
DistHand
{
get
;
private
set
;
}
public
float
DistSpine
{
get
;
private
set
;
}
public
float
DistHandBaseHead
{
get
;
private
set
;
}
public
float
DistHandLeft
{
get
;
private
set
;
}
public
float
DistHandRight
{
get
;
private
set
;
}
public
float
DistHandBaseElbow_Left
{
get
;
private
set
;
}
public
float
DistHandBaseElbow_Right
{
get
;
private
set
;
}
public
float
DistHandBaseHead_Left
{
get
;
private
set
;
}
public
float
DistHandBaseHead_Right
{
get
;
private
set
;
}
public
float
DistHandBaseSpineMid_Left
{
get
;
private
set
;
}
public
float
DistHandBaseSpineMid_Right
{
get
;
private
set
;
}
public
float
DistKneeBaseTable
{
get
;
private
set
;
}
public
float
ItvElbowBaseSpineMid_Left
{
get
;
private
set
;
}
public
float
ItvElbowBaseSpineMid_Right
{
get
;
private
set
;
}
public
float
ItvHandBaseHead
{
get
;
private
set
;
}
public
float
ItvHandBaseHead_LeftEar
{
get
;
private
set
;
}
public
float
ItvHandBaseHead_RightEar
{
get
;
private
set
;
}
public
float
ItvHandBaseHead_LeftDepth
{
get
;
private
set
;
}
public
float
ItvHandBaseHead_RightDepth
{
get
;
private
set
;
}
public
DistItvExtractor
(
float
table
)
{
Table
=
table
;
}
public
void
Extract
(
KinectModule
.
IBody
body
)
{
UpdatePosition
(
body
);
UpdateDistItv
();
SaveRecent
();
}
private
void
UpdatePosition
(
KinectModule
.
IBody
body
)
{
Head
=
body
.
Joints
[
JointType
.
Head
]
.
Position
;
HandLeft
=
body
.
Joints
[
JointType
.
HandLeft
]
.
Position
;
HandRight
=
body
.
Joints
[
JointType
.
HandRight
]
.
Position
;
SpineShoulder
=
body
.
Joints
[
JointType
.
SpineShoulder
].
Position
;
SpineMid
=
body
.
Joints
[
JointType
.
SpineMid
]
.
Position
;
ElbowLeft
=
body
.
Joints
[
JointType
.
ElbowLeft
]
.
Position
;
ElbowRight
=
body
.
Joints
[
JointType
.
ElbowRight
]
.
Position
;
KneeLeft
=
body
.
Joints
[
JointType
.
KneeLeft
]
.
Position
;
KneeRight
=
body
.
Joints
[
JointType
.
KneeRight
]
.
Position
;
}
private
void
SaveRecent
()
{
SpineMidRecent
=
SpineMid
;
HandLeftRecent
=
HandLeft
;
HandRightRecent
=
HandRight
;
}
private
void
UpdateDistItv
()
{
ComputeClap
();
ComputeJump
();
ComputeHurray
();
ComputeHandMove
();
ComputeGuardBase
();
ComputeHandUp
();
ComputeHandDown
();
ComputeOnTheTable
();
ComputeJesus
();
ComputeHeadphone
();
}
private
void
ComputeClap
()
{
DistHandBaseSpineShoulder
=
Mathf
.
Min
(
HandLeft
.
Y
,
HandRight
.
Y
)
-
SpineShoulder
.
Y
;
DistHand
=
Distance
(
HandLeft
,
HandRight
);
}
private
void
ComputeJump
()
{
DistSpine
=
SpineMid
.
Y
-
SpineMidRecent
.
Y
;
}
private
void
ComputeHurray
()
{
DistHandBaseHead
=
Mathf
.
Min
(
HandLeft
.
Y
,
HandRight
.
Y
)
-
Head
.
Y
;
}
private
void
ComputeHandMove
()
{
DistHandLeft
=
HandLeft
.
Y
-
HandLeftRecent
.
Y
;
DistHandRight
=
HandRight
.
Y
-
HandRightRecent
.
Y
;
}
private
void
ComputeGuardBase
()
{
DistHandBaseElbow_Left
=
HandLeft
.
Y
-
ElbowLeft
.
Y
;
DistHandBaseElbow_Right
=
HandRight
.
Y
-
ElbowRight
.
Y
;
ItvElbowBaseSpineMid_Left
=
Mathf
.
Abs
(
ElbowLeft
.
X
-
SpineMid
.
X
);
ItvElbowBaseSpineMid_Right
=
Mathf
.
Abs
(
ElbowRight
.
X
-
SpineMid
.
X
);
}
private
void
ComputeHandUp
()
{
DistHandBaseHead_Left
=
HandLeft
.
Y
-
Head
.
Y
;
DistHandBaseHead_Right
=
HandRight
.
Y
-
Head
.
Y
;
}
private
void
ComputeHandDown
()
{
DistHandBaseSpineMid_Left
=
HandLeft
.
Y
-
SpineMid
.
Y
;
DistHandBaseSpineMid_Right
=
HandRight
.
Y
-
SpineMid
.
Y
;
}
private
void
ComputeOnTheTable
()
{
DistKneeBaseTable
=
Mathf
.
Min
(
KneeLeft
.
Y
,
KneeRight
.
Y
)
-
Table
;
}
private
void
ComputeJesus
()
{
ItvHandBaseHead
=
Mathf
.
Min
(
Mathf
.
Abs
(
HandLeft
.
X
-
Head
.
X
),
Mathf
.
Abs
(
HandRight
.
X
-
Head
.
X
));
}
private
void
ComputeHeadphone
()
{
ItvHandBaseHead_LeftEar
=
Mathf
.
Abs
(
HandLeft
.
X
-
Head
.
X
);
ItvHandBaseHead_RightEar
=
Mathf
.
Abs
(
HandRight
.
X
-
Head
.
X
);
ItvHandBaseHead_LeftDepth
=
Mathf
.
Abs
(
HandLeft
.
Z
-
Head
.
Z
);
ItvHandBaseHead_RightDepth
=
Mathf
.
Abs
(
HandRight
.
Z
-
Head
.
Z
);
}
private
float
Distance
(
CameraSpacePoint
a
,
CameraSpacePoint
b
)
{
return
Mathf
.
Sqrt
(
Mathf
.
Pow
(
a
.
X
-
b
.
X
,
2.0f
)
+
Mathf
.
Pow
(
a
.
Y
-
b
.
Y
,
2.0f
)
+
Mathf
.
Pow
(
a
.
Z
-
b
.
Z
,
2.0f
));
}
}
}
\ No newline at end of file
Assets/Script/MotionAnalysis/MotionDiscriminator.cs
0 → 100644
View file @
a55d35a9
using
System.Collections.Generic
;
using
System.Linq
;
using
Windows.Kinect
;
namespace
MotionAnalysis
{
public
class
MotionDiscriminator
{
private
DistItvExtractor
Extractor
;
public
MotionState
Motion
{
get
;
private
set
;
}
public
bool
IsPreseted
{
get
;
private
set
;
}
public
void
Preset
(
KinectModule
.
IBody
body
)
{
IsPreseted
=
false
;
if
(
DoNotHaveKneeJoint
(
body
))
return
;
Extractor
=
new
DistItvExtractor
(
ComputeKneeMean
(
body
));
IsPreseted
=
true
;
Init
();
}
private
bool
DoNotHaveKneeJoint
(
KinectModule
.
IBody
body
)
{
KinectModule
.
IJoint
left
,
right
;
return
!
body
.
Joints
.
TryGetValue
(
JointType
.
KneeLeft
,
out
left
)
||
!
body
.
Joints
.
TryGetValue
(
JointType
.
KneeRight
,
out
right
);
}
private
float
ComputeKneeMean
(
KinectModule
.
IBody
body
)
{
return
body
.
Joints
.
Where
(
x
=>
x
.
Key
==
JointType
.
KneeLeft
||
x
.
Key
==
JointType
.
KneeRight
)
.
Select
(
x
=>
x
.
Value
.
Position
.
Y
)
.
Average
();
}
private
void
Init
()
{
Motion
=
MotionState
.
UNKNOWN
;
}
public
void
Update
(
KinectModule
.
IBody
body
)
{
Extractor
.
Extract
(
body
);
Init
();
Determine
();
}
void
Determine
()
{
Clap
();
Jump
();
Hurray
();
HandMove
();
GuardBase
();
HandUp
();
HandDown
();
Jesus
();
Headphone
();
OnTheTable
();
}
void
Clap
()
{
const
float
distPrepare
=
0.3f
,
distDone
=
0.1f
;
if
(
Extractor
.
DistHandBaseSpineShoulder
<=
0.0f
)
return
;
if
(
Extractor
.
DistHand
>
distPrepare
)
Motion
|=
MotionState
.
CLAP_PREPARE
;
else
if
(
Extractor
.
DistHand
<
distDone
)
Motion
|=
MotionState
.
CLAP_DONE
;
}
void
Jump
()
{
const
float
distPrepare
=
0.05f
,
distDone
=
0.0f
;
if
(
Extractor
.
DistSpine
<
distPrepare
)
Motion
|=
MotionState
.
JUMP_PREPARE
;
else
if
(
Extractor
.
DistSpine
>
distDone
)
Motion
|=
MotionState
.
JUMP_DONE
;
}
void
Hurray
()
{
if
(
Extractor
.
DistHandBaseHead
>
0
)
Motion
|=
MotionState
.
HURRAY
;
}
void
HandMove
()
{
if
(
Extractor
.
DistHandLeft
>
0
)
Motion
|=
MotionState
.
HAND_MOVE_UP_LEFT
;
else
if
(
Extractor
.
DistHandLeft
<
0
)
Motion
|=
MotionState
.
HAND_MOVE_DOWN_LEFT
;
if
(
Extractor
.
DistHandRight
>
0
)
Motion
|=
MotionState
.
HAND_MOVE_UP_RIGHT
;
else
if
(
Extractor
.
DistHandRight
<
0
)
Motion
|=
MotionState
.
HAND_MOVE_DOWN_RIGHT
;
}
void
GuardBase
()
{
const
float
distBase
=
0.5f
;
if
(
Extractor
.
DistHandBaseElbow_Left
>
0.0f
&&
Extractor
.
ItvElbowBaseSpineMid_Left
<
distBase
)
Motion
|=
MotionState
.
GUARD_BASE_LEFT
;
if
(
Extractor
.
DistHandBaseElbow_Right
>
0.0f
&&
Extractor
.
ItvElbowBaseSpineMid_Right
<
distBase
)
Motion
|=
MotionState
.
GUARD_BASE_RIGHT
;
}
void
HandUp
()
{
const
float
distUp
=
0.2f
;
if
(
Extractor
.
DistHandBaseHead_Left
>
distUp
)
Motion
|=
MotionState
.
HAND_UP_LEFT
;
if
(
Extractor
.
DistHandBaseHead_Right
>
distUp
)
Motion
|=
MotionState
.
HAND_UP_RIGHT
;
}
void
HandDown
()
{
if
(
Extractor
.
DistHandBaseSpineMid_Left
<
0.0f
)
Motion
|=
MotionState
.
HAND_DOWN_LEFT
;
if
(
Extractor
.
DistHandBaseSpineMid_Right
<
0.0f
)
Motion
|=
MotionState
.
HAND_DOWN_RIGHT
;
}
void
Jesus
()
{
const
float
distJesus
=
0.5f
;
if
(
Extractor
.
DistHandBaseSpineShoulder
>
0.0f
&&
Extractor
.
ItvHandBaseHead
>=
distJesus
)
Motion
|=
MotionState
.
JESUS
;
}
void
Headphone
()
{
const
float
itvDepth
=
0.2f
,
itvEar
=
0.2f
;
if
(
Extractor
.
ItvHandBaseHead_LeftEar
<
itvEar
&&
Extractor
.
ItvHandBaseHead_LeftDepth
<
itvDepth
)
Motion
|=
MotionState
.
HEADPHONE_LEFT
;
if
(
Extractor
.
ItvHandBaseHead_RightEar
<
itvEar
&&
Extractor
.
ItvHandBaseHead_RightDepth
<
itvDepth
)
Motion
|=
MotionState
.
HEADPHONE_RIGHT
;
}
void
OnTheTable
()
{
const
float
distTable
=
0.5f
;
if
(
Extractor
.
DistKneeBaseTable
>=
distTable
)
Motion
|=
MotionState
.
ON_THE_TABLE
;
}
}
}
Assets/Script/MotionAnalysis/MotionState.cs
0 → 100644
View file @
a55d35a9
using
System
;
namespace
MotionAnalysis
{
[
Flags
]
public
enum
MotionState
:
uint
{
UNKNOWN
=
0x00000
,
CLAP_PREPARE
=
0x00001
,
CLAP_DONE
=
0x00002
,
JUMP_PREPARE
=
0x00004
,
JUMP_DONE
=
0x00008
,
HURRAY
=
0x00010
,
HAND_MOVE_UP_LEFT
=
0x00020
,
HAND_MOVE_DOWN_LEFT
=
0x00040
,
HAND_MOVE_UP_RIGHT
=
0x00080
,
HAND_MOVE_DOWN_RIGHT
=
0x00100
,
GUARD_BASE_LEFT
=
0x00200
,
GUARD_BASE_RIGHT
=
0x00400
,
HAND_UP_LEFT
=
0x00800
,
HAND_DOWN_LEFT
=
0x01000
,
HAND_UP_RIGHT
=
0x02000
,
HAND_DOWN_RIGHT
=
0x04000
,
JESUS
=
0x10000
,
HEADPHONE_LEFT
=
0x20000
,
HEADPHONE_RIGHT
=
0x40000
,
ON_THE_TABLE
=
0x80000
}
}
\ No newline at end of file
Assets/Script/MotionSampleDisplay.cs
View file @
a55d35a9
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
using
UnityEngine
;
public
class
MotionSampleDisplay
:
MonoBehaviour
{
[
SerializeField
]
GameObject
left
,
right
;
GameObject
left
,
right
;
public
Sprite
sprite
;
public
float
timeout
;
public
Sprite
sprite
;
public
float
timeout
;
public
MotionNote
caller
;
private
float
elapsedTime
;
private
float
velocity
;
private
float
acceleration
;
private
float
elapsedTime
;
private
float
acceleration
;
private
float
distance
=
1.5f
;
private
float
distance
=
1.5f
;
private
Vector3
localScaleLR
=
new
Vector3
(
0.5f
,
0.5f
,
0
);
private
Vector3
InitialTranslateL
{
get
{
var
tmp
=
InitialTranslateR
;
tmp
.
x
=
-
tmp
.
x
;
return
tmp
;
}
}
private
Vector3
InitialTranslateR
{
get
{
return
new
Vector3
(
distance
,
-
0.8f
,
0
);
}
}
// Use this for initialization
void
Start
()
{
elapsedTime
=
0f
;
velocity
=
0f
;
acceleration
=
2
*
distance
/
Mathf
.
Pow
(
timeout
,
2
);
SetObject
(
left
,
true
);
SetObject
(
right
,
false
);
}
left
.
GetComponent
<
SpriteRenderer
>().
sprite
=
sprite
;
right
.
GetComponent
<
SpriteRenderer
>().
sprite
=
sprite
;
left
.
transform
.
Translate
(-
distance
,
-
0.8f
,
0
);
left
.
transform
.
localScale
=
new
Vector3
(
0.5f
,
0.5f
);
right
.
transform
.
Translate
(
distance
,
-
0.8f
,
0
);
right
.
transform
.
localScale
=
new
Vector3
(
0.5f
,
0.5f
);
void
SetObject
(
GameObject
obj
,
bool
isLeft
)
{
obj
.
GetComponent
<
SpriteRenderer
>().
sprite
=
sprite
;
obj
.
transform
.
Translate
(
isLeft
?
InitialTranslateL
:
InitialTranslateR
);
obj
.
transform
.
localScale
=
localScaleLR
;
}
// Update is called once per frame
void
Update
()
{
float
delta
=
Time
.
deltaTime
*
1000f
;
var
delta
=
Time
.
deltaTime
*
1000f
;
elapsedTime
+=
delta
;
velocity
=
acceleration
*
elapsedTime
;
if
(
elapsedTime
>
timeout
)
{
Destroy
(
gameObject
);
return
;
}
left
.
transform
.
Translate
(
new
Vector3
(
velocity
*
delta
,
0
));
right
.
transform
.
Translate
(
new
Vector3
(-
velocity
*
delta
,
0
));
var
velocity
=
acceleration
*
elapsedTime
;
var
movement
=
velocity
*
delta
;
left
.
transform
.
Translate
(
new
Vector3
(
movement
,
0
,
0
));
right
.
transform
.
Translate
(
new
Vector3
(-
movement
,
0
,
0
));
}
}
\ No newline at end of file
Assets/Script/MotionView.cs
View file @
a55d35a9
using
System
;
using
MotionAnalysis
;
using
System.Collections.Generic
;
using
UnityEngine
;
using
Windows.Kinect
;
using
System.Linq
;
using
UnityEngine
;
public
class
MotionView
:
MonoBehaviour
{
CoordinateMapperManager
manager
;
InputManager
input
;
IEnumerable
<
KinectModule
.
IBody
>
body
;
MotionDiscriminator
discriminator
=
new
MotionDiscriminator
();
bool
IsInit
;
private
CoordinateMapperManager
Manager
;
private
InputManager
Input
;
private
IEnumerable
<
KinectModule
.
IBody
>
Body
;
private
MotionDiscriminator
Discriminator
=
new
MotionDiscriminator
();
// Use this for initialization
void
Start
()
{
IsInit
=
false
;
var
ingameManager
=
GameObject
.
Find
(
"InGameManagers"
);
m
anager
=
ingameManager
.
GetComponent
<
CoordinateMapperManager
>();
input
=
ingameManager
.
GetComponent
<
InputManager
>();
M
anager
=
ingameManager
.
GetComponent
<
CoordinateMapperManager
>();
Input
=
ingameManager
.
GetComponent
<
InputManager
>();
}
// Update is called once per frame
void
Update
()
{
if
(
IsInit
)
{
input
.
CurrentMotionState
=
DetermineState
();
return
;
}
body
=
manager
.
BodyBuffer
;
var
tmp
=
body
.
ToList
()[
0
];
if
(
tmp
!=
null
)
{
discriminator
.
Preset
(
body
.
ToList
()[
0
]);
IsInit
=
true
;
}
}
MotionState
DetermineState
()
{
var
tracked
=
body
.
Where
(
x
=>
x
!=
null
&&
x
.
IsTracked
).
ToList
();
if
(
tracked
.
Count
()
==
0
||
tracked
[
0
].
Joints
==
null
)
return
MotionState
.
UNKNOWN
;
discriminator
.
Update
(
tracked
[
0
]);
return
discriminator
.
Motion
;
}
}
[
Flags
]
public
enum
MotionState
:
uint
{
UNKNOWN
=
0x00000
,
CLAP_PREPARE
=
0x00001
,
CLAP_DONE
=
0x00002
,
JUMP_PREPARE
=
0x00004
,
JUMP_DONE
=
0x00008
,
HURRAY
=
0x00010
,
HAND_MOVE_UP_LEFT
=
0x00020
,
HAND_MOVE_DOWN_LEFT
=
0x00040
,
HAND_MOVE_UP_RIGHT
=
0x00080
,
HAND_MOVE_DOWN_RIGHT
=
0x00100
,
GUARD_BASE_LEFT
=
0x00200
,
GUARD_BASE_RIGHT
=
0x00400
,
HAND_UP_LEFT
=
0x00800
,
HAND_DOWN_LEFT
=
0x01000
,
HAND_UP_RIGHT
=
0x02000
,
HAND_DOWN_RIGHT
=
0x04000
,
JESUS
=
0x10000
,
HEADPHONE_LEFT
=
0x20000
,
HEADPHONE_RIGHT
=
0x40000
,
ON_THE_TABLE
=
0x80000
}
internal
class
MotionDiscriminator
{
DistItvExtractor
extractor
;
private
MotionState
_Motion
;
public
MotionState
Motion
{
get
{
return
_Motion
;
}
}
public
void
Preset
(
KinectModule
.
IBody
body
)
{
CameraSpacePoint
KneeLeftBase
=
body
.
Joints
[
JointType
.
KneeLeft
].
Position
,
KneeRightBase
=
body
.
Joints
[
JointType
.
KneeRight
].
Position
;
extractor
=
new
DistItvExtractor
((
KneeLeftBase
.
Y
+
KneeRightBase
.
Y
)
/
2
);
Initialize
();
}
private
void
Initialize
()
{
_Motion
=
MotionState
.
UNKNOWN
;
}
public
void
Update
(
KinectModule
.
IBody
body
)
{
extractor
.
Extract
(
body
);
Initialize
();
Determine
();
}
float
Distance
(
CameraSpacePoint
a
,
CameraSpacePoint
b
)
{
return
Mathf
.
Sqrt
(
Mathf
.
Pow
(
a
.
X
-
b
.
X
,
2.0f
)
+
Mathf
.
Pow
(
a
.
Y
-
b
.
Y
,
2.0f
)
+
Mathf
.
Pow
(
a
.
Z
-
b
.
Z
,
2.0f
));
}
void
Determine
()
{
Clap
();
Jump
();
Hurray
();
HandMove
();
GuardBase
();
HandUp
();
HandDown
();
Jesus
();
Headphone
();
OnTheTable
();
}
void
Clap
()
{
const
float
distPrepare
=
0.3f
,
distDone
=
0.1f
;
if
(
extractor
.
DistHandBaseSpineShoulder
<=
0.0f
)
return
;
if
(
extractor
.
DistHand
>
distPrepare
)
_Motion
|=
MotionState
.
CLAP_PREPARE
;
else
if
(
extractor
.
DistHand
<
distDone
)
_Motion
|=
MotionState
.
CLAP_DONE
;
}
void
Jump
()
{
const
float
distPrepare
=
0.05f
,
distDone
=
0.0f
;
if
(
extractor
.
DistSpine
<
distPrepare
)
_Motion
|=
MotionState
.
JUMP_PREPARE
;
else
if
(
extractor
.
DistSpine
>
distDone
)
_Motion
|=
MotionState
.
JUMP_DONE
;
}
void
Hurray
()
{
if
(
extractor
.
DistHandBaseHead
>
0
)
_Motion
|=
MotionState
.
HURRAY
;
}
void
HandMove
()
{
if
(
extractor
.
DistHandLeft
>
0
)
_Motion
|=
MotionState
.
HAND_MOVE_UP_LEFT
;
else
if
(
extractor
.
DistHandLeft
<
0
)
_Motion
|=
MotionState
.
HAND_MOVE_DOWN_LEFT
;
if
(
extractor
.
DistHandRight
>
0
)
_Motion
|=
MotionState
.
HAND_MOVE_UP_RIGHT
;
else
if
(
extractor
.
DistHandRight
<
0
)
_Motion
|=
MotionState
.
HAND_MOVE_DOWN_RIGHT
;
}
void
GuardBase
()
{
const
float
distBase
=
0.5f
;
if
(
extractor
.
DistHandBaseElbow_Left
>
0.0f
&&
extractor
.
ItvElbowBaseSpineMid_Left
<
distBase
)
_Motion
|=
MotionState
.
GUARD_BASE_LEFT
;
if
(
extractor
.
DistHandBaseElbow_Right
>
0.0f
&&
extractor
.
ItvElbowBaseSpineMid_Right
<
distBase
)
_Motion
|=
MotionState
.
GUARD_BASE_RIGHT
;
if
(
InitDiscriminator
())
Input
.
CurrentMotionState
=
DetermineState
();
}
void
HandUp
()
bool
InitDiscriminator
()
{
const
float
distUp
=
0.2f
;
if
(
extractor
.
DistHandBaseHead_Left
>
distUp
)
_Motion
|=
MotionState
.
HAND_UP_LEFT
;
if
(
extractor
.
DistHandBaseHead_Right
>
distUp
)
_Motion
|=
MotionState
.
HAND_UP_RIGHT
;
}
if
(
Discriminator
.
IsPreseted
)
return
true
;
void
HandDown
()
{
if
(
extractor
.
DistHandBaseSpineMid_Left
<
0.0f
)
_Motion
|=
MotionState
.
HAND_DOWN_LEFT
;
Body
=
Manager
.
BodyBuffer
;
if
(
extractor
.
DistHandBaseSpineMid_Right
<
0.0f
)
_Motion
|=
MotionState
.
HAND_DOWN_RIGHT
;
}
var
body0
=
Body
.
ToList
()[
0
];
if
(
body0
==
null
)
return
false
;
void
Jesus
()
{
const
float
distJesus
=
0.5f
;
Discriminator
.
Preset
(
body0
);
if
(!
Discriminator
.
IsPreseted
)
return
false
;
if
(
extractor
.
DistHandBaseSpineShoulder
>
0.0f
&&
extractor
.
ItvHandBaseHead
>=
distJesus
)
_Motion
|=
MotionState
.
JESUS
;
return
true
;
}
void
Headphone
()
{
const
float
itvDepth
=
0.2f
,
itvEar
=
0.2f
;
if
(
extractor
.
ItvHandBaseHead_LeftEar
<
itvEar
&&
extractor
.
ItvHandBaseHead_LeftDepth
<
itvDepth
)
_Motion
|=
MotionState
.
HEADPHONE_LEFT
;
if
(
extractor
.
ItvHandBaseHead_RightEar
<
itvEar
&&
extractor
.
ItvHandBaseHead_RightDepth
<
itvDepth
)
_Motion
|=
MotionState
.
HEADPHONE_RIGHT
;
}
MotionState
DetermineState
()
{
var
tracked
=
Body
.
Where
(
x
=>
x
!=
null
&&
x
.
IsTracked
)
.
ToList
();
if
(
tracked
.
Count
()
==
0
||
tracked
[
0
].
Joints
==
null
)
return
MotionState
.
UNKNOWN
;
void
OnTheTable
()
{
const
float
distTable
=
0.5f
;
Discriminator
.
Update
(
tracked
[
0
]);
if
(
extractor
.
DistKneeBaseTable
>=
distTable
)
_Motion
|=
MotionState
.
ON_THE_TABLE
;
}
return
Discriminator
.
Motion
;
}
}
internal
class
DistItvExtractor
{
CameraSpacePoint
Head
,
HandLeft
,
HandRight
,
SpineShoulder
,
SpineMid
,
ElbowLeft
,
ElbowRight
,
KneeLeft
,
KneeRight
,
SpineMidRecent
,
HandLeftRecent
,
HandRightRecent
;
float
Table
;
public
float
DistHandBaseSpineShoulder
{
get
;
private
set
;
}
public
float
DistHand
{
get
;
private
set
;
}
public
float
DistSpine
{
get
;
private
set
;
}
public
float
DistHandBaseHead
{
get
;
private
set
;
}
public
float
DistHandLeft
{
get
;
private
set
;
}
public
float
DistHandRight
{
get
;
private
set
;
}
public
float
DistHandBaseElbow_Left
{
get
;
private
set
;
}
public
float
DistHandBaseElbow_Right
{
get
;
private
set
;
}
public
float
DistHandBaseHead_Left
{
get
;
private
set
;
}
public
float
DistHandBaseHead_Right
{
get
;
private
set
;
}
public
float
DistHandBaseSpineMid_Left
{
get
;
private
set
;
}
public
float
DistHandBaseSpineMid_Right
{
get
;
private
set
;
}
public
float
DistKneeBaseTable
{
get
;
private
set
;
}
public
float
ItvElbowBaseSpineMid_Left
{
get
;
private
set
;
}
public
float
ItvElbowBaseSpineMid_Right
{
get
;
private
set
;
}
public
float
ItvHandBaseHead
{
get
;
private
set
;
}
public
float
ItvHandBaseHead_LeftEar
{
get
;
private
set
;
}
public
float
ItvHandBaseHead_RightEar
{
get
;
private
set
;
}
public
float
ItvHandBaseHead_LeftDepth
{
get
;
private
set
;
}
public
float
ItvHandBaseHead_RightDepth
{
get
;
private
set
;
}
public
DistItvExtractor
(
float
table
)
{
Table
=
table
;
}
public
void
Extract
(
KinectModule
.
IBody
body
)
{
UpdatePosition
(
body
);
UpdateDistItv
();
SaveRecent
();
}
void
UpdatePosition
(
KinectModule
.
IBody
body
)
{
Head
=
body
.
Joints
[
JointType
.
Head
].
Position
;
HandLeft
=
body
.
Joints
[
JointType
.
HandLeft
].
Position
;
HandRight
=
body
.
Joints
[
JointType
.
HandRight
].
Position
;
SpineShoulder
=
body
.
Joints
[
JointType
.
SpineShoulder
].
Position
;
SpineMid
=
body
.
Joints
[
JointType
.
SpineMid
].
Position
;
ElbowLeft
=
body
.
Joints
[
JointType
.
ElbowLeft
].
Position
;
ElbowRight
=
body
.
Joints
[
JointType
.
ElbowRight
].
Position
;
KneeLeft
=
body
.
Joints
[
JointType
.
KneeLeft
].
Position
;
KneeRight
=
body
.
Joints
[
JointType
.
KneeRight
].
Position
;
}
void
SaveRecent
()
{
SpineMidRecent
=
SpineMid
;
HandLeftRecent
=
HandLeft
;
HandRightRecent
=
HandRight
;
}
void
UpdateDistItv
()
{
DistHandBaseSpineShoulder
=
Mathf
.
Min
(
HandLeft
.
Y
,
HandRight
.
Y
)
-
SpineShoulder
.
Y
;
DistHand
=
Distance
(
HandLeft
,
HandRight
);
DistSpine
=
SpineMid
.
Y
-
SpineMidRecent
.
Y
;
DistHandBaseHead
=
Mathf
.
Min
(
HandLeft
.
Y
,
HandRight
.
Y
)
-
Head
.
Y
;
DistHandLeft
=
HandLeft
.
Y
-
HandLeftRecent
.
Y
;
DistHandRight
=
HandRight
.
Y
-
HandRightRecent
.
Y
;
DistHandBaseElbow_Left
=
HandLeft
.
Y
-
ElbowLeft
.
Y
;
DistHandBaseElbow_Right
=
HandRight
.
Y
-
ElbowRight
.
Y
;
DistHandBaseHead_Left
=
HandLeft
.
Y
-
Head
.
Y
;
DistHandBaseHead_Right
=
HandRight
.
Y
-
Head
.
Y
;
DistHandBaseSpineMid_Left
=
HandLeft
.
Y
-
SpineMid
.
Y
;
DistHandBaseSpineMid_Right
=
HandRight
.
Y
-
SpineMid
.
Y
;
DistKneeBaseTable
=
Mathf
.
Min
(
KneeLeft
.
Y
,
KneeRight
.
Y
)
-
Table
;
ItvElbowBaseSpineMid_Left
=
Mathf
.
Abs
(
ElbowLeft
.
X
-
SpineMid
.
X
);
ItvElbowBaseSpineMid_Right
=
Mathf
.
Abs
(
ElbowRight
.
X
-
SpineMid
.
X
);
ItvHandBaseHead
=
Mathf
.
Min
(
Mathf
.
Abs
(
HandLeft
.
X
-
Head
.
X
),
Mathf
.
Abs
(
HandLeft
.
X
-
Head
.
X
));
ItvHandBaseHead_LeftEar
=
Mathf
.
Abs
(
HandLeft
.
X
-
Head
.
X
);
ItvHandBaseHead_RightEar
=
Mathf
.
Abs
(
HandRight
.
X
-
Head
.
X
);
ItvHandBaseHead_LeftDepth
=
Mathf
.
Abs
(
HandLeft
.
Z
-
Head
.
Z
);
ItvHandBaseHead_RightDepth
=
Mathf
.
Abs
(
HandRight
.
Z
-
Head
.
Z
);
}
float
Distance
(
CameraSpacePoint
a
,
CameraSpacePoint
b
)
{
return
Mathf
.
Sqrt
(
Mathf
.
Pow
(
a
.
X
-
b
.
X
,
2.0f
)
+
Mathf
.
Pow
(
a
.
Y
-
b
.
Y
,
2.0f
)
+
Mathf
.
Pow
(
a
.
Z
-
b
.
Z
,
2.0f
));
}
}
\ No newline at end of file
Assets/Script/ScoreDisplayManager.cs
View file @
a55d35a9
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
using
UnityEngine
;
using
UnityEngine.UI
;
public
class
ScoreDisplayManager
:
MonoBehaviour
{
public
class
ScoreDisplayManager
:
MonoBehaviour
{
public
Text
Score
;
public
Text
Perfect
;
public
Text
Good
;
...
...
@@ -13,33 +10,30 @@ public class ScoreDisplayManager : MonoBehaviour {
public
Text
Miss
;
public
Text
Combo
;
// Use this for initialization
void
Start
()
{
Score
.
text
=
GameManager
.
Instance
.
Score
.
ToString
();
void
Start
()
{
Score
.
text
=
GameManager
.
Instance
.
Score
.
ToString
();
Perfect
.
text
=
GameManager
.
Instance
.
JudgeCount
[
Judge
.
JudgeList
[
0
]].
ToString
();
Good
.
text
=
GameManager
.
Instance
.
JudgeCount
[
Judge
.
JudgeList
[
1
]].
ToString
();
Bad
.
text
=
GameManager
.
Instance
.
JudgeCount
[
Judge
.
JudgeList
[
2
]].
ToString
();
Miss
.
text
=
GameManager
.
Instance
.
JudgeCount
[
Judge
.
JudgeList
[
3
]].
ToString
();
Combo
.
text
=
GameManager
.
Instance
.
LongestCombo
.
ToString
();
Good
.
text
=
GameManager
.
Instance
.
JudgeCount
[
Judge
.
JudgeList
[
1
]].
ToString
();
Bad
.
text
=
GameManager
.
Instance
.
JudgeCount
[
Judge
.
JudgeList
[
2
]].
ToString
();
Miss
.
text
=
GameManager
.
Instance
.
JudgeCount
[
Judge
.
JudgeList
[
3
]].
ToString
();
Combo
.
text
=
GameManager
.
Instance
.
LongestCombo
.
ToString
();
}
// Update is called once per frame
void
Update
()
{
void
Update
()
{
if
(
Input
.
anyKey
)
{
GameManager
.
Instance
.
Score
=
0
;
GameManager
.
Instance
.
JudgeCount
[
Judge
.
JudgeList
[
0
]]
=
0
;
GameManager
.
Instance
.
JudgeCount
[
Judge
.
JudgeList
[
1
]]
=
0
;
GameManager
.
Instance
.
JudgeCount
[
Judge
.
JudgeList
[
2
]]
=
0
;
GameManager
.
Instance
.
JudgeCount
[
Judge
.
JudgeList
[
3
]]
=
0
;
Judge
.
JudgeList
.
ForEach
(
x
=>
GameManager
.
Instance
.
JudgeCount
[
x
]
=
0
);
GameManager
.
Instance
.
LongestCombo
=
0
;
Destroy
(
this
);
GameManager
.
Instance
.
SceneTransition
(
"SetSelect"
);
return
;
}
}
}
Assets/Script/StatusConvert/ButtonStatusGetter.cs
0 → 100644
View file @
a55d35a9
using
UnityEngine
;
namespace
StatusConvert
{
public
static
class
ButtonStatusGetter
{
public
static
bool
IsButtonDown
{
get
{
return
Input
.
GetKey
(
KeyCode
.
Space
)
||
Input
.
GetKey
(
KeyCode
.
Joystick1Button0
);
}
}
}
}
\ No newline at end of file
Assets/Script/StatusConvert/InputStatus.cs
0 → 100644
View file @
a55d35a9
namespace
StatusConvert
{
public
enum
InputStatus
{
Entered
,
Continuing
,
Stopped
,
None
}
}
\ No newline at end of file
Assets/Script/StatusConvert/MotionStatus.cs
0 → 100644
View file @
a55d35a9
using
System
;
namespace
StatusConvert
{
[
Flags
]
public
enum
MotionStatus
:
uint
{
Prepared
=
0x1
,
Done
=
0x2
,
None
=
0x0
}
}
\ No newline at end of file
Assets/Script/StatusConvert/MotionStatusExtractor.cs
0 → 100644
View file @
a55d35a9
using
MotionAnalysis
;
using
System.Collections.Generic
;
namespace
StatusConvert
{
public
static
class
MotionStatusExtractor
{
private
static
readonly
Dictionary
<
string
,
Dictionary
<
string
,
MotionState
>>
ShortStates
=
new
Dictionary
<
string
,
Dictionary
<
string
,
MotionState
>>
{
{
"Clap"
,
new
Dictionary
<
string
,
MotionState
>
{
{
"prepare"
,
MotionState
.
CLAP_PREPARE
},
{
"done"
,
MotionState
.
CLAP_DONE
}
}
},
{
"Jump"
,
new
Dictionary
<
string
,
MotionState
>
{
{
"prepare"
,
MotionState
.
JUMP_PREPARE
},
{
"done"
,
MotionState
.
JUMP_DONE
}
}
},
{
"PushUpLeft"
,
new
Dictionary
<
string
,
MotionState
>
{
{
"prepare"
,
MotionState
.
HURRAY
&
MotionState
.
HAND_MOVE_UP_LEFT
},
{
"done"
,
MotionState
.
HURRAY
&
MotionState
.
HAND_MOVE_DOWN_LEFT
}
}
},
{
"PushUpRight"
,
new
Dictionary
<
string
,
MotionState
>
{
{
"prepare"
,
MotionState
.
HURRAY
&
MotionState
.
HAND_MOVE_UP_RIGHT
},
{
"done"
,
MotionState
.
HURRAY
&
MotionState
.
HAND_MOVE_DOWN_RIGHT
}
}
},
{
"JumpPushUpLeft"
,
new
Dictionary
<
string
,
MotionState
>
{
{
"prepare"
,
MotionState
.
JUMP_PREPARE
&
MotionState
.
HURRAY
&
MotionState
.
HAND_MOVE_UP_LEFT
},
{
"done"
,
MotionState
.
JUMP_DONE
&
MotionState
.
HURRAY
&
MotionState
.
HAND_MOVE_DOWN_LEFT
}
}
},
{
"JumpPushUpRight"
,
new
Dictionary
<
string
,
MotionState
>
{
{
"prepare"
,
MotionState
.
JUMP_PREPARE
&
MotionState
.
HURRAY
&
MotionState
.
HAND_MOVE_UP_RIGHT
},
{
"done"
,
MotionState
.
JUMP_DONE
&
MotionState
.
HURRAY
&
MotionState
.
HAND_MOVE_DOWN_RIGHT
}
}
},
{
"GuardLeft"
,
new
Dictionary
<
string
,
MotionState
>
{
{
"prepare"
,
MotionState
.
GUARD_BASE_LEFT
&
MotionState
.
HAND_MOVE_UP_LEFT
},
{
"done"
,
MotionState
.
GUARD_BASE_LEFT
&
MotionState
.
HAND_MOVE_DOWN_LEFT
}
}
},
{
"GuardRight"
,
new
Dictionary
<
string
,
MotionState
>
{
{
"prepare"
,
MotionState
.
GUARD_BASE_RIGHT
&
MotionState
.
HAND_MOVE_UP_RIGHT
},
{
"done"
,
MotionState
.
GUARD_BASE_RIGHT
&
MotionState
.
HAND_MOVE_DOWN_RIGHT
}
}
}
};
private
static
readonly
Dictionary
<
string
,
MotionState
>
LongStates
=
new
Dictionary
<
string
,
MotionState
>
{
{
"HandUpLeft"
,
MotionState
.
HAND_UP_LEFT
},
{
"HandUpRight"
,
MotionState
.
HAND_UP_RIGHT
},
{
"HandDownLeft"
,
MotionState
.
HAND_DOWN_LEFT
},
{
"HandDownRight"
,
MotionState
.
HAND_DOWN_RIGHT
},
{
"Jesus"
,
MotionState
.
JESUS
},
{
"HeadphoneLeft"
,
MotionState
.
HEADPHONE_LEFT
},
{
"HeadphoneRight"
,
MotionState
.
HEADPHONE_RIGHT
},
{
"OnTheTable"
,
MotionState
.
ON_THE_TABLE
}
};
private
static
bool
IsContain
(
MotionState
target
,
MotionState
motion
)
{
return
(
target
&
motion
)
==
motion
;
}
private
static
MotionStatus
ExtractShort
(
string
name
,
MotionState
state
)
{
if
(
IsContain
(
state
,
ShortStates
[
name
][
"prepare"
]))
return
MotionStatus
.
Prepared
;
if
(
IsContain
(
state
,
ShortStates
[
name
][
"done"
]))
return
MotionStatus
.
Done
;
return
MotionStatus
.
None
;
}
private
static
MotionStatus
ExtractLong
(
string
name
,
MotionState
state
)
{
if
(
IsContain
(
state
,
LongStates
[
name
]))
return
MotionStatus
.
Prepared
|
MotionStatus
.
Done
;
return
MotionStatus
.
None
;
}
public
static
MotionStatus
Extract
(
string
name
,
MotionState
state
)
{
if
(
ShortStates
.
ContainsKey
(
name
))
return
ExtractShort
(
name
,
state
);
if
(
LongStates
.
ContainsKey
(
name
))
return
ExtractLong
(
name
,
state
);
return
MotionStatus
.
None
;
}
}
}
\ No newline at end of file
Assets/Script/TitleManager.cs
View file @
a55d35a9
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
using
UnityEngine
;
public
class
TitleManager
:
MonoBehaviour
{
// Use this for initialization
void
Start
()
{
}
public
class
TitleManager
:
MonoBehaviour
{
// Update is called once per frame
void
Update
()
{
if
(
Input
.
anyKey
)
{
Destroy
(
this
);
GameManager
.
Instance
.
SceneTransition
(
"SetSelect"
);
return
;
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment