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
6cfca48c
Commit
6cfca48c
authored
7 years ago
by
16이상민
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactoring about motion notes
parent
b6e8f197
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
127 additions
and
114 deletions
+127
-114
Clap.cs
Assets/MotionNotes/Clap.cs
+1
-0
Guard.cs
Assets/MotionNotes/Guard.cs
+3
-0
HandDown.cs
Assets/MotionNotes/HandDown.cs
+3
-0
HandUp.cs
Assets/MotionNotes/HandUp.cs
+3
-0
Headphone.cs
Assets/MotionNotes/Headphone.cs
+3
-0
Jesus.cs
Assets/MotionNotes/Jesus.cs
+1
-0
Jump.cs
Assets/MotionNotes/Jump.cs
+1
-0
OnTheTable.cs
Assets/MotionNotes/OnTheTable.cs
+1
-0
PushUp.cs
Assets/MotionNotes/PushUp.cs
+6
-0
InputManager.cs
Assets/Script/InputManager.cs
+86
-112
JudgeManager.cs
Assets/Script/JudgeManager.cs
+17
-2
MotionNote.cs
Assets/Script/MotionNote.cs
+2
-0
No files found.
Assets/MotionNotes/Clap.cs
View file @
6cfca48c
...
@@ -15,6 +15,7 @@ public class Clap : MotionNote
...
@@ -15,6 +15,7 @@ public class Clap : MotionNote
public
Clap
(
string
key
,
float
start
,
float
end
=
0f
)
:
this
(
start
,
end
)
public
Clap
(
string
key
,
float
start
,
float
end
=
0f
)
:
this
(
start
,
end
)
{
{
MotionName
=
"Clap"
;
}
}
public
Clap
(
float
start
,
float
end
=
0f
)
:
base
(
start
,
end
)
public
Clap
(
float
start
,
float
end
=
0f
)
:
base
(
start
,
end
)
{
{
...
...
This diff is collapsed.
Click to expand it.
Assets/MotionNotes/Guard.cs
View file @
6cfca48c
...
@@ -29,6 +29,7 @@ public class Guard : MotionNote
...
@@ -29,6 +29,7 @@ public class Guard : MotionNote
|
MotionState
.
HAND_MOVE_DOWN_LEFT
|
MotionState
.
HAND_MOVE_DOWN_RIGHT
;
|
MotionState
.
HAND_MOVE_DOWN_LEFT
|
MotionState
.
HAND_MOVE_DOWN_RIGHT
;
done
=
MotionState
.
GUARD_BASE_LEFT
|
MotionState
.
GUARD_BASE_RIGHT
done
=
MotionState
.
GUARD_BASE_LEFT
|
MotionState
.
GUARD_BASE_RIGHT
|
MotionState
.
HAND_MOVE_UP_LEFT
|
MotionState
.
HAND_MOVE_UP_RIGHT
;
|
MotionState
.
HAND_MOVE_UP_LEFT
|
MotionState
.
HAND_MOVE_UP_RIGHT
;
MotionName
=
"GuardBoth"
;
break
;
break
;
case
"LG"
:
case
"LG"
:
hand
=
Hand
.
Left
;
hand
=
Hand
.
Left
;
...
@@ -37,6 +38,7 @@ public class Guard : MotionNote
...
@@ -37,6 +38,7 @@ public class Guard : MotionNote
|
MotionState
.
HAND_MOVE_DOWN_LEFT
;
|
MotionState
.
HAND_MOVE_DOWN_LEFT
;
done
=
MotionState
.
GUARD_BASE_LEFT
done
=
MotionState
.
GUARD_BASE_LEFT
|
MotionState
.
HAND_MOVE_UP_LEFT
;
|
MotionState
.
HAND_MOVE_UP_LEFT
;
MotionName
=
"GuardLeft"
;
break
;
break
;
case
"RG"
:
case
"RG"
:
hand
=
Hand
.
Right
;
hand
=
Hand
.
Right
;
...
@@ -45,6 +47,7 @@ public class Guard : MotionNote
...
@@ -45,6 +47,7 @@ public class Guard : MotionNote
|
MotionState
.
HAND_MOVE_DOWN_RIGHT
;
|
MotionState
.
HAND_MOVE_DOWN_RIGHT
;
done
=
MotionState
.
GUARD_BASE_RIGHT
done
=
MotionState
.
GUARD_BASE_RIGHT
|
MotionState
.
HAND_MOVE_UP_RIGHT
;
|
MotionState
.
HAND_MOVE_UP_RIGHT
;
MotionName
=
"GuardRight"
;
break
;
break
;
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Assets/MotionNotes/HandDown.cs
View file @
6cfca48c
...
@@ -26,16 +26,19 @@ public class HandDown : MotionNote
...
@@ -26,16 +26,19 @@ public class HandDown : MotionNote
hand
=
Hand
.
Both
;
hand
=
Hand
.
Both
;
image
=
LoadNewSprite
(
"Assets/MotionNotes/BD.png"
);
image
=
LoadNewSprite
(
"Assets/MotionNotes/BD.png"
);
done
=
MotionState
.
HAND_DOWN_LEFT
|
MotionState
.
HAND_DOWN_RIGHT
;
done
=
MotionState
.
HAND_DOWN_LEFT
|
MotionState
.
HAND_DOWN_RIGHT
;
MotionName
=
"HandDownBoth"
;
break
;
break
;
case
"LD"
:
case
"LD"
:
hand
=
Hand
.
Left
;
hand
=
Hand
.
Left
;
image
=
LoadNewSprite
(
"Assets/MotionNotes/LD.png"
);
image
=
LoadNewSprite
(
"Assets/MotionNotes/LD.png"
);
done
=
MotionState
.
HAND_DOWN_LEFT
;
done
=
MotionState
.
HAND_DOWN_LEFT
;
MotionName
=
"HandDownLeft"
;
break
;
break
;
case
"RD"
:
case
"RD"
:
hand
=
Hand
.
Right
;
hand
=
Hand
.
Right
;
image
=
LoadNewSprite
(
"Assets/MotionNotes/RD.png"
);
image
=
LoadNewSprite
(
"Assets/MotionNotes/RD.png"
);
done
=
MotionState
.
HAND_DOWN_RIGHT
;
done
=
MotionState
.
HAND_DOWN_RIGHT
;
MotionName
=
"HandDownRight"
;
break
;
break
;
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Assets/MotionNotes/HandUp.cs
View file @
6cfca48c
...
@@ -26,16 +26,19 @@ public class HandUp : MotionNote
...
@@ -26,16 +26,19 @@ public class HandUp : MotionNote
hand
=
Hand
.
Both
;
hand
=
Hand
.
Both
;
image
=
LoadNewSprite
(
"Assets/MotionNotes/BU.png"
);
image
=
LoadNewSprite
(
"Assets/MotionNotes/BU.png"
);
done
=
MotionState
.
HAND_UP_LEFT
|
MotionState
.
HAND_UP_RIGHT
;
done
=
MotionState
.
HAND_UP_LEFT
|
MotionState
.
HAND_UP_RIGHT
;
MotionName
=
"HandUpBoth"
;
break
;
break
;
case
"LU"
:
case
"LU"
:
hand
=
Hand
.
Left
;
hand
=
Hand
.
Left
;
image
=
LoadNewSprite
(
"Assets/MotionNotes/LU.png"
);
image
=
LoadNewSprite
(
"Assets/MotionNotes/LU.png"
);
done
=
MotionState
.
HAND_UP_LEFT
;
done
=
MotionState
.
HAND_UP_LEFT
;
MotionName
=
"HandUpLeft"
;
break
;
break
;
case
"RU"
:
case
"RU"
:
hand
=
Hand
.
Right
;
hand
=
Hand
.
Right
;
image
=
LoadNewSprite
(
"Assets/MotionNotes/RU.png"
);
image
=
LoadNewSprite
(
"Assets/MotionNotes/RU.png"
);
done
=
MotionState
.
HAND_UP_RIGHT
;
done
=
MotionState
.
HAND_UP_RIGHT
;
MotionName
=
"HandUpRight"
;
break
;
break
;
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Assets/MotionNotes/Headphone.cs
View file @
6cfca48c
...
@@ -26,16 +26,19 @@ public class Headphone : MotionNote
...
@@ -26,16 +26,19 @@ public class Headphone : MotionNote
hand
=
Hand
.
Both
;
hand
=
Hand
.
Both
;
image
=
LoadNewSprite
(
"Assets/MotionNotes/BH.png"
);
image
=
LoadNewSprite
(
"Assets/MotionNotes/BH.png"
);
done
=
MotionState
.
HEADPHONE_LEFT
|
MotionState
.
HEADPHONE_RIGHT
;
done
=
MotionState
.
HEADPHONE_LEFT
|
MotionState
.
HEADPHONE_RIGHT
;
MotionName
=
"HeadphoneBoth"
;
break
;
break
;
case
"LH"
:
case
"LH"
:
hand
=
Hand
.
Left
;
hand
=
Hand
.
Left
;
image
=
LoadNewSprite
(
"Assets/MotionNotes/LH.png"
);
image
=
LoadNewSprite
(
"Assets/MotionNotes/LH.png"
);
done
=
MotionState
.
HEADPHONE_LEFT
;
done
=
MotionState
.
HEADPHONE_LEFT
;
MotionName
=
"HeadphoneLeft"
;
break
;
break
;
case
"RH"
:
case
"RH"
:
hand
=
Hand
.
Right
;
hand
=
Hand
.
Right
;
image
=
LoadNewSprite
(
"Assets/MotionNotes/RH.png"
);
image
=
LoadNewSprite
(
"Assets/MotionNotes/RH.png"
);
done
=
MotionState
.
HEADPHONE_RIGHT
;
done
=
MotionState
.
HEADPHONE_RIGHT
;
MotionName
=
"HeadphoneRight"
;
break
;
break
;
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Assets/MotionNotes/Jesus.cs
View file @
6cfca48c
...
@@ -15,6 +15,7 @@ public class Jesus : MotionNote
...
@@ -15,6 +15,7 @@ public class Jesus : MotionNote
public
Jesus
(
string
key
,
float
start
,
float
end
=
0f
)
:
this
(
start
,
end
)
public
Jesus
(
string
key
,
float
start
,
float
end
=
0f
)
:
this
(
start
,
end
)
{
{
MotionName
=
"Jesus"
;
}
}
public
Jesus
(
float
start
,
float
end
=
0f
)
:
base
(
start
,
end
)
public
Jesus
(
float
start
,
float
end
=
0f
)
:
base
(
start
,
end
)
{
{
...
...
This diff is collapsed.
Click to expand it.
Assets/MotionNotes/Jump.cs
View file @
6cfca48c
...
@@ -15,6 +15,7 @@ public class Jump : MotionNote
...
@@ -15,6 +15,7 @@ public class Jump : MotionNote
public
Jump
(
string
key
,
float
start
,
float
end
=
0f
)
:
this
(
start
,
end
)
public
Jump
(
string
key
,
float
start
,
float
end
=
0f
)
:
this
(
start
,
end
)
{
{
MotionName
=
"Jump"
;
}
}
public
Jump
(
float
start
,
float
end
=
0f
)
:
base
(
start
,
end
)
public
Jump
(
float
start
,
float
end
=
0f
)
:
base
(
start
,
end
)
{
{
...
...
This diff is collapsed.
Click to expand it.
Assets/MotionNotes/OnTheTable.cs
View file @
6cfca48c
...
@@ -15,6 +15,7 @@ public class OnTheTable : MotionNote
...
@@ -15,6 +15,7 @@ public class OnTheTable : MotionNote
public
OnTheTable
(
string
key
,
float
start
,
float
end
=
0f
)
:
this
(
start
,
end
)
public
OnTheTable
(
string
key
,
float
start
,
float
end
=
0f
)
:
this
(
start
,
end
)
{
{
MotionName
=
"OnTheTable"
;
}
}
public
OnTheTable
(
float
start
,
float
end
=
0f
)
:
base
(
start
,
end
)
public
OnTheTable
(
float
start
,
float
end
=
0f
)
:
base
(
start
,
end
)
{
{
...
...
This diff is collapsed.
Click to expand it.
Assets/MotionNotes/PushUp.cs
View file @
6cfca48c
...
@@ -27,36 +27,42 @@ public class PushUp : MotionNote
...
@@ -27,36 +27,42 @@ public class PushUp : MotionNote
image
=
LoadNewSprite
(
"Assets/MotionNotes/BP.png"
);
image
=
LoadNewSprite
(
"Assets/MotionNotes/BP.png"
);
prepare
=
MotionState
.
HAND_MOVE_UP_LEFT
|
MotionState
.
HAND_MOVE_UP_RIGHT
;
prepare
=
MotionState
.
HAND_MOVE_UP_LEFT
|
MotionState
.
HAND_MOVE_UP_RIGHT
;
done
=
MotionState
.
HAND_MOVE_DOWN_LEFT
|
MotionState
.
HAND_MOVE_DOWN_RIGHT
;
done
=
MotionState
.
HAND_MOVE_DOWN_LEFT
|
MotionState
.
HAND_MOVE_DOWN_RIGHT
;
MotionName
=
"PushUpBoth"
;
break
;
break
;
case
"LP"
:
case
"LP"
:
hand
=
Hand
.
Left
;
hand
=
Hand
.
Left
;
image
=
LoadNewSprite
(
"Assets/MotionNotes/LP.png"
);
image
=
LoadNewSprite
(
"Assets/MotionNotes/LP.png"
);
prepare
=
MotionState
.
HAND_MOVE_UP_LEFT
;
prepare
=
MotionState
.
HAND_MOVE_UP_LEFT
;
done
=
MotionState
.
HAND_MOVE_DOWN_LEFT
;
done
=
MotionState
.
HAND_MOVE_DOWN_LEFT
;
MotionName
=
"PushUpLeft"
;
break
;
break
;
case
"RP"
:
case
"RP"
:
hand
=
Hand
.
Right
;
hand
=
Hand
.
Right
;
image
=
LoadNewSprite
(
"Assets/MotionNotes/RP.png"
);
image
=
LoadNewSprite
(
"Assets/MotionNotes/RP.png"
);
prepare
=
MotionState
.
HAND_MOVE_UP_RIGHT
;
prepare
=
MotionState
.
HAND_MOVE_UP_RIGHT
;
done
=
MotionState
.
HAND_MOVE_DOWN_RIGHT
;
done
=
MotionState
.
HAND_MOVE_DOWN_RIGHT
;
MotionName
=
"PushUpRight"
;
break
;
break
;
case
"BK"
:
case
"BK"
:
hand
=
Hand
.
Both
;
hand
=
Hand
.
Both
;
image
=
LoadNewSprite
(
"Assets/MotionNotes/BK.png"
);
image
=
LoadNewSprite
(
"Assets/MotionNotes/BK.png"
);
prepare
=
MotionState
.
HAND_MOVE_UP_LEFT
|
MotionState
.
HAND_MOVE_UP_RIGHT
|
MotionState
.
JUMP_PREPARE
;
prepare
=
MotionState
.
HAND_MOVE_UP_LEFT
|
MotionState
.
HAND_MOVE_UP_RIGHT
|
MotionState
.
JUMP_PREPARE
;
done
=
MotionState
.
HAND_MOVE_DOWN_LEFT
|
MotionState
.
HAND_MOVE_DOWN_RIGHT
|
MotionState
.
JUMP_DONE
;
done
=
MotionState
.
HAND_MOVE_DOWN_LEFT
|
MotionState
.
HAND_MOVE_DOWN_RIGHT
|
MotionState
.
JUMP_DONE
;
MotionName
=
"JumpPushUpBoth"
;
break
;
break
;
case
"LK"
:
case
"LK"
:
hand
=
Hand
.
Left
;
hand
=
Hand
.
Left
;
image
=
LoadNewSprite
(
"Assets/MotionNotes/LK.png"
);
image
=
LoadNewSprite
(
"Assets/MotionNotes/LK.png"
);
prepare
=
MotionState
.
HAND_MOVE_UP_LEFT
|
MotionState
.
JUMP_PREPARE
;
prepare
=
MotionState
.
HAND_MOVE_UP_LEFT
|
MotionState
.
JUMP_PREPARE
;
done
=
MotionState
.
HAND_MOVE_DOWN_LEFT
|
MotionState
.
JUMP_DONE
;
done
=
MotionState
.
HAND_MOVE_DOWN_LEFT
|
MotionState
.
JUMP_DONE
;
MotionName
=
"JumpPushUpLeft"
;
break
;
break
;
case
"RK"
:
case
"RK"
:
hand
=
Hand
.
Right
;
hand
=
Hand
.
Right
;
image
=
LoadNewSprite
(
"Assets/MotionNotes/RK.png"
);
image
=
LoadNewSprite
(
"Assets/MotionNotes/RK.png"
);
prepare
=
MotionState
.
HAND_MOVE_UP_RIGHT
|
MotionState
.
JUMP_PREPARE
;
prepare
=
MotionState
.
HAND_MOVE_UP_RIGHT
|
MotionState
.
JUMP_PREPARE
;
done
=
MotionState
.
HAND_MOVE_DOWN_RIGHT
|
MotionState
.
JUMP_DONE
;
done
=
MotionState
.
HAND_MOVE_DOWN_RIGHT
|
MotionState
.
JUMP_DONE
;
MotionName
=
"JumpPushUpRight"
;
break
;
break
;
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Assets/Script/InputManager.cs
View file @
6cfca48c
...
@@ -71,14 +71,17 @@ public class InputManager : MonoBehaviour {
...
@@ -71,14 +71,17 @@ public class InputManager : MonoBehaviour {
{
{
get
get
{
{
if
(
ClapStat
==
InputStatus
.
Entered
||
if
(
ShortMotionToInput
(
"Clap"
)
==
InputStatus
.
Entered
||
JumpStat
==
InputStatus
.
Entered
||
ShortMotionToInput
(
"Jump"
)
==
InputStatus
.
Entered
||
PushUpLeftStat
==
InputStatus
.
Entered
||
ShortMotionToInput
(
"PushUpLeft"
)
==
InputStatus
.
Entered
||
PushUpRightStat
==
InputStatus
.
Entered
||
ShortMotionToInput
(
"PushUpRight"
)
==
InputStatus
.
Entered
||
PushUpBothStat
==
InputStatus
.
Entered
||
ShortMotionToInput
(
"PushUpBoth"
)
==
InputStatus
.
Entered
||
GuardLeftStat
==
InputStatus
.
Entered
||
ShortMotionToInput
(
"JumpPushUpLeft"
)
==
InputStatus
.
Entered
||
GuardRightStat
==
InputStatus
.
Entered
||
ShortMotionToInput
(
"JumpPushUpRight"
)
==
InputStatus
.
Entered
||
GuardBothStat
==
InputStatus
.
Entered
)
ShortMotionToInput
(
"JumpPushUpBoth"
)
==
InputStatus
.
Entered
||
ShortMotionToInput
(
"GuardLeft"
)
==
InputStatus
.
Entered
||
ShortMotionToInput
(
"GuardRight"
)
==
InputStatus
.
Entered
||
ShortMotionToInput
(
"GuardBoth"
)
==
InputStatus
.
Entered
)
return
InputStatus
.
Entered
;
return
InputStatus
.
Entered
;
return
InputStatus
.
None
;
return
InputStatus
.
None
;
}
}
...
@@ -88,108 +91,33 @@ public class InputManager : MonoBehaviour {
...
@@ -88,108 +91,33 @@ public class InputManager : MonoBehaviour {
{
{
get
get
{
{
if
(
HandUpLeftStat
==
InputStatus
.
Entered
||
if
(
LongMotionToInput
(
"HandUpLeft"
)
==
InputStatus
.
Entered
||
HandUpLeftStat
==
InputStatus
.
Continuing
||
LongMotionToInput
(
"HandUpLeft"
)
==
InputStatus
.
Continuing
||
HandUpRightStat
==
InputStatus
.
Entered
||
LongMotionToInput
(
"HandUpRight"
)
==
InputStatus
.
Entered
||
HandUpRightStat
==
InputStatus
.
Continuing
||
LongMotionToInput
(
"HandUpRight"
)
==
InputStatus
.
Continuing
||
HandUpBothStat
==
InputStatus
.
Entered
||
LongMotionToInput
(
"HandUpBoth"
)
==
InputStatus
.
Entered
||
HandUpBothStat
==
InputStatus
.
Continuing
||
LongMotionToInput
(
"HandUpBoth"
)
==
InputStatus
.
Continuing
||
HandDownLeftStat
==
InputStatus
.
Entered
||
LongMotionToInput
(
"HandDownLeft"
)
==
InputStatus
.
Entered
||
HandDownLeftStat
==
InputStatus
.
Continuing
||
LongMotionToInput
(
"HandDownLeft"
)
==
InputStatus
.
Continuing
||
HandDownRightStat
==
InputStatus
.
Entered
||
LongMotionToInput
(
"HandDownRight"
)
==
InputStatus
.
Entered
||
HandDownRightStat
==
InputStatus
.
Continuing
||
LongMotionToInput
(
"HandDownRight"
)
==
InputStatus
.
Continuing
||
HandDownBothStat
==
InputStatus
.
Entered
||
LongMotionToInput
(
"HandDownBoth"
)
==
InputStatus
.
Entered
||
HandDownBothStat
==
InputStatus
.
Continuing
||
LongMotionToInput
(
"HandDownBoth"
)
==
InputStatus
.
Continuing
||
JesusStat
==
InputStatus
.
Entered
||
LongMotionToInput
(
"Jesus"
)
==
InputStatus
.
Entered
||
JesusStat
==
InputStatus
.
Continuing
||
LongMotionToInput
(
"Jesus"
)
==
InputStatus
.
Continuing
||
HeadphoneLeftStat
==
InputStatus
.
Entered
||
LongMotionToInput
(
"HeadphoneLeft"
)
==
InputStatus
.
Entered
||
HeadphoneLeftStat
==
InputStatus
.
Continuing
||
LongMotionToInput
(
"HeadphoneLeft"
)
==
InputStatus
.
Continuing
||
HeadphoneRightStat
==
InputStatus
.
Entered
||
LongMotionToInput
(
"HeadphoneRight"
)
==
InputStatus
.
Entered
||
HeadphoneRightStat
==
InputStatus
.
Continuing
||
LongMotionToInput
(
"HeadphoneRight"
)
==
InputStatus
.
Continuing
||
HeadphoneBothStat
==
InputStatus
.
Entered
||
LongMotionToInput
(
"HeadphoneBoth"
)
==
InputStatus
.
Entered
||
HeadphoneBothStat
==
InputStatus
.
Continuing
||
LongMotionToInput
(
"HeadphoneBoth"
)
==
InputStatus
.
Continuing
||
OnTheTableStat
==
InputStatus
.
Entered
||
LongMotionToInput
(
"OnTheTable"
)
==
InputStatus
.
Entered
||
OnTheTableStat
==
InputStatus
.
Continuing
)
LongMotionToInput
(
"OnTheTable"
)
==
InputStatus
.
Continuing
)
return
InputStatus
.
Entered
;
return
InputStatus
.
Entered
;
return
InputStatus
.
None
;
return
InputStatus
.
None
;
}
}
}
}
public
InputStatus
ClapStat
{
get
{
return
ShortMotionToInput
(
"Clap"
);
}
}
public
InputStatus
JumpStat
{
get
{
return
ShortMotionToInput
(
"Jump"
);
}
}
public
InputStatus
PushUpLeftStat
{
get
{
return
ShortMotionToInput
(
"PushUpLeft"
);
}
}
public
InputStatus
PushUpRightStat
{
get
{
return
ShortMotionToInput
(
"PushUpRight"
);
}
}
public
InputStatus
PushUpBothStat
{
get
{
var
left
=
PushUpLeftStat
;
var
right
=
PushUpRightStat
;
return
left
==
right
?
left
:
InputStatus
.
None
;
}
}
public
InputStatus
GuardLeftStat
{
get
{
return
ShortMotionToInput
(
"GuardLeft"
);
}
}
public
InputStatus
GuardRightStat
{
get
{
return
ShortMotionToInput
(
"GuardRight"
);
}
}
public
InputStatus
GuardBothStat
{
get
{
var
left
=
GuardLeftStat
;
var
right
=
GuardRightStat
;
return
left
==
right
?
left
:
InputStatus
.
None
;
}
}
public
InputStatus
HandUpLeftStat
{
get
{
return
LongMotionToInput
(
"HandUpLeft"
);
}
}
public
InputStatus
HandUpRightStat
{
get
{
return
LongMotionToInput
(
"HandUpRight"
);
}
}
public
InputStatus
HandUpBothStat
{
get
{
var
left
=
HandUpLeftStat
;
var
right
=
HandUpRightStat
;
return
left
==
right
?
left
:
InputStatus
.
None
;
}
}
public
InputStatus
HandDownLeftStat
{
get
{
return
LongMotionToInput
(
"HandDownLeft"
);
}
}
public
InputStatus
HandDownRightStat
{
get
{
return
LongMotionToInput
(
"HandDownRight"
);
}
}
public
InputStatus
HandDownBothStat
{
get
{
var
left
=
HandDownLeftStat
;
var
right
=
HandDownRightStat
;
return
left
==
right
?
left
:
InputStatus
.
None
;
}
}
public
InputStatus
JesusStat
{
get
{
return
LongMotionToInput
(
"Jesus"
);
}
}
public
InputStatus
HeadphoneLeftStat
{
get
{
return
LongMotionToInput
(
"HeadphoneLeft"
);
}
}
public
InputStatus
HeadphoneRightStat
{
get
{
return
LongMotionToInput
(
"HeadphoneRight"
);
}
}
public
InputStatus
HeadphoneBothStat
{
get
{
var
left
=
HeadphoneLeftStat
;
var
right
=
HeadphoneRightStat
;
return
left
==
right
?
left
:
InputStatus
.
None
;
}
}
public
InputStatus
OnTheTableStat
{
get
{
return
LongMotionToInput
(
"OnTheTable"
);
}
}
// Update is called once per frame
// Update is called once per frame
void
Update
()
void
Update
()
{
{
...
@@ -197,8 +125,18 @@ public class InputManager : MonoBehaviour {
...
@@ -197,8 +125,18 @@ public class InputManager : MonoBehaviour {
PrevMotionState
=
CurrentMotionState
;
PrevMotionState
=
CurrentMotionState
;
}
}
p
rivate
InputStatus
LongMotionToInput
(
string
name
)
p
ublic
InputStatus
LongMotionToInput
(
string
name
)
{
{
if
(
name
.
Contains
(
"Both"
))
{
var
tmpname
=
name
.
Substring
(
name
.
IndexOf
(
"Both"
));
var
left
=
LongMotionToInput
(
tmpname
+
"Left"
);
var
right
=
LongMotionToInput
(
tmpname
+
"Right"
);
return
left
==
right
?
left
:
InputStatus
.
None
;
}
Func
<
MotionState
,
MotionStatus
>
extractor
=
MotionStatusExtractor
.
GetExtractor
(
name
);
Func
<
MotionState
,
MotionStatus
>
extractor
=
MotionStatusExtractor
.
GetExtractor
(
name
);
if
(
extractor
==
null
)
if
(
extractor
==
null
)
return
InputStatus
.
None
;
return
InputStatus
.
None
;
...
@@ -219,8 +157,18 @@ public class InputManager : MonoBehaviour {
...
@@ -219,8 +157,18 @@ public class InputManager : MonoBehaviour {
return
InputStatus
.
None
;
return
InputStatus
.
None
;
}
}
p
rivate
InputStatus
ShortMotionToInput
(
string
name
)
p
ublic
InputStatus
ShortMotionToInput
(
string
name
)
{
{
if
(
name
.
Contains
(
"Both"
))
{
var
tmpname
=
name
.
Substring
(
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
);
Func
<
MotionState
,
MotionStatus
>
extractor
=
MotionStatusExtractor
.
GetExtractor
(
name
);
if
(
extractor
==
null
)
if
(
extractor
==
null
)
return
InputStatus
.
None
;
return
InputStatus
.
None
;
...
@@ -249,7 +197,7 @@ public class InputManager : MonoBehaviour {
...
@@ -249,7 +197,7 @@ public class InputManager : MonoBehaviour {
if
(
IsContain
(
state
,
MotionState
.
CLAP_PREPARE
))
if
(
IsContain
(
state
,
MotionState
.
CLAP_PREPARE
))
return
MotionStatus
.
Prepared
;
return
MotionStatus
.
Prepared
;
if
(
IsContain
(
state
,
MotionState
.
CLAP_DONE
))
if
(
IsContain
(
state
,
MotionState
.
CLAP_DONE
))
return
MotionStatus
.
Prepared
;
return
MotionStatus
.
Done
;
return
MotionStatus
.
None
;
return
MotionStatus
.
None
;
}
}
...
@@ -258,7 +206,7 @@ public class InputManager : MonoBehaviour {
...
@@ -258,7 +206,7 @@ public class InputManager : MonoBehaviour {
if
(
IsContain
(
state
,
MotionState
.
JUMP_PREPARE
))
if
(
IsContain
(
state
,
MotionState
.
JUMP_PREPARE
))
return
MotionStatus
.
Prepared
;
return
MotionStatus
.
Prepared
;
if
(
IsContain
(
state
,
MotionState
.
JUMP_DONE
))
if
(
IsContain
(
state
,
MotionState
.
JUMP_DONE
))
return
MotionStatus
.
Prepared
;
return
MotionStatus
.
Done
;
return
MotionStatus
.
None
;
return
MotionStatus
.
None
;
}
}
...
@@ -269,7 +217,7 @@ public class InputManager : MonoBehaviour {
...
@@ -269,7 +217,7 @@ public class InputManager : MonoBehaviour {
return
MotionStatus
.
Prepared
;
return
MotionStatus
.
Prepared
;
if
(
IsContain
(
state
,
MotionState
.
HURRAY
)
&&
if
(
IsContain
(
state
,
MotionState
.
HURRAY
)
&&
IsContain
(
state
,
MotionState
.
HAND_MOVE_DOWN_LEFT
))
IsContain
(
state
,
MotionState
.
HAND_MOVE_DOWN_LEFT
))
return
MotionStatus
.
Prepared
;
return
MotionStatus
.
Done
;
return
MotionStatus
.
None
;
return
MotionStatus
.
None
;
}
}
...
@@ -280,7 +228,29 @@ public class InputManager : MonoBehaviour {
...
@@ -280,7 +228,29 @@ public class InputManager : MonoBehaviour {
return
MotionStatus
.
Prepared
;
return
MotionStatus
.
Prepared
;
if
(
IsContain
(
state
,
MotionState
.
HURRAY
)
&&
if
(
IsContain
(
state
,
MotionState
.
HURRAY
)
&&
IsContain
(
state
,
MotionState
.
HAND_MOVE_DOWN_RIGHT
))
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
;
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
;
return
MotionStatus
.
None
;
}
}
...
@@ -291,7 +261,7 @@ public class InputManager : MonoBehaviour {
...
@@ -291,7 +261,7 @@ public class InputManager : MonoBehaviour {
return
MotionStatus
.
Prepared
;
return
MotionStatus
.
Prepared
;
if
(
IsContain
(
state
,
MotionState
.
GUARD_BASE_LEFT
)
&&
if
(
IsContain
(
state
,
MotionState
.
GUARD_BASE_LEFT
)
&&
IsContain
(
state
,
MotionState
.
HAND_MOVE_DOWN_LEFT
))
IsContain
(
state
,
MotionState
.
HAND_MOVE_DOWN_LEFT
))
return
MotionStatus
.
Prepared
;
return
MotionStatus
.
Done
;
return
MotionStatus
.
None
;
return
MotionStatus
.
None
;
}
}
...
@@ -302,7 +272,7 @@ public class InputManager : MonoBehaviour {
...
@@ -302,7 +272,7 @@ public class InputManager : MonoBehaviour {
return
MotionStatus
.
Prepared
;
return
MotionStatus
.
Prepared
;
if
(
IsContain
(
state
,
MotionState
.
GUARD_BASE_RIGHT
)
&&
if
(
IsContain
(
state
,
MotionState
.
GUARD_BASE_RIGHT
)
&&
IsContain
(
state
,
MotionState
.
HAND_MOVE_DOWN_RIGHT
))
IsContain
(
state
,
MotionState
.
HAND_MOVE_DOWN_RIGHT
))
return
MotionStatus
.
Prepared
;
return
MotionStatus
.
Done
;
return
MotionStatus
.
None
;
return
MotionStatus
.
None
;
}
}
...
@@ -382,6 +352,10 @@ public class InputManager : MonoBehaviour {
...
@@ -382,6 +352,10 @@ public class InputManager : MonoBehaviour {
return
ExtractPushUpLeft
;
return
ExtractPushUpLeft
;
if
(
name
.
Equals
(
"PushUpRight"
))
if
(
name
.
Equals
(
"PushUpRight"
))
return
ExtractPushUpRight
;
return
ExtractPushUpRight
;
if
(
name
.
Equals
(
"JumpPushUpLeft"
))
return
ExtractJumpPushUpLeft
;
if
(
name
.
Equals
(
"JumpPushUpRight"
))
return
ExtractJumpPushUpRight
;
if
(
name
.
Equals
(
"GuardLeft"
))
if
(
name
.
Equals
(
"GuardLeft"
))
return
ExtractGuardLeft
;
return
ExtractGuardLeft
;
if
(
name
.
Equals
(
"GuardRight"
))
if
(
name
.
Equals
(
"GuardRight"
))
...
...
This diff is collapsed.
Click to expand it.
Assets/Script/JudgeManager.cs
View file @
6cfca48c
...
@@ -266,7 +266,7 @@ public class JudgeManager : MonoBehaviour
...
@@ -266,7 +266,7 @@ public class JudgeManager : MonoBehaviour
private
class
NoteCondition
private
class
NoteCondition
{
{
public
static
Dictionary
<
string
,
InputStatus
>
Judge
Input
(
Note
note
)
public
static
Dictionary
<
string
,
InputStatus
>
Wrong
Input
(
Note
note
)
{
{
if
(
note
is
MotionNote
)
if
(
note
is
MotionNote
)
return
new
Dictionary
<
string
,
InputStatus
>
return
new
Dictionary
<
string
,
InputStatus
>
...
@@ -281,6 +281,21 @@ public class JudgeManager : MonoBehaviour
...
@@ -281,6 +281,21 @@ public class JudgeManager : MonoBehaviour
};
};
}
}
public
static
Dictionary
<
string
,
InputStatus
>
JudgeInput
(
Note
note
)
{
if
(
note
is
MotionNote
)
return
new
Dictionary
<
string
,
InputStatus
>
{
{
"short"
,
InputManager
.
Instance
.
ShortMotionToInput
((
note
as
MotionNote
).
MotionName
)
},
{
"long"
,
InputManager
.
Instance
.
LongMotionToInput
((
note
as
MotionNote
).
MotionName
)
}
};
return
new
Dictionary
<
string
,
InputStatus
>
{
{
"short"
,
InputManager
.
Instance
.
ShortButtonStat
},
{
"long"
,
InputManager
.
Instance
.
LongButtonStat
}
};
}
public
static
bool
IsShortNoteEntered
(
Note
note
)
public
static
bool
IsShortNoteEntered
(
Note
note
)
{
{
return
JudgeInput
(
note
)[
"short"
]
==
InputStatus
.
Entered
;
return
JudgeInput
(
note
)[
"short"
]
==
InputStatus
.
Entered
;
...
@@ -321,7 +336,7 @@ public class JudgeManager : MonoBehaviour
...
@@ -321,7 +336,7 @@ public class JudgeManager : MonoBehaviour
public
static
bool
IsWrongInput
(
Note
note
)
public
static
bool
IsWrongInput
(
Note
note
)
{
{
var
stat
=
Judge
Input
(
note
);
var
stat
=
Wrong
Input
(
note
);
return
stat
[
"short"
]
==
InputStatus
.
Entered
||
return
stat
[
"short"
]
==
InputStatus
.
Entered
||
stat
[
"long"
]
==
InputStatus
.
Entered
||
stat
[
"long"
]
==
InputStatus
.
Entered
||
stat
[
"long"
]
==
InputStatus
.
Continuing
;
stat
[
"long"
]
==
InputStatus
.
Continuing
;
...
...
This diff is collapsed.
Click to expand it.
Assets/Script/MotionNote.cs
View file @
6cfca48c
...
@@ -20,6 +20,8 @@ public abstract class MotionNote : Note
...
@@ -20,6 +20,8 @@ public abstract class MotionNote : Note
public
MotionSampleDisplay
MotionSampleDisplay
{
get
;
set
;
}
public
MotionSampleDisplay
MotionSampleDisplay
{
get
;
set
;
}
public
string
MotionName
{
get
;
protected
set
;
}
public
static
readonly
Dictionary
<
string
,
Type
>
keymap
public
static
readonly
Dictionary
<
string
,
Type
>
keymap
=
new
Dictionary
<
string
,
Type
>
=
new
Dictionary
<
string
,
Type
>
{
{
...
...
This diff is collapsed.
Click to expand it.
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