Instantly share code, notes, and snippets.

What would you like to do?
Draw call batching in Unity: Scene Optimization
// e.g. changes the material color (reflects in all objects that are using it)
gameObject.GetComponent<Renderer>().sharedMaterial.color =;
// e.g. creates a copy of the material and changes it’s color (the material is no longer shared)
gameObject.GetComponent<Renderer>().material.color =;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment