47 lines
1.3 KiB
C#
Raw Normal View History

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;
2022-03-02 19:46:33 -08:00
namespace QSB.PoolSync;
2023-07-28 19:30:57 +01:00
public class PoolManager : WorldObjectManager
{
2022-03-02 19:46:33 -08:00
public override WorldObjectScene WorldObjectScene => WorldObjectScene.SolarSystem;
public override async UniTask BuildWorldObjects(OWScene scene, CancellationToken ct)
{
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);
}
2022-03-02 19:46:33 -08:00
foreach (var camera in QSBWorldSync.GetUnityObjects<CustomNomaiRemoteCamera>())
{
2022-03-02 19:46:33 -08:00
Destroy(camera);
}
2022-03-02 19:46:33 -08:00
foreach (var streaming in QSBWorldSync.GetUnityObjects<CustomNomaiRemoteCameraStreaming>())
{
2022-03-02 19:46:33 -08:00
Destroy(streaming);
}
}
}