In this video, Jesse Freeman teaches you how to create a more generic approach to implementing object pooling in Unity by creating a recycle GameObject script that can be applied to any GameObject in Unity. Learning how to create a reusable object pool system in Unity 5 is an important skill for building a 2D game.
- [Voiceover] Now our object pool system is working…really well, and we can simply attach…a recycled game object script…to any game object we want to add to the pool.…But what happens in other scripts…when we restart a game object that's being recycled?…Right now there's no way to actually call Restart…or Shut Down on other scripts.…In order to do that, we're gonna modify the way…that our recycled script works to look for other scripts…that it'll need to reset whenever it gets reset itself.…
Let's open up the recycled game object script.…Now, one of the ways that we can actually implement this…is by using something called the interface.…An interface is like a type of contract…that ensures that a class that uses it will always…have the same type of public methods.…Here above our recycled game object…we're gonna create a new public interface…and we're gonna call this interface IRecycle.…The two methods that we use inside of our recycled…game object script are Restart and Shutdown.…
So let's put them into our IRecycled interface.…
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.