In this video, Jesse Freeman teaches you how to connect up the object pool class build in the previous video. In order or use the object pool, you'll need to make sure Unity knows how to recycle its GameObjects. Learning how to create a reusable object pool system in Unity 5 is an important skill for building a 2D game.
- [Voiceover] So now that we have our object pool…let's look into how to connect it up…into our game object utility.…We'll open up the game object utility…and start adding in the code we need.…We'll want to manage all of the object pools in our game.…In order to do this we're going to create something…called the dictionary.…A dictionary allows us to have a key and a value.…In this case, we're going to type the key…to a specific type of prefab and the value…will match to the corresponding pool.…
This will help us look up where each of the pools are…whenever we need to create a new instance.…In order to do this we're going to need to import…the generic collections again.…So copy the systems collection line and add in generic.…Now, let's add the following property…to the top of our utility.…It's important to note that since…both of these methods are static,…and we want this class to be completely static,…we're going to have to also make our properties…static as well.…
This way they will always be stored inside of the…
Start watching to learn how to convert artwork into sprites, create repeating background textures with Unity's TexturePacker, and build reusable game objects such as players, obstacles, and enemies. Jesse also covers the basics of object pooling, working with custom UI components, and multiplatform publishing.
- Importing artwork
- Editing sprites
- Creating repeating background textures
- Building reusable obstacles
- Recycling game objects
- Building an object pool
- Creating the player
- Starting and ending the game
- Displaying and saving the score
- Adding menus and text
- Publishing a Unity game in different formats
Skill Level Beginner
1. Working with Sprites
2. Creating Repeating Textures
3. Creating Obstacles
4. Object Pooling
5. Creating the Player
6. Setting Up the Game
7. Polishing the Game
8. Creating More Obstacles
Publish to different formats5m 42s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.