2022-01-28 20:49:07 -08:00
|
|
|
|
using Cysharp.Threading.Tasks;
|
|
|
|
|
using QSB.MeteorSync.WorldObjects;
|
2021-11-10 18:40:02 -08:00
|
|
|
|
using QSB.WorldSync;
|
2021-11-25 15:32:34 +00:00
|
|
|
|
using System.Linq;
|
2022-01-28 20:49:07 -08:00
|
|
|
|
using System.Threading;
|
2021-11-10 18:40:02 -08:00
|
|
|
|
|
2022-03-02 19:46:33 -08:00
|
|
|
|
namespace QSB.MeteorSync;
|
|
|
|
|
|
|
|
|
|
public class MeteorManager : WorldObjectManager
|
2021-11-10 18:40:02 -08:00
|
|
|
|
{
|
2022-03-02 19:46:33 -08:00
|
|
|
|
public override WorldObjectScene WorldObjectScene => WorldObjectScene.SolarSystem;
|
2021-12-20 18:41:12 -08:00
|
|
|
|
|
2022-03-02 19:46:33 -08:00
|
|
|
|
public static WhiteHoleVolume WhiteHoleVolume;
|
2021-11-10 18:40:02 -08:00
|
|
|
|
|
2022-03-02 19:46:33 -08:00
|
|
|
|
public override async UniTask BuildWorldObjects(OWScene scene, CancellationToken ct)
|
|
|
|
|
{
|
|
|
|
|
// wait for all late initializers (which includes meteor launchers) to finish
|
|
|
|
|
await UniTask.WaitUntil(() => LateInitializerManager.isDoneInitializing, cancellationToken: ct);
|
2022-01-28 20:57:17 -08:00
|
|
|
|
|
2022-11-02 00:00:56 -04:00
|
|
|
|
// NH can make multiple so ensure its the stock whitehole
|
|
|
|
|
var whiteHole = QSBWorldSync.GetUnityObjects<AstroObject>().First(x => x.GetAstroObjectName() == AstroObject.Name.WhiteHole);
|
|
|
|
|
WhiteHoleVolume = whiteHole?.GetComponentInChildren<WhiteHoleVolume>();
|
2022-03-02 19:46:33 -08:00
|
|
|
|
QSBWorldSync.Init<QSBFragment, FragmentIntegrity>();
|
2022-03-11 07:17:40 -08:00
|
|
|
|
QSBWorldSync.Init<QSBMeteorLauncher, MeteorLauncher>();
|
|
|
|
|
QSBWorldSync.Init<QSBMeteor, MeteorController>();
|
2021-11-10 18:40:02 -08:00
|
|
|
|
}
|
2022-03-10 21:27:29 -08:00
|
|
|
|
}
|