mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-02-20 15:41:01 +00:00
>:(
This commit is contained in:
parent
c17cdcd537
commit
d0491e33f0
@ -14,7 +14,6 @@ namespace QSB.JellyfishSync.TransformSync
|
||||
protected override bool OnlyApplyOnDeserialize => true;
|
||||
|
||||
private QSBJellyfish _qsbJellyfish;
|
||||
private AlignWithTargetBody _alignWithTargetBody;
|
||||
private static readonly List<JellyfishTransformSync> _instances = new();
|
||||
|
||||
protected override OWRigidbody InitAttachedRigidbody()
|
||||
@ -51,8 +50,6 @@ namespace QSB.JellyfishSync.TransformSync
|
||||
AttachedRigidbody.OnUnsuspendOWRigidbody += OnUnsuspend;
|
||||
AttachedRigidbody.OnSuspendOWRigidbody += OnSuspend;
|
||||
netIdentity.SendAuthQueueMessage(AttachedRigidbody.IsSuspended() ? AuthQueueAction.Remove : AuthQueueAction.Add);
|
||||
|
||||
_alignWithTargetBody = AttachedRigidbody.GetComponent<AlignWithTargetBody>();
|
||||
}
|
||||
|
||||
protected override void Uninit()
|
||||
@ -71,18 +68,9 @@ namespace QSB.JellyfishSync.TransformSync
|
||||
private void OnUnsuspend(OWRigidbody suspendedBody) => netIdentity.SendAuthQueueMessage(AuthQueueAction.Add);
|
||||
private void OnSuspend(OWRigidbody suspendedBody) => netIdentity.SendAuthQueueMessage(AuthQueueAction.Remove);
|
||||
|
||||
protected override void GetFromAttached()
|
||||
{
|
||||
_alignWithTargetBody.enabled = true;
|
||||
|
||||
base.GetFromAttached();
|
||||
}
|
||||
|
||||
/// replacement using SetPosition/Rotation instead of Move
|
||||
protected override void ApplyToAttached()
|
||||
{
|
||||
_alignWithTargetBody.enabled = false;
|
||||
|
||||
var pos = ReferenceTransform.FromRelPos(transform.position);
|
||||
AttachedRigidbody.SetPosition(pos);
|
||||
AttachedRigidbody.SetRotation(ReferenceTransform.FromRelRot(transform.rotation));
|
||||
|
@ -16,6 +16,8 @@ namespace QSB.JellyfishSync.WorldObjects
|
||||
|
||||
public override void Init()
|
||||
{
|
||||
Object.Destroy(AttachedObject.GetComponent<AlignWithTargetBody>());
|
||||
|
||||
if (QSBCore.IsHost)
|
||||
{
|
||||
Object.Instantiate(QSBNetworkManager.singleton.JellyfishPrefab).SpawnWithServerAuthority();
|
||||
|
Loading…
x
Reference in New Issue
Block a user