Skip to content

Instantly share code, notes, and snippets.

@tsmrecki
Created May 19, 2016 08:52
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 tsmrecki/ee8026cc8c6bb1f2b3577833df7b1ddb to your computer and use it in GitHub Desktop.
Save tsmrecki/ee8026cc8c6bb1f2b3577833df7b1ddb to your computer and use it in GitHub Desktop.
Getting the component of the object
public void SetGazedAt(bool gazedAt) {
GetComponent<Renderer>().material.color = gazedAt ? Color.green : Color.red;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment