Skip to content

Instantly share code, notes, and snippets.

@shivaduke28
Created March 24, 2022 06:59
Show Gist options
  • Save shivaduke28/87bc3a79cd9311274e7e73641e8fce4f to your computer and use it in GitHub Desktop.
Save shivaduke28/87bc3a79cd9311274e7e73641e8fce4f to your computer and use it in GitHub Desktop.
GamingLight for Kanikama
using UdonSharp;
using UnityEngine;
public class GamingLight : UdonSharpBehaviour
{
[SerializeField] Renderer[] renderers;
[SerializeField] float intensity;
[SerializeField] float speed;
private void LateUpdate()
{
for(var i = 0; i< renderers.Length; i++)
{
var h = (float)i / renderers.Length + Time.time * speed;
var c = Color.HSVToRGB(h % 1, 1, 1);
renderers[i].material.SetVector("_EmissionColor", c.linear * intensity);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment