Time for action – creating your first purchase function
The first step when integrating purchases is to mark any script that manages purchasing as a purchase listener. This tells the OUYA SDK that it will be handling at least one transaction and needs to be able to access the product list. Perform the following steps to create a function for purchasing:
Add the following lines of code to your class definition to enable it to listen for all IAP activity:
public class PauseScreen : MonoBehavior, OuyaSDK.IPauseListener, OuyaSDK.IResumeListener, OuyaSDK.IFetchGamerInfoListener, OuyaSDK.IGetProductsListener, OuyaSDK.IPurchaseListener, OuyaSDK.IGetReceiptsListener { ... }
Add the following extension to your
PauseScreen
script'sAwake
function to mark it as a listener for all of the previous events:void Awake () { OuyaSDK...