Created
September 4, 2019 18:46
-
-
Save kleberandrade/317b5b072eca9db24f8984d8273bb7ba to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class ChangeColor : MonoBehaviour | |
{ | |
public Color m_MinColor = Color.white; | |
public Color m_MaxColor = Color.white; | |
private Renderer m_Renderer; | |
private void Start() | |
{ | |
m_Renderer = GetComponent<Renderer>(); | |
Color color = Color.Lerp(m_MinColor, m_MaxColor, Random.Range(0.0f, 1.0f)); | |
m_Renderer.material.SetColor("_Color", color); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment