mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-17 01:13:05 +00:00
meteors: don't both with initial state
This commit is contained in:
parent
ada70e4acb
commit
e5fc6d4e5c
@ -1,24 +1,13 @@
|
||||
using Cysharp.Threading.Tasks;
|
||||
using QSB.WorldSync;
|
||||
using System.Threading;
|
||||
using QSB.WorldSync;
|
||||
using UnityEngine;
|
||||
|
||||
namespace QSB.MeteorSync.WorldObjects;
|
||||
|
||||
public class QSBMeteor : WorldObject<MeteorController>
|
||||
{
|
||||
private QSBMeteorLauncher _qsbMeteorLauncher;
|
||||
|
||||
public override async UniTask Init(CancellationToken ct)
|
||||
{
|
||||
var meteorLauncher = AttachedObject._suspendRoot.GetComponent<MeteorLauncher>();
|
||||
await UniTask.WaitUntil(() => QSBWorldSync.AllObjectsAdded, cancellationToken: ct);
|
||||
_qsbMeteorLauncher = meteorLauncher.GetWorldObject<QSBMeteorLauncher>();
|
||||
}
|
||||
|
||||
public override void SendInitialState(uint to)
|
||||
{
|
||||
// todo SendInitialState
|
||||
// we don't really need to sync initial state
|
||||
}
|
||||
|
||||
public static bool IsSpecialImpact(GameObject go) =>
|
||||
|
@ -1,26 +1,13 @@
|
||||
using Cysharp.Threading.Tasks;
|
||||
using QSB.Utility;
|
||||
using QSB.WorldSync;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using QSB.WorldSync;
|
||||
using UnityEngine;
|
||||
|
||||
namespace QSB.MeteorSync.WorldObjects;
|
||||
|
||||
public class QSBMeteorLauncher : WorldObject<MeteorLauncher>
|
||||
{
|
||||
private QSBMeteor[] _qsbMeteors;
|
||||
|
||||
public override async UniTask Init(CancellationToken ct)
|
||||
{
|
||||
var meteors = AttachedObject._meteorPool.EmptyIfNull().Concat(AttachedObject._dynamicMeteorPool.EmptyIfNull());
|
||||
await UniTask.WaitUntil(() => QSBWorldSync.AllObjectsAdded, cancellationToken: ct);
|
||||
_qsbMeteors = meteors.Select(x => x.GetWorldObject<QSBMeteor>()).ToArray();
|
||||
}
|
||||
|
||||
public override void SendInitialState(uint to)
|
||||
{
|
||||
// todo SendInitialState
|
||||
// we don't really need to sync initial state
|
||||
}
|
||||
|
||||
public void PreLaunchMeteor()
|
||||
|
Loading…
Reference in New Issue
Block a user