2

For properties, layer needs gameObject to precede it but transform doesn't.

For methods, SetActive() needs gameObject to precede it but GetComponent<T>() doesn't.

Second question: is there a convention to use gameObject.[method/property name] at times instead of only writing [method/property name] (when appropriate)?

Roger Wang
  • 565
  • 2
  • 12
  • 30
  • I, and people I've worked with, always do just to be as explicit as possible but I don't know what official convention is. I don't think it's mentioned in the unity style guide. – Rocketman Dan May 27 '20 at 20:41

0 Answers0