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-02-24 22:04:54 -08:00
|
|
|
|
namespace QSB.MeteorSync;
|
|
|
|
|
|
|
|
|
|
public class MeteorManager : WorldObjectManager
|
2021-11-10 18:40:02 -08:00
|
|
|
|
{
|
2022-02-25 00:25:24 -08:00
|
|
|
|
public override WorldObjectScene WorldObjectScene => WorldObjectScene.SolarSystem;
|
2021-12-20 18:41:12 -08:00
|
|
|
|
|
2022-02-24 22:04:54 -08:00
|
|
|
|
public static WhiteHoleVolume WhiteHoleVolume;
|
2021-11-10 18:40:02 -08:00
|
|
|
|
|
2022-02-24 22:04:54 -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-02-24 22:04:54 -08:00
|
|
|
|
WhiteHoleVolume = QSBWorldSync.GetUnityObjects<WhiteHoleVolume>().First();
|
|
|
|
|
QSBWorldSync.Init<QSBMeteorLauncher, MeteorLauncher>();
|
|
|
|
|
QSBWorldSync.Init<QSBMeteor, MeteorController>();
|
|
|
|
|
QSBWorldSync.Init<QSBFragment, FragmentIntegrity>();
|
2021-11-10 18:40:02 -08:00
|
|
|
|
}
|
2022-02-24 22:04:54 -08:00
|
|
|
|
}
|