Time for action – reflecting unlocked functionality in games
Coding in-app purchasing can be intimidating because it requires tricky code and doesn't allow for a lot of visual creation in the Unity editor, but at this point, the hardest part is behind you. Now, you get to create a functionality in your game that only gets called if the game is unlocked, and what you add to the full version of your game is completely up to you.
In this section, we'll add a different, special cannonball to our prototype that bounces on impact instead of landing firmly. Any user who has unlocked the full game will be able to fire this new type of cannonball in place of the standard one. Perform the following steps to display the unlocked functionality:
Create a new prefab called
CannonballSpecial
in yourPrefabs
folder.Create a primitive sphere using the Create menu in the Hierarchy window and link it to your new prefab.
Create a new, unique material called
CannonballSpecialMat
in yourMaterials
folder.Import...