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
Jan 22, 2018
by
16이상민
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactoring about motion notes
parent
b6e8f197
Changes
12
Expand all
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
public
Clap
(
string
key
,
float
start
,
float
end
=
0f
)
:
this
(
start
,
end
)
{
MotionName
=
"Clap"
;
}
public
Clap
(
float
start
,
float
end
=
0f
)
:
base
(
start
,
end
)
{
...
...
Assets/MotionNotes/Guard.cs
View file @
6cfca48c
...
...
@@ -29,6 +29,7 @@ public class Guard : MotionNote
|
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
;
MotionName
=
"GuardBoth"
;
break
;
case
"LG"
:
hand
=
Hand
.
Left
;
...
...
@@ -37,6 +38,7 @@ public class Guard : MotionNote
|
MotionState
.
HAND_MOVE_DOWN_LEFT
;
done
=
MotionState
.
GUARD_BASE_LEFT
|
MotionState
.
HAND_MOVE_UP_LEFT
;
MotionName
=
"GuardLeft"
;
break
;
case
"RG"
:
hand
=
Hand
.
Right
;
...
...
@@ -45,6 +47,7 @@ public class Guard : MotionNote
|
MotionState
.
HAND_MOVE_DOWN_RIGHT
;
done
=
MotionState
.
GUARD_BASE_RIGHT
|
MotionState
.
HAND_MOVE_UP_RIGHT
;
MotionName
=
"GuardRight"
;
break
;
}
}
...
...
Assets/MotionNotes/HandDown.cs
View file @
6cfca48c
...
...
@@ -26,16 +26,19 @@ public class HandDown : MotionNote
hand
=
Hand
.
Both
;
image
=
LoadNewSprite
(
"Assets/MotionNotes/BD.png"
);
done
=
MotionState
.
HAND_DOWN_LEFT
|
MotionState
.
HAND_DOWN_RIGHT
;
MotionName
=
"HandDownBoth"
;
break
;
case
"LD"
:
hand
=
Hand
.
Left
;
image
=
LoadNewSprite
(
"Assets/MotionNotes/LD.png"
);
done
=
MotionState
.
HAND_DOWN_LEFT
;
MotionName
=
"HandDownLeft"
;
break
;
case
"RD"
:
hand
=
Hand
.
Right
;
image
=
LoadNewSprite
(
"Assets/MotionNotes/RD.png"
);
done
=
MotionState
.
HAND_DOWN_RIGHT
;
MotionName
=
"HandDownRight"
;
break
;
}
}
...
...
Assets/MotionNotes/HandUp.cs
View file @
6cfca48c
...
...
@@ -26,16 +26,19 @@ public class HandUp : MotionNote
hand
=
Hand
.
Both
;
image
=
LoadNewSprite
(
"Assets/MotionNotes/BU.png"
);
done
=
MotionState
.
HAND_UP_LEFT
|
MotionState
.
HAND_UP_RIGHT
;
MotionName
=
"HandUpBoth"
;
break
;
case
"LU"
:
hand
=
Hand
.
Left
;
image
=
LoadNewSprite
(
"Assets/MotionNotes/LU.png"
);
done
=
MotionState
.
HAND_UP_LEFT
;
MotionName
=
"HandUpLeft"
;
break
;
case
"RU"
:
hand
=
Hand
.
Right
;
image
=
LoadNewSprite
(
"Assets/MotionNotes/RU.png"
);
done
=
MotionState
.
HAND_UP_RIGHT
;
MotionName
=
"HandUpRight"
;
break
;
}
}
...
...
Assets/MotionNotes/Headphone.cs
View file @
6cfca48c
...
...
@@ -26,16 +26,19 @@ public class Headphone : MotionNote
hand
=
Hand
.
Both
;
image
=
LoadNewSprite
(
"Assets/MotionNotes/BH.png"
);
done
=
MotionState
.
HEADPHONE_LEFT
|
MotionState
.
HEADPHONE_RIGHT
;
MotionName
=
"HeadphoneBoth"
;
break
;
case
"LH"
:
hand
=
Hand
.
Left
;
image
=
LoadNewSprite
(
"Assets/MotionNotes/LH.png"
);
done
=
MotionState
.
HEADPHONE_LEFT
;
MotionName
=
"HeadphoneLeft"
;
break
;
case
"RH"
:
hand
=
Hand
.
Right
;
image
=
LoadNewSprite
(
"Assets/MotionNotes/RH.png"
);
done
=
MotionState
.
HEADPHONE_RIGHT
;
MotionName
=
"HeadphoneRight"
;
break
;
}
}
...
...
Assets/MotionNotes/Jesus.cs
View file @
6cfca48c
...
...
@@ -15,6 +15,7 @@ public class Jesus : MotionNote
public
Jesus
(
string
key
,
float
start
,
float
end
=
0f
)
:
this
(
start
,
end
)
{
MotionName
=
"Jesus"
;
}
public
Jesus
(
float
start
,
float
end
=
0f
)
:
base
(
start
,
end
)
{
...
...
Assets/MotionNotes/Jump.cs
View file @
6cfca48c
...
...
@@ -15,6 +15,7 @@ public class Jump : MotionNote
public
Jump
(
string
key
,
float
start
,
float
end
=
0f
)
:
this
(
start
,
end
)
{
MotionName
=
"Jump"
;
}
public
Jump
(
float
start
,
float
end
=
0f
)
:
base
(
start
,
end
)
{
...
...
Assets/MotionNotes/OnTheTable.cs
View file @
6cfca48c
...
...
@@ -15,6 +15,7 @@ public class OnTheTable : MotionNote
public
OnTheTable
(
string
key
,
float
start
,
float
end
=
0f
)
:
this
(
start
,
end
)
{
MotionName
=
"OnTheTable"
;
}
public
OnTheTable
(
float
start
,
float
end
=
0f
)
:
base
(
start
,
end
)
{
...
...
Assets/MotionNotes/PushUp.cs
View file @
6cfca48c
...
...
@@ -27,36 +27,42 @@ public class PushUp : MotionNote
image
=
LoadNewSprite
(
"Assets/MotionNotes/BP.png"
);
prepare
=
MotionState
.
HAND_MOVE_UP_LEFT
|
MotionState
.
HAND_MOVE_UP_RIGHT
;
done
=
MotionState
.
HAND_MOVE_DOWN_LEFT
|
MotionState
.
HAND_MOVE_DOWN_RIGHT
;
MotionName
=
"PushUpBoth"
;
break
;
case
"LP"
:
hand
=
Hand
.
Left
;
image
=
LoadNewSprite
(
"Assets/MotionNotes/LP.png"
);
prepare
=
MotionState
.
HAND_MOVE_UP_LEFT
;
done
=
MotionState
.
HAND_MOVE_DOWN_LEFT
;
MotionName
=
"PushUpLeft"
;
break
;
case
"RP"
:
hand
=
Hand
.
Right
;
image
=
LoadNewSprite
(
"Assets/MotionNotes/RP.png"
);
prepare
=
MotionState
.
HAND_MOVE_UP_RIGHT
;
done
=
MotionState
.
HAND_MOVE_DOWN_RIGHT
;
MotionName
=
"PushUpRight"
;
break
;
case
"BK"
:
hand
=
Hand
.
Both
;
image
=
LoadNewSprite
(
"Assets/MotionNotes/BK.png"
);
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
;
MotionName
=
"JumpPushUpBoth"
;
break
;
case
"LK"
:
hand
=
Hand
.
Left
;
image
=
LoadNewSprite
(
"Assets/MotionNotes/LK.png"
);
prepare
=
MotionState
.
HAND_MOVE_UP_LEFT
|
MotionState
.
JUMP_PREPARE
;
done
=
MotionState
.
HAND_MOVE_DOWN_LEFT
|
MotionState
.
JUMP_DONE
;
MotionName
=
"JumpPushUpLeft"
;
break
;
case
"RK"
:
hand
=
Hand
.
Right
;
image
=
LoadNewSprite
(
"Assets/MotionNotes/RK.png"
);
prepare
=
MotionState
.
HAND_MOVE_UP_RIGHT
|
MotionState
.
JUMP_PREPARE
;
done
=
MotionState
.
HAND_MOVE_DOWN_RIGHT
|
MotionState
.
JUMP_DONE
;
MotionName
=
"JumpPushUpRight"
;
break
;
}
}
...
...
Assets/Script/InputManager.cs
View file @
6cfca48c
This diff is collapsed.
Click to expand it.
Assets/Script/JudgeManager.cs
View file @
6cfca48c
...
...
@@ -266,7 +266,7 @@ public class JudgeManager : MonoBehaviour
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
)
return
new
Dictionary
<
string
,
InputStatus
>
...
...
@@ -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
)
{
return
JudgeInput
(
note
)[
"short"
]
==
InputStatus
.
Entered
;
...
...
@@ -321,7 +336,7 @@ public class JudgeManager : MonoBehaviour
public
static
bool
IsWrongInput
(
Note
note
)
{
var
stat
=
Judge
Input
(
note
);
var
stat
=
Wrong
Input
(
note
);
return
stat
[
"short"
]
==
InputStatus
.
Entered
||
stat
[
"long"
]
==
InputStatus
.
Entered
||
stat
[
"long"
]
==
InputStatus
.
Continuing
;
...
...
Assets/Script/MotionNote.cs
View file @
6cfca48c
...
...
@@ -20,6 +20,8 @@ public abstract class MotionNote : Note
public
MotionSampleDisplay
MotionSampleDisplay
{
get
;
set
;
}
public
string
MotionName
{
get
;
protected
set
;
}
public
static
readonly
Dictionary
<
string
,
Type
>
keymap
=
new
Dictionary
<
string
,
Type
>
{
...
...
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