功能批量实现 优化 服务端 新浮动小游戏框架 新界面UI

This commit is contained in:
FloatGaming
2026-04-24 13:20:16 +08:00
parent e0bc0bbf08
commit 5eec879582
257 changed files with 38481 additions and 1288 deletions
@@ -142,6 +142,44 @@ public sealed class StoreOwnershipLedger : MonoBehaviour
return true;
}
public bool TryRevokeOwnership(storeItemSO itemSO, out string failureMessage)
{
InitializeIfNeeded();
failureMessage = string.Empty;
if (itemSO == null)
{
failureMessage = "商品数据丢失";
return false;
}
StoreOwnershipEntry entry;
entriesByItemId.TryGetValue(itemSO.itemID, out entry);
if (entry == null && !IsOwned(itemSO))
{
return true;
}
if (entry != null)
{
entry.owned = false;
if (entry.unlockedStorySonIds != null)
{
entry.unlockedStorySonIds.Clear();
}
if (!entry.owned && (entry.unlockedStorySonIds == null || entry.unlockedStorySonIds.Count == 0))
{
entriesByItemId.Remove(itemSO.itemID);
}
}
SyncAllMirrorFlags();
GlobalAchievementService.EnsureInstance().RefreshDerivedMetrics();
SaveNow();
return true;
}
public bool TryGrantOwnershipPreview(storeItemSO itemSO, out string failureMessage)
{
InitializeIfNeeded();
@@ -203,7 +241,7 @@ public sealed class StoreOwnershipLedger : MonoBehaviour
private void LoadStoreItems()
{
cachedStoreItems.Clear();
var loadedItems = Resources.LoadAll<storeItemSO>(RuntimeStoreItemResourcesPath);
var loadedItems = RuntimeResourcesCache.LoadAllStoreItems();
var seen = new HashSet<int>();
for (int i = 0; i < loadedItems.Length; i++)
{