功能批量实现 优化 服务端 新浮动小游戏框架 新界面UI
This commit is contained in:
@@ -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++)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user