Hello,
I'm trying to override the function that unity calls for drawing GameObject's to the screen.
I want this so I can change values in the shader just before the object is drawn.
Right now I have this:
void Update () {
renderer.sharedMaterial.SetVector("center", new Vector4(transform.position.x, transform.position.y, 0, 0));
}
But since Update() is called for all GameObject's before any are drawn, only the last updated GameObject has the correct value for "center"
Any help would be appreciated,
↧