using UnityEngine;
using System.Collections;
using UnityEngine.Purchasing;
public class PurchaseManager : MonoBehaviour, IStoreListener
{
//public BuyManager buyManager;
private IStoreController controller;
//IAP组件相关的对象,controller里存储着商品信息
private static IAppleExtensions m_AppleExtensions;
private static bool PurchaseAvailable = true;//IAP可用状态
private static bool InternetAvailable;//是否初始化成功
//void OnEnable()
//{
// //Debug.Log("onenable");
// 如果没有连击网络,关闭IAP功能
// //if (Application.internetReachability == NetworkReachability.NotReachable)
// //{
// // PurchaseAvailable = false;
// //}
// //else
// //{
// // PurchaseAvailable = true;
// // //如果没有初始化成功
// // if (InternetAvailable == false)
// // {
// // InitUnityPurchase();//初始化
// // }
// //}
//}
public void InitUnityPurchase()//初始化方法
{
var module = StandardPurchasingModule.Instance();//标准采购模块<