using Cysharp.Threading.Tasks; using QSB.Utility.Deterministic; using QSB.WorldSync; using System.Threading; namespace QSB.PoolSync; public class PoolManager : WorldObjectManager { public override WorldObjectScene WorldObjectScene => WorldObjectScene.SolarSystem; public override async UniTask BuildWorldObjects(OWScene scene, CancellationToken ct) { foreach (var streaming in QSBWorldSync.GetUnityObjects().SortDeterministic()) { streaming.gameObject.AddComponent(); } foreach (var camera in QSBWorldSync.GetUnityObjects().SortDeterministic()) { camera.gameObject.AddComponent(); } foreach (var platform in QSBWorldSync.GetUnityObjects().SortDeterministic()) { platform.gameObject.AddComponent(); } } public override void UnbuildWorldObjects() { foreach (var platform in QSBWorldSync.GetUnityObjects()) { Destroy(platform); } foreach (var camera in QSBWorldSync.GetUnityObjects()) { Destroy(camera); } foreach (var streaming in QSBWorldSync.GetUnityObjects()) { Destroy(streaming); } } }