mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2024-12-28 00:19:27 +00:00
28 lines
1.0 KiB
C#
28 lines
1.0 KiB
C#
using Cysharp.Threading.Tasks;
|
|
using QSB.MeteorSync.WorldObjects;
|
|
using QSB.WorldSync;
|
|
using System.Linq;
|
|
using System.Threading;
|
|
|
|
namespace QSB.MeteorSync;
|
|
|
|
public class MeteorManager : WorldObjectManager
|
|
{
|
|
public override WorldObjectScene WorldObjectScene => WorldObjectScene.SolarSystem;
|
|
|
|
public static WhiteHoleVolume WhiteHoleVolume;
|
|
|
|
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);
|
|
|
|
// 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>();
|
|
QSBWorldSync.Init<QSBFragment, FragmentIntegrity>();
|
|
QSBWorldSync.Init<QSBMeteorLauncher, MeteorLauncher>();
|
|
QSBWorldSync.Init<QSBMeteor, MeteorController>();
|
|
}
|
|
}
|