Ejemplo n.º 1
0
 public void OnUnityAdsDidFinish(string placementId, ShowResult showResult)
 {
     if (showResult == ShowResult.Finished)
     {
         gems.IncreaseGems(rewardValue);
     }
     else if (showResult == ShowResult.Skipped)
     {
         Debug.Log("Ah now, fair is fair, ya cant be skipping the auld ad's fella!");
     }
     else if (showResult == ShowResult.Failed)
     {
         Debug.LogWarning("The ad did not finish due to an error.");
     }
 }
Ejemplo n.º 2
0
    public PurchaseProcessingResult ProcessPurchase(PurchaseEventArgs e)
    {
        if (purchaseId.Equals(e.purchasedProduct.definition.id))
        {
            Debug.Log(string.Format("ProcessPurchase: PASS. Product: '{0}'", e.purchasedProduct.definition.id));
            Gems gems = FindObjectOfType <Gems>();
            gems.IncreaseGems(100);
        }
        else
        {
            Debug.Log(string.Format("ProcessPurchase: FAIL. Unrecognized product: '{0}'", e.purchasedProduct.definition.id));
        }

        return(PurchaseProcessingResult.Complete);
    }