Exemplo n.º 1
0
 //购买商品
 public void PurchaseItem(int productID,IAPSuccessEvent iapSuccessHandle,IAPFailedEvent iapFailedHandle)
 {
     _IAPSuccessEvent=iapSuccessHandle;
     _IAPFailedEvent=iapFailedHandle;
     string Id = System.Convert.ToString(productID);
     string[] args={Id};
     mainActivity.Call("purchaseItem",args);
 }
Exemplo n.º 2
0
 public static void RestoreProduct(IAPRestoreResultEvent IAPRestoreResultHandle,IAPFailedEvent iapFailedHandle)
 {
     _IAPRestoreResultEvent=IAPRestoreResultHandle;
     _IAPFailedEvent=iapFailedHandle;
     _restoreProduct();
 }
Exemplo n.º 3
0
 public static void PurchaseItem(int productID,IAPSuccessEvent iapSuccessHandle,IAPFailedEvent iapFailedHandle)
 {
     _IAPSuccessEvent=iapSuccessHandle;
     _IAPFailedEvent=iapFailedHandle;
     _purchaseItem(productID);
 }
Exemplo n.º 4
0
 void onItemPurchaseFail(IAPFailedEvent e)
 {
     if (promise != null)
         promise.Reject(new Exception(e.id));
 }
Exemplo n.º 5
0
 public void RestoreProduct(IAPRestoreResultEvent IAPRestoreResultHandle,IAPFailedEvent iapFailedHandle)
 {
     if (Application.platform == RuntimePlatform.IPhonePlayer)
     {
         UtilsForIOS.RestoreProduct(IAPRestoreResultHandle,iapFailedHandle);
     }
     else if (Application.platform == RuntimePlatform.Android)
     {
     #if UNITY_ANDROID
         UtilsForAndroid.Instance.RestoreProduct(IAPRestoreResultHandle,iapFailedHandle);
     #endif
     }
 }
Exemplo n.º 6
0
 public void PurchaseItem(int productID,IAPSuccessEvent iapSuccessHandle,IAPFailedEvent iapFailedHandle)
 {
     if (Application.platform == RuntimePlatform.IPhonePlayer)
     {
         UtilsForIOS.PurchaseItem(productID,iapSuccessHandle,iapFailedHandle);
     }
     else if (Application.platform == RuntimePlatform.Android)
     {
     #if UNITY_ANDROID
         UtilsForAndroid.Instance.PurchaseItem(productID,iapSuccessHandle,iapFailedHandle);
     #endif
     }
 }
Exemplo n.º 7
0
 //恢复内购
 public void RestoreProduct(IAPRestoreResultEvent IAPRestoreResultHandle,IAPFailedEvent iapFailedHandle)
 {
     _IAPRestoreResultEvent=IAPRestoreResultHandle;
     _IAPFailedEvent=iapFailedHandle;
     mainActivity.Call("restoreProduct");
 }