Hi - I have a script which applies a texture to a curved custom cylinder.I want to be able to fade in and out this object. It has a component which I think is a shader (Backing
). If I change the tint of this material, and tweak the alpha in the inspector, it does the fade out - but I can’t figure out how to change that tint / alpha in code. I seem to be able to get a reference to the shader with Shader tileShader = thisTile.GetComponent<Shader>();
but this doesn’t seem to have a property called tint or color or anything like that. How would I change this in code? Or is there an easier way to accomplish the fade? I have access to DOTween, but its DOFade method doesn’t seem to be able to access the type of Game Object I have (a texture?)
Looks like I was able to get it through
GetComponent<Renderer>().materials[0].DOFade(0,1)