Time for action – creating a purchase screen
To sell our product in our game, we first need a screen that offers the option for users to buy it. As a developer, you can put the purchase screen anywhere, but for this demonstration, we'll add it to a pause screen. Perform the following steps to create a purchase screen:
Create an empty
GameObject
to hold our pause screen code by clicking on Create Empty in the GameObject menu on Unity's toolbar.Name the new object
PauseManager
in the Hierarchy window.Your new object should now appear in the Inspector and Hierarchy windows as shown in the following screenshot:
Next, we'll create the pause screen window that will contain the purchase button.
Add a new GUI Texture component to your
PauseManager
object by selecting it from the Rendering category in the Add Component menu.Use your preferred image editor to create a basic texture that reads PAUSED at the top and apply it to your GUI Texture component.
Make sure your texture is positioned at the proper...