示例#1
0
 void OnDestroy()
 {
     if (debug)
     {
         Debug.Log("[GamedoniaStoreInAppPurchases] StopInAppBilling");
     }
     GamedoniaStore.StopInAppBilling();
 }
示例#2
0
    public void ProductPurchased(string response)
    {
        if (debug)
        {
            Debug.Log("[GamedoniaStoreInAppPurchases] ProductPurchased: " + response);
        }
        if (response != null)
        {
            GamedoniaStore.ProductPurchased(response);
        }

        if (GamedoniaStore.purchaseResponse != null && GamedoniaStore.purchaseResponse.success)
        {
                        #if UNITY_EDITOR
            OnPurchaseResponse();
                        #elif UNITY_IPHONE
            Dictionary <string, object> parameters = new Dictionary <string, object>();
            parameters["deviceId"] = GamedoniaDevices.device.deviceId;
            parameters["receipt"]  = GamedoniaStore.purchaseResponse.receipt;
            GamedoniaStore.VerifyPurchase(parameters,
                                          delegate(bool success) {
                if (!success)
                {
                    GamedoniaStore.purchaseResponse.success = false;
                    GamedoniaStore.purchaseResponse.status  = "error";
                    GamedoniaStore.purchaseResponse.message = "purchase verification failed";
                }
                OnPurchaseResponse();
            }
                                          );
                        #elif UNITY_ANDROID
            Dictionary <string, object> parameters = new Dictionary <string, object>();
            parameters["deviceId"] = GamedoniaDevices.device.deviceId;
            parameters["receipt"]  = GamedoniaStore.purchaseResponse.receipt;
            GamedoniaStore.VerifyPurchase(parameters,
                                          delegate(bool success) {
                if (!success)
                {
                    GamedoniaStore.purchaseResponse.success = false;
                    GamedoniaStore.purchaseResponse.status  = "error";
                    GamedoniaStore.purchaseResponse.message = "purchase verification failed";
                }
                OnPurchaseResponse();
            }
                                          );
                        #endif
        }
        else
        {
            OnPurchaseResponse();
        }
    }
示例#3
0
    public void ProductsRequested(string response)
    {
        if (debug)
        {
            Debug.Log("[GamedoniaStoreInAppPurchases] ProductsRequested: " + response);
        }
        if (response != null)
        {
            GamedoniaStore.ProductsRequested(response);
        }

        OnRequestResponse();
    }
示例#4
0
    void OnLogin(bool success)
    {
        statusMsg = "";
        if (success)
        {
            printToConsole("Session started successfully. uid: " + GamedoniaUsers.me._id);

            //Requesting products
            GamedoniaStore.RequestProducts(productsList, productsList.Length);
        }
        else
        {
            errorMsg = Gamedonia.getLastError().ToString();
            Debug.Log(errorMsg);
        }
    }
示例#5
0
    void Awake()
    {
        GDService service = new GDService();

        service.ProfileEvent += new ProfilerEventHandler(Profile);
        GamedoniaDevices.services.Add(service);

                #if UNITY_EDITOR
                #elif UNITY_ANDROID
        if (debug)
        {
            Debug.Log("[GamedoniaStoreInAppPurchases] StartInAppBilling");
        }
        GamedoniaStore.StartInAppBilling(androidPublickey);
                #endif
    }
示例#6
0
 private void purchaseGas()
 {
     if (!Application.isEditor)
     {
         if (gasProgress < 1)
         {
             statusMsg = "Purchasing GAS...";
             GamedoniaStore.BuyProduct("gas");
         }
         else
         {
             printToConsole("Already full of gas!, drive to spent some");
         }
     }
     else
     {
         printToConsole("Purchase is disabled in Editor mode!!");
     }
 }
示例#7
0
 public void RequestProducts()
 {
     GamedoniaStore.RequestProducts(products_list, products_list.Length);
 }
示例#8
0
 public void BuyProduct()
 {
     //GamedoniaStore.RequestProducts(consumable_products, consumable_products.Length);
     GamedoniaStore.BuyProduct("m_lives");
 }