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
d618a691
Commit
d618a691
authored
Aug 25, 2017
by
16도재형
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
모션노트 완료
parent
89b2c3b3
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
350 additions
and
94 deletions
+350
-94
Clap.cs
Assets/MotionNotes/Clap.cs
+5
-15
Guard.cs
Assets/MotionNotes/Guard.cs
+25
-14
Guard.cs.meta
Assets/MotionNotes/Guard.cs.meta
+1
-1
HandDown.cs
Assets/MotionNotes/HandDown.cs
+56
-0
HandDown.cs.meta
Assets/MotionNotes/HandDown.cs.meta
+2
-2
HandUp.cs
Assets/MotionNotes/HandUp.cs
+56
-0
HandUp.cs.meta
Assets/MotionNotes/HandUp.cs.meta
+12
-0
Headphone.cs
Assets/MotionNotes/Headphone.cs
+56
-0
Headphone.cs.meta
Assets/MotionNotes/Headphone.cs.meta
+12
-0
Jesus.cs
Assets/MotionNotes/Jesus.cs
+33
-0
Jesus.cs.meta
Assets/MotionNotes/Jesus.cs.meta
+12
-0
Jump.cs
Assets/MotionNotes/Jump.cs
+6
-30
OnTheTable.cs
Assets/MotionNotes/OnTheTable.cs
+33
-0
OnTheTable.cs.meta
Assets/MotionNotes/OnTheTable.cs.meta
+12
-0
PushUp.cs
Assets/MotionNotes/PushUp.cs
+17
-12
MotionNote.cs
Assets/Script/MotionNote.cs
+12
-20
No files found.
Assets/MotionNotes/Clap.cs
View file @
d618a691
...
...
@@ -20,25 +20,15 @@ public class Clap : MotionNote
{
}
public
override
IEnumerator
Checkpoint
()
public
override
void
Checkpoint
()
{
var
motion
=
InputManager
.
Instance
.
CurrentMotionState
;
while
((
motion
&
MotionState
.
CLAP_PREPARE
)
==
0
)
yield
return
null
;
IsChecked
=
true
;
yield
break
;
IsChecked
=
(
InputManager
.
Instance
.
CurrentMotionState
&
MotionState
.
CLAP_PREPARE
)
!=
0
;
}
public
override
bool
FinalJudgeAction
()
{
var
motion
=
InputManager
.
Instance
.
CurrentMotionState
;
if
((
motion
&
MotionState
.
CLAP_DONE
)
!=
0
)
return
true
;
return
false
;
return
(
InputManager
.
Instance
.
CurrentMotionState
&
MotionState
.
CLAP_DONE
)
!=
0
;
}
}
Assets/MotionNotes/Guard.cs
View file @
d618a691
...
...
@@ -7,7 +7,9 @@ public class Guard : MotionNote
enum
Hand
{
Both
,
Left
,
Right
}
Hand
hand
;
private
static
Sprite
image
=
LoadNewSprite
(
""
);
MotionState
prepare
,
done
;
private
static
Sprite
image
;
public
override
Sprite
Image
{
get
...
...
@@ -16,40 +18,49 @@ public class Guard : MotionNote
}
}
public
Guard
(
string
key
,
float
timing
,
float
end
=
0f
)
:
this
(
timing
,
end
)
public
Guard
(
string
key
,
float
timing
)
:
this
(
timing
)
{
switch
(
key
)
{
case
"BG"
:
hand
=
Hand
.
Both
;
image
=
LoadNewSprite
(
"BG"
);
prepare
=
MotionState
.
GUARD_BASE_LEFT
|
MotionState
.
GUARD_BASE_RIGHT
|
MotionState
.
HAND_MOVE_DOWN_LEFT
|
MotionState
.
HAND_MOVE_DOWN_RIGHT
;
done
=
MotionState
.
GUARD_BASE_LEFT
|
MotionState
.
GUARD_BASE_RIGHT
|
MotionState
.
HAND_MOVE_UP_LEFT
|
MotionState
.
HAND_MOVE_UP_RIGHT
;
break
;
case
"LG"
:
hand
=
Hand
.
Left
;
image
=
LoadNewSprite
(
"LG"
);
prepare
=
MotionState
.
GUARD_BASE_LEFT
|
MotionState
.
HAND_MOVE_DOWN_LEFT
;
done
=
MotionState
.
GUARD_BASE_LEFT
|
MotionState
.
HAND_MOVE_UP_LEFT
;
break
;
case
"RG"
:
hand
=
Hand
.
Right
;
image
=
LoadNewSprite
(
"RG"
);
prepare
=
MotionState
.
GUARD_BASE_RIGHT
|
MotionState
.
HAND_MOVE_DOWN_RIGHT
;
done
=
MotionState
.
GUARD_BASE_RIGHT
|
MotionState
.
HAND_MOVE_UP_RIGHT
;
break
;
}
}
public
Guard
(
float
timing
,
float
end
=
0f
)
:
base
(
timing
,
end
)
public
Guard
(
float
timing
)
:
base
(
timing
)
{
}
public
override
IEnumerator
Checkpoint
()
public
override
void
Checkpoint
()
{
var
motionState
=
InputManager
.
Instance
.
CurrentMotionState
;
var
motion
=
motionState
;
while
(
motion
!=
MotionState
.
CLAP_PREPARE
)
yield
return
false
;
Activated
=
true
;
yield
break
;
IsChecked
=
(
InputManager
.
Instance
.
CurrentMotionState
&
prepare
)
!=
0
;
}
public
override
bool
FinalJudgeAction
()
{
throw
new
NotImplementedException
();
return
(
InputManager
.
Instance
.
CurrentMotionState
&
done
)
!=
0
;
}
}
Assets/MotionNotes/Guard.cs.meta
View file @
d618a691
fileFormatVersion: 2
guid: 9335418863367cf4fb5c77889556b26a
timeCreated: 1503
548782
timeCreated: 1503
639949
licenseType: Free
MonoImporter:
serializedVersion: 2
...
...
Assets/MotionNotes/HandDown.cs
0 → 100644
View file @
d618a691
using
System
;
using
System.Collections
;
using
UnityEngine
;
public
class
HandDown
:
MotionNote
{
enum
Hand
{
Both
,
Left
,
Right
}
Hand
hand
;
MotionState
done
;
private
static
Sprite
image
;
public
override
Sprite
Image
{
get
{
return
image
;
}
}
public
HandDown
(
string
key
,
float
timing
)
:
this
(
timing
)
{
switch
(
key
)
{
case
"BD"
:
hand
=
Hand
.
Both
;
image
=
LoadNewSprite
(
"BD"
);
done
=
MotionState
.
HAND_DOWN_LEFT
|
MotionState
.
HAND_DOWN_RIGHT
;
break
;
case
"LD"
:
hand
=
Hand
.
Left
;
image
=
LoadNewSprite
(
"LD"
);
done
=
MotionState
.
HAND_DOWN_LEFT
;
break
;
case
"RD"
:
hand
=
Hand
.
Right
;
image
=
LoadNewSprite
(
"RD"
);
done
=
MotionState
.
HAND_DOWN_RIGHT
;
break
;
}
}
public
HandDown
(
float
timing
)
:
base
(
timing
)
{
}
public
override
void
Checkpoint
()
{
IsChecked
=
true
;
}
public
override
bool
FinalJudgeAction
()
{
return
(
InputManager
.
Instance
.
CurrentMotionState
&
done
)
!=
0
;
}
}
Assets/MotionNotes/
Piano
.cs.meta
→
Assets/MotionNotes/
HandDown
.cs.meta
View file @
d618a691
fileFormatVersion: 2
guid:
e943dcff2ea00af40acbfc09b7345f25
timeCreated: 1503
548782
guid:
0a95b7cf44f588a478ab3d020a20d647
timeCreated: 1503
640030
licenseType: Free
MonoImporter:
serializedVersion: 2
...
...
Assets/MotionNotes/
Piano
.cs
→
Assets/MotionNotes/
HandUp
.cs
View file @
d618a691
using
System
;
using
System
;
using
System.Collections
;
using
UnityEngine
;
public
class
Piano
:
MotionNote
public
class
HandUp
:
MotionNote
{
enum
Hand
{
Both
,
Left
,
Right
}
Hand
hand
;
private
static
Sprite
image
=
LoadNewSprite
(
""
);
MotionState
done
;
private
static
Sprite
image
;
public
override
Sprite
Image
{
get
...
...
@@ -16,40 +18,39 @@ public class Piano : MotionNote
}
}
public
Piano
(
string
key
,
float
timing
)
:
this
(
timing
)
public
HandUp
(
string
key
,
float
timing
)
:
this
(
timing
)
{
switch
(
key
)
{
case
"B
I
"
:
case
"B
U
"
:
hand
=
Hand
.
Both
;
image
=
LoadNewSprite
(
"BU"
);
done
=
MotionState
.
HAND_UP_LEFT
|
MotionState
.
HAND_UP_RIGHT
;
break
;
case
"L
I
"
:
case
"L
U
"
:
hand
=
Hand
.
Left
;
image
=
LoadNewSprite
(
"LU"
);
done
=
MotionState
.
HAND_UP_LEFT
;
break
;
case
"R
I
"
:
case
"R
U
"
:
hand
=
Hand
.
Right
;
image
=
LoadNewSprite
(
"RU"
);
done
=
MotionState
.
HAND_UP_RIGHT
;
break
;
}
}
public
Piano
(
float
timing
)
:
base
(
timing
)
public
HandUp
(
float
timing
)
:
base
(
timing
)
{
}
public
override
IEnumerator
Checkpoint
()
public
override
void
Checkpoint
()
{
var
motionState
=
InputManager
.
Instance
.
CurrentMotionState
;
var
motion
=
motionState
;
while
(
motion
!=
MotionState
.
CLAP_PREPARE
)
yield
return
false
;
Activated
=
true
;
yield
break
;
IsChecked
=
true
;
}
public
override
bool
FinalJudgeAction
()
{
throw
new
NotImplementedException
();
return
(
InputManager
.
Instance
.
CurrentMotionState
&
done
)
!=
0
;
}
}
Assets/MotionNotes/HandUp.cs.meta
0 → 100644
View file @
d618a691
fileFormatVersion: 2
guid: be9752588c388ac4d985d31009c56a33
timeCreated: 1503640021
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Assets/MotionNotes/Headphone.cs
0 → 100644
View file @
d618a691
using
System
;
using
System.Collections
;
using
UnityEngine
;
public
class
Headphone
:
MotionNote
{
enum
Hand
{
Both
,
Left
,
Right
}
Hand
hand
;
MotionState
done
;
private
static
Sprite
image
;
public
override
Sprite
Image
{
get
{
return
image
;
}
}
public
Headphone
(
string
key
,
float
timing
)
:
this
(
timing
)
{
switch
(
key
)
{
case
"BH"
:
hand
=
Hand
.
Both
;
image
=
LoadNewSprite
(
"BH"
);
done
=
MotionState
.
HEADPHONE_LEFT
|
MotionState
.
HEADPHONE_RIGHT
;
break
;
case
"LH"
:
hand
=
Hand
.
Left
;
image
=
LoadNewSprite
(
"LH"
);
done
=
MotionState
.
HEADPHONE_LEFT
;
break
;
case
"RH"
:
hand
=
Hand
.
Right
;
image
=
LoadNewSprite
(
"RH"
);
done
=
MotionState
.
HEADPHONE_RIGHT
;
break
;
}
}
public
Headphone
(
float
timing
)
:
base
(
timing
)
{
}
public
override
void
Checkpoint
()
{
IsChecked
=
true
;
}
public
override
bool
FinalJudgeAction
()
{
return
(
InputManager
.
Instance
.
CurrentMotionState
&
done
)
!=
0
;
}
}
Assets/MotionNotes/Headphone.cs.meta
0 → 100644
View file @
d618a691
fileFormatVersion: 2
guid: 7001b42f9e2553a4cb28935d34b516be
timeCreated: 1503640044
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Assets/MotionNotes/Jesus.cs
0 → 100644
View file @
d618a691
using
System
;
using
System.Collections
;
using
UnityEngine
;
public
class
Jesus
:
MotionNote
{
private
static
Sprite
image
=
LoadNewSprite
(
"Assets/MotionNotes/JP.png"
);
public
override
Sprite
Image
{
get
{
return
image
;
}
}
public
Jesus
(
string
key
,
float
timing
)
:
this
(
timing
)
{
}
public
Jesus
(
float
timing
)
:
base
(
timing
)
{
}
public
override
void
Checkpoint
()
{
IsChecked
=
true
;
}
public
override
bool
FinalJudgeAction
()
{
return
(
InputManager
.
Instance
.
CurrentMotionState
&
MotionState
.
JESUS
)
!=
0
;
}
}
Assets/MotionNotes/Jesus.cs.meta
0 → 100644
View file @
d618a691
fileFormatVersion: 2
guid: 15c3b7e2e4c349745a04b348f255f6ca
timeCreated: 1503640038
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Assets/MotionNotes/Jump.cs
View file @
d618a691
...
...
@@ -4,7 +4,7 @@ using UnityEngine;
public
class
Jump
:
MotionNote
{
private
static
Sprite
image
=
new
Sprite
(
);
private
static
Sprite
image
=
LoadNewSprite
(
"Assets/MotionNotes/JP.png"
);
public
override
Sprite
Image
{
get
...
...
@@ -18,41 +18,17 @@ public class Jump : MotionNote
}
public
Jump
(
float
timing
)
:
base
(
timing
)
{
downCount
=
0
;
}
private
float
spineHeight
;
private
int
downCount
;
public
override
IEnumerator
Checkpoint
()
public
override
void
Checkpoint
()
{
float
currentSpineHeight
=
InputManager
.
Instance
.
Joints
[
Windows
.
Kinect
.
JointType
.
SpineBase
].
Position
.
Y
;
while
(
downCount
<
10
&&
currentSpineHeight
<=
spineHeight
-
0.1f
)
{
spineHeight
=
currentSpineHeight
;
currentSpineHeight
=
InputManager
.
Instance
.
Joints
[
Windows
.
Kinect
.
JointType
.
SpineBase
].
Position
.
Y
;
downCount
++;
yield
return
false
;
}
if
(
downCount
>=
10
)
Activated
=
true
;
yield
break
;
IsChecked
=
(
InputManager
.
Instance
.
CurrentMotionState
&
MotionState
.
JUMP_PREPARE
)
!=
0
;
}
public
override
bool
FinalJudgeAction
()
{
float
currentSpineHeight
=
InputManager
.
Instance
.
Joints
[
Windows
.
Kinect
.
JointType
.
SpineBase
].
Position
.
Y
;
return
currentSpineHeight
>=
spineHeight
;
return
(
InputManager
.
Instance
.
CurrentMotionState
&
MotionState
.
JUMP_DONE
)
!=
0
;
}
}
Assets/MotionNotes/OnTheTable.cs
0 → 100644
View file @
d618a691
using
System
;
using
System.Collections
;
using
UnityEngine
;
public
class
OnTheTable
:
MotionNote
{
private
static
Sprite
image
=
LoadNewSprite
(
"Assets/MotionNotes/JP.png"
);
public
override
Sprite
Image
{
get
{
return
image
;
}
}
public
OnTheTable
(
string
key
,
float
timing
)
:
this
(
timing
)
{
}
public
OnTheTable
(
float
timing
)
:
base
(
timing
)
{
}
public
override
void
Checkpoint
()
{
IsChecked
=
true
;
}
public
override
bool
FinalJudgeAction
()
{
return
(
InputManager
.
Instance
.
CurrentMotionState
&
MotionState
.
ON_THE_TABLE
)
!=
0
;
}
}
Assets/MotionNotes/OnTheTable.cs.meta
0 → 100644
View file @
d618a691
fileFormatVersion: 2
guid: 03af2790100c5024185b0a02a2c81490
timeCreated: 1503640053
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Assets/MotionNotes/PushUp.cs
View file @
d618a691
...
...
@@ -7,7 +7,9 @@ public class PushUp : MotionNote
enum
Hand
{
Both
,
Left
,
Right
}
Hand
hand
;
private
static
Sprite
image
=
LoadNewSprite
(
""
);
MotionState
prepare
,
done
;
private
static
Sprite
image
;
public
override
Sprite
Image
{
get
...
...
@@ -22,12 +24,21 @@ public class PushUp : MotionNote
{
case
"BP"
:
hand
=
Hand
.
Both
;
image
=
LoadNewSprite
(
"BP"
);
prepare
=
MotionState
.
HAND_MOVE_UP_LEFT
|
MotionState
.
HAND_MOVE_UP_RIGHT
;
done
=
MotionState
.
HAND_MOVE_DOWN_LEFT
|
MotionState
.
HAND_MOVE_DOWN_RIGHT
;
break
;
case
"LP"
:
hand
=
Hand
.
Left
;
image
=
LoadNewSprite
(
"LP"
);
prepare
=
MotionState
.
HAND_MOVE_UP_LEFT
;
done
=
MotionState
.
HAND_MOVE_DOWN_LEFT
;
break
;
case
"RP"
:
hand
=
Hand
.
Right
;
image
=
LoadNewSprite
(
"RP"
);
prepare
=
MotionState
.
HAND_MOVE_UP_RIGHT
;
done
=
MotionState
.
HAND_MOVE_DOWN_RIGHT
;
break
;
}
}
...
...
@@ -35,21 +46,15 @@ public class PushUp : MotionNote
{
}
public
override
IEnumerator
Checkpoint
()
public
override
void
Checkpoint
()
{
var
motionState
=
InputManager
.
Instance
.
CurrentMotionState
;
var
motion
=
motionState
;
while
(
motion
!=
MotionState
.
CLAP_PREPARE
)
yield
return
false
;
Activated
=
true
;
yield
break
;
IsChecked
=
(
InputManager
.
Instance
.
CurrentMotionState
&
prepare
)
!=
0
;
}
public
override
bool
FinalJudgeAction
()
{
throw
new
NotImplementedException
();
return
(
InputManager
.
Instance
.
CurrentMotionState
&
done
)
!=
0
;
}
}
Assets/Script/MotionNote.cs
View file @
d618a691
...
...
@@ -13,7 +13,7 @@ public abstract class MotionNote : Note
public
MotionNote
(
string
key
,
float
start
,
float
end
=
0f
)
:
this
(
start
,
end
)
{
}
public
abstract
IEnumerator
Checkpoint
();
public
abstract
void
Checkpoint
();
public
abstract
bool
FinalJudgeAction
();
public
bool
IsChecked
{
get
;
protected
set
;
}
...
...
@@ -35,34 +35,26 @@ public abstract class MotionNote : Note
{
"LK"
,
typeof
(
PushUp
)
},
{
"RK"
,
typeof
(
PushUp
)
},
{
"BI"
,
typeof
(
Piano
)
},
{
"LI"
,
typeof
(
Piano
)
},
{
"RI"
,
typeof
(
Piano
)
},
{
"BG"
,
typeof
(
Guard
)
},
{
"LG"
,
typeof
(
Guard
)
},
{
"RG"
,
typeof
(
Guard
)
},
{
"BL"
,
typeof
(
Guard
)
},
{
"LL"
,
typeof
(
Guard
)
},
{
"RL"
,
typeof
(
Guard
)
},
// Long motion
{
"BU"
,
typeof
(
Guard
)
},
{
"LU"
,
typeof
(
Guard
)
},
{
"RU"
,
typeof
(
Guard
)
},
{
"BU"
,
typeof
(
HandUp
)
},
{
"LU"
,
typeof
(
HandUp
)
},
{
"RU"
,
typeof
(
HandUp
)
},
{
"BD"
,
typeof
(
Guard
)
},
{
"LD"
,
typeof
(
Guard
)
},
{
"RD"
,
typeof
(
Guard
)
},
{
"BD"
,
typeof
(
HandDown
)
},
{
"LD"
,
typeof
(
HandDown
)
},
{
"RD"
,
typeof
(
HandDown
)
},
{
"JS"
,
typeof
(
Guard
)
},
{
"JS"
,
typeof
(
Jesus
)
},
{
"BH"
,
typeof
(
Guard
)
},
{
"LH"
,
typeof
(
Guard
)
},
{
"RH"
,
typeof
(
Guard
)
},
{
"BH"
,
typeof
(
Headphone
)
},
{
"LH"
,
typeof
(
Headphone
)
},
{
"RH"
,
typeof
(
Headphone
)
},
{
"OT"
,
typeof
(
Guard
)
},
{
"OT"
,
typeof
(
OnTheTable
)
},
};
protected
static
Sprite
LoadNewSprite
(
string
FilePath
,
float
PixelsPerUnit
=
100.0f
)
...
...
16서원빈
@eseiker
mentioned in commit
38747f67
·
Aug 26, 2017
mentioned in commit
38747f67
mentioned in commit 38747f6765cdadcda0eadc73ab1e05078c9d521d
Toggle commit list
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