26 lines
776 B
C#
Raw Normal View History

2022-04-01 19:08:03 +01:00
using Cysharp.Threading.Tasks;
using QSB.Utility.Deterministic;
2022-04-01 14:19:28 -07:00
using System.Linq;
2022-04-01 19:08:03 +01:00
using System.Threading;
namespace QSB.WorldSync;
2023-07-28 19:30:57 +01:00
public class MiscManager : WorldObjectManager
2022-04-01 19:08:03 +01:00
{
public override WorldObjectScene WorldObjectScene => WorldObjectScene.Both;
public override bool DlcOnly => false;
public override async UniTask BuildWorldObjects(OWScene scene, CancellationToken ct)
{
await UniTask.WaitUntil(() => LateInitializerManager.isDoneInitializing, cancellationToken: ct);
2022-04-01 14:20:19 -07:00
var listToInitFrom = QSBWorldSync.GetUnityObjects<OWRigidbody>()
2022-04-01 14:19:28 -07:00
.Where(x =>
x is not (PlayerBody or ShipBody or ShuttleBody) &&
!x.TryGetComponent<SurveyorProbe>(out _)
)
.SortDeterministic();
2022-04-01 14:20:19 -07:00
QSBWorldSync.Init<QSBOWRigidbody, OWRigidbody>(listToInitFrom);
2022-04-01 19:08:03 +01:00
}
}