- Home /
Changing emission color in realtime after export doesn't work
Hey guys,
I am using the following code to change material's emission color in realtime:
Color selectionColor = new Color(0.3f, 0.2f, 0.0f);
void Start()
{
gameObject.GetComponent<Renderer>().material.EnableKeyword("_EMISSION");
}
void OnMouseDown()
{
isSelected = !isSelected;
if (isSelected)
{
gameObject.GetComponent<Renderer>().material.SetColor("_EmissionColor", selectionColor);
}
else
{
gameObject.GetComponent<Renderer>().material.SetColor("_EmissionColor", Color.black);
}
}
in Unity's editor it's working very well, but when I export my project to Desktop version, altering the emission color of any object simply doesn't work.
Do you have an idea what may be the cause?
I'm using Unity 5.1.1p3 and updating to newer version doesn't change anything.
Comment