using QSB.QuantumSync.WorldObjects; using QSB.WorldSync; using System.Collections.Generic; using UnityEngine; namespace QSB.QuantumSync { internal class QuantumManager : MonoBehaviour { public static QuantumManager Instance { get; private set; } private List _socketedQuantumObjects; private List _multiStateQuantumObjects; private List _quantumSockets; private List _quantumShuffleObjects; public void Awake() { Instance = this; QSBSceneManager.OnSceneLoaded += OnSceneLoaded; } public void OnDestroy() => QSBSceneManager.OnSceneLoaded -= OnSceneLoaded; private void OnSceneLoaded(OWScene scene, bool isInUniverse) { _socketedQuantumObjects = QSBWorldSync.Init(); _multiStateQuantumObjects = QSBWorldSync.Init(); _quantumSockets = QSBWorldSync.Init(); _quantumShuffleObjects = QSBWorldSync.Init(); } public int GetId(SocketedQuantumObject obj) => _socketedQuantumObjects.IndexOf(obj); public int GetId(MultiStateQuantumObject obj) => _multiStateQuantumObjects.IndexOf(obj); public int GetId(QuantumSocket obj) => _quantumSockets.IndexOf(obj); public int GetId(QuantumShuffleObject obj) => _quantumShuffleObjects.IndexOf(obj); } }