Accessing GameObjects using drag-and-drop versus writing code

Unity has a rather neat feature that allows us to assign GameObjects to variables without writing the code. It definitely has its uses, however, if it's not really necessary, I recommend assigning GameObjects in code. Why?

Tip

Six months from now, when you are the stranger looking at your own code, you may look at it and wonder why your code looks incomplete. It's your game though, so you can create it anyway you please. I'm just saying, don't go hog wild with drag-and-drop and then later wonder what it was you were trying to accomplish.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.168.8