fix:更换sdk,修复bug

This commit is contained in:
barry
2026-06-06 16:55:32 +08:00
parent bd28506b1f
commit 7003140acc
565 changed files with 44334 additions and 43789 deletions
+21 -3
View File
@@ -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权限
}
});
}