fix:更换sdk,修复bug
This commit is contained in:
@@ -11,6 +11,7 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using RedHotRoast;
|
||||
using SDK_IAP;
|
||||
using SGModule.Net;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Purchasing;
|
||||
|
||||
@@ -224,7 +225,7 @@ namespace RedHotRoast
|
||||
Debug.Log("[IAP IOS] 恢复购买流程完成(实际恢复内容通过 OnDeliver 发放)");
|
||||
Debug.Log("[IAP IOS] restore success: " + result.success);
|
||||
GameHelper.ShowTips("Restore_pur", true);
|
||||
// SaveData.GetSaveObject().have_slot = success;
|
||||
// SaveData.GetSaveObject().have_slot = result.success;
|
||||
// DataMgr.VipLevel.Value = 3;
|
||||
// DataMgr.VipExpirationTime.Value = ServerClock.GetCurrentServerTime() + 7 * 24 * 60 * 60;
|
||||
}
|
||||
@@ -247,7 +248,7 @@ namespace RedHotRoast
|
||||
{
|
||||
IAPManager.CheckEntitlement(productId, status =>
|
||||
{
|
||||
Debug.Log($"[IAP IOS] {productName} 权益状态: {status}");
|
||||
Debug.Log($"[IAP IOS] {productId} 权益状态: {status}");
|
||||
onResult?.Invoke(status);
|
||||
});
|
||||
}
|
||||
@@ -260,6 +261,7 @@ namespace RedHotRoast
|
||||
if (state == EntitlementStatus.FullyEntitled)
|
||||
{
|
||||
// 激活加一格权限
|
||||
SaveData.GetSaveObject().have_slot = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -267,11 +269,27 @@ namespace RedHotRoast
|
||||
/// <summary>检查VIP订阅权益</summary>
|
||||
public void CheckVipEntitlement()
|
||||
{
|
||||
CheckEntitlement(PRODUCT_VIP_YEAR, "VIP年卡", status =>
|
||||
{
|
||||
if (status == EntitlementStatus.FullyEntitled)
|
||||
{
|
||||
// 激活年VIP权限
|
||||
}
|
||||
});
|
||||
|
||||
CheckEntitlement(PRODUCT_VIP_MONTH, "VIP月卡", status =>
|
||||
{
|
||||
if (status == EntitlementStatus.FullyEntitled)
|
||||
{
|
||||
// 激活VIP权限
|
||||
// 激活月VIP权限
|
||||
}
|
||||
});
|
||||
|
||||
CheckEntitlement(PRODUCT_VIP_WEEK, "VIP周卡", status =>
|
||||
{
|
||||
if (status == EntitlementStatus.FullyEntitled)
|
||||
{
|
||||
// 激活周VIP权限
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user