Enable Emission to update at run time in editor 5.6.1?

I recently updated Unity from 5.5.2 to 5.6.1 since I started a new project and figured it would be a good time to do so.

In one of my scripts I had a blinking glow functions that adjusted the emission value to create the effect.

In 5.5.2 it worked in the editor without any special needs or anything of that sort.

In 5.6.1, it no longer works in the editor by default and to get it to work in the editor I have to open up the material on the object in the inspector or put on a different shader on it which causes it to lose the texture reference until I open the material up in the inspector.

I read that I have to use enable keywords to get the materials to work right in the editor at run time but I haven’t been able to find a reference to what keywords are available.

Wow, this problem did not have an easily discovered answer…


You must call it every time you change the emissive material in any way, this single function gets its very own extension class so you don’t even find it when you look under Renderer…

Found a list of all Keywords at Unity - Manual: Using materials with C# scripts