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
76bf8620
Commit
76bf8620
authored
Nov 18, 2019
by
15박보승
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'notemovement' of
https://git.kucatdog.net/ulongcha/rhythmkata
into notemovement
parents
2c23ca16
928ffea4
Changes
18
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
19705 additions
and
305 deletions
+19705
-305
EdgeNote_Down.prefab
RhythmKata/Assets/Prefabs/EdgeNote_Down.prefab
+5
-5
EdgeNote_Left.prefab
RhythmKata/Assets/Prefabs/EdgeNote_Left.prefab
+3
-3
EdgeNote_Right.prefab
RhythmKata/Assets/Prefabs/EdgeNote_Right.prefab
+3
-3
EdgeNote_Up.prefab
RhythmKata/Assets/Prefabs/EdgeNote_Up.prefab
+5
-5
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
EdgeNoteObject.cs
RhythmKata/Assets/Scripts/EdgeNoteObject.cs
+18
-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
+1
-1
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/EdgeNote_Down.prefab
View file @
76bf8620
...
@@ -27,13 +27,13 @@ Transform:
...
@@ -27,13 +27,13 @@ Transform:
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
4640709078173886784
}
m_GameObject
:
{
fileID
:
4640709078173886784
}
m_LocalRotation
:
{
x
:
0
,
y
:
0
,
z
:
0
.7071068
,
w
:
0.7071068
}
m_LocalRotation
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
1
}
m_LocalPosition
:
{
x
:
0
,
y
:
-3
,
z
:
5
0
}
m_LocalPosition
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalScale
:
{
x
:
1
,
y
:
10
,
z
:
1
}
m_LocalScale
:
{
x
:
1
0
,
y
:
10
,
z
:
1
}
m_Children
:
[]
m_Children
:
[]
m_Father
:
{
fileID
:
0
}
m_Father
:
{
fileID
:
0
}
m_RootOrder
:
0
m_RootOrder
:
0
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
9
0
}
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
---
!u!33
&4640709078173886787
---
!u!33
&4640709078173886787
MeshFilter
:
MeshFilter
:
m_ObjectHideFlags
:
0
m_ObjectHideFlags
:
0
...
@@ -111,4 +111,4 @@ MonoBehaviour:
...
@@ -111,4 +111,4 @@ MonoBehaviour:
hitSfx
:
hitSfx
:
-
{
fileID
:
8300000
,
guid
:
e60d0bfc8448c5040af14e9faeaecae5
,
type
:
3
}
-
{
fileID
:
8300000
,
guid
:
e60d0bfc8448c5040af14e9faeaecae5
,
type
:
3
}
-
{
fileID
:
8300000
,
guid
:
b90743fe091960d4f837d44bbd2ad318
,
type
:
3
}
-
{
fileID
:
8300000
,
guid
:
b90743fe091960d4f837d44bbd2ad318
,
type
:
3
}
direction
:
{
x
:
0
,
y
:
0
,
z
:
0
}
direction
:
{
x
:
0
,
y
:
-1
,
z
:
0
}
RhythmKata/Assets/Prefabs/EdgeNote_Left.prefab
View file @
76bf8620
...
@@ -28,8 +28,8 @@ Transform:
...
@@ -28,8 +28,8 @@ Transform:
m_PrefabAsset
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
4734231541000158423
}
m_GameObject
:
{
fileID
:
4734231541000158423
}
m_LocalRotation
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
1
}
m_LocalRotation
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
1
}
m_LocalPosition
:
{
x
:
-5
,
y
:
0
,
z
:
5
0
}
m_LocalPosition
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalScale
:
{
x
:
1
,
y
:
7
,
z
:
1
}
m_LocalScale
:
{
x
:
1
0
,
y
:
10
,
z
:
1
}
m_Children
:
[]
m_Children
:
[]
m_Father
:
{
fileID
:
0
}
m_Father
:
{
fileID
:
0
}
m_RootOrder
:
0
m_RootOrder
:
0
...
@@ -111,4 +111,4 @@ MonoBehaviour:
...
@@ -111,4 +111,4 @@ MonoBehaviour:
hitSfx
:
hitSfx
:
-
{
fileID
:
8300000
,
guid
:
e60d0bfc8448c5040af14e9faeaecae5
,
type
:
3
}
-
{
fileID
:
8300000
,
guid
:
e60d0bfc8448c5040af14e9faeaecae5
,
type
:
3
}
-
{
fileID
:
8300000
,
guid
:
b90743fe091960d4f837d44bbd2ad318
,
type
:
3
}
-
{
fileID
:
8300000
,
guid
:
b90743fe091960d4f837d44bbd2ad318
,
type
:
3
}
direction
:
{
x
:
0
,
y
:
0
,
z
:
0
}
direction
:
{
x
:
-1
,
y
:
0
,
z
:
0
}
RhythmKata/Assets/Prefabs/EdgeNote_Right.prefab
View file @
76bf8620
...
@@ -28,8 +28,8 @@ Transform:
...
@@ -28,8 +28,8 @@ Transform:
m_PrefabAsset
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
1476454008853626150
}
m_GameObject
:
{
fileID
:
1476454008853626150
}
m_LocalRotation
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
1
}
m_LocalRotation
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
1
}
m_LocalPosition
:
{
x
:
5
,
y
:
0
,
z
:
5
0
}
m_LocalPosition
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalScale
:
{
x
:
1
,
y
:
7
,
z
:
1
}
m_LocalScale
:
{
x
:
1
0
,
y
:
10
,
z
:
1
}
m_Children
:
[]
m_Children
:
[]
m_Father
:
{
fileID
:
0
}
m_Father
:
{
fileID
:
0
}
m_RootOrder
:
0
m_RootOrder
:
0
...
@@ -111,4 +111,4 @@ MonoBehaviour:
...
@@ -111,4 +111,4 @@ MonoBehaviour:
hitSfx
:
hitSfx
:
-
{
fileID
:
8300000
,
guid
:
e60d0bfc8448c5040af14e9faeaecae5
,
type
:
3
}
-
{
fileID
:
8300000
,
guid
:
e60d0bfc8448c5040af14e9faeaecae5
,
type
:
3
}
-
{
fileID
:
8300000
,
guid
:
b90743fe091960d4f837d44bbd2ad318
,
type
:
3
}
-
{
fileID
:
8300000
,
guid
:
b90743fe091960d4f837d44bbd2ad318
,
type
:
3
}
direction
:
{
x
:
0
,
y
:
0
,
z
:
0
}
direction
:
{
x
:
1
,
y
:
0
,
z
:
0
}
RhythmKata/Assets/Prefabs/EdgeNote_Up.prefab
View file @
76bf8620
...
@@ -27,13 +27,13 @@ Transform:
...
@@ -27,13 +27,13 @@ Transform:
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
4081910931583206819
}
m_GameObject
:
{
fileID
:
4081910931583206819
}
m_LocalRotation
:
{
x
:
0
,
y
:
0
,
z
:
0
.7071068
,
w
:
0.7071068
}
m_LocalRotation
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
1
}
m_LocalPosition
:
{
x
:
0
,
y
:
3
,
z
:
5
0
}
m_LocalPosition
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalScale
:
{
x
:
1
,
y
:
10
,
z
:
1
}
m_LocalScale
:
{
x
:
1
0
,
y
:
10
,
z
:
1
}
m_Children
:
[]
m_Children
:
[]
m_Father
:
{
fileID
:
0
}
m_Father
:
{
fileID
:
0
}
m_RootOrder
:
0
m_RootOrder
:
0
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
9
0
}
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
---
!u!33
&4081910931583206814
---
!u!33
&4081910931583206814
MeshFilter
:
MeshFilter
:
m_ObjectHideFlags
:
0
m_ObjectHideFlags
:
0
...
@@ -111,4 +111,4 @@ MonoBehaviour:
...
@@ -111,4 +111,4 @@ MonoBehaviour:
hitSfx
:
hitSfx
:
-
{
fileID
:
8300000
,
guid
:
e60d0bfc8448c5040af14e9faeaecae5
,
type
:
3
}
-
{
fileID
:
8300000
,
guid
:
e60d0bfc8448c5040af14e9faeaecae5
,
type
:
3
}
-
{
fileID
:
8300000
,
guid
:
b90743fe091960d4f837d44bbd2ad318
,
type
:
3
}
-
{
fileID
:
8300000
,
guid
:
b90743fe091960d4f837d44bbd2ad318
,
type
:
3
}
direction
:
{
x
:
0
,
y
:
0
,
z
:
0
}
direction
:
{
x
:
0
,
y
:
1
,
z
:
0
}
RhythmKata/Assets/Prefabs/HitEffects/Hit.prefab
View file @
76bf8620
...
@@ -9568,7 +9568,7 @@ ParticleSystem:
...
@@ -9568,7 +9568,7 @@ ParticleSystem:
serializedVersion
:
6
serializedVersion
:
6
lengthInSec
:
0.2
lengthInSec
:
0.2
simulationSpeed
:
1
simulationSpeed
:
1
stopAction
:
0
stopAction
:
2
cullingMode
:
1
cullingMode
:
1
ringBufferMode
:
0
ringBufferMode
:
0
ringBufferLoopRange
:
{
x
:
0
,
y
:
1
}
ringBufferLoopRange
:
{
x
:
0
,
y
:
1
}
...
...
RhythmKata/Assets/Prefabs/HitEffects/Miss.prefab
0 → 100644
View file @
76bf8620
This diff is collapsed.
Click to expand it.
RhythmKata/Assets/Prefabs/HitEffects/Miss.prefab.meta
0 → 100644
View file @
76bf8620
fileFormatVersion: 2
guid: b8ffb5b84b254524abff419289c5adfd
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
RhythmKata/Assets/Prefabs/HitEffects/Perfect.prefab
View file @
76bf8620
...
@@ -43,7 +43,7 @@ ParticleSystem:
...
@@ -43,7 +43,7 @@ ParticleSystem:
serializedVersion
:
6
serializedVersion
:
6
lengthInSec
:
0.1
lengthInSec
:
0.1
simulationSpeed
:
1
simulationSpeed
:
1
stopAction
:
0
stopAction
:
2
cullingMode
:
3
cullingMode
:
3
ringBufferMode
:
0
ringBufferMode
:
0
ringBufferLoopRange
:
{
x
:
0
,
y
:
1
}
ringBufferLoopRange
:
{
x
:
0
,
y
:
1
}
...
...
RhythmKata/Assets/Scenes/bs.unity
View file @
76bf8620
This diff is collapsed.
Click to expand it.
RhythmKata/Assets/Scenes/mergescene.unity
View file @
76bf8620
This diff is collapsed.
Click to expand it.
RhythmKata/Assets/Scripts/Core/Level.cs
View file @
76bf8620
...
@@ -23,7 +23,7 @@ class Level
...
@@ -23,7 +23,7 @@ class Level
{
{
note
.
Deactivate
();
note
.
Deactivate
();
}
}
note
.
HandleJudge
(
judge
);
note
.
HandleJudge
(
judge
);
}
}
}
}
...
...
RhythmKata/Assets/Scripts/EdgeNoteObject.cs
View file @
76bf8620
...
@@ -6,6 +6,8 @@ public class EdgeNoteObject : NoteObject
...
@@ -6,6 +6,8 @@ public class EdgeNoteObject : NoteObject
{
{
[
SerializeField
]
[
SerializeField
]
private
Vector3
direction
;
private
Vector3
direction
;
private
const
float
radius
=
100f
;
public
void
Init
(
HandType
hand
)
public
void
Init
(
HandType
hand
)
{
{
Material
mat
=
GetComponent
<
Renderer
>().
material
;
Material
mat
=
GetComponent
<
Renderer
>().
material
;
...
@@ -28,7 +30,22 @@ public class EdgeNoteObject : NoteObject
...
@@ -28,7 +30,22 @@ public class EdgeNoteObject : NoteObject
public
override
void
SetPosition
(
float
remainedTime
)
public
override
void
SetPosition
(
float
remainedTime
)
{
{
transform
.
position
=
Vector3
.
Lerp
(
endPoint
,
endPoint
+
new
Vector3
(
0
,
0
,
200
),
remainedTime
/
maxRemainedTime
);
if
(
remainedTime
>
0.5f
)
{
transform
.
position
=
new
Vector3
(
0
,
0
,
Mathf
.
Lerp
(
radius
,
500
,
(
remainedTime
-
0.5f
)
*
2
));
}
else
{
float
angle
=
Mathf
.
Lerp
(
0
,
90
,
Mathf
.
Pow
(
remainedTime
*
2
-
1
,
2
));
transform
.
position
=
Quaternion
.
Euler
(
direction
.
x
*
angle
,
direction
.
y
*
angle
,
0
)
*
new
Vector3
(
0
,
0
,
radius
);
transform
.
LookAt
(
Vector3
.
zero
);
}
//transform.position = Vector3.Lerp(endPoint, endPoint + new Vector3(0, 0, 200), remainedTime);
}
}
public
override
bool
IsHit
(
Ray
ray
)
public
override
bool
IsHit
(
Ray
ray
)
...
...
RhythmKata/Assets/Scripts/IngameUIManager.cs
View file @
76bf8620
...
@@ -9,6 +9,7 @@ public class IngameUIManager : SingletonBehaviour<IngameUIManager>
...
@@ -9,6 +9,7 @@ public class IngameUIManager : SingletonBehaviour<IngameUIManager>
public
Text
scoreText
;
public
Text
scoreText
;
public
Text
comboText
;
public
Text
comboText
;
private
Vector3
comboTextPosition
;
private
void
Start
()
private
void
Start
()
{
{
...
@@ -33,6 +34,17 @@ public class IngameUIManager : SingletonBehaviour<IngameUIManager>
...
@@ -33,6 +34,17 @@ public class IngameUIManager : SingletonBehaviour<IngameUIManager>
if
(
combo
<
1
)
if
(
combo
<
1
)
comboText
.
text
=
""
;
comboText
.
text
=
""
;
else
else
{
comboText
.
text
=
combo
.
ToString
()
+
" Combo!"
;
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 @
76bf8620
...
@@ -14,7 +14,7 @@ public abstract class NoteObject : MonoBehaviour
...
@@ -14,7 +14,7 @@ public abstract class NoteObject : MonoBehaviour
public
Vector3
endPoint
;
public
Vector3
endPoint
;
public
float
maxRemainedTime
=
5
;
public
float
maxRemainedTime
=
5
;
public
float
perfectZ
=
1
0
;
public
float
perfectZ
=
5
0
;
public
AudioClip
[]
hitSfx
;
public
AudioClip
[]
hitSfx
;
...
@@ -60,10 +60,17 @@ public abstract class NoteObject : MonoBehaviour
...
@@ -60,10 +60,17 @@ public abstract class NoteObject : MonoBehaviour
// TODO: temporary implementation
// TODO: temporary implementation
// make note invisible
// make note invisible
StartCoroutine
(
DissolveRoutine
());
/*
var meshRenderer = gameObject.GetComponent<MeshRenderer>();
var meshRenderer = gameObject.GetComponent<MeshRenderer>();
var trailRenderer = gameObject.GetComponent<TrailRenderer>();
var trailRenderer = gameObject.GetComponent<TrailRenderer>();
if (meshRenderer) meshRenderer.enabled = false;
if (meshRenderer) meshRenderer.enabled = false;
if (trailRenderer) trailRenderer.enabled = false;
if (trailRenderer) trailRenderer.enabled = false;
*/
PlayEngine
.
inst
.
HandleNoteJudge
(
judge
.
type
);
}
}
}
}
...
@@ -75,4 +82,38 @@ public abstract class NoteObject : MonoBehaviour
...
@@ -75,4 +82,38 @@ public abstract class NoteObject : MonoBehaviour
}
}
public
abstract
bool
IsHit
(
Ray
ray
);
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 @
76bf8620
...
@@ -30,7 +30,10 @@ public class PlayEngine : SingletonBehaviour<PlayEngine>
...
@@ -30,7 +30,10 @@ public class PlayEngine : SingletonBehaviour<PlayEngine>
public
SteamVR_Action_Boolean
fire
;
public
SteamVR_Action_Boolean
fire
;
public
SteamVR_Input_Sources
leftHand
;
public
SteamVR_Input_Sources
leftHand
;
public
SteamVR_Input_Sources
rightHand
;
public
SteamVR_Input_Sources
rightHand
;
private
int
combo
;
private
int
score
;
public
void
Start
()
public
void
Start
()
{
{
...
@@ -121,6 +124,20 @@ public class PlayEngine : SingletonBehaviour<PlayEngine>
...
@@ -121,6 +124,20 @@ public class PlayEngine : SingletonBehaviour<PlayEngine>
startDspTime
-=
1.0f
;
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
public
class
PlayerInput
...
...
RhythmKata/Assets/
Resources/SFX/SFX Project/sfx Project/Samples/Recorded
.meta
→
RhythmKata/Assets/
Shaders
.meta
View file @
76bf8620
fileFormatVersion: 2
fileFormatVersion: 2
guid:
d9a533cec04e2124e9c31541b4f63e72
guid:
c914f324cf453f049a32e43b44daeee1
folderAsset: yes
folderAsset: yes
DefaultImporter:
DefaultImporter:
externalObjects: {}
externalObjects: {}
...
...
RhythmKata/Assets/Shaders/Dissolve.shader
0 → 100644
View file @
76bf8620
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 @
76bf8620
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