BuyLabel.cs 532 B

1234567891011121314151617181920212223242526
  1. using UnityEngine;
  2. using System.Collections;
  3. public class BuyLabel : MonoBehaviour
  4. {
  5. public StoreProductId productId;
  6. UILabel label;
  7. void Awake()
  8. {
  9. label = GetComponent<UILabel>();
  10. }
  11. void OnEnable()
  12. {
  13. IAPProduct product = StoreManager.Instance.GetProduct(productId);
  14. if (product != null)
  15. {
  16. label.text = string.Format(Localization.instance.Get("button.label.buyProduct"), product.currencyCode+product.price);
  17. } else
  18. {
  19. label.text = Localization.instance.Get("button.label.buyProductNoPrice");
  20. }
  21. }
  22. }