Create a gist now
Instantly share code, notes, and snippets.
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 = Color.red;|
|// e.g. creates a copy of the material and changes it’s color (the material is no longer shared)|
|gameObject.GetComponent<Renderer>().material.color = Color.red;|