コード例 #1
0
 public static bool IsInitialized()
 {
             #if UNITY_ANDROID
     return(AndroidBilling.IsInitialized());
             #elif UNITY_IOS
     return(iOSBilling.IsInitialized());
             #endif
 }
コード例 #2
0
 public static bool IsReady()
 {
             #if UNITY_ANDROID
     return(AndroidBilling.IsReady());
             #elif UNITY_IOS
     return(iOSBilling.IsReady());
             #endif
 }
コード例 #3
0
 public static void RestorePurchases()
 {
             #if UNITY_ANDROID
     AndroidBilling.RestorePurchases();
             #elif UNITY_IOS
     iOSBilling.RestorePurchases();
             #endif
 }
コード例 #4
0
 public static void Purchase(string itemId)
 {
     if (!string.IsNullOrEmpty(itemId))
     {
                     #if UNITY_ANDROID
         AndroidBilling.Purchase(itemId);
                     #elif UNITY_IOS
         iOSBilling.Purchase(itemId);
                     #endif
     }
     else
     {
         Debug.LogError("Could not purchase item with invalid item ID!");
     }
 }
コード例 #5
0
 public static void Purchase(string itemId, string developerPayload)
 {
     if (!string.IsNullOrEmpty(itemId))
     {
                     #if UNITY_ANDROID
         AndroidBilling.Purchase(itemId, developerPayload);
                     #elif UNITY_IOS
         // The developer payload is android only
         iOSBilling.Purchase(itemId);
                     #endif
     }
     else
     {
         Debug.LogError("Could not purchase item with invalid item ID!");
     }
 }
コード例 #6
0
    public static bool IsItemOwned(string itemId)
    {
        if (!string.IsNullOrEmpty(itemId))
        {
                        #if UNITY_ANDROID
            return(AndroidBilling.IsItemOwned(itemId));
                        #elif UNITY_IOS
            return(iOSBilling.IsItemOwned(itemId));
                        #endif
        }
        else
        {
            Debug.LogError("Could not check if item was owned with blank item ID!");
        }

        return(false);
    }
コード例 #7
0
 public static void Initialize(string publicKey, ItemData[] itemList)
 {
     if (!string.IsNullOrEmpty(publicKey))
     {
         if (itemList.Length > 0)
         {
             AndroidBilling.Initialize(publicKey, itemList);
         }
         else
         {
             Debug.LogError("Could not initialize billing with 0 items!");
         }
     }
     else
     {
         Debug.LogError("Invalid billing public key!");
     }
 }