Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Start()
- {
- if (m_StoreController == null)
- {
- InitializePurchasing();
- }
- checkProd(YEAR_SUB);
- }
- public void checkProd(string prodId)
- {
- #if UNITY_EDITOR
- #elif UNITY_ANDROID
- StartCoroutine("checkProduct", prodId);
- #endif
- }
- IEnumerator checkProduct(string prodId)
- {
- yield return new WaitForSeconds(5);
- Product cproduct = m_StoreController.products.WithID(prodId);
- if (cproduct != null && cproduct.hasReceipt)
- {
- if (prodId == YEAR_SUB)
- {
- PlayerPrefs.SetInt("isSubscr", 1);
- }
- }
- else
- {
- if (prodId == YEAR_SUB)
- {
- PlayerPrefs.SetInt("isSubscr", 0);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement