Ejemplo n.º 1
0
    /// <summary>
    /// The OnResult method fires when it recieves the answer from the server
    /// </summary>
    /// <param name="resultCode">Code</param>
    /// <param name="response">Response</param>
    public void OnResult(int resultCode, ProductDetailsResponse response)

    {
        hmsManager       = GameObject.Find("HMSManager").GetComponent <HMSManager>();
        callbacksHandler = GameObject.Find("HMSManager").GetComponent <HMSCallbacksHandler>();


        if (resultCode == 0)
        {
            hmsManager.numberOfProductsRetrieved++;
            callbacksHandler.onProductDetailSuccess(response);

            if (hmsManager.numberOfProductsRetrieved == hmsManager.products.Length)
            {
#if DEBUG
                Debug.Log("[HMS]: all products retrieved");
#endif
                callbacksHandler.productListInitialiced();
            }
        }
        else
        {
            callbacksHandler.onProductDetailError(resultCode);
        }
    }
Ejemplo n.º 2
0
    /// <summary>
    /// The OnResult method fires when it recieves the answer from the server
    /// </summary>
    /// <param name="resultCode">Code</param>
    /// <param name="response">Response</param>
    public void OnResult(int resultCode, PurchaseInfoResponse response)

    {
#if DEBUG
        Debug.Log("get Purchase Info callback");
#endif

        callbacksHandler = GameObject.Find("HMSManager").GetComponent <HMSCallbacksHandler>();

        if (resultCode == 0)
        {
            callbacksHandler.OnRestorePurchasesSuccess(response);
        }
        else
        {
            callbacksHandler.OnRestorePurchasesError(resultCode);
        }
    }
Ejemplo n.º 3
0
    private void Start()
    {
        hmsManager       = GameObject.Find("HMSManager").GetComponent <HMSManager>();
        callbacksHandler = GameObject.Find("HMSManager").GetComponent <HMSCallbacksHandler>();

        img       = transform.Find("ItemImage").GetComponent <Image>();
        nameText  = transform.Find("ItemName").GetComponent <Text>();
        priceText = transform.Find("ItemCost").GetComponent <Text>();
        descText  = transform.Find("ItemDesc").GetComponent <Text>();

        //itemImage = Resources.Load<Sprite>("DefaultImage");

        img.sprite = itemImage;

        nameText.text  = "";
        priceText.text = "";
        descText.text  = "";
    }
Ejemplo n.º 4
0
    /// <summary>
    /// The OnResult method fires when it recieves the answer from the server
    /// </summary>
    /// <param name="resultCode">Code</param>
    public void OnResult(int resultCode)

    {
        callbacksHandler = GameObject.Find("HMSManager").GetComponent <HMSCallbacksHandler>();

#if DEBUG
        Debug.Log("Saving players info callback");
#endif


        if (resultCode == 0)
        {
            callbacksHandler.OnSavePlayerSucccess();
        }
        else
        {
            callbacksHandler.OnSavePlayerError(resultCode);
        }
    }
Ejemplo n.º 5
0
    /// <summary>
    /// The OnResult method fires when it recieves the answer from the server
    /// </summary>
    /// <param name="resultCode">Code</param>
    /// <param name="response">Response</param>
    public void OnResult(int resultCode, ProductPayResponse response)

    {
#if DEBUG
        Debug.Log("Login callback");
#endif

        callbacksHandler = GameObject.Find("HMSManager").GetComponent <HMSCallbacksHandler>();


        if (resultCode == 0)
        {
            callbacksHandler.OnPurchaseSuccess(response);
        }
        else
        {
            callbacksHandler.OnPurchaseError(resultCode);
        }
    }
Ejemplo n.º 6
0
    /// <summary>
    /// The OnResult method fires when it recieves the answer from the server
    /// </summary>
    /// <param name="resultCode">Code</param>

    void ICheckUpdateHandler.OnResult(int resultCode)

    {
        callbacksHandler = GameObject.Find("HMSManager").GetComponent <HMSCallbacksHandler>();

        switch (resultCode)
        {
        case -1:
            callbacksHandler.OnCheckUpdateError(resultCode);
            break;

        case 0:


        case 1:
            callbacksHandler.OnCheckUpdateSuccess(resultCode);
            break;
        }
    }
Ejemplo n.º 7
0
    /// <summary>
    /// The OnResult method fires when it recieves the answer from the server
    /// </summary>
    /// <param name="resultCode">Code</param>
    /// <param name="response">Response</param>
    public void OnResult(int resultCode, GameUserData response)

    {
#if DEBUG
        Debug.Log("Login callback");
#endif

        callbacksHandler = GameObject.Find("HMSManager").GetComponent <HMSCallbacksHandler>();


        if (resultCode == 0)
        {
            callbacksHandler.onLoginSuccess(response);
        }
        else
        {
            callbacksHandler.onLoginError(resultCode);
        }
    }
Ejemplo n.º 8
0
 // Start is called before the first frame update
 void Start()
 {
     callbacksHandler = GameObject.Find("HMSManager").GetComponent <HMSCallbacksHandler>();
     itemName         = GetComponent <Text>();
     itemName.text    = callbacksHandler.getProductName("coins100");
 }