quantum-space-buddies/QSB/PoolSync/PoolManager.cs

48 lines
1.2 KiB
C#
Raw Normal View History

2022-01-29 04:49:07 +00:00
using Cysharp.Threading.Tasks;
using QSB.WorldSync;
using System.Threading;
namespace QSB.PoolSync
{
2021-03-29 22:37:36 +00:00
internal class PoolManager : WorldObjectManager
{
public override WorldObjectType WorldObjectType => WorldObjectType.SolarSystem;
2022-01-29 04:50:34 +00:00
public override async UniTask BuildWorldObjects(OWScene scene, CancellationToken ct)
{
foreach (var streaming in QSBWorldSync.GetUnityObjects<NomaiRemoteCameraStreaming>())
{
streaming.gameObject.AddComponent<CustomNomaiRemoteCameraStreaming>();
}
2021-06-18 21:38:32 +00:00
foreach (var camera in QSBWorldSync.GetUnityObjects<NomaiRemoteCamera>())
{
camera.gameObject.AddComponent<CustomNomaiRemoteCamera>();
}
2021-06-18 21:38:32 +00:00
foreach (var platform in QSBWorldSync.GetUnityObjects<NomaiRemoteCameraPlatform>())
{
platform.gameObject.AddComponent<CustomNomaiRemoteCameraPlatform>();
}
}
public override void UnbuildWorldObjects()
{
foreach (var platform in QSBWorldSync.GetUnityObjects<CustomNomaiRemoteCameraPlatform>())
{
Destroy(platform);
}
foreach (var camera in QSBWorldSync.GetUnityObjects<CustomNomaiRemoteCamera>())
{
Destroy(camera);
}
foreach (var streaming in QSBWorldSync.GetUnityObjects<CustomNomaiRemoteCameraStreaming>())
{
Destroy(streaming);
}
}
}
}