UI换了很多,spine主视觉停用
This commit is contained in:
@@ -76,6 +76,7 @@ public sealed class ExpBottleLedger : MonoBehaviour
|
||||
loadedFromSave = ExpBottleLedgerStorage.TryLoad(out payload);
|
||||
RebuildFromPayload(payload);
|
||||
initialized = true;
|
||||
TryRecoverFromDefaultPlayerData();
|
||||
SyncMirrorCounts();
|
||||
SaveNow();
|
||||
if (OnLedgerReloaded != null)
|
||||
@@ -421,6 +422,46 @@ public sealed class ExpBottleLedger : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
private bool TryRecoverFromDefaultPlayerData()
|
||||
{
|
||||
Player_SO player = RuntimeResourcesCache.LoadDefaultPlayerSo();
|
||||
if (player == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool changed = false;
|
||||
for (int i = 0; i < ExpBottleCatalog.All.Count; i++)
|
||||
{
|
||||
var descriptor = ExpBottleCatalog.All[i];
|
||||
if (string.IsNullOrEmpty(descriptor.LegacyPlayerFieldName))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
int legacyValue = Mathf.Max(0, player.GetLegacyExpBottleCount(descriptor.LegacyPlayerFieldName));
|
||||
if (legacyValue <= 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (GetCountByKey(descriptor.Key) > 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
countsByKey[descriptor.Key] = legacyValue;
|
||||
changed = true;
|
||||
}
|
||||
|
||||
if (changed)
|
||||
{
|
||||
Debug.LogWarning("[ExpBottleLedger] Recovered bottle counts from Player_SO mirror fields.");
|
||||
}
|
||||
|
||||
return changed;
|
||||
}
|
||||
|
||||
private void SyncToPlayerData()
|
||||
{
|
||||
if (boundPlayerData == null)
|
||||
|
||||
Reference in New Issue
Block a user