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
928ffea4
Commit
928ffea4
authored
Nov 17, 2019
by
15박보승
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NoteHit시 노트가 Dissolve 되도록 구현, Combo & Score UI 간단히 구현, Miss 이펙트 추가
parent
48cee20a
Changes
13
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
19678 additions
and
287 deletions
+19678
-287
Hit.prefab
RhythmKata/Assets/Prefabs/HitEffects/Hit.prefab
+1
-1
Miss.prefab
RhythmKata/Assets/Prefabs/HitEffects/Miss.prefab
+19092
-0
Miss.prefab.meta
RhythmKata/Assets/Prefabs/HitEffects/Miss.prefab.meta
+7
-0
Perfect.prefab
RhythmKata/Assets/Prefabs/HitEffects/Perfect.prefab
+1
-1
bs.unity
RhythmKata/Assets/Scenes/bs.unity
+1
-276
mergescene.unity
RhythmKata/Assets/Scenes/mergescene.unity
+413
-6
Level.cs
RhythmKata/Assets/Scripts/Core/Level.cs
+1
-1
IngameUIManager.cs
RhythmKata/Assets/Scripts/IngameUIManager.cs
+12
-0
NoteObject.cs
RhythmKata/Assets/Scripts/NoteObject.cs
+42
-1
PlayEngine.cs
RhythmKata/Assets/Scripts/PlayEngine.cs
+18
-1
Shaders.meta
RhythmKata/Assets/Shaders.meta
+8
-0
Dissolve.shader
RhythmKata/Assets/Shaders/Dissolve.shader
+73
-0
Dissolve.shader.meta
RhythmKata/Assets/Shaders/Dissolve.shader.meta
+9
-0
No files found.
RhythmKata/Assets/Prefabs/HitEffects/Hit.prefab
View file @
928ffea4
...
...
@@ -9568,7 +9568,7 @@ ParticleSystem:
serializedVersion
:
6
lengthInSec
:
0.2
simulationSpeed
:
1
stopAction
:
0
stopAction
:
2
cullingMode
:
1
ringBufferMode
:
0
ringBufferLoopRange
:
{
x
:
0
,
y
:
1
}
...
...
RhythmKata/Assets/Prefabs/HitEffects/Miss.prefab
0 → 100644
View file @
928ffea4
This diff is collapsed.
Click to expand it.
RhythmKata/Assets/Prefabs/HitEffects/Miss.prefab.meta
0 → 100644
View file @
928ffea4
fileFormatVersion: 2
guid: b8ffb5b84b254524abff419289c5adfd
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
RhythmKata/Assets/Prefabs/HitEffects/Perfect.prefab
View file @
928ffea4
...
...
@@ -43,7 +43,7 @@ ParticleSystem:
serializedVersion
:
6
lengthInSec
:
0.1
simulationSpeed
:
1
stopAction
:
0
stopAction
:
2
cullingMode
:
3
ringBufferMode
:
0
ringBufferLoopRange
:
{
x
:
0
,
y
:
1
}
...
...
RhythmKata/Assets/Scenes/bs.unity
View file @
928ffea4
This diff is collapsed.
Click to expand it.
RhythmKata/Assets/Scenes/mergescene.unity
View file @
928ffea4
This diff is collapsed.
Click to expand it.
RhythmKata/Assets/Scripts/Core/Level.cs
View file @
928ffea4
...
...
@@ -23,7 +23,7 @@ class Level
{
note
.
Deactivate
();
}
note
.
HandleJudge
(
judge
);
}
}
...
...
RhythmKata/Assets/Scripts/IngameUIManager.cs
View file @
928ffea4
...
...
@@ -9,6 +9,7 @@ public class IngameUIManager : SingletonBehaviour<IngameUIManager>
public
Text
scoreText
;
public
Text
comboText
;
private
Vector3
comboTextPosition
;
private
void
Start
()
{
...
...
@@ -33,6 +34,17 @@ public class IngameUIManager : SingletonBehaviour<IngameUIManager>
if
(
combo
<
1
)
comboText
.
text
=
""
;
else
{
comboText
.
text
=
combo
.
ToString
()
+
" Combo!"
;
StartCoroutine
(
ComboRoutine
());
}
}
private
IEnumerator
ComboRoutine
()
{
for
(
float
t
=
0
;
t
<
0.2f
;
t
+=
Time
.
deltaTime
)
{
comboText
.
transform
.
localPosition
=
Vector3
.
Lerp
(
new
Vector3
(
0
,
10
),
Vector3
.
zero
,
t
*
5
);
yield
return
new
WaitForEndOfFrame
();
}
comboText
.
transform
.
localPosition
=
Vector3
.
zero
;
}
}
RhythmKata/Assets/Scripts/NoteObject.cs
View file @
928ffea4
...
...
@@ -14,7 +14,7 @@ public abstract class NoteObject : MonoBehaviour
public
Vector3
endPoint
;
public
float
maxRemainedTime
=
5
;
public
float
perfectZ
=
1
0
;
public
float
perfectZ
=
5
0
;
public
AudioClip
[]
hitSfx
;
...
...
@@ -60,10 +60,17 @@ public abstract class NoteObject : MonoBehaviour
// TODO: temporary implementation
// make note invisible
StartCoroutine
(
DissolveRoutine
());
/*
var meshRenderer = gameObject.GetComponent<MeshRenderer>();
var trailRenderer = gameObject.GetComponent<TrailRenderer>();
if (meshRenderer) meshRenderer.enabled = false;
if (trailRenderer) trailRenderer.enabled = false;
*/
PlayEngine
.
inst
.
HandleNoteJudge
(
judge
.
type
);
}
}
...
...
@@ -75,4 +82,38 @@ public abstract class NoteObject : MonoBehaviour
}
public
abstract
bool
IsHit
(
Ray
ray
);
private
IEnumerator
DissolveRoutine
()
{
Material
mat
=
new
Material
(
Shader
.
Find
(
"Unlit/Dissolve"
));
MeshRenderer
mr
=
GetComponent
<
MeshRenderer
>();
mat
.
SetColor
(
"_Color"
,
mr
.
material
.
color
);
mat
.
SetColor
(
"_Glow"
,
(
Color
.
white
+
mr
.
material
.
color
)
/
2
);
mr
.
material
=
mat
;
Texture2D
noise
=
new
Texture2D
(
100
,
100
);
float
scale
=
UnityEngine
.
Random
.
Range
(
20
,
50
);
for
(
int
i
=
0
;
i
<
noise
.
width
;
++
i
)
{
for
(
int
j
=
0
;
j
<
noise
.
height
;
++
j
)
{
float
noiseVal
=
Mathf
.
PerlinNoise
(
scale
*
i
/
noise
.
width
,
scale
*
j
/
noise
.
height
);
noise
.
SetPixel
(
i
,
j
,
new
Color
(
noiseVal
,
noiseVal
,
noiseVal
,
1
));
}
}
noise
.
Apply
();
mat
.
SetTexture
(
"_NoiseTex"
,
noise
);
const
float
time
=
0.5f
;
for
(
float
t
=
0
;
t
<
time
;
t
+=
Time
.
deltaTime
)
{
//print(t / time);
mat
.
SetFloat
(
"_Threshold"
,
t
/
time
);
yield
return
null
;
}
mat
.
SetFloat
(
"_Threshold"
,
1
);
}
}
RhythmKata/Assets/Scripts/PlayEngine.cs
View file @
928ffea4
...
...
@@ -30,7 +30,10 @@ public class PlayEngine : SingletonBehaviour<PlayEngine>
public
SteamVR_Action_Boolean
fire
;
public
SteamVR_Input_Sources
leftHand
;
public
SteamVR_Input_Sources
rightHand
;
public
SteamVR_Input_Sources
rightHand
;
private
int
combo
;
private
int
score
;
public
void
Start
()
{
...
...
@@ -121,6 +124,20 @@ public class PlayEngine : SingletonBehaviour<PlayEngine>
startDspTime
-=
1.0f
;
}
}
// Simple implementations of Combo, Score UIs
// It needs to be changed if PlayEngine don't have any responsibilities of score & combo
public
void
HandleNoteJudge
(
JudgeType
type
)
{
if
(
type
==
JudgeType
.
Ignore
)
return
;
combo
=
type
!=
JudgeType
.
Miss
?
combo
+
1
:
0
;
score
+=
(
int
)
type
;
IngameUIManager
.
inst
.
UpdateComboUI
(
combo
);
IngameUIManager
.
inst
.
UpdateScoreUI
(
score
);
}
//
}
public
class
PlayerInput
...
...
RhythmKata/Assets/Shaders.meta
0 → 100644
View file @
928ffea4
fileFormatVersion: 2
guid: c914f324cf453f049a32e43b44daeee1
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
RhythmKata/Assets/Shaders/Dissolve.shader
0 → 100644
View file @
928ffea4
Shader
"Unlit/Dissolve"
{
Properties
{
_MainTex
(
"Texture"
,
2
D
)
=
"white"
{}
_Color
(
"Color"
,
Color
)
=
(
1
,
1
,
1
,
1
)
_NoiseTex
(
"Noise_Texture"
,
2
D
)
=
"white"
{}
_Threshold
(
"Threshold"
,
range
(
0
,
1
))
=
0
_Glow
(
"Glow"
,
Color
)
=
(
1
,
0
.
5
,
0
.
5
,
1
)
_EmissionAmount
(
"Emission amount"
,
float
)
=
1
}
SubShader
{
Tags
{
"RenderType"
=
"Opaque"
}
LOD
100
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
// make fog work
#pragma multi_compile_fog
#include "UnityCG.cginc"
struct
appdata
{
float4
vertex
:
POSITION
;
float2
uv
:
TEXCOORD0
;
};
struct
v2f
{
float2
uv
:
TEXCOORD0
;
float4
vertex
:
SV_POSITION
;
};
sampler2D
_MainTex
;
float4
_MainTex_ST
;
v2f
vert
(
appdata
v
)
{
v2f
o
;
o
.
vertex
=
UnityObjectToClipPos
(
v
.
vertex
);
o
.
uv
=
TRANSFORM_TEX
(
v
.
uv
,
_MainTex
);
UNITY_TRANSFER_FOG
(
o
,
o
.
vertex
);
return
o
;
}
fixed4
_Color
;
sampler2D
_NoiseTex
;
float
_Threshold
;
fixed4
_Glow
;
float
_EmissionAmount
;
fixed4
frag
(
v2f
i
)
:
SV_Target
{
fixed4
col
=
tex2D
(
_MainTex
,
i
.
uv
)
*
_Color
;
if
(
col
.
a
<
0
.
01
f
)
discard
;
if
(
tex2D
(
_NoiseTex
,
i
.
uv
).
r
<
_Threshold
)
discard
;
else
if
(
tex2D
(
_NoiseTex
,
i
.
uv
).
r
<
_Threshold
+
0
.
05
f
)
col
=
lerp
(
_Glow
,
col
,
(
tex2D
(
_NoiseTex
,
i
.
uv
).
r
-
_Threshold
)
*
20
);
//else
// o.Emission = _Glow * _EmissionAmount * pow(1 - (tex2D(_NoiseTex, IN.uv_MainTex).r - _Threshold), 10);
return
col
;
}
ENDCG
}
}
}
RhythmKata/Assets/Shaders/Dissolve.shader.meta
0 → 100644
View file @
928ffea4
fileFormatVersion: 2
guid: 457a7835d317dbd40a3c3467b0006e70
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
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