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
c79c553d
Commit
c79c553d
authored
Nov 20, 2019
by
15박보승
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ForwardNote 움직임 변경
parent
07054fb5
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
202 additions
and
214 deletions
+202
-214
Skybox.mat
RhythmKata/Assets/Materials/Skybox.mat
+1
-1
DefaultNote.prefab
RhythmKata/Assets/Prefabs/DefaultNote.prefab
+42
-0
mergescene.unity
RhythmKata/Assets/Scenes/mergescene.unity
+133
-198
Note.cs
RhythmKata/Assets/Scripts/Core/Note.cs
+1
-1
ForwardNoteObject.cs
RhythmKata/Assets/Scripts/ForwardNoteObject.cs
+23
-12
NoteObject.cs
RhythmKata/Assets/Scripts/NoteObject.cs
+2
-2
No files found.
RhythmKata/Assets/Materials/Skybox.mat
View file @
c79c553d
...
...
@@ -48,7 +48,7 @@ Material:
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_FrontTex
:
m_Texture
:
{
fileID
:
0
}
m_Texture
:
{
fileID
:
2800000
,
guid
:
d6f0e028c1244404eb2d02959b9f8f60
,
type
:
3
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_LeftTex
:
...
...
RhythmKata/Assets/Prefabs/DefaultNote.prefab
View file @
c79c553d
...
...
@@ -205,6 +205,48 @@ MonoBehaviour:
-
{
fileID
:
8300000
,
guid
:
c2f12704acf658247b2140ac0cf42ba5
,
type
:
3
}
-
{
fileID
:
8300000
,
guid
:
555197e3a8315ad44844278d16b1e3fb
,
type
:
3
}
ring
:
{
fileID
:
0
}
curve
:
serializedVersion
:
2
m_Curve
:
-
serializedVersion
:
3
time
:
0
value
:
-0.006500244
inSlope
:
5.2741838
outSlope
:
5.2741838
tangentMode
:
0
weightedMode
:
0
inWeight
:
0
outWeight
:
0.074386515
-
serializedVersion
:
3
time
:
0.75
value
:
2
inSlope
:
0
outSlope
:
0
tangentMode
:
0
weightedMode
:
0
inWeight
:
0.096423134
outWeight
:
1
-
serializedVersion
:
3
time
:
1
value
:
1
inSlope
:
-4.2210984
outSlope
:
-4.2210984
tangentMode
:
0
weightedMode
:
0
inWeight
:
0.33333334
outWeight
:
0.13715482
-
serializedVersion
:
3
time
:
1.5
value
:
0.17175293
inSlope
:
0
outSlope
:
0
tangentMode
:
0
weightedMode
:
0
inWeight
:
0.6662333
outWeight
:
0
m_PreInfinity
:
2
m_PostInfinity
:
2
m_RotationOrder
:
4
---
!u!96
&3626977960969211900
TrailRenderer
:
serializedVersion
:
2
...
...
RhythmKata/Assets/Scenes/mergescene.unity
View file @
c79c553d
This diff is collapsed.
Click to expand it.
RhythmKata/Assets/Scripts/Core/Note.cs
View file @
c79c553d
...
...
@@ -98,7 +98,7 @@ abstract class Note
private
static
readonly
float
NOTE_POSITION_MULTIPLIER
=
2
;
public
void
Update
(
float
remainingTime
)
{
if
(
remainingTime
<
NOTE_HIDE_TIMING
||
remainingTime
>
NOTE_SHOW_TIMING
)
if
(
remainingTime
<
NOTE_HIDE_TIMING
*
NOTE_POSITION_MULTIPLIER
||
remainingTime
>
NOTE_SHOW_TIMING
)
{
noteObject
.
gameObject
.
SetActive
(
false
);
isVisible
=
false
;
...
...
RhythmKata/Assets/Scripts/ForwardNoteObject.cs
View file @
c79c553d
...
...
@@ -5,24 +5,31 @@ using UnityEngine.UI;
public
class
ForwardNoteObject
:
NoteObject
{
public
RectTransform
ring
;
public
AnimationCurve
curve
;
private
Material
mat
;
// 각 노트별 개별 함수이기 때문에 상속 관계 유지 불필요.
public
void
Init
(
float
x
,
float
y
,
HandType
handType
)
{
//Vector3 point = Camera.main.ScreenToWorldPoint(new Vector3(Screen.width * x, Screen.height * y, Camera.main.nearClipPlane));
//
//Vector3 point = Camera.main.ScreenToWorldPoint(new Vector3(Screen.width * x, Screen.height * y, Camera.main.nearClipPlane));
//
perfectZ
=
IngameUIManager
.
inst
.
transform
.
position
.
z
;
perfectZ
=
IngameUIManager
.
inst
.
transform
.
position
.
z
;
//Ray ray = Camera.main.ScreenPointToRay(new Vector3(Screen.width * x, Screen.height * y, 0));
//endPoint = ray.GetPoint(perfectZ);
endPoint
=
new
Vector3
(-
20f
+
40
*
x
,
-
20.0f
+
40
*
y
,
perfectZ
);
//Ray ray = Camera.main.ScreenPointToRay(new Vector3(Screen.width * x, Screen.height * y, 0));
//endPoint = ray.GetPoint(perfectZ);
endPoint
=
new
Vector3
(-
100f
+
200
*
x
,
-
100.0f
+
200
*
y
,
perfectZ
);
Ray
ray
=
new
Ray
(
Vector3
.
zero
,
endPoint
.
normalized
);
endPoint
=
ray
.
GetPoint
(
perfectZ
);
Debug
.
Log
(
endPoint
);
transform
.
position
=
endPoint
+
new
Vector3
(
0
,
0
,
15
);
ring
=
IngameUIManager
.
inst
.
AddNoteRingUI
();
ring
.
position
=
endPoint
;
ring
.
LookAt
(
Vector3
.
zero
);
Material
mat
=
GetComponent
<
Renderer
>().
material
;
mat
=
GetComponent
<
Renderer
>().
material
;
switch
(
handType
)
{
...
...
@@ -38,8 +45,6 @@ public class ForwardNoteObject : NoteObject
GetComponentInChildren
<
Light
>().
color
=
Color
.
cyan
;
ring
.
GetComponent
<
Image
>().
color
=
Color
.
cyan
;
break
;
}
}
private
void
Start
()
...
...
@@ -73,9 +78,15 @@ public class ForwardNoteObject : NoteObject
public
override
void
SetPosition
(
float
remainedTime
)
{
base
.
SetPosition
(
remainedTime
);
//base.SetPosition(remainedTime);
float
z
=
250
*
remainedTime
;
//float t = Mathf.Pow(1 - z / 250, 3);
float
t
=
1
-
remainedTime
;
transform
.
position
=
new
Vector3
(
curve
.
Evaluate
(
t
)
*
endPoint
.
x
,
curve
.
Evaluate
(
t
)
*
endPoint
.
y
,
endPoint
.
z
+
z
);
//transform.position = new Vector3(t * endPoint.x, t * endPoint.y, endPoint.z + z);
var
showRing
=
remainedTime
<
0.3f
;
var
showRing
=
remainedTime
<
0.3f
;
ring
.
localScale
=
Mathf
.
Max
((
1
+
20
*
remainedTime
),
0
)
*
new
Vector3
(
1
,
1
,
1
);
// change ring alpha
...
...
RhythmKata/Assets/Scripts/NoteObject.cs
View file @
c79c553d
...
...
@@ -111,9 +111,9 @@ public abstract class NoteObject : MonoBehaviour
for
(
float
t
=
0
;
t
<
time
;
t
+=
Time
.
deltaTime
)
{
//print(t / time);
mat
.
SetFloat
(
"_Threshold"
,
t
/
time
);
yield
return
null
;
mat
.
SetColor
(
"_Color"
,
mat
.
color
-
new
Color
(
0
,
0
,
0
,
2
)
*
Time
.
deltaTime
);
yield
return
null
;
}
mat
.
SetFloat
(
"_Threshold"
,
1
);
...
...
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