Building a better bucket

By typing a Collection, we're telling Unity which type of thing we'll put in there. That speeds up Unity's calculations, because the software doesn't have to worry about sorting through different types of things in the Collection.

Imagine if you brought home a bucket of mystery fried chicken, but were warned that it also contained a tennis shoe, a wrench, 175 ball bearings, and a well-worn copy of Big Al's Bathroom Reader. It would take you longer to sort out what was chicken and what was scrap metal than if it was 100% chicken, and consequently, you wouldn't be able to eat your way through the bucket quite as quickly. (Of course, if you made any dire mistakes, that Bathroom Reader would probably come in handy.)

Typing ...

Get Unity 4.x Game Development by Example Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.