quantum-space-buddies/QSB/MeteorSync/MeteorManager.cs
2022-01-28 20:50:34 -08:00

30 lines
925 B
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 WorldObjectType WorldObjectType => WorldObjectType.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
StartDelayedReady();
QSBCore.UnityEvents.RunWhen(() => LateInitializerManager.isDoneInitializing, () =>
{
FinishDelayedReady();
WhiteHoleVolume = QSBWorldSync.GetUnityObjects<WhiteHoleVolume>().First();
QSBWorldSync.Init<QSBMeteorLauncher, MeteorLauncher>();
QSBWorldSync.Init<QSBMeteor, MeteorController>();
QSBWorldSync.Init<QSBFragment, FragmentIntegrity>();
});
}
}
}