soundvision/UnityProject/Assets/Scenes/Examples/SpectrogramWorld/ChangeHue.cs
2019-11-21 10:44:56 +01:00

27 lines
No EOL
560 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace cylvester
{
interface IChangeHue
{
float Hue { set; }
}
public class ChangeHue : MonoBehaviour, IChangeHue
{
[SerializeField] Renderer thisRend_;
private static readonly int spectrogramHue_ = Shader.PropertyToID("_Pitch");
public float Hue
{
set
{
var x = value * 1f;
thisRend_.material.SetFloat(spectrogramHue_, x);
}
}
}
}