/// <summary> /// Tries to open the purchase dialog this product via Unity IAP. /// </summary> public void Purchase() { #if UNITY_ANALYTICS if (!buyable) { return; } UnityIAPManager.PurchaseProduct(id); #endif }
/// <summary> /// Tries to open the purchase dialog this product via Unity IAP. /// </summary> public void Purchase() { #if UNITY_PURCHASING if (!buyable) { return; } UnityIAPManager.PurchaseProduct(id); #endif }
private void Awake() { if (Instance == null) { Instance = this; DontDestroyOnLoad(this.gameObject); } else { Destroy(this.gameObject); } }
/// <summary> /// Tries to open the purchase dialog this product via Unity IAP. /// </summary> public void Purchase(int money) { if (uimain.MoneyAmount > money) { #if UNITY_ANALYTICS if (!buyable) { return; } UnityIAPManager.PurchaseProduct(id); #endif uimain.MoneyAmount -= money; } }
public void Init(string id) { if (!string.IsNullOrEmpty(id)) { gameId = id; } if (!string.IsNullOrEmpty(gameIDInput.text)) { gameId = gameIDInput.text; } if (!Advertisement.isSupported || Advertisement.isInitialized) { Debug.Log("Could not initialize ads"); return; } Debug.Log("Initializing Unity Ads with game ID: " + gameId); UnityIAPManager iapManager = this.GetComponent <UnityIAPManager> (); iapManager.Initialize(); Advertisement.Initialize(gameId, false); }
public void Init() { this.uIAPMAnager = new UnityIAPManager(); }
/// <summary> /// Calls Unity IAPs RestoreTransactions method. /// It makes sense to add this to an UI button event. /// </summary> public void Restore() { #if UNITY_PURCHASING UnityIAPManager.RestoreTransactions(); #endif }
/// <summary> /// Calls Unity IAPs RestoreTransactions method. /// It makes sense to add this to an UI button event. /// </summary> public void Restore() { #if UNITY_ANALYTICS UnityIAPManager.RestoreTransactions(); #endif }