mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-02-20 15:41:01 +00:00
QSBMeteorLauncher: meteor pools might be null
This commit is contained in:
parent
276ff3d8e3
commit
22856c9cd4
@ -1,5 +1,6 @@
|
||||
using Cysharp.Threading.Tasks;
|
||||
using QSB.WorldSync;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using UnityEngine;
|
||||
@ -12,7 +13,8 @@ public class QSBMeteorLauncher : WorldObject<MeteorLauncher>
|
||||
|
||||
public override async UniTask Init(CancellationToken ct)
|
||||
{
|
||||
var meteors = AttachedObject._meteorPool.Concat(AttachedObject._dynamicMeteorPool);
|
||||
var meteors = (AttachedObject._meteorPool ?? new List<MeteorController>())
|
||||
.Concat(AttachedObject._dynamicMeteorPool ?? new List<MeteorController>());
|
||||
await UniTask.WaitUntil(() => QSBWorldSync.AllObjectsAdded, cancellationToken: ct);
|
||||
_qsbMeteors = meteors.Select(x => x.GetWorldObject<QSBMeteor>()).ToArray();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user