quantum-space-buddies/QSB/Tools/ProbeLauncherTool/ProbeLauncherManager.cs
2022-01-28 20:50:34 -08:00

25 lines
719 B
C#

using Cysharp.Threading.Tasks;
using QSB.Tools.ProbeLauncherTool.WorldObjects;
using QSB.WorldSync;
using System.Linq;
using System.Threading;
namespace QSB.Tools.ProbeLauncherTool
{
internal class ProbeLauncherManager : WorldObjectManager
{
public override WorldObjectType WorldObjectType => WorldObjectType.Both;
public override async UniTask BuildWorldObjects(OWScene scene, CancellationToken ct)
{
QSBWorldSync.Init<QSBProbeLauncher, ProbeLauncher>(typeof(PlayerProbeLauncher));
if (scene == OWScene.SolarSystem)
{
QSBWorldSync.Init<QSBProbeLauncher, ProbeLauncher>(new[]
{
QSBWorldSync.GetUnityObjects<ShipCockpitController>().First().GetShipProbeLauncher()
});
}
}
}
}