コード例 #1
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!");
     }
 }
コード例 #2
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!");
     }
 }