mirror of
https://github.com/RHeavenStudioPlus/HeavenStudioPlus.git
synced 2024-11-08 18:55:07 +00:00
31 lines
937 B
C#
31 lines
937 B
C#
using UnityEngine;
|
|
|
|
public class DoodleText : MonoBehaviour
|
|
{
|
|
public Material mat; // - Target material
|
|
|
|
public Vector4 DoodleMaxOffset; // - How far the UV can be distorted
|
|
public float DoodleFrameTime; // - How long does a frame last
|
|
public int DoodleFrameCount; // - How many frames per animation
|
|
public Vector4 DoodleNoiseScale; // - How noisy should the effect be
|
|
|
|
public bool DoodleOn; // - Toggle doodle effect
|
|
|
|
void Update()
|
|
{
|
|
SetAll();
|
|
}
|
|
|
|
public void SetAll()
|
|
{
|
|
mat.SetVector("_DoodleMaxOffset", DoodleMaxOffset);
|
|
mat.SetFloat("_DoodleFrameTime", DoodleFrameTime);
|
|
mat.SetInt("_DoodleFrameCount", DoodleFrameCount);
|
|
mat.SetVector("_DoodleNoiseScale", DoodleNoiseScale);
|
|
|
|
if (DoodleOn)
|
|
Shader.EnableKeyword("DOODLE_ON");
|
|
else
|
|
Shader.DisableKeyword("DOODLE_ON");
|
|
}
|
|
}
|