mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-01 03:32:38 +00:00
angler/jelly: allow inactive
This commit is contained in:
parent
267a888c1c
commit
5cae7b8bec
@ -10,6 +10,7 @@ namespace QSB.Anglerfish.TransformSync;
|
||||
public class AnglerTransformSync : UnsectoredRigidbodySync
|
||||
{
|
||||
protected override bool UseInterpolation => false;
|
||||
protected override bool AllowInactiveAttachedObject => true; // since they deactivate when suspended
|
||||
|
||||
private QSBAngler _qsbAngler;
|
||||
private static readonly List<AnglerTransformSync> _instances = new();
|
||||
@ -70,7 +71,8 @@ public class AnglerTransformSync : UnsectoredRigidbodySync
|
||||
{
|
||||
if (!QSBCore.DebugSettings.DrawLines
|
||||
|| !IsValid
|
||||
|| !ReferenceTransform)
|
||||
|| !ReferenceTransform
|
||||
|| !AttachedTransform.gameObject.activeInHierarchy)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ namespace QSB.JellyfishSync.TransformSync;
|
||||
public class JellyfishTransformSync : UnsectoredRigidbodySync
|
||||
{
|
||||
protected override bool UseInterpolation => false;
|
||||
protected override bool AllowInactiveAttachedObject => true; // since they deactivate when suspended
|
||||
|
||||
private QSBJellyfish _qsbJellyfish;
|
||||
private bool _isRising;
|
||||
@ -104,7 +105,8 @@ public class JellyfishTransformSync : UnsectoredRigidbodySync
|
||||
{
|
||||
if (!QSBCore.DebugSettings.DrawLines
|
||||
|| !IsValid
|
||||
|| !ReferenceTransform)
|
||||
|| !ReferenceTransform
|
||||
|| !AttachedTransform.gameObject.activeInHierarchy)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -319,10 +319,10 @@ public abstract class SyncBase : QSBNetworkTransform
|
||||
|
||||
var interpDiv = _interpolating ? 2 : 1;
|
||||
Popcron.Gizmos.Cube(ReferenceTransform.FromRelPos(transform.position), ReferenceTransform.FromRelRot(transform.rotation), Vector3.one / 8, Color.red / interpDiv);
|
||||
Popcron.Gizmos.Line(ReferenceTransform.FromRelPos(transform.position), AttachedTransform.transform.position, Color.red / interpDiv);
|
||||
Popcron.Gizmos.Cube(AttachedTransform.transform.position, AttachedTransform.transform.rotation, Vector3.one / 6, Color.green / interpDiv);
|
||||
Popcron.Gizmos.Line(ReferenceTransform.FromRelPos(transform.position), AttachedTransform.position, Color.red / interpDiv);
|
||||
Popcron.Gizmos.Cube(AttachedTransform.position, AttachedTransform.rotation, Vector3.one / 6, Color.green / interpDiv);
|
||||
Popcron.Gizmos.Cube(ReferenceTransform.position, ReferenceTransform.rotation, Vector3.one / 8, Color.magenta / interpDiv);
|
||||
Popcron.Gizmos.Line(AttachedTransform.transform.position, ReferenceTransform.position, Color.cyan / interpDiv);
|
||||
Popcron.Gizmos.Line(AttachedTransform.position, ReferenceTransform.position, Color.cyan / interpDiv);
|
||||
}
|
||||
|
||||
private void OnGUI()
|
||||
@ -335,6 +335,6 @@ public abstract class SyncBase : QSBNetworkTransform
|
||||
return;
|
||||
}
|
||||
|
||||
DebugGUI.DrawLabel(AttachedTransform.transform, ToString());
|
||||
DebugGUI.DrawLabel(AttachedTransform, ToString());
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user