mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-06 01:00:16 +00:00
go back to using list. rip
This commit is contained in:
parent
f9323728d6
commit
2493e8f97d
@ -1,4 +1,5 @@
|
||||
using QSB.JellyfishSync.WorldObjects;
|
||||
using System.Collections.Generic;
|
||||
using QSB.JellyfishSync.WorldObjects;
|
||||
using QSB.Syncs.Unsectored.Rigidbodies;
|
||||
using QSB.WorldSync;
|
||||
using QuantumUNET.Transport;
|
||||
@ -12,21 +13,20 @@ namespace QSB.JellyfishSync.TransformSync
|
||||
public override bool UseInterpolation => false;
|
||||
|
||||
private QSBJellyfish _qsbJellyfish;
|
||||
private static int _nextId;
|
||||
private int _id;
|
||||
private static readonly List<JellyfishTransformSync> _instances = new();
|
||||
|
||||
protected override OWRigidbody GetRigidbody()
|
||||
=> _qsbJellyfish.AttachedObject._jellyfishBody;
|
||||
|
||||
public override void Start()
|
||||
{
|
||||
_id = _nextId++;
|
||||
_instances.Add(this);
|
||||
base.Start();
|
||||
}
|
||||
|
||||
protected override void OnDestroy()
|
||||
{
|
||||
_nextId--;
|
||||
_instances.Remove(this);
|
||||
base.OnDestroy();
|
||||
}
|
||||
|
||||
@ -34,7 +34,7 @@ namespace QSB.JellyfishSync.TransformSync
|
||||
|
||||
protected override void Init()
|
||||
{
|
||||
_qsbJellyfish = QSBWorldSync.GetWorldFromId<QSBJellyfish>(_id);
|
||||
_qsbJellyfish = QSBWorldSync.GetWorldFromId<QSBJellyfish>(_instances.IndexOf(this));
|
||||
_qsbJellyfish.TransformSync = this;
|
||||
|
||||
base.Init();
|
||||
|
Loading…
Reference in New Issue
Block a user