24 lines
705 B
C#
Raw Normal View History

2022-01-28 20:49:07 -08:00
using Cysharp.Threading.Tasks;
using QSB.Tools.ProbeLauncherTool.WorldObjects;
using QSB.WorldSync;
2022-01-20 13:22:58 -08:00
using System.Linq;
2022-01-28 20:49:07 -08:00
using System.Threading;
2022-03-02 19:46:33 -08:00
namespace QSB.Tools.ProbeLauncherTool;
internal class ProbeLauncherManager : WorldObjectManager
{
2022-03-02 19:46:33 -08:00
public override WorldObjectScene WorldObjectScene => WorldObjectScene.Both;
2022-03-02 19:46:33 -08:00
public override async UniTask BuildWorldObjects(OWScene scene, CancellationToken ct)
{
QSBWorldSync.Init<QSBProbeLauncher, ProbeLauncher>(typeof(PlayerProbeLauncher));
if (scene == OWScene.SolarSystem)
2022-01-20 13:22:58 -08:00
{
2022-03-02 19:46:33 -08:00
QSBWorldSync.Init<QSBProbeLauncher, ProbeLauncher>(new[]
2022-01-20 13:22:58 -08:00
{
2022-03-02 19:46:33 -08:00
QSBWorldSync.GetUnityObjects<ShipCockpitController>().First().GetShipProbeLauncher()
});
2022-01-20 13:22:58 -08:00
}
}
}