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
6bd361a5
Commit
6bd361a5
authored
Feb 28, 2018
by
16이상민
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix motion guage logic
parent
79dd6896
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
44 additions
and
55 deletions
+44
-55
JudgeManager.cs
Assets/JudgeModule/JudgeManager.cs
+1
-1
MotionGageManager.cs
Assets/JudgeModule/MotionGageManager.cs
+8
-23
NoteJudger.cs
Assets/JudgeModule/NoteJudger.cs
+11
-0
InGame.unity
Assets/Scene/InGame.unity
+19
-17
InGameManager.cs
Assets/Script/InGameManager.cs
+4
-13
ProjectVersion.txt
ProjectSettings/ProjectVersion.txt
+1
-1
No files found.
Assets/JudgeModule/JudgeManager.cs
View file @
6bd361a5
...
...
@@ -29,7 +29,7 @@ namespace JudgeModule
public
void
JudgeNote
(
Note
note
,
float
timing
)
{
if
(
Judge
.
IsPastNote
(
note
,
timing
)
||
if
(
Judge
.
IsPastNote
(
note
,
timing
)
||
note
.
Component
.
transform
.
position
.
x
>
appear
.
transform
.
position
.
x
)
return
;
...
...
Assets/JudgeModule/MotionGageManager.cs
View file @
6bd361a5
...
...
@@ -6,34 +6,19 @@ namespace JudgeModule
class
MotionGageManager
{
public
GameObject
motionGuage
;
private
float
elapsedMotion
;
private
float
motionTimeout
;
private
float
elapsedTime
=
0
;
public
void
ResetGuage
(
float
timeout
=
0f
)
{
if
(
timeout
<=
0f
)
{
elapsedMotion
=
0f
;
motionGuage
.
transform
.
parent
.
gameObject
.
SetActive
(
false
);
return
;
}
private
float
motionTimeout
,
baseTime
;
motionTimeout
=
timeout
;
motionGuage
.
transform
.
parent
.
gameObject
.
SetActive
(
true
);
motionGuage
.
SetActive
(
true
);
}
public
void
UpdateGuage
()
public
void
ResetGuage
(
float
timeout
=
0f
,
float
basetime
=
0f
)
{
if
(
elapsedMotion
>=
motionTimeout
)
ResetGuage
();
else
motionGuage
.
GetComponent
<
Image
>().
fillAmount
=
elapsedMotion
/
motionTimeout
;
motionTimeout
=
timeout
;
baseTime
=
basetime
;
motionGuage
.
transform
.
parent
.
gameObject
.
SetActive
(
timeout
!=
0f
);
}
public
void
UpdateTime
(
float
delta
)
public
void
UpdateGuage
(
float
timing
)
{
elapsedTime
+=
delta
;
motionGuage
.
GetComponent
<
Image
>().
fillAmount
=
(
timing
-
baseTime
)
/
motionTimeout
;
}
}
}
Assets/JudgeModule/NoteJudger.cs
View file @
6bd361a5
...
...
@@ -11,6 +11,7 @@ namespace JudgeModule
private
Action
EndGame
;
private
GameObject
judgeText
;
private
JudgeTextManager
judgetextmanager
;
private
MotionGageManager
guage
;
public
NoteJudger
(
Dictionary
<
string
,
GameObject
>
obj
,
Action
endgame
)
{
...
...
@@ -19,6 +20,8 @@ namespace JudgeModule
EndGame
=
endgame
;
judgetextmanager
=
judgeText
.
GetComponent
<
JudgeTextManager
>();
guage
=
new
MotionGageManager
{
motionGuage
=
obj
[
"guage"
]
};
guage
.
ResetGuage
();
}
public
void
WrongNoteProc
(
Note
note
)
...
...
@@ -40,7 +43,12 @@ namespace JudgeModule
Debug
.
Log
(
"Entered: "
+
timing
+
", Judge: "
+
judge
.
Name
);
if
(
note
.
IsLong
&&
!
judge
.
IsBreak
)
{
note
.
Activated
=
true
;
if
(
note
.
Type
==
NoteType
.
LMO
)
guage
.
ResetGuage
(
note
.
Length
,
timing
);
}
else
{
note
.
Component
.
Deactivate
(
deactives
.
transform
,
!
note
.
IsLong
);
...
...
@@ -50,6 +58,7 @@ namespace JudgeModule
public
void
ContinuingNoteProc
(
Note
note
,
float
timing
,
float
interval
)
{
guage
.
UpdateGuage
(
timing
);
if
(
Judge
.
IsNoteProgress
(
note
,
timing
,
interval
))
{
Debug
.
Log
(
"Continuing: "
+
timing
);
...
...
@@ -61,6 +70,7 @@ namespace JudgeModule
public
void
CorrectlyStoppedNoteProc
(
Note
note
,
float
timing
)
{
guage
.
ResetGuage
();
SetJudge
(
Judge
.
TestJudge
(
note
,
timing
,
true
),
judgeText
);
judgetextmanager
.
Register
(
note
);
note
.
Component
.
Deactivate
(
deactives
.
transform
);
...
...
@@ -69,6 +79,7 @@ namespace JudgeModule
public
void
IncorrectlyStoppedNoteProc
(
Note
note
)
{
guage
.
ResetGuage
();
SetJudge
(
Judge
.
MISS
,
judgeText
);
judgetextmanager
.
Register
(
note
);
note
.
Component
.
Deactivate
(
deactives
.
transform
,
false
);
...
...
Assets/Scene/InGame.unity
View file @
6bd361a5
...
...
@@ -88,6 +88,7 @@ LightmapSettings:
m_PVRFilteringAtrousPositionSigmaDirect
:
0.5
m_PVRFilteringAtrousPositionSigmaIndirect
:
2
m_PVRFilteringAtrousPositionSigmaAO
:
1
m_ShowResolutionOverlay
:
1
m_LightingDataAsset
:
{
fileID
:
0
}
m_UseShadowmask
:
1
---
!u!196
&4
...
...
@@ -136,7 +137,7 @@ RectTransform:
m_PrefabInternal
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
36226165
}
m_LocalRotation
:
{
x
:
-0
,
y
:
-0
,
z
:
-0
,
w
:
1
}
m_LocalPosition
:
{
x
:
0
,
y
:
-1
,
z
:
0
}
m_LocalPosition
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalScale
:
{
x
:
1
,
y
:
1
,
z
:
1
}
m_Children
:
[]
m_Father
:
{
fileID
:
785996772
}
...
...
@@ -535,7 +536,7 @@ RectTransform:
m_PrefabInternal
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
295245169
}
m_LocalRotation
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
1
}
m_LocalPosition
:
{
x
:
0
,
y
:
-75
,
z
:
0
}
m_LocalPosition
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalScale
:
{
x
:
1
,
y
:
1
,
z
:
1
}
m_Children
:
-
{
fileID
:
1152155867
}
...
...
@@ -1623,8 +1624,8 @@ RectTransform:
m_PrefabInternal
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
765048384
}
m_LocalRotation
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
1
}
m_LocalPosition
:
{
x
:
523
,
y
:
294
,
z
:
0
}
m_LocalScale
:
{
x
:
1
,
y
:
1
,
z
:
1
}
m_LocalPosition
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalScale
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_Children
:
-
{
fileID
:
1073141667
}
-
{
fileID
:
1173591428
}
...
...
@@ -1982,7 +1983,7 @@ RectTransform:
m_PrefabInternal
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
1073141666
}
m_LocalRotation
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
1
}
m_LocalPosition
:
{
x
:
0
,
y
:
294
,
z
:
0
}
m_LocalPosition
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalScale
:
{
x
:
1
,
y
:
1
,
z
:
1
}
m_Children
:
-
{
fileID
:
785996772
}
...
...
@@ -2149,7 +2150,7 @@ RectTransform:
m_PrefabInternal
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
1152155866
}
m_LocalRotation
:
{
x
:
-0
,
y
:
-0
,
z
:
-0
,
w
:
1
}
m_LocalPosition
:
{
x
:
0
,
y
:
-9
0
,
z
:
0
}
m_LocalPosition
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalScale
:
{
x
:
1
,
y
:
1
,
z
:
1
}
m_Children
:
[]
m_Father
:
{
fileID
:
295245170
}
...
...
@@ -2331,7 +2332,7 @@ RectTransform:
m_PrefabInternal
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
1173591427
}
m_LocalRotation
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
1
}
m_LocalPosition
:
{
x
:
0
,
y
:
-94
,
z
:
0
}
m_LocalPosition
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalScale
:
{
x
:
1
,
y
:
1
,
z
:
1
}
m_Children
:
-
{
fileID
:
1665813939
}
...
...
@@ -2340,8 +2341,8 @@ RectTransform:
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_AnchorMin
:
{
x
:
0.5
,
y
:
0
}
m_AnchorMax
:
{
x
:
0.5
,
y
:
0
}
m_AnchoredPosition
:
{
x
:
0
,
y
:
200
}
m_SizeDelta
:
{
x
:
200
,
y
:
2
00
}
m_AnchoredPosition
:
{
x
:
0
,
y
:
77
}
m_SizeDelta
:
{
x
:
100
,
y
:
1
00
}
m_Pivot
:
{
x
:
0.5
,
y
:
0.5
}
---
!u!114
&1173591430
MonoBehaviour
:
...
...
@@ -2527,6 +2528,7 @@ Camera:
m_TargetEye
:
3
m_HDR
:
1
m_AllowMSAA
:
1
m_AllowDynamicResolution
:
0
m_ForceIntoRT
:
0
m_OcclusionCulling
:
1
m_StereoConvergence
:
10
...
...
@@ -2631,7 +2633,7 @@ RectTransform:
m_PrefabInternal
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
1299260532
}
m_LocalRotation
:
{
x
:
-0
,
y
:
-0
,
z
:
-0
,
w
:
1
}
m_LocalPosition
:
{
x
:
0
,
y
:
-151
,
z
:
0
}
m_LocalPosition
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalScale
:
{
x
:
1
,
y
:
1
,
z
:
1
}
m_Children
:
[]
m_Father
:
{
fileID
:
785996772
}
...
...
@@ -2959,7 +2961,7 @@ RectTransform:
m_PrefabInternal
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
1463464316
}
m_LocalRotation
:
{
x
:
-0
,
y
:
-0
,
z
:
-0
,
w
:
1
}
m_LocalPosition
:
{
x
:
-486.5
,
y
:
0
,
z
:
0
}
m_LocalPosition
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalScale
:
{
x
:
1
,
y
:
1
,
z
:
1
}
m_Children
:
[]
m_Father
:
{
fileID
:
295245170
}
...
...
@@ -3235,7 +3237,7 @@ RectTransform:
m_PrefabInternal
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
1669651589
}
m_LocalRotation
:
{
x
:
-0
,
y
:
-0
,
z
:
-0
,
w
:
1
}
m_LocalPosition
:
{
x
:
488.5
,
y
:
0
,
z
:
0
}
m_LocalPosition
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalScale
:
{
x
:
1
,
y
:
1
,
z
:
1
}
m_Children
:
[]
m_Father
:
{
fileID
:
295245170
}
...
...
@@ -3270,7 +3272,7 @@ RectTransform:
m_PrefabInternal
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
1681188542
}
m_LocalRotation
:
{
x
:
-0
,
y
:
-0
,
z
:
-0
,
w
:
1
}
m_LocalPosition
:
{
x
:
0
,
y
:
-101
,
z
:
0
}
m_LocalPosition
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalScale
:
{
x
:
1
,
y
:
1
,
z
:
1
}
m_Children
:
[]
m_Father
:
{
fileID
:
785996772
}
...
...
@@ -3613,7 +3615,7 @@ RectTransform:
m_PrefabInternal
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
1852280156
}
m_LocalRotation
:
{
x
:
-0
,
y
:
-0
,
z
:
-0
,
w
:
1
}
m_LocalPosition
:
{
x
:
0
,
y
:
-51
,
z
:
0
}
m_LocalPosition
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalScale
:
{
x
:
1
,
y
:
1
,
z
:
1
}
m_Children
:
[]
m_Father
:
{
fileID
:
785996772
}
...
...
@@ -3847,7 +3849,7 @@ RectTransform:
m_PrefabInternal
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
2001722606
}
m_LocalRotation
:
{
x
:
-0
,
y
:
-0
,
z
:
-0
,
w
:
1
}
m_LocalPosition
:
{
x
:
-1.5
,
y
:
0
,
z
:
0
}
m_LocalPosition
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalScale
:
{
x
:
1
,
y
:
1
,
z
:
1
}
m_Children
:
-
{
fileID
:
791052775
}
...
...
@@ -3975,9 +3977,9 @@ MeshCollider:
m_Material
:
{
fileID
:
0
}
m_IsTrigger
:
0
m_Enabled
:
1
serializedVersion
:
2
serializedVersion
:
3
m_Convex
:
0
m_
InflateMesh
:
0
m_
CookingOptions
:
14
m_SkinWidth
:
0.01
m_Mesh
:
{
fileID
:
10209
,
guid
:
0000000000000000e000000000000000
,
type
:
0
}
---
!u!33
&2093461956
...
...
Assets/Script/InGameManager.cs
View file @
6bd361a5
...
...
@@ -19,8 +19,6 @@ public class InGameManager : MonoBehaviour
disappear
,
judgetext
,
motionSampleDisplayPrefab
;
private
MotionGageManager
motionGageManager
;
private
InputManager
input
;
private
NoteManager
notemanager
;
...
...
@@ -60,9 +58,6 @@ public class InGameManager : MonoBehaviour
ShowResult
,
objects
,
GameManager
.
Instance
.
CurrentTrack
.
BPM
);
motionGageManager
=
new
MotionGageManager
{
motionGuage
=
GameObject
.
Find
(
"Motion Guage"
)
};
}
private
void
SetObjectRef
()
...
...
@@ -73,8 +68,7 @@ public class InGameManager : MonoBehaviour
appear
=
GameObject
.
Find
(
"AppearNote"
);
disappear
=
GameObject
.
Find
(
"DisappearNote"
);
judgetext
=
GameObject
.
Find
(
"Judge"
);
input
=
GameObject
.
Find
(
"InGameManagers"
)
.
GetComponent
<
InputManager
>();
input
=
GetComponent
<
InputManager
>();
motionSampleDisplayPrefab
=
Resources
.
Load
(
"Motion Sample Display"
)
as
GameObject
;
...
...
@@ -89,14 +83,14 @@ public class InGameManager : MonoBehaviour
{
"appear"
,
appear
},
{
"disappear"
,
disappear
},
{
"judgetext"
,
judgetext
},
{
"sample"
,
motionSampleDisplayPrefab
}
{
"sample"
,
motionSampleDisplayPrefab
},
{
"guage"
,
GameObject
.
Find
(
"Motion Guage"
)
}
});
}
private
void
JudgeInit
()
{
judgetext
.
SetActive
(
false
);
motionGageManager
.
ResetGuage
();
baseTime
=
0f
;
IsInitTime
=
false
;
delayBase
=
(
appear
.
transform
.
position
.
x
-
offset
.
transform
.
position
.
x
)
...
...
@@ -131,10 +125,7 @@ public class InGameManager : MonoBehaviour
}
float
timing
=
current
-
baseTime
-
delayBase
-
delay
;
motionGageManager
.
UpdateTime
(
Time
.
deltaTime
*
1000
);
motionGageManager
.
UpdateGuage
();
notemanager
.
Controll
(
timing
);
if
(
notemanager
.
IsEnd
)
...
...
ProjectSettings/ProjectVersion.txt
View file @
6bd361a5
m_EditorVersion: 2017.
2
.0f3
m_EditorVersion: 2017.
3
.0f3
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