备份,准备做双端
This commit is contained in:
@@ -34,6 +34,11 @@ public sealed class PlayerSkillService : MonoBehaviour
|
||||
|
||||
public static PlayerSkillService Instance { get; private set; }
|
||||
|
||||
// Monotonic counter bumped whenever the selected skill (and thus any skill-derived
|
||||
// scene state) may have changed. Per-frame consumers can compare against a cached copy
|
||||
// to skip re-evaluation while the selection is stable.
|
||||
public static int SelectionVersion { get; private set; }
|
||||
|
||||
private bool initialized;
|
||||
private PlayerSkillSaveData saveData;
|
||||
private userLevel_skills_SO registeredSkillAsset;
|
||||
@@ -467,6 +472,10 @@ public sealed class PlayerSkillService : MonoBehaviour
|
||||
|
||||
private void ApplySceneBindings()
|
||||
{
|
||||
// Selection-derived scene state is being (re)applied here; advance the version so
|
||||
// per-frame consumers know to re-read it once.
|
||||
SelectionVersion++;
|
||||
|
||||
bool revealLockedSkills = IsSkillEnabledInternal(RevealLockedIdolSkillsSkillIndex);
|
||||
|
||||
idolSkillsHub[] hubs = FindObjectsByType<idolSkillsHub>(FindObjectsInactive.Include, FindObjectsSortMode.None);
|
||||
@@ -599,6 +608,9 @@ public sealed class PlayerSkillService : MonoBehaviour
|
||||
}
|
||||
|
||||
saveData.selectedSkillIndex = enabledIndex;
|
||||
// Selection was repaired from the asset's enabled flags without going through
|
||||
// ApplySceneBindings; bump the version so per-frame consumers re-read it.
|
||||
SelectionVersion++;
|
||||
SaveNow();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user