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
d94eeb54
Commit
d94eeb54
authored
Aug 25, 2017
by
Chae Ho Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP
parent
6e0695fb
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
240 additions
and
111 deletions
+240
-111
Clap.cs
Assets/MotionNotes/Clap.cs
+17
-4
Guard.cs
Assets/MotionNotes/Guard.cs
+29
-4
Jump.cs
Assets/MotionNotes/Jump.cs
+13
-4
Piano.cs
Assets/MotionNotes/Piano.cs
+0
-55
PushUp.cs
Assets/MotionNotes/PushUp.cs
+10
-1
LMO.prefab
Assets/Resources/LMO.prefab
+3
-3
Motion Sample Display.prefab
Assets/Resources/Motion Sample Display.prefab
+1
-1
InGame.unity
Assets/Scene/InGame.unity
+2
-2
Result.unity
Assets/Scene/Result.unity
+10
-9
GameManager.cs
Assets/Script/GameManager.cs
+3
-2
Judge.cs
Assets/Script/Judge.cs
+6
-4
JudgeManager.cs
Assets/Script/JudgeManager.cs
+92
-16
MotionNote.cs
Assets/Script/MotionNote.cs
+7
-5
MotionSampleDisplay.cs
Assets/Script/MotionSampleDisplay.cs
+1
-1
TrackManager.cs
Assets/Script/TrackManager.cs
+3
-0
JJR.bpe
Assets/Tracks/Test/JJR.bpe
+12
-0
JJR.bpe.meta
Assets/Tracks/Test/JJR.bpe.meta
+8
-0
REC001.WAV
Assets/Tracks/Test/REC001.WAV
+0
-0
REC001.WAV.meta
Assets/Tracks/Test/REC001.WAV.meta
+23
-0
No files found.
Assets/MotionNotes/Clap.cs
View file @
d94eeb54
...
@@ -20,14 +20,27 @@ public class Clap : MotionNote
...
@@ -20,14 +20,27 @@ public class Clap : MotionNote
{
{
}
}
public
override
IEnumerator
Checkpoint
()
private
bool
isChecked
=
false
;
public
override
bool
IsChecked
{
{
var
motion
=
InputManager
.
Instance
.
CurrentMotionState
;
get
{
return
isChecked
;
}
}
public
override
IEnumerator
Checkpoint
(
MotionNote
obj
)
{
IsCoroutineExecuted
=
true
;
var
motion
=
InputManager
.
Instance
.
CurrentMotionState
;
while
((
motion
&
MotionState
.
CLAP_PREPARE
)
==
0
)
while
((
motion
&
MotionState
.
CLAP_PREPARE
)
==
0
)
{
yield
return
null
;
yield
return
null
;
}
I
sChecked
=
true
;
i
sChecked
=
true
;
yield
break
;
yield
break
;
}
}
...
@@ -36,7 +49,7 @@ public class Clap : MotionNote
...
@@ -36,7 +49,7 @@ public class Clap : MotionNote
{
{
var
motion
=
InputManager
.
Instance
.
CurrentMotionState
;
var
motion
=
InputManager
.
Instance
.
CurrentMotionState
;
if
((
motion
&
MotionState
.
CLAP_DONE
)
!=
0
)
if
(
isChecked
&&
(
motion
&
MotionState
.
CLAP_DONE
)
!=
0
)
return
true
;
return
true
;
return
false
;
return
false
;
...
...
Assets/MotionNotes/Guard.cs
View file @
d94eeb54
...
@@ -7,15 +7,40 @@ public class Guard : MotionNote
...
@@ -7,15 +7,40 @@ public class Guard : MotionNote
enum
Hand
{
Both
,
Left
,
Right
}
enum
Hand
{
Both
,
Left
,
Right
}
Hand
hand
;
Hand
hand
;
private
static
Sprite
image
=
LoadNewSprite
(
""
);
private
static
Sprite
imageB
=
LoadNewSprite
(
""
);
private
static
Sprite
imageL
=
LoadNewSprite
(
""
);
private
static
Sprite
imageR
=
LoadNewSprite
(
""
);
public
override
Sprite
Image
public
override
Sprite
Image
{
{
get
get
{
{
return
image
;
switch
(
hand
)
{
default
:
case
Hand
.
Both
:
return
imageB
;
case
Hand
.
Left
:
return
imageL
;
case
Hand
.
Right
:
return
imageR
;
}
}
}
private
bool
isChecked
=
false
;
public
override
bool
IsChecked
{
get
{
return
isChecked
;
}
}
}
}
public
Guard
(
string
key
,
float
timing
)
:
this
(
key
,
timing
,
0f
)
{
}
public
Guard
(
string
key
,
float
timing
,
float
end
=
0f
)
:
this
(
timing
,
end
)
public
Guard
(
string
key
,
float
timing
,
float
end
=
0f
)
:
this
(
timing
,
end
)
{
{
switch
(
key
)
switch
(
key
)
...
@@ -35,7 +60,7 @@ public class Guard : MotionNote
...
@@ -35,7 +60,7 @@ public class Guard : MotionNote
{
{
}
}
public
override
IEnumerator
Checkpoint
()
public
override
IEnumerator
Checkpoint
(
MotionNote
obj
)
{
{
var
motionState
=
InputManager
.
Instance
.
CurrentMotionState
;
var
motionState
=
InputManager
.
Instance
.
CurrentMotionState
;
var
motion
=
motionState
;
var
motion
=
motionState
;
...
@@ -50,6 +75,6 @@ public class Guard : MotionNote
...
@@ -50,6 +75,6 @@ public class Guard : MotionNote
public
override
bool
FinalJudgeAction
()
public
override
bool
FinalJudgeAction
()
{
{
throw
new
NotImplementedException
()
;
return
false
;
}
}
}
}
Assets/MotionNotes/Jump.cs
View file @
d94eeb54
...
@@ -4,7 +4,7 @@ using UnityEngine;
...
@@ -4,7 +4,7 @@ using UnityEngine;
public
class
Jump
:
MotionNote
public
class
Jump
:
MotionNote
{
{
private
static
Sprite
image
=
new
Sprite
(
);
private
static
Sprite
image
=
LoadNewSprite
(
"Assets/MotionNotes/JP.png"
);
public
override
Sprite
Image
public
override
Sprite
Image
{
{
get
get
...
@@ -21,16 +21,25 @@ public class Jump : MotionNote
...
@@ -21,16 +21,25 @@ public class Jump : MotionNote
downCount
=
0
;
downCount
=
0
;
}
}
private
float
spineHeight
;
private
bool
isChecked
=
false
;
public
override
bool
IsChecked
{
get
{
return
isChecked
;
}
}
private
float
spineHeight
=
0f
;
private
int
downCount
;
private
int
downCount
;
public
override
IEnumerator
Checkpoint
()
public
override
IEnumerator
Checkpoint
(
MotionNote
obj
)
{
{
float
currentSpineHeight
float
currentSpineHeight
=
InputManager
.
Instance
=
InputManager
.
Instance
.
Joints
[
Windows
.
Kinect
.
JointType
.
SpineBase
].
Position
.
Y
;
.
Joints
[
Windows
.
Kinect
.
JointType
.
SpineBase
].
Position
.
Y
;
while
(
downCount
<
10
&&
currentSpineHeight
<=
spineHeight
-
0.1f
)
while
(
spineHeight
==
0f
||
downCount
<
10
&&
currentSpineHeight
<=
spineHeight
-
0.1f
)
{
{
spineHeight
=
currentSpineHeight
;
spineHeight
=
currentSpineHeight
;
currentSpineHeight
currentSpineHeight
...
...
Assets/MotionNotes/Piano.cs
deleted
100644 → 0
View file @
6e0695fb
using
System
;
using
System.Collections
;
using
UnityEngine
;
public
class
Piano
:
MotionNote
{
enum
Hand
{
Both
,
Left
,
Right
}
Hand
hand
;
private
static
Sprite
image
=
LoadNewSprite
(
""
);
public
override
Sprite
Image
{
get
{
return
image
;
}
}
public
Piano
(
string
key
,
float
timing
)
:
this
(
timing
)
{
switch
(
key
)
{
case
"BI"
:
hand
=
Hand
.
Both
;
break
;
case
"LI"
:
hand
=
Hand
.
Left
;
break
;
case
"RI"
:
hand
=
Hand
.
Right
;
break
;
}
}
public
Piano
(
float
timing
)
:
base
(
timing
)
{
}
public
override
IEnumerator
Checkpoint
()
{
var
motionState
=
InputManager
.
Instance
.
CurrentMotionState
;
var
motion
=
motionState
;
while
(
motion
!=
MotionState
.
CLAP_PREPARE
)
yield
return
false
;
Activated
=
true
;
yield
break
;
}
public
override
bool
FinalJudgeAction
()
{
throw
new
NotImplementedException
();
}
}
Assets/MotionNotes/PushUp.cs
View file @
d94eeb54
...
@@ -35,7 +35,16 @@ public class PushUp : MotionNote
...
@@ -35,7 +35,16 @@ public class PushUp : MotionNote
{
{
}
}
public
override
IEnumerator
Checkpoint
()
private
bool
isChecked
=
false
;
public
override
bool
IsChecked
{
get
{
return
isChecked
;
}
}
public
override
IEnumerator
Checkpoint
(
MotionNote
obj
)
{
{
var
motionState
=
InputManager
.
Instance
.
CurrentMotionState
;
var
motionState
=
InputManager
.
Instance
.
CurrentMotionState
;
var
motion
=
motionState
;
var
motion
=
motionState
;
...
...
Assets/Resources/LMO.prefab
View file @
d94eeb54
...
@@ -90,7 +90,7 @@ MonoBehaviour:
...
@@ -90,7 +90,7 @@ MonoBehaviour:
m_Name
:
m_Name
:
m_EditorClassIdentifier
:
m_EditorClassIdentifier
:
m_Material
:
{
fileID
:
0
}
m_Material
:
{
fileID
:
0
}
m_Color
:
{
r
:
1
,
g
:
0
,
b
:
0
,
a
:
0.627451
}
m_Color
:
{
r
:
1
,
g
:
1
,
b
:
1
,
a
:
0
}
m_RaycastTarget
:
1
m_RaycastTarget
:
1
m_OnCullStateChanged
:
m_OnCullStateChanged
:
m_PersistentCalls
:
m_PersistentCalls
:
...
@@ -117,7 +117,7 @@ MonoBehaviour:
...
@@ -117,7 +117,7 @@ MonoBehaviour:
m_Name
:
m_Name
:
m_EditorClassIdentifier
:
m_EditorClassIdentifier
:
m_Material
:
{
fileID
:
0
}
m_Material
:
{
fileID
:
0
}
m_Color
:
{
r
:
1
,
g
:
0
,
b
:
0
,
a
:
1
}
m_Color
:
{
r
:
1
,
g
:
1
,
b
:
1
,
a
:
0
}
m_RaycastTarget
:
1
m_RaycastTarget
:
1
m_OnCullStateChanged
:
m_OnCullStateChanged
:
m_PersistentCalls
:
m_PersistentCalls
:
...
@@ -144,7 +144,7 @@ MonoBehaviour:
...
@@ -144,7 +144,7 @@ MonoBehaviour:
m_Name
:
m_Name
:
m_EditorClassIdentifier
:
m_EditorClassIdentifier
:
m_Material
:
{
fileID
:
0
}
m_Material
:
{
fileID
:
0
}
m_Color
:
{
r
:
1
,
g
:
0
,
b
:
0
,
a
:
1
}
m_Color
:
{
r
:
1
,
g
:
1
,
b
:
1
,
a
:
0
}
m_RaycastTarget
:
1
m_RaycastTarget
:
1
m_OnCullStateChanged
:
m_OnCullStateChanged
:
m_PersistentCalls
:
m_PersistentCalls
:
...
...
Assets/Resources/Motion Sample Display.prefab
View file @
d94eeb54
...
@@ -66,7 +66,7 @@ Transform:
...
@@ -66,7 +66,7 @@ Transform:
m_PrefabInternal
:
{
fileID
:
100100000
}
m_PrefabInternal
:
{
fileID
:
100100000
}
m_GameObject
:
{
fileID
:
1870857072681458
}
m_GameObject
:
{
fileID
:
1870857072681458
}
m_LocalRotation
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
1
}
m_LocalRotation
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
1
}
m_LocalPosition
:
{
x
:
0
,
y
:
5.5
,
z
:
-1.6
}
m_LocalPosition
:
{
x
:
0
,
y
:
6.5
,
z
:
-3
}
m_LocalScale
:
{
x
:
0.5
,
y
:
0.5
,
z
:
1
}
m_LocalScale
:
{
x
:
0.5
,
y
:
0.5
,
z
:
1
}
m_Children
:
m_Children
:
-
{
fileID
:
4514239179313720
}
-
{
fileID
:
4514239179313720
}
...
...
Assets/Scene/InGame.unity
View file @
d94eeb54
...
@@ -1924,8 +1924,8 @@ RectTransform:
...
@@ -1924,8 +1924,8 @@ RectTransform:
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_AnchorMin
:
{
x
:
0.5
,
y
:
0
}
m_AnchorMin
:
{
x
:
0.5
,
y
:
0
}
m_AnchorMax
:
{
x
:
0.5
,
y
:
0
}
m_AnchorMax
:
{
x
:
0.5
,
y
:
0
}
m_AnchoredPosition
:
{
x
:
0
,
y
:
8
0
}
m_AnchoredPosition
:
{
x
:
0
,
y
:
20
0
}
m_SizeDelta
:
{
x
:
120
,
y
:
12
0
}
m_SizeDelta
:
{
x
:
200
,
y
:
20
0
}
m_Pivot
:
{
x
:
0.5
,
y
:
0.5
}
m_Pivot
:
{
x
:
0.5
,
y
:
0.5
}
---
!u!114
&1173591430
---
!u!114
&1173591430
MonoBehaviour
:
MonoBehaviour
:
...
...
Assets/Scene/Result.unity
View file @
d94eeb54
...
@@ -1174,24 +1174,25 @@ MonoBehaviour:
...
@@ -1174,24 +1174,25 @@ MonoBehaviour:
m_GameObject
:
{
fileID
:
1243499222
}
m_GameObject
:
{
fileID
:
1243499222
}
m_Enabled
:
1
m_Enabled
:
1
m_EditorHideFlags
:
0
m_EditorHideFlags
:
0
m_Script
:
{
fileID
:
-
98529514
,
guid
:
f70555f144d8491a825f0804e09c671c
,
type
:
3
}
m_Script
:
{
fileID
:
-
765806418
,
guid
:
f70555f144d8491a825f0804e09c671c
,
type
:
3
}
m_Name
:
m_Name
:
m_EditorClassIdentifier
:
m_EditorClassIdentifier
:
m_Material
:
{
fileID
:
0
}
m_Material
:
{
fileID
:
0
}
m_Color
:
{
r
:
1
,
g
:
1
,
b
:
1
,
a
:
1
}
m_Color
:
{
r
:
1
,
g
:
1
,
b
:
1
,
a
:
0.712
}
m_RaycastTarget
:
1
m_RaycastTarget
:
1
m_OnCullStateChanged
:
m_OnCullStateChanged
:
m_PersistentCalls
:
m_PersistentCalls
:
m_Calls
:
[]
m_Calls
:
[]
m_TypeName
:
UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
m_TypeName
:
UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_Texture
:
{
fileID
:
0
}
m_Sprite
:
{
fileID
:
0
}
m_UVRect
:
m_Type
:
0
serializedVersion
:
2
m_PreserveAspect
:
0
x
:
0
m_FillCenter
:
1
y
:
0
m_FillMethod
:
4
width
:
1
m_FillAmount
:
1
height
:
1
m_FillClockwise
:
1
m_FillOrigin
:
0
---
!u!222
&1243499228
---
!u!222
&1243499228
CanvasRenderer
:
CanvasRenderer
:
m_ObjectHideFlags
:
0
m_ObjectHideFlags
:
0
...
...
Assets/Script/GameManager.cs
View file @
d94eeb54
...
@@ -56,8 +56,9 @@ public class GameManager : MonoBehaviour {
...
@@ -56,8 +56,9 @@ public class GameManager : MonoBehaviour {
{
{
}
}
public
void
SceneTransition
(
string
sceneName
)
public
void
SceneTransition
(
string
sceneName
,
bool
additive
=
false
)
{
{
SceneManager
.
LoadScene
(
"Scene/"
+
sceneName
);
SceneManager
.
LoadScene
(
"Scene/"
+
sceneName
,
additive
?
LoadSceneMode
.
Additive
:
LoadSceneMode
.
Single
);
}
}
}
}
Assets/Script/Judge.cs
View file @
d94eeb54
...
@@ -17,7 +17,7 @@ public class Judge
...
@@ -17,7 +17,7 @@ public class Judge
private
Judge
()
private
Judge
()
{
{
ButtonTimingRange
=
0f
;
ButtonTimingRange
=
0f
;
MotionTimingRange
=
ButtonTimingRange
;
ButtonTimingRange
=
0f
;
Score
=
0
;
Score
=
0
;
IsBreak
=
false
;
IsBreak
=
false
;
Color
=
Color
.
black
;
Color
=
Color
.
black
;
...
@@ -28,20 +28,22 @@ public class Judge
...
@@ -28,20 +28,22 @@ public class Judge
public
string
Name
{
get
;
private
set
;
}
public
string
Name
{
get
;
private
set
;
}
public
float
ButtonTimingRange
{
get
;
private
set
;
}
public
float
ButtonTimingRange
{
get
;
private
set
;
}
public
float
MotionTimingRange
{
get
;
private
set
;
}
public
int
Score
{
get
;
private
set
;
}
public
int
Score
{
get
;
private
set
;
}
public
bool
IsBreak
{
get
;
private
set
;
}
public
bool
IsBreak
{
get
;
private
set
;
}
public
Color
Color
{
get
;
private
set
;
}
public
Color
Color
{
get
;
private
set
;
}
public
static
readonly
Judge
MISS
=
JudgeList
.
Last
();
public
static
readonly
Judge
MISS
=
JudgeList
.
Last
();
p
rivate
static
readonly
p
ublic
static
readonly
float
MaxButtonTimingRange
=
JudgeList
[
2
].
ButtonTimingRange
;
float
MaxButtonTimingRange
=
JudgeList
[
2
].
ButtonTimingRange
;
public
static
Judge
TestJudge
(
Note
note
,
float
elapsedTime
,
bool
end
=
false
)
public
static
Judge
TestJudge
(
Note
note
,
float
elapsedTime
,
bool
end
=
false
,
bool
test
=
false
)
{
{
float
timing
=
end
?
note
.
EndTiming
:
note
.
StartTiming
;
float
timing
=
end
?
note
.
EndTiming
:
note
.
StartTiming
;
float
difference
=
Mathf
.
Abs
(
elapsedTime
-
timing
);
float
difference
=
Mathf
.
Abs
(
elapsedTime
-
timing
);
if
(
test
)
Debug
.
Log
(
elapsedTime
-
timing
);
foreach
(
Judge
judge
in
JudgeList
)
foreach
(
Judge
judge
in
JudgeList
)
{
{
if
(
difference
<
judge
.
ButtonTimingRange
)
if
(
difference
<
judge
.
ButtonTimingRange
)
...
...
Assets/Script/JudgeManager.cs
View file @
d94eeb54
...
@@ -54,6 +54,32 @@ public class JudgeManager : MonoBehaviour
...
@@ -54,6 +54,32 @@ public class JudgeManager : MonoBehaviour
}
}
}
}
private
float
elapsedMotion
;
private
float
motionTimeout
;
private
void
MotionGuageReset
(
float
timeout
=
0f
)
{
if
(
timeout
<=
0f
)
{
elapsedMotion
=
0f
;
motionGuage
.
transform
.
parent
.
gameObject
.
SetActive
(
false
);
return
;
}
motionTimeout
=
timeout
;
motionGuage
.
transform
.
parent
.
gameObject
.
SetActive
(
true
);
motionGuage
.
SetActive
(
true
);
}
private
void
MotionGuageUpdate
()
{
if
(
motionGuage
.
transform
.
parent
.
gameObject
.
activeInHierarchy
)
elapsedMotion
+=
Time
.
deltaTime
*
1000f
;
if
(
elapsedMotion
>=
motionTimeout
)
MotionGuageReset
();
else
motionGuage
.
GetComponent
<
Image
>().
fillAmount
=
elapsedMotion
/
motionTimeout
;
}
// Use this for initialization
// Use this for initialization
void
Start
()
void
Start
()
{
{
...
@@ -68,22 +94,29 @@ public class JudgeManager : MonoBehaviour
...
@@ -68,22 +94,29 @@ public class JudgeManager : MonoBehaviour
initialPos
=
offset
.
transform
.
position
;
initialPos
=
offset
.
transform
.
position
;
judgeText
.
SetActive
(
false
);
judgeText
.
SetActive
(
false
);
motionGuage
.
transform
.
parent
.
gameObject
.
SetActive
(
false
);
MotionGuageReset
(
);
activatedNotes
=
new
List
<
MotionNote
>();
activatedNotes
=
new
List
<
MotionNote
>();
LoadNotes
(
GameManager
.
Instance
.
CurrentTrack
.
Notes
);
LoadNotes
(
GameManager
.
Instance
.
CurrentTrack
.
Notes
);
Instantiate
(
GameManager
.
Instance
.
CurrentTrack
.
BGM
);
//
Instantiate(GameManager.Instance.CurrentTrack.BGM);
}
}
// Update is called once per frame
// Update is called once per frame
void
Update
()
void
Update
()
{
{
elapsedTime
+=
Time
.
deltaTime
*
1000
;
elapsedTime
+=
Time
.
deltaTime
*
1000
;
float
timing
=
elapsedTime
+
latency
;
float
timing
=
elapsedTime
;
offset
.
transform
.
position
=
new
Vector3
(-
timing
*
ScrollSpeed
,
0
,
0
);
offset
.
transform
.
position
=
new
Vector3
(-
timing
*
ScrollSpeed
,
0
,
0
);
MotionGuageUpdate
();
if
(
noteobj
.
transform
.
childCount
<=
0
&&
smobj
.
transform
.
childCount
<=
0
&&
lmobj
.
transform
.
childCount
<=
0
)
Invoke
(
"ShowResult"
,
2f
);
new
Action
(()
=>
new
Action
(()
=>
{
{
if
(
noteobj
.
transform
.
childCount
<=
0
)
if
(
noteobj
.
transform
.
childCount
<=
0
)
...
@@ -143,29 +176,45 @@ public class JudgeManager : MonoBehaviour
...
@@ -143,29 +176,45 @@ public class JudgeManager : MonoBehaviour
GameObject
smo
=
smobj
.
transform
.
GetChild
(
0
).
gameObject
;
GameObject
smo
=
smobj
.
transform
.
GetChild
(
0
).
gameObject
;
MotionNote
smnote
=
(
MotionNote
)
smo
.
GetComponent
<
Note
.
Controller
>().
Instance
;
MotionNote
smnote
=
(
MotionNote
)
smo
.
GetComponent
<
Note
.
Controller
>().
Instance
;
if
(!
smnote
.
Activated
&&
elapsedTime
>=
(
smnote
.
StartTiming
-
MsPerBeat
))
if
(!
smnote
.
IsCoroutineExecuted
)
{
StartCoroutine
(
smnote
.
Checkpoint
(
smnote
));
}
if
(!
smnote
.
Activated
&&
timing
>=
(
smnote
.
StartTiming
-
MsPerBeat
))
{
{
GameObject
motionSample
=
Instantiate
(
motionSampleDisplayPrefab
);
GameObject
motionSample
=
Instantiate
(
motionSampleDisplayPrefab
);
MotionSampleDisplay
msd
=
motionSample
.
GetComponent
<
MotionSampleDisplay
>();
MotionSampleDisplay
msd
=
motionSample
.
GetComponent
<
MotionSampleDisplay
>();
msd
.
sprite
=
smnote
.
Image
;
msd
.
sprite
=
smnote
.
Image
;
msd
.
timeout
=
MsPerBeat
*
2
;
msd
.
timeout
=
MsPerBeat
;
smnote
.
Activated
=
true
;
smnote
.
Activated
=
true
;
smnote
.
MotionSampleDisplay
=
msd
;
smnote
.
MotionSampleDisplay
=
msd
;
activatedNotes
.
Add
(
smnote
);
activatedNotes
.
Add
(
smnote
);
smnote
.
Component
.
transform
.
SetParent
(
offset
.
transform
);
}
}
for
(
int
i
=
activatedNotes
.
Count
-
1
;
i
>=
0
;
i
--)
for
(
int
i
=
activatedNotes
.
Count
-
1
;
i
>=
0
;
i
--)
{
{
if
((
InputManager
.
Instance
.
CurrentMotionState
&
MotionState
.
CLAP_DONE
)
!=
0
)
{
foreach
(
MotionNote
anote
in
activatedNotes
)
{
Debug
.
Log
(
anote
.
IsChecked
);
}
}
MotionNote
note
=
activatedNotes
[
i
];
MotionNote
note
=
activatedNotes
[
i
];
if
(
note
.
FinalJudgeAction
()
||
elapsedTime
>
note
.
EndTiming
+
Judge
.
MISS
.
MotionTimingRange
)
if
(
note
.
FinalJudgeAction
()
||
(
timing
>
(
note
.
EndTiming
+
Judge
.
MaxButtonTimingRange
))
)
{
{
SetJudge
(
Judge
.
TestJudge
(
note
,
timing
,
true
));
Debug
.
Log
(
note
.
IsChecked
);
SetJudge
(
Judge
.
TestJudge
(
note
,
timing
,
false
,
true
),
true
);
activatedNotes
.
RemoveAt
(
i
);
activatedNotes
.
RemoveAt
(
i
);
DeactivateNote
(
note
);
DeactivateNote
(
note
);
}
}
}
}
})();
})();
new
Action
(()
=>
new
Action
(()
=>
{
{
if
(
lmobj
.
transform
.
childCount
<=
0
)
if
(
lmobj
.
transform
.
childCount
<=
0
)
...
@@ -174,15 +223,33 @@ public class JudgeManager : MonoBehaviour
...
@@ -174,15 +223,33 @@ public class JudgeManager : MonoBehaviour
GameObject
lmo
=
lmobj
.
transform
.
GetChild
(
0
).
gameObject
;
GameObject
lmo
=
lmobj
.
transform
.
GetChild
(
0
).
gameObject
;
MotionNote
lmnote
=
(
MotionNote
)
lmo
.
GetComponent
<
Note
.
Controller
>().
Instance
;
MotionNote
lmnote
=
(
MotionNote
)
lmo
.
GetComponent
<
Note
.
Controller
>().
Instance
;
lmnote
.
Checkpoint
(
);
StartCoroutine
(
lmnote
.
Checkpoint
(
lmnote
)
);
if
(
lmnote
.
Activated
)
if
(
!
lmnote
.
Activated
&&
elapsedTime
>=
(
lmnote
.
StartTiming
-
MsPerBeat
)
)
{
{
SetJudge
(
Judge
.
TestJudge
(
lmnote
,
timing
));
GameObject
motionSample
=
Instantiate
(
motionSampleDisplayPrefab
);
DeactivateNote
(
lmnote
);
MotionSampleDisplay
msd
=
motionSample
.
GetComponent
<
MotionSampleDisplay
>();
msd
.
sprite
=
lmnote
.
Image
;
msd
.
timeout
=
MsPerBeat
;
lmnote
.
Activated
=
true
;
lmnote
.
MotionSampleDisplay
=
msd
;
activatedNotes
.
Add
(
lmnote
);
}
}
return
;
for
(
int
i
=
activatedNotes
.
Count
-
1
;
i
>=
0
;
i
--)
{
MotionNote
note
=
activatedNotes
[
i
];
if
(
elapsedTime
>
note
.
StartTiming
)
MotionGuageReset
(
note
.
Length
);
if
(
note
.
FinalJudgeAction
()
||
elapsedTime
>
note
.
EndTiming
+
Judge
.
MaxButtonTimingRange
)
{
SetJudge
(
Judge
.
TestJudge
(
note
,
timing
,
true
));
activatedNotes
.
RemoveAt
(
i
);
DeactivateNote
(
note
);
MotionGuageReset
();
}
}
})();
})();
}
}
...
@@ -202,9 +269,7 @@ public class JudgeManager : MonoBehaviour
...
@@ -202,9 +269,7 @@ public class JudgeManager : MonoBehaviour
GameManager
.
Instance
.
Score
+=
judge
.
Score
;
GameManager
.
Instance
.
Score
+=
judge
.
Score
;
GameManager
.
Instance
.
JudgeCount
[
judge
]++;
GameManager
.
Instance
.
JudgeCount
[
judge
]++;
Debug
.
Log
(
judge
.
Name
+
(
isMotion
?
" Motion"
:
" Note"
));
Debug
.
Log
(
judge
.
Name
+
(
isMotion
?
" Motion"
:
" Note"
)
+
" Combo: "
+
GameManager
.
Instance
.
Combo
);
Debug
.
Log
(
GameManager
.
Instance
.
Combo
);
Debug
.
Log
(
GameManager
.
Instance
.
LongestCombo
);
judgeText
.
SetActive
(
true
);
judgeText
.
SetActive
(
true
);
judgeText
.
GetComponent
<
Text
>().
text
=
judge
.
Name
;
judgeText
.
GetComponent
<
Text
>().
text
=
judge
.
Name
;
...
@@ -248,4 +313,15 @@ public class JudgeManager : MonoBehaviour
...
@@ -248,4 +313,15 @@ public class JudgeManager : MonoBehaviour
obj
.
AddComponent
<
Note
.
Controller
>().
Instance
=
note
;
obj
.
AddComponent
<
Note
.
Controller
>().
Instance
=
note
;
}
}
}
}
private
bool
onResult
=
false
;
private
void
ShowResult
()
{
if
(!
onResult
)
{
GameManager
.
Instance
.
SceneTransition
(
"Result"
,
true
);
onResult
=
true
;
}
}
}
}
Assets/Script/MotionNote.cs
View file @
d94eeb54
...
@@ -13,10 +13,12 @@ public abstract class MotionNote : Note
...
@@ -13,10 +13,12 @@ public abstract class MotionNote : Note
public
MotionNote
(
string
key
,
float
start
,
float
end
=
0f
)
public
MotionNote
(
string
key
,
float
start
,
float
end
=
0f
)
:
this
(
start
,
end
)
{
}
:
this
(
start
,
end
)
{
}
public
abstract
IEnumerator
Checkpoint
();
public
abstract
IEnumerator
Checkpoint
(
MotionNote
obj
);
public
abstract
bool
FinalJudgeAction
();
public
abstract
bool
FinalJudgeAction
();
public
bool
IsChecked
{
get
;
protected
set
;
}
public
abstract
bool
IsChecked
{
get
;
}
public
bool
IsCoroutineExecuted
{
get
;
protected
set
;
}
public
MotionSampleDisplay
MotionSampleDisplay
{
get
;
set
;
}
public
MotionSampleDisplay
MotionSampleDisplay
{
get
;
set
;
}
...
@@ -35,9 +37,9 @@ public abstract class MotionNote : Note
...
@@ -35,9 +37,9 @@ public abstract class MotionNote : Note
{
"LK"
,
typeof
(
PushUp
)
},
{
"LK"
,
typeof
(
PushUp
)
},
{
"RK"
,
typeof
(
PushUp
)
},
{
"RK"
,
typeof
(
PushUp
)
},
{
"BI"
,
typeof
(
Piano
)
},
{
"BI"
,
typeof
(
Guard
)
},
{
"LI"
,
typeof
(
Piano
)
},
{
"LI"
,
typeof
(
Guard
)
},
{
"RI"
,
typeof
(
Piano
)
},
{
"RI"
,
typeof
(
Guard
)
},
{
"BG"
,
typeof
(
Guard
)
},
{
"BG"
,
typeof
(
Guard
)
},
{
"LG"
,
typeof
(
Guard
)
},
{
"LG"
,
typeof
(
Guard
)
},
...
...
Assets/Script/MotionSampleDisplay.cs
View file @
d94eeb54
...
@@ -15,7 +15,7 @@ public class MotionSampleDisplay : MonoBehaviour
...
@@ -15,7 +15,7 @@ public class MotionSampleDisplay : MonoBehaviour
private
float
velocity
;
private
float
velocity
;
private
float
acceleration
;
private
float
acceleration
;
private
float
distance
=
3
f
;
private
float
distance
=
1.5
f
;
// Use this for initialization
// Use this for initialization
void
Start
()
void
Start
()
...
...
Assets/Script/TrackManager.cs
View file @
d94eeb54
...
@@ -62,6 +62,9 @@ public class TrackManager : MonoBehaviour {
...
@@ -62,6 +62,9 @@ public class TrackManager : MonoBehaviour {
// Update is called once per frame
// Update is called once per frame
void
Update
()
void
Update
()
{
{
if
(
trackList
.
transform
.
childCount
<
0
)
return
;
if
(
Input
.
GetKeyDown
(
KeyCode
.
DownArrow
))
if
(
Input
.
GetKeyDown
(
KeyCode
.
DownArrow
))
{
{
trackList
.
transform
.
GetChild
(
0
).
SetAsLastSibling
();
trackList
.
transform
.
GetChild
(
0
).
SetAsLastSibling
();
...
...
Assets/Tracks/Test/JJR.bpe
0 → 100644
View file @
d94eeb54
#TITLE Jump Jump Revolution
#ARTIST 128
#GENRE None
#BPM 128
#PLAYLEVEL 0
#TRACKLIST Something - Someone
#TRACKLIST Probably - Amumal
#TRACKLIST PARANOiA - Revolution
#002SMO JPJPJPJP
#003SMO JPJPJPJP
Assets/
MotionNotes/Piano.cs
.meta
→
Assets/
Tracks/Test/JJR.bpe
.meta
View file @
d94eeb54
fileFormatVersion: 2
fileFormatVersion: 2
guid:
e943dcff2ea00af40acbfc09b7345f25
guid:
a0ed6224ca6bb234085d194a31e2a3c1
timeCreated: 1503
548782
timeCreated: 1503
617877
licenseType: Free
licenseType: Free
MonoImporter:
DefaultImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
userData:
assetBundleName:
assetBundleName:
assetBundleVariant:
assetBundleVariant:
Assets/Tracks/Test/REC001.WAV
0 → 100644
View file @
d94eeb54
File added
Assets/Tracks/Test/REC001.WAV.meta
0 → 100644
View file @
d94eeb54
fileFormatVersion: 2
guid: 16201f7e6e6532143b745bb09761c13b
timeCreated: 1503611397
licenseType: Free
AudioImporter:
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:
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