Albedoの色相をスクリプトで変える

UnityEngine.Color.HSVToRGB関数を使ってHSVの値を調節しています

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class hsv : MonoBehaviour
{
    //inspectorにsliderで0~1までのfloatで表示
    [Range(0.0f,1.0f)]
    public float h = 1 ;
    public float s = 1 ;
    public float v = 1 ;

    void Update()
    {
        //rgbをhsvに変換
        GetComponent<Renderer>().material.color = UnityEngine.Color.HSVToRGB(h,s,v);
    }
}


f:id:shinobigiken:20170727080619g:plain