Question by
ed-spatialsauce · May 12, 2020 at 10:29 AM ·
shadersstandard
EnableKeyword("_EMISSION") not working 2019.3.13f1
Hey there,
Does mat.EnableKeyword("_EMISSION") no longer work in 2019.3.13f1?
I can't find out if it was removed or if it's broken. Is there a new way to enable emission or to check if it is enabled?
I made a new project with a cube that has a material using a standard shader. I think added the script below and plugged in the material. It seems the keyword _EMISSION doesn't exist for the shader?
Thanks
using UnityEngine;
public class Emission : MonoBehaviour
{
public Material mat;
public bool emEnabled = false;
private void Awake()
{
mat.DisableKeyword("_EMISSION");
emEnabled = false;
}
private void Update()
{
if (Time.time > 2f && !emEnabled)
{
emEnabled = true;
mat.EnableKeyword("_EMISSION");
}
}
}
Comment
Your answer