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
0868bc71
Commit
0868bc71
authored
Feb 27, 2018
by
16이상민
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Beat/Measure lines logic
parent
5d59739a
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
82 additions
and
36 deletions
+82
-36
NoteManager.cs
Assets/JudgeModule/NoteManager.cs
+51
-3
BeatLine.prefab
Assets/Resources/BeatLine.prefab
+2
-2
MeasureLine.prefab
Assets/Resources/MeasureLine.prefab
+1
-1
Controller.cs
Assets/Script/Controller.cs
+1
-7
CoordinateMapperManager.cs
Assets/Script/CoordinateMapperManager.cs
+21
-21
GameManager.cs
Assets/Script/GameManager.cs
+1
-1
DynamicsManager.asset
ProjectSettings/DynamicsManager.asset
+2
-0
Physics2DSettings.asset
ProjectSettings/Physics2DSettings.asset
+2
-0
ProjectVersion.txt
ProjectSettings/ProjectVersion.txt
+1
-1
No files found.
Assets/JudgeModule/NoteManager.cs
View file @
0868bc71
...
@@ -27,7 +27,13 @@ namespace JudgeModule
...
@@ -27,7 +27,13 @@ namespace JudgeModule
disables
disables
=
new
Dictionary
<
string
,
List
<
Controller
>>();
=
new
Dictionary
<
string
,
List
<
Controller
>>();
private
string
[]
notenames
private
string
[]
notenames
=
new
string
[]
{
"SBT"
,
"LBT"
,
"SMO"
,
"LMO"
};
=
new
string
[]
{
"SBT"
,
"LBT"
,
"SMO"
,
"LMO"
},
linenames
=
new
string
[]
{
"BeatLine"
,
"MeasureLine"
},
names
=
new
string
[]
{
"SBT"
,
"LBT"
,
"SMO"
,
"LMO"
,
"BeatLine"
,
"MeasureLine"
};
private
float
recentBeatTiming
,
recentMeasureTiming
;
public
Note
CurrentBT
public
Note
CurrentBT
{
{
...
@@ -131,6 +137,7 @@ namespace JudgeModule
...
@@ -131,6 +137,7 @@ namespace JudgeModule
DeactiveUndecided
();
DeactiveUndecided
();
SwitchStandBy
();
SwitchStandBy
();
AssignNotes
(
timing
);
AssignNotes
(
timing
);
AssignLines
(
timing
);
}
}
private
void
DeactiveUndecided
()
private
void
DeactiveUndecided
()
...
@@ -149,7 +156,7 @@ namespace JudgeModule
...
@@ -149,7 +156,7 @@ namespace JudgeModule
private
void
SwitchStandBy
()
private
void
SwitchStandBy
()
{
{
foreach
(
var
name
in
n
oten
ames
)
foreach
(
var
name
in
names
)
{
{
var
controllers
=
disables
[
name
].
ToArray
();
var
controllers
=
disables
[
name
].
ToArray
();
foreach
(
var
c
in
controllers
)
foreach
(
var
c
in
controllers
)
...
@@ -162,6 +169,9 @@ namespace JudgeModule
...
@@ -162,6 +169,9 @@ namespace JudgeModule
c
.
gameObject
.
SetActive
(
false
);
c
.
gameObject
.
SetActive
(
false
);
disables
[
name
].
Remove
(
c
);
disables
[
name
].
Remove
(
c
);
waits
[
name
].
Add
(
c
);
waits
[
name
].
Add
(
c
);
if
(
name
!=
"BeatLine"
&&
name
!=
"MeasureLine"
)
++
cntWait
;
++
cntWait
;
}
}
}
}
...
@@ -246,5 +256,43 @@ namespace JudgeModule
...
@@ -246,5 +256,43 @@ namespace JudgeModule
hold
.
Translate
(
Vector3
.
right
*
(
length
/
2
));
hold
.
Translate
(
Vector3
.
right
*
(
length
/
2
));
end
.
Translate
(
Vector3
.
right
*
length
);
end
.
Translate
(
Vector3
.
right
*
length
);
}
}
private
void
AssignLines
(
float
timing
)
{
foreach
(
var
name
in
linenames
)
{
foreach
(
var
x
in
waits
[
name
])
AssignLine
(
name
,
timing
,
x
);
disables
[
name
].
AddRange
(
waits
[
name
]);
waits
[
name
].
Clear
();
}
}
private
void
AssignLine
(
string
name
,
float
timing
,
Controller
controller
)
{
NoteType
type
=
(
NoteType
)
Enum
.
Parse
(
typeof
(
NoteType
),
name
);
float
next
;
if
(
type
==
NoteType
.
BeatLine
)
{
next
=
recentBeatTiming
;
recentBeatTiming
+=
(
MsPerBeat
/
4
);
}
else
{
next
=
recentMeasureTiming
;
recentMeasureTiming
+=
MsPerBeat
;
}
Note
note
=
new
Note
(
type
,
next
);
controller
.
Instance
=
note
;
note
.
Component
=
controller
;
controller
.
transform
.
position
=
initialPos
+
Vector3
.
right
*
((
note
.
StartTiming
-
timing
)
*
ScrollSpeed
);
controller
.
transform
.
SetParent
(
deactives
.
transform
);
controller
.
gameObject
.
SetActive
(
true
);
}
}
}
}
}
\ No newline at end of file
Assets/Resources/BeatLine.prefab
View file @
0868bc71
...
@@ -40,7 +40,7 @@ MonoBehaviour:
...
@@ -40,7 +40,7 @@ MonoBehaviour:
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
:
0.627451
}
m_Color
:
{
r
:
0.5808823
,
g
:
0.5808823
,
b
:
0.5808823
,
a
:
0.352
}
m_RaycastTarget
:
1
m_RaycastTarget
:
1
m_OnCullStateChanged
:
m_OnCullStateChanged
:
m_PersistentCalls
:
m_PersistentCalls
:
...
@@ -77,5 +77,5 @@ RectTransform:
...
@@ -77,5 +77,5 @@ RectTransform:
m_AnchorMin
:
{
x
:
0.5
,
y
:
0
}
m_AnchorMin
:
{
x
:
0.5
,
y
:
0
}
m_AnchorMax
:
{
x
:
0.5
,
y
:
1
}
m_AnchorMax
:
{
x
:
0.5
,
y
:
1
}
m_AnchoredPosition
:
{
x
:
0
,
y
:
0
}
m_AnchoredPosition
:
{
x
:
0
,
y
:
0
}
m_SizeDelta
:
{
x
:
2
,
y
:
0
}
m_SizeDelta
:
{
x
:
0.5
,
y
:
0
}
m_Pivot
:
{
x
:
0.5
,
y
:
0.5
}
m_Pivot
:
{
x
:
0.5
,
y
:
0.5
}
Assets/Resources/MeasureLine.prefab
View file @
0868bc71
...
@@ -40,7 +40,7 @@ MonoBehaviour:
...
@@ -40,7 +40,7 @@ MonoBehaviour:
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
:
0.627451
}
m_Color
:
{
r
:
0.5808823
,
g
:
0.5808823
,
b
:
0.5808823
,
a
:
0.602
}
m_RaycastTarget
:
1
m_RaycastTarget
:
1
m_OnCullStateChanged
:
m_OnCullStateChanged
:
m_PersistentCalls
:
m_PersistentCalls
:
...
...
Assets/Script/Controller.cs
View file @
0868bc71
...
@@ -9,8 +9,6 @@ public class Controller : MonoBehaviour
...
@@ -9,8 +9,6 @@ public class Controller : MonoBehaviour
public
List
<
Controller
>
enables
,
public
List
<
Controller
>
enables
,
disables
;
disables
;
private
float
time
=
0f
;
private
readonly
float
minAlpha
=
0.3f
;
private
readonly
float
minAlpha
=
0.3f
;
private
readonly
float
maxAlpha
=
0.7f
;
private
readonly
float
maxAlpha
=
0.7f
;
...
@@ -19,15 +17,11 @@ public class Controller : MonoBehaviour
...
@@ -19,15 +17,11 @@ public class Controller : MonoBehaviour
{
{
if
(
transform
.
parent
.
gameObject
.
name
==
"Deactives"
)
if
(
transform
.
parent
.
gameObject
.
name
==
"Deactives"
)
{
{
time
+=
Time
.
deltaTime
*
3
;
foreach
(
Image
img
in
GetComponentsInChildren
<
Image
>())
foreach
(
Image
img
in
GetComponentsInChildren
<
Image
>())
{
{
Color
tmp
=
img
.
color
;
Color
tmp
=
img
.
color
;
tmp
.
a
=
0f
;
tmp
.
a
=
0f
;
img
.
color
=
tmp
+
new
Color
(
0
,
0
,
0
,
img
.
color
=
tmp
+
new
Color
(
0
,
0
,
0
,
minAlpha
);
(
maxAlpha
+
minAlpha
)
/
2
+
Mathf
.
Cos
(
time
*
4
)
*
(
maxAlpha
-
minAlpha
)
/
2
);
}
}
}
}
}
}
...
...
Assets/Script/CoordinateMapperManager.cs
View file @
0868bc71
...
@@ -54,8 +54,8 @@ public class CoordinateMapperManager : MonoBehaviour
...
@@ -54,8 +54,8 @@ public class CoordinateMapperManager : MonoBehaviour
{
{
GUI
.
Box
(
new
Rect
(
10
,
10
,
200
,
30
),
"FPS: "
+
fps
.
ToString
(
"0.00"
));
GUI
.
Box
(
new
Rect
(
10
,
10
,
200
,
30
),
"FPS: "
+
fps
.
ToString
(
"0.00"
));
if
(
_KinectAccessManager
.
NullFrame
)
/*
if (_KinectAccessManager.NullFrame)
GUI
.
Box
(
new
Rect
(
10
,
50
,
200
,
30
),
"NULL MSFR Frame"
);
GUI.Box (new Rect(10, 50, 200, 30), "NULL MSFR Frame");*/
}
}
void
MapColorToDepth
()
void
MapColorToDepth
()
...
...
Assets/Script/GameManager.cs
View file @
0868bc71
...
@@ -16,7 +16,7 @@ public class GameManager : MonoBehaviour {
...
@@ -16,7 +16,7 @@ public class GameManager : MonoBehaviour {
instance
=
new
GameObject
().
AddComponent
<
GameManager
>();
instance
=
new
GameObject
().
AddComponent
<
GameManager
>();
instance
.
CurrentTrack
instance
.
CurrentTrack
=
new
TrackInfo
(
"Assets/Tracks/Tutorial/temp
2
.bpe"
);
=
new
TrackInfo
(
"Assets/Tracks/Tutorial/temp.bpe"
);
}
}
return
instance
;
return
instance
;
...
...
ProjectSettings/DynamicsManager.asset
View file @
0868bc71
...
@@ -16,3 +16,5 @@ PhysicsManager:
...
@@ -16,3 +16,5 @@ PhysicsManager:
m_EnableAdaptiveForce
:
0
m_EnableAdaptiveForce
:
0
m_EnablePCM
:
1
m_EnablePCM
:
1
m_LayerCollisionMatrix
:
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
m_LayerCollisionMatrix
:
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
m_AutoSimulation
:
1
m_AutoSyncTransforms
:
1
ProjectSettings/Physics2DSettings.asset
View file @
0868bc71
...
@@ -19,10 +19,12 @@ Physics2DSettings:
...
@@ -19,10 +19,12 @@ Physics2DSettings:
m_LinearSleepTolerance
:
0.01
m_LinearSleepTolerance
:
0.01
m_AngularSleepTolerance
:
2
m_AngularSleepTolerance
:
2
m_DefaultContactOffset
:
0.01
m_DefaultContactOffset
:
0.01
m_AutoSimulation
:
1
m_QueriesHitTriggers
:
1
m_QueriesHitTriggers
:
1
m_QueriesStartInColliders
:
1
m_QueriesStartInColliders
:
1
m_ChangeStopsCallbacks
:
0
m_ChangeStopsCallbacks
:
0
m_CallbacksOnDisable
:
1
m_CallbacksOnDisable
:
1
m_AutoSyncTransforms
:
1
m_AlwaysShowColliders
:
0
m_AlwaysShowColliders
:
0
m_ShowColliderSleep
:
1
m_ShowColliderSleep
:
1
m_ShowColliderContacts
:
0
m_ShowColliderContacts
:
0
...
...
ProjectSettings/ProjectVersion.txt
View file @
0868bc71
m_EditorVersion: 2017.
3
.0f3
m_EditorVersion: 2017.
2
.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