Join Jesse Freeman for an in-depth discussion in this video Recycling game objects, part of Unity 5 2D Essential Training (2015).
- Now we're ready to start…looking into how we can Recycle GameObjects.…One way that we see,…that we're going to need to Destroy an Object,…is to not actually Destroy it.…We're simply going to shut it down.…Now, Unity takes advantage of…composition over inheritance.…That means it prefers having lots of little scripts…that are attached to GameObjects…that add additional functionality.…This is the opposite of if we'd built a base class…for all of our GameObjects and extended it…and added this Recycle logic to it.…So, in order to start building out…the foundation for our Object Pool,…we're going to create a simple script…that just tells either our utility or the Object Pool…how to shut down and restart a GameObject.…
Let's go back into our Scripts folder…and here we're going to create a new C# Script…called Recycle GameObject.…Then, let's open this up in MonoDevelop.…Now we will be adding this class to our GameObjects,…so let's leave the inheritance of Monobehavior.…But we will not be using the Start and Update methods,…
Super Zombie Runner riffs off the popular endless runner genre: a one-button casual game that's not only fun to play but exciting to build. The focus of the work is a reusable code base that you can extend and make your own, while learning the basics of object pooling, supporting multiple screen resolutions, tracking scoring, and multi-platform publishing. Along the way, Jesse covers key Unity features, such as working with sprites, creating animations, and leveraging the UI components.
- Working with sprites and animation
- Creating the player
- Spawning GameObjects
- Adding obstacles and collisions
- Building the game objects and logic
- Managing game state
- Creating pixel-perfect cameras
- Designing for multiple screen resolutions
- Adding scores
- Optimizing performance
- Publishing to desktop, web, and mobile platforms
Skill Level Intermediate
1. Working with Sprites
2. Creating Repeating Textures
3. Creating Obstacles
4. Object Pooling
5. Creating the Player
6. Setting Up the Game
7. Adding UI
8. Creating More Obstacles
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
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.