养成基本完毕,新UI,修bug,装备初步,
This commit is contained in:
@@ -77,6 +77,7 @@ public sealed class ExpBottleLedger : MonoBehaviour
|
||||
loadedFromSave = ExpBottleLedgerStorage.TryLoad(out payload);
|
||||
RebuildFromPayload(payload);
|
||||
initialized = true;
|
||||
SyncMirrorCounts();
|
||||
SaveNow();
|
||||
if (OnLedgerReloaded != null)
|
||||
{
|
||||
@@ -289,10 +290,26 @@ public sealed class ExpBottleLedger : MonoBehaviour
|
||||
public void SaveNow()
|
||||
{
|
||||
InitializeIfNeededForSave();
|
||||
SyncMirrorCounts();
|
||||
ExpBottleLedgerStorage.TrySave(BuildPayload());
|
||||
SyncToPlayerData();
|
||||
}
|
||||
|
||||
private void SyncMirrorCounts()
|
||||
{
|
||||
expBottlesSO[] definitions = Resources.FindObjectsOfTypeAll<expBottlesSO>();
|
||||
for (int i = 0; i < definitions.Length; i++)
|
||||
{
|
||||
expBottlesSO definition = definitions[i];
|
||||
if (definition == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
definition.runtimeOwnedCount = GetCount(definition.bottleKind);
|
||||
}
|
||||
}
|
||||
|
||||
private void InitializeIfNeededForSave()
|
||||
{
|
||||
if (!initialized)
|
||||
|
||||
Reference in New Issue
Block a user