冯乐乐的《Unity Shader入门精要》附带项目,其中部分shader已经修改测试
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

26 lines
547 B

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class LumLightTest : MonoBehaviour {
public GameObject lightObj;
private Color lightColor;
// Use this for initialization
void Start()
{
lightColor = new Color(0,0,0,0);
}
// Update is called once per frame
void Update()
{
if (lightColor.r < 1)
{
print(lightColor.r);
lightColor.r += Time.deltaTime;
lightColor.g += Time.deltaTime / 2;
lightObj.GetComponent<Renderer>().material.SetColor("_LuminousColor", lightColor);
}
}
}