2022-01-29 04:49:07 +00:00
|
|
|
|
using Cysharp.Threading.Tasks;
|
2022-02-21 21:02:58 +00:00
|
|
|
|
using QSB.Utility;
|
2022-01-29 04:49:07 +00:00
|
|
|
|
using QSB.WorldSync;
|
|
|
|
|
using System.Threading;
|
2021-03-28 16:53:05 +00:00
|
|
|
|
|
2022-03-03 03:46:33 +00:00
|
|
|
|
namespace QSB.PoolSync;
|
|
|
|
|
|
|
|
|
|
internal class PoolManager : WorldObjectManager
|
2021-03-28 16:53:05 +00:00
|
|
|
|
{
|
2022-03-03 03:46:33 +00:00
|
|
|
|
public override WorldObjectScene WorldObjectScene => WorldObjectScene.SolarSystem;
|
|
|
|
|
|
|
|
|
|
public override async UniTask BuildWorldObjects(OWScene scene, CancellationToken ct)
|
2021-03-28 16:53:05 +00:00
|
|
|
|
{
|
2022-03-03 03:46:33 +00: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-21 02:41:12 +00:00
|
|
|
|
|
2022-03-03 03:46:33 +00:00
|
|
|
|
foreach (var camera in QSBWorldSync.GetUnityObjects<CustomNomaiRemoteCamera>())
|
2021-03-28 16:53:05 +00:00
|
|
|
|
{
|
2022-03-03 03:46:33 +00:00
|
|
|
|
Destroy(camera);
|
2021-03-28 16:53:05 +00:00
|
|
|
|
}
|
2022-01-18 08:46:27 +00:00
|
|
|
|
|
2022-03-03 03:46:33 +00:00
|
|
|
|
foreach (var streaming in QSBWorldSync.GetUnityObjects<CustomNomaiRemoteCameraStreaming>())
|
2022-01-18 08:46:27 +00:00
|
|
|
|
{
|
2022-03-03 03:46:33 +00:00
|
|
|
|
Destroy(streaming);
|
2022-01-18 08:46:27 +00:00
|
|
|
|
}
|
2021-03-28 16:53:05 +00:00
|
|
|
|
}
|
2022-02-25 06:04:54 +00:00
|
|
|
|
}
|