meteors: don't both with initial state

This commit is contained in:
JohnCorby 2022-03-11 05:40:52 -08:00
parent ada70e4acb
commit e5fc6d4e5c
2 changed files with 4 additions and 28 deletions

View File

@ -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) =>

View File

@ -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()