Under normal conditions, the gameobject will use a material where the metallic component is null. When the conditions of an if statement are met, I would like to insert a sprite into the metallic component. What is the syntax for that?
I tried:
public void Udate()
{
if (forestDefense == true)
m_Renderer = GetComponent<Renderer>();
m_Renderer.material.EnableKeyword("_METALLICGLOSSMAP");
m_Renderer.material.SetTexture("_MetallicGlossMap", camouflage); ERROR
else
m_Renderer.material.SetTexture("_MetallicGlossMap", null);
and I get an error message (where it says ERROR), saying that “}” is expected there.
Thats one. Two, is it possible that if this change is made, that it would apply to only this specific gameObject or will it apply to every gameObject using that material?