Hello,
I wish to change dynamically this value on a material. Which way can I do that?
Thank you
Hello,
I wish to change dynamically this value on a material. Which way can I do that?
Thank you
using UnityEngine;
using System.Collections;
public class EmissiveColorSet : MonoBehaviour {
public Color _color;
public Material mat;
void Start() {
}
void Update()
{
mat.SetColor("_EmissionColor", _color);
}
}
It is not the color I wish to change, but value on the box into the red circle I made. The multiplier?
I tried something like this:
render.material.EnableKeyword("_EMISSION");
DynamicGI.SetEmissive(render, new Color(1f, 0.0f, 0.0f, 1.0f) * 10);
render.UpdateGIMaterials();
DynamicGI.UpdateEnvironment();
But I didnt succeed to scale the emissive dynamically during game.
I wonder if there is some pre requisite on the material to activate, or in the environment?