To make our first in-app purchase, we will make use of a feature of Unity that was just added to our project, Codeless IAP. It is called Codeless IAP because you do not need to write any code for the actual IAP transaction, just the script that defines what users get if they make the purchase. It's by far the easiest way to integrate in-app purchases in Unity games and a great way to start trying IAPs in our project.
One of the most common in-app purchases is the ability to disable advertisements in mobile games. Using the following steps, let's add that functionality by creating a button that, when clicked, will disable advertisements:
- Open up our Main Menu level by going to the Project window, opening the Assets/Scenes folder, and then double-clicking on the MainMenu file.
- From there, return to the Scene window if not there already and then click on the 2D button to go into 2D mode since we'll be working with UI.
- We will first need to have...