备份CatanBuilding瘦身独立工程
This commit is contained in:
75
Assets/Scripts/Services/DevIAPService.cs
Normal file
75
Assets/Scripts/Services/DevIAPService.cs
Normal file
@@ -0,0 +1,75 @@
|
||||
//using asap.core;
|
||||
//using cfg;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using asap.core;
|
||||
using cfg;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using tysdk;
|
||||
|
||||
namespace game
|
||||
{
|
||||
|
||||
public class DevIAPService : IIAPService
|
||||
{
|
||||
[Inject]
|
||||
public IRTService rts { get; set; }
|
||||
|
||||
private IDisposable disposable;
|
||||
|
||||
public async Task<IList<SKUDetail>> GetSKUs()
|
||||
{
|
||||
var IAPList = GContext.container.Resolve<Tables>().TbIAPItemList.DataList;
|
||||
var result = new List<SKUDetail>();
|
||||
foreach (var iap in IAPList)
|
||||
{
|
||||
result.Add(new SKUDetail
|
||||
{
|
||||
productId = iap.ProductId1,
|
||||
title = iap.ID.ToString(),
|
||||
price = $"US${iap.PaymentAmount}",
|
||||
});
|
||||
}
|
||||
await Awaiters.NextFrame;
|
||||
return result; ;
|
||||
}
|
||||
|
||||
|
||||
public async Task<PaymentInfo> Pay(Action<string> OnSuccessFromSdk,string replenishmentDataStr, SKUDetail sku, int count, float usdPrice, JObject extraPurcheInfo)
|
||||
{
|
||||
await Awaiters.NextFrame;
|
||||
return new PaymentInfo() { code = "0" };
|
||||
}
|
||||
|
||||
public void Release()
|
||||
{
|
||||
disposable?.Dispose();
|
||||
disposable = null;
|
||||
}
|
||||
|
||||
public void Init()
|
||||
{
|
||||
|
||||
Release();
|
||||
disposable = rts.OnEvent<SC_OrderConfirmEvt>(OnOrderCompleted);
|
||||
}
|
||||
|
||||
public async Task<Dictionary<string,string>> GetOrderUnreceived()
|
||||
{
|
||||
await Awaiters.NextFrame;
|
||||
return new Dictionary<string,string>();
|
||||
}
|
||||
|
||||
private void OnOrderCompleted(SC_OrderConfirmEvt evt)
|
||||
{
|
||||
UnityEngine.Debug.Log($"[AggIAPService] OnOrderCompleted \r\n {evt}");
|
||||
}
|
||||
|
||||
public async Task<bool> ConfirmOrders(List<string> orderIDs)
|
||||
{
|
||||
await Awaiters.NextFrame;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user