Material mat = spriteRenderer.material;
mat.EnableKeyword("_EMISSION");
mat.globalIlluminationFlags = MaterialGlobalIlluminationFlags.RealtimeEmissive;
// Set Emission Intensity
mat.SetFloat("_EmissiveIntensity", 10000);
// Apply Emission Color * Intensity to Force Update
Color emissionColor = Color.white * 10000; // White for max glow
mat.SetColor("_EmissionColor", emissionColor);
spriteRenderer.material = mat;
I'm setting the material's emissive intensity and it kinda works but it doesn't show in game. When I succesfully change the intensity the sprites material turns to (Instance) where it shows the intensity as what I wanted but unless I manually change the float a bit it just doesn't affect in game. To change intensity; mat.SetFloat("_EmissiveIntensity", 10000);
works but I've added other lines to make sure even though I still couldn't get it to work.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744837957a4596379.html
评论列表(0条)