2022-01-28 20:49:07 -08:00
|
|
|
|
using Cysharp.Threading.Tasks;
|
2022-02-21 13:02:58 -08:00
|
|
|
|
using QSB.Utility;
|
2022-01-28 20:49:07 -08:00
|
|
|
|
using QSB.WorldSync;
|
|
|
|
|
using System.Threading;
|
2021-03-28 17:53:05 +01:00
|
|
|
|
|
2022-03-02 19:46:33 -08:00
|
|
|
|
namespace QSB.PoolSync;
|
|
|
|
|
|
2023-07-28 19:30:57 +01:00
|
|
|
|
public class PoolManager : WorldObjectManager
|
2021-03-28 17:53:05 +01:00
|
|
|
|
{
|
2022-03-02 19:46:33 -08:00
|
|
|
|
public override WorldObjectScene WorldObjectScene => WorldObjectScene.SolarSystem;
|
|
|
|
|
|
|
|
|
|
public override async UniTask BuildWorldObjects(OWScene scene, CancellationToken ct)
|
2021-03-28 17:53:05 +01:00
|
|
|
|
{
|
2022-03-02 19:46:33 -08:00
|
|
|
|
foreach (var streaming in QSBWorldSync.GetUnityObjects<NomaiRemoteCameraStreaming>().SortDeterministic())
|
|
|
|
|
{
|
|
|
|
|
streaming.gameObject.AddComponent<CustomNomaiRemoteCameraStreaming>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
foreach (var camera in QSBWorldSync.GetUnityObjects<NomaiRemoteCamera>().SortDeterministic())
|
|
|
|
|
{
|
|
|
|
|
camera.gameObject.AddComponent<CustomNomaiRemoteCamera>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
foreach (var platform in QSBWorldSync.GetUnityObjects<NomaiRemoteCameraPlatform>().SortDeterministic())
|
|
|
|
|
{
|
|
|
|
|
platform.gameObject.AddComponent<CustomNomaiRemoteCameraPlatform>();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void UnbuildWorldObjects()
|
|
|
|
|
{
|
|
|
|
|
foreach (var platform in QSBWorldSync.GetUnityObjects<CustomNomaiRemoteCameraPlatform>())
|
|
|
|
|
{
|
|
|
|
|
Destroy(platform);
|
|
|
|
|
}
|
2021-12-20 18:41:12 -08:00
|
|
|
|
|
2022-03-02 19:46:33 -08:00
|
|
|
|
foreach (var camera in QSBWorldSync.GetUnityObjects<CustomNomaiRemoteCamera>())
|
2021-03-28 17:53:05 +01:00
|
|
|
|
{
|
2022-03-02 19:46:33 -08:00
|
|
|
|
Destroy(camera);
|
2021-03-28 17:53:05 +01:00
|
|
|
|
}
|
2022-01-18 00:46:27 -08:00
|
|
|
|
|
2022-03-02 19:46:33 -08:00
|
|
|
|
foreach (var streaming in QSBWorldSync.GetUnityObjects<CustomNomaiRemoteCameraStreaming>())
|
2022-01-18 00:46:27 -08:00
|
|
|
|
{
|
2022-03-02 19:46:33 -08:00
|
|
|
|
Destroy(streaming);
|
2022-01-18 00:46:27 -08:00
|
|
|
|
}
|
2021-03-28 17:53:05 +01:00
|
|
|
|
}
|
2022-02-24 22:04:54 -08:00
|
|
|
|
}
|