2022-01-29 04:49:07 +00:00
|
|
|
|
using Cysharp.Threading.Tasks;
|
|
|
|
|
using QSB.MeteorSync.WorldObjects;
|
2021-11-11 02:40:02 +00:00
|
|
|
|
using QSB.WorldSync;
|
2024-03-10 18:01:12 +00:00
|
|
|
|
using System.Linq;
|
2022-01-29 04:49:07 +00:00
|
|
|
|
using System.Threading;
|
2021-11-11 02:40:02 +00:00
|
|
|
|
|
2022-03-03 03:46:33 +00:00
|
|
|
|
namespace QSB.MeteorSync;
|
|
|
|
|
|
|
|
|
|
public class MeteorManager : WorldObjectManager
|
2021-11-11 02:40:02 +00:00
|
|
|
|
{
|
2022-03-03 03:46:33 +00:00
|
|
|
|
public override WorldObjectScene WorldObjectScene => WorldObjectScene.SolarSystem;
|
2021-12-21 02:41:12 +00:00
|
|
|
|
|
2022-03-03 03:46:33 +00:00
|
|
|
|
public static WhiteHoleVolume WhiteHoleVolume;
|
2021-11-11 02:40:02 +00:00
|
|
|
|
|
2022-03-03 03:46:33 +00: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-29 04:57:17 +00:00
|
|
|
|
|
2024-03-10 18:01:12 +00: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-03 03:46:33 +00:00
|
|
|
|
QSBWorldSync.Init<QSBFragment, FragmentIntegrity>();
|
2022-03-11 15:17:40 +00:00
|
|
|
|
QSBWorldSync.Init<QSBMeteorLauncher, MeteorLauncher>();
|
|
|
|
|
QSBWorldSync.Init<QSBMeteor, MeteorController>();
|
2021-11-11 02:40:02 +00:00
|
|
|
|
}
|
2022-03-11 05:27:29 +00:00
|
|
|
|
}
|