Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
RhythmKata
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
13정준영
RhythmKata
Commits
768a7f44
Commit
768a7f44
authored
Nov 13, 2019
by
15박보승
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Forward 노트가 이동하는 경로 수정
parent
f3910b09
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
171 additions
and
8 deletions
+171
-8
DefaultNote.prefab
RhythmKata/Assets/Prefabs/DefaultNote.prefab
+154
-0
bs.unity
RhythmKata/Assets/Scenes/bs.unity
+2
-1
Note.cs
RhythmKata/Assets/Scripts/Core/Note.cs
+2
-1
ForwardNoteObject.cs
RhythmKata/Assets/Scripts/ForwardNoteObject.cs
+5
-3
NoteObject.cs
RhythmKata/Assets/Scripts/NoteObject.cs
+4
-2
PlayEngine.cs
RhythmKata/Assets/Scripts/PlayEngine.cs
+4
-1
No files found.
RhythmKata/Assets/Prefabs/DefaultNote.prefab
View file @
768a7f44
...
...
@@ -104,6 +104,7 @@ GameObject:
-
component
:
{
fileID
:
8354046899824507573
}
-
component
:
{
fileID
:
8354046899824507572
}
-
component
:
{
fileID
:
8354046899824507576
}
-
component
:
{
fileID
:
3626977960969211900
}
m_Layer
:
0
m_Name
:
DefaultNote
m_TagString
:
Untagged
...
...
@@ -197,7 +198,160 @@ MonoBehaviour:
m_Script
:
{
fileID
:
11500000
,
guid
:
5ede6b16436a58b4bb3118a59fd1a9ba
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
curveX
:
serializedVersion
:
2
m_Curve
:
-
serializedVersion
:
3
time
:
0
value
:
0
inSlope
:
1
outSlope
:
1
tangentMode
:
34
weightedMode
:
0
inWeight
:
0
outWeight
:
0
-
serializedVersion
:
3
time
:
1
value
:
1
inSlope
:
1
outSlope
:
1
tangentMode
:
34
weightedMode
:
0
inWeight
:
0
outWeight
:
0
m_PreInfinity
:
2
m_PostInfinity
:
2
m_RotationOrder
:
4
curveY
:
serializedVersion
:
2
m_Curve
:
-
serializedVersion
:
3
time
:
0
value
:
0
inSlope
:
1
outSlope
:
1
tangentMode
:
34
weightedMode
:
0
inWeight
:
0
outWeight
:
0
-
serializedVersion
:
3
time
:
1
value
:
1
inSlope
:
1
outSlope
:
1
tangentMode
:
34
weightedMode
:
0
inWeight
:
0
outWeight
:
0
m_PreInfinity
:
2
m_PostInfinity
:
2
m_RotationOrder
:
4
endPoint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
maxRemainedTime
:
1
perfectZ
:
10
ring
:
{
fileID
:
0
}
---
!u!96
&3626977960969211900
TrailRenderer
:
serializedVersion
:
2
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
8354046899824507571
}
m_Enabled
:
1
m_CastShadows
:
1
m_ReceiveShadows
:
1
m_DynamicOccludee
:
1
m_MotionVectors
:
1
m_LightProbeUsage
:
0
m_ReflectionProbeUsage
:
0
m_RenderingLayerMask
:
1
m_RendererPriority
:
0
m_Materials
:
-
{
fileID
:
10754
,
guid
:
0000000000000000f000000000000000
,
type
:
0
}
m_StaticBatchInfo
:
firstSubMesh
:
0
subMeshCount
:
0
m_StaticBatchRoot
:
{
fileID
:
0
}
m_ProbeAnchor
:
{
fileID
:
0
}
m_LightProbeVolumeOverride
:
{
fileID
:
0
}
m_ScaleInLightmap
:
1
m_ReceiveGI
:
1
m_PreserveUVs
:
0
m_IgnoreNormalsForChartDetection
:
0
m_ImportantGI
:
0
m_StitchLightmapSeams
:
1
m_SelectedEditorRenderState
:
3
m_MinimumChartSize
:
4
m_AutoUVMaxDistance
:
0.5
m_AutoUVMaxAngle
:
89
m_LightmapParameters
:
{
fileID
:
0
}
m_SortingLayerID
:
0
m_SortingLayer
:
0
m_SortingOrder
:
0
m_Time
:
1
m_Parameters
:
serializedVersion
:
3
widthMultiplier
:
1
widthCurve
:
serializedVersion
:
2
m_Curve
:
-
serializedVersion
:
3
time
:
0
value
:
1
inSlope
:
0
outSlope
:
0
tangentMode
:
0
weightedMode
:
0
inWeight
:
0.33333334
outWeight
:
0.33333334
-
serializedVersion
:
3
time
:
1
value
:
0
inSlope
:
0
outSlope
:
0
tangentMode
:
0
weightedMode
:
0
inWeight
:
0
outWeight
:
0
m_PreInfinity
:
2
m_PostInfinity
:
2
m_RotationOrder
:
4
colorGradient
:
serializedVersion
:
2
key0
:
{
r
:
1
,
g
:
0
,
b
:
0
,
a
:
1
}
key1
:
{
r
:
1
,
g
:
1
,
b
:
1
,
a
:
0
}
key2
:
{
r
:
0
,
g
:
0
,
b
:
0
,
a
:
0
}
key3
:
{
r
:
0
,
g
:
0
,
b
:
0
,
a
:
0
}
key4
:
{
r
:
0
,
g
:
0
,
b
:
0
,
a
:
0
}
key5
:
{
r
:
0
,
g
:
0
,
b
:
0
,
a
:
0
}
key6
:
{
r
:
0
,
g
:
0
,
b
:
0
,
a
:
0
}
key7
:
{
r
:
0
,
g
:
0
,
b
:
0
,
a
:
0
}
ctime0
:
0
ctime1
:
65535
ctime2
:
0
ctime3
:
0
ctime4
:
0
ctime5
:
0
ctime6
:
0
ctime7
:
0
atime0
:
0
atime1
:
65535
atime2
:
0
atime3
:
0
atime4
:
0
atime5
:
0
atime6
:
0
atime7
:
0
m_Mode
:
0
m_NumColorKeys
:
2
m_NumAlphaKeys
:
2
numCornerVertices
:
0
numCapVertices
:
0
alignment
:
0
textureMode
:
0
shadowBias
:
0.5
generateLightingData
:
0
m_MinVertexDistance
:
0.1
m_Autodestruct
:
0
m_Emitting
:
1
RhythmKata/Assets/Scenes/bs.unity
View file @
768a7f44
...
...
@@ -233,7 +233,8 @@ MonoBehaviour:
m_EditorClassIdentifier
:
ringUIPrefab
:
{
fileID
:
8100479809720507869
,
guid
:
13fc3a8405d796e4e87e099e870cc446
,
type
:
3
}
hitEffectPrefabs
:
[]
scoreText
:
{
fileID
:
0
}
comboText
:
{
fileID
:
0
}
---
!u!1
&615417178
GameObject
:
m_ObjectHideFlags
:
0
...
...
RhythmKata/Assets/Scripts/Core/Note.cs
View file @
768a7f44
...
...
@@ -31,6 +31,7 @@ abstract class Note
// TODO: Refactort this
private
static
readonly
float
NOTE_SHOW_TIMING
=
5
;
private
static
readonly
float
NOTE_HIDE_TIMING
=
-
2
;
private
static
readonly
float
NOTE_POSITION_MULTIPLIER
=
2
;
public
void
Update
(
float
remainingTime
)
{
if
(
remainingTime
<
NOTE_HIDE_TIMING
||
remainingTime
>
NOTE_SHOW_TIMING
)
...
...
@@ -44,7 +45,7 @@ abstract class Note
noteObject
.
gameObject
.
SetActive
(
true
);
}
noteObject
.
SetPosition
(
remainingTime
/
NOTE_SHOW_TIMING
);
noteObject
.
SetPosition
(
remainingTime
/
NOTE_SHOW_TIMING
*
NOTE_POSITION_MULTIPLIER
);
}
// factory method
...
...
RhythmKata/Assets/Scripts/ForwardNoteObject.cs
View file @
768a7f44
...
...
@@ -74,13 +74,15 @@ public class ForwardNoteObject : NoteObject
public
override
void
SetPosition
(
float
remainedTime
)
{
base
.
SetPosition
(
remainedTime
);
ring
.
localScale
=
Mathf
.
Max
((
1
+
4
*
remainedTime
/
maxRemainedTime
),
0
)
*
new
Vector3
(
1
,
1
,
1
);
var
showRing
=
remainedTime
<
0.3f
;
ring
.
localScale
=
Mathf
.
Max
((
1
+
20
*
remainedTime
),
0
)
*
new
Vector3
(
1
,
1
,
1
);
// change ring alpha
var
img
=
ring
.
gameObject
.
GetComponent
<
UnityEngine
.
UI
.
Image
>();
var
color
=
img
.
color
;
color
.
a
=
1f
-
Mathf
.
Clamp
(
remainedTime
/
maxRemainedTime
,
0
,
1
)
;
color
.
a
=
showRing
?
1f
-
Mathf
.
Clamp
(
remainedTime
/
0.3f
,
0
,
1f
)
:
0
;
img
.
color
=
color
;
}
...
...
RhythmKata/Assets/Scripts/NoteObject.cs
View file @
768a7f44
...
...
@@ -21,7 +21,7 @@ public abstract class NoteObject : MonoBehaviour
public
Vector3
startPoint
{
get
{
return
endPoint
+
new
Vector3
(
0
,
0
,
50
);
}
}
public
Vector3
endPoint
;
public
float
maxRemainedTime
=
1
;
public
float
maxRemainedTime
=
5
;
public
float
perfectZ
=
10
;
protected
virtual
void
OnDestroy
()
...
...
@@ -43,7 +43,9 @@ public abstract class NoteObject : MonoBehaviour
public
virtual
void
SetPosition
(
float
remainedTime
)
{
transform
.
position
=
endPoint
+
new
Vector3
(
0
,
0
,
50
)
*
remainedTime
/
maxRemainedTime
;
float
z
=
250
*
remainedTime
;
float
t
=
Mathf
.
Pow
(
1
-
z
/
250
,
3
);
transform
.
position
=
new
Vector3
(
t
*
endPoint
.
x
,
t
*
endPoint
.
y
,
endPoint
.
z
+
z
);
}
public
abstract
bool
IsHit
(
Ray
ray
);
...
...
RhythmKata/Assets/Scripts/PlayEngine.cs
View file @
768a7f44
...
...
@@ -69,21 +69,24 @@ public class PlayEngine : SingletonBehaviour<PlayEngine>
var
time
=
AudioSettings
.
dspTime
-
startDspTime
;
level
.
UpdateNotes
(
time
);
// level.HandleInput(time);
/*
if (fire.GetStateDown(inputSource)) {
AudioSource.PlayClipAtPoint(gunSfx, Vector3.zero);
level.HandleInput(time);
}
*/
}
if
(
Input
.
GetKeyDown
(
KeyCode
.
LeftArrow
))
{
audioSource
.
time
-=
1.0f
;
startDspTime
+=
1.0f
;
}
if
(
Input
.
GetKeyDown
(
KeyCode
.
RightArrow
))
{
audioSource
.
time
+=
1.0f
;
startDspTime
-=
1.0f
;
}
}
}
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