Проект добавил
This commit is contained in:
1 parent
07ce9b8ba7
commit
1a78beb58a
545 files changed
+90820
No files matched your search
@@ -0,0 +1,23 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class WaveExpander : MonoBehaviour
|
||||
{
|
||||
public float expandSpeed = 15f;
|
||||
public float maxRadius = 20f;
|
||||
private float currentRadius = 0f;
|
||||
|
||||
void Update()
|
||||
{
|
||||
currentRadius += expandSpeed * Time.deltaTime;
|
||||
|
||||
// Отправляем данные в шейдер!
|
||||
Shader.SetGlobalVector("_WaveCenter", transform.position);
|
||||
Shader.SetGlobalFloat("_WaveRadius", currentRadius);
|
||||
|
||||
if (currentRadius >= maxRadius)
|
||||
{
|
||||
Shader.SetGlobalFloat("_WaveRadius", 0f);
|
||||
Destroy(gameObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user