Creating our first purchase
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. Let's add that functionality now by creating a button that when clicked will do just that:
- Let's first open up our Main Menu level by going to the
Project
window, opening theAssets/Scenes
folder, and then double-clicking on theMainMenu
file. - From there, let's click on the 2D button to go into 2D mode since we'll be working with UI.
- We will first need to have something to sell; to do that, we will use the IAP Catalog, which we can access by going to
Window...