I have seen a piece of code that does this:
public Material outlineMaterial;
//...
void SomeFunction()
{
outlineMaterial.SetColor("_OutlineCol", outlineColor);
// ...
}
On Unity program exit, this change will be committed to the material file.
If I want to avoid such change, what’s the proper way to clone/instantiate this material?
PS: the material is not associated with a renderer, as it is being used with Graphics.Blit for a shader effect.