Displaying single object pickups with carrying and not-carrying text

Often the simplest inventory situation is to display text to tell players if they are carrying a single item (or not).

Getting ready

This recipe assumes that you are starting with the project Simple2Dgame_SpaceGirl setup from the first recipe in this chapter. So, either make a copy of that project or do the following:

  1. Create a new, empty 2D project.
  2. Import the Simple2Dgame_SpaceGirl package.
  3. Open scene Scene1 (in the Scenes folder).
  4. Set the Unity Player screen size to 800 x 600 (see the previous recipe for how to do this) and select this resolution in the Game panel the drop-down menu.
  5. Convert each sprite image to be of type Sprite (2D and UI). In the Inspector, choose Sprite (2D and ...

Get Unity 5.x Cookbook 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.