【内购】安卓商品

Android_release
zhangaotian 2024-08-13 16:20:17 +08:00
parent a8c0053a69
commit a2d1b18698
1 changed files with 13 additions and 7 deletions

View File

@ -13,7 +13,6 @@ namespace Gameplay.Manager
public class ShopManager : Singlenton<ShopManager>, IInitable public class ShopManager : Singlenton<ShopManager>, IInitable
{ {
private Dictionary<PropType, int> _unusedPropCount; private Dictionary<PropType, int> _unusedPropCount;
public string Platform = "ios";
public bool IsDebug; public bool IsDebug;
private Dictionary<string, int> _consumableGoods; private Dictionary<string, int> _consumableGoods;
@ -40,21 +39,28 @@ namespace Gameplay.Manager
InitProducts(); InitProducts();
//_sdkHelper = SDKManager.Instance.GetSdkHelper(SDKManager.SdkName.IAP) as IBuyServices; //_sdkHelper = SDKManager.Instance.GetSdkHelper(SDKManager.SdkName.IAP) as IBuyServices;
IAPManager.Instance.SetClientVerify(true); IAPManager.Instance.SetClientVerify(true);
IAPManager.Instance.AddGoods(_consumableGoods.Keys.ToList(), _nonConsumableGoods.Keys.ToList(), OnRestorePurchase); IAPManager.Instance.AddGoods(_consumableGoods.Keys.ToList(), _nonConsumableGoods.Keys.ToList(),
OnRestorePurchase);
_init = true; _init = true;
} }
private void InitProducts() private void InitProducts()
{ {
#if UNITY_ANDROID #if UNITY_ANDROID
Platform = "android";
#endif
_consumableGoods = new Dictionary<string, int>() _consumableGoods = new Dictionary<string, int>()
{ {
{ Platform + "_CoinBox_100", 100 }, { Platform + "_CoinBox_600", 600 }, { "android_coinbox_100", 100 }, { "android_coinbox_600", 600 },
{ Platform + "_CoinBox_1600", 1600 } { "android_coinbox_1600", 1600 }
}; };
_nonConsumableGoods = new Dictionary<string, int>(); _nonConsumableGoods = new Dictionary<string, int>();
#else
_consumableGoods = new Dictionary<string, int>()
{
{ "ios_CoinBox_100", 100 }, { "ios_CoinBox_600", 600 },
{ "ios_CoinBox_1600", 1600 }
};
_nonConsumableGoods = new Dictionary<string, int>();
#endif
} }
public void BuyGoods(string goodsID) public void BuyGoods(string goodsID)