/// <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); } }
/// <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); } }
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 = ""; }
/// <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); } }
/// <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); } }
/// <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; } }
/// <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); } }
// Start is called before the first frame update void Start() { callbacksHandler = GameObject.Find("HMSManager").GetComponent <HMSCallbacksHandler>(); itemName = GetComponent <Text>(); itemName.text = callbacksHandler.getProductName("coins100"); }