Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@tomazsaraiva
Last active February 18, 2018 00:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomazsaraiva/819876de4380146e98f5fbe587e9b56d to your computer and use it in GitHub Desktop.
Save tomazsaraiva/819876de4380146e98f5fbe587e9b56d to your computer and use it in GitHub Desktop.
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;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment