update: 修复支付接口问题, 增加日志

feature/Inventory
胡宇飞 2024-01-22 15:15:26 +08:00
parent 2b72cdfd70
commit 8e2b78a385
1 changed files with 10 additions and 2 deletions

View File

@ -324,17 +324,25 @@ namespace Guru
} }
} }
/// <summary>
/// 获取 IAP 内置商品
/// </summary>
/// <param name="productName"></param>
/// <returns></returns>
public Product GetProduct(string productName) public Product GetProduct(string productName)
{ {
if (_storeController != null || _storeController.products != null) if (_storeController != null && _storeController.products != null)
{ {
var info = GetInfo(productName); var info = GetInfo(productName);
if (info != null) if (info != null)
{ {
return _storeController.products.WithID(info.Id); return _storeController.products.WithID(info.Id);
} }
Debug.LogError($"[IAP] --- can't find <ProductInfo> with name {productName}");
} }
// 商品不存在则返回 NULL
Debug.LogError($"[IAP] --- _storeController is null or products is null or products.all.Length == 0");
return null; return null;
} }