mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-02-21 09:39:56 +00:00
wow look at all those gizmos
This commit is contained in:
parent
36f6ccc251
commit
f9323728d6
@ -72,12 +72,27 @@ namespace QSB.Anglerfish.TransformSync
|
||||
if (!QSBCore.WorldObjectsReady
|
||||
|| !QSBCore.ShowLinesInDebug
|
||||
|| !IsReady
|
||||
|| ReferenceTransform == null)
|
||||
|| ReferenceTransform == null
|
||||
|| ((OWRigidbody)AttachedObject).IsSuspended())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Popcron.Gizmos.Line(AttachedObject.transform.position, _qsbAngler.AttachedObject.GetTargetPosition(), Color.white);
|
||||
Popcron.Gizmos.Sphere(AttachedObject.transform.position, _qsbAngler.AttachedObject._arrivalDistance, Color.blue);
|
||||
Popcron.Gizmos.Sphere(AttachedObject.transform.position, _qsbAngler.AttachedObject._pursueDistance, Color.red);
|
||||
Popcron.Gizmos.Sphere(AttachedObject.transform.position, _qsbAngler.AttachedObject._escapeDistance, Color.yellow);
|
||||
Popcron.Gizmos.Sphere(AttachedObject.transform.position
|
||||
+ AttachedObject.transform.TransformDirection(_qsbAngler.AttachedObject._mouthOffset), 3, Color.grey);
|
||||
|
||||
if (_qsbAngler.TargetTransform != null)
|
||||
{
|
||||
Popcron.Gizmos.Line(_qsbAngler.TargetTransform.position, ((OWRigidbody)AttachedObject).GetPosition(), Color.gray);
|
||||
Popcron.Gizmos.Line(_qsbAngler.TargetTransform.position, _qsbAngler.TargetTransform.position + _qsbAngler.TargetVelocity, Color.green);
|
||||
Popcron.Gizmos.Line(((OWRigidbody)AttachedObject).GetPosition(), _qsbAngler.AttachedObject._targetPos, Color.red);
|
||||
Popcron.Gizmos.Sphere(_qsbAngler.AttachedObject._targetPos, 5, Color.red);
|
||||
}
|
||||
|
||||
// Popcron.Gizmos.Line(AttachedObject.transform.position, _qsbAngler.AttachedObject.GetTargetPosition(), Color.white);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ namespace QSB.JellyfishSync.Patches
|
||||
{
|
||||
__instance.gameObject.SetActive(true);
|
||||
__instance._jellyfishBody.Unsuspend();
|
||||
QSBEventManager.FireEvent(EventNames.QSBSuspendChange, qsbJellyfish.TransformSync.NetIdentity, true);
|
||||
QSBEventManager.FireEvent(EventNames.QSBSuspendChange, qsbJellyfish.TransformSync.NetIdentity, false);
|
||||
return false;
|
||||
}
|
||||
if (__instance.gameObject.activeSelf && !__instance._sector.ContainsAnyOccupants(DynamicOccupant.Player | DynamicOccupant.Probe | DynamicOccupant.Ship))
|
||||
|
@ -1,8 +1,8 @@
|
||||
using System.Collections.Generic;
|
||||
using QSB.JellyfishSync.WorldObjects;
|
||||
using QSB.JellyfishSync.WorldObjects;
|
||||
using QSB.Syncs.Unsectored.Rigidbodies;
|
||||
using QSB.WorldSync;
|
||||
using QuantumUNET.Transport;
|
||||
using UnityEngine;
|
||||
|
||||
namespace QSB.JellyfishSync.TransformSync
|
||||
{
|
||||
@ -12,14 +12,12 @@ namespace QSB.JellyfishSync.TransformSync
|
||||
public override bool UseInterpolation => false;
|
||||
|
||||
private QSBJellyfish _qsbJellyfish;
|
||||
private static readonly List<JellyfishTransformSync> _instances = new();
|
||||
private static int _nextId;
|
||||
private int _id;
|
||||
|
||||
protected override OWRigidbody GetRigidbody()
|
||||
=> _qsbJellyfish.AttachedObject._jellyfishBody;
|
||||
|
||||
private static int _nextId;
|
||||
private int _id;
|
||||
|
||||
public override void Start()
|
||||
{
|
||||
_id = _nextId++;
|
||||
@ -32,7 +30,7 @@ namespace QSB.JellyfishSync.TransformSync
|
||||
base.OnDestroy();
|
||||
}
|
||||
|
||||
public override float GetNetworkSendInterval() => 1;
|
||||
public override float GetNetworkSendInterval() => 10;
|
||||
|
||||
protected override void Init()
|
||||
{
|
||||
@ -66,5 +64,27 @@ namespace QSB.JellyfishSync.TransformSync
|
||||
_shouldUpdate = false;
|
||||
return base.UpdateTransform();
|
||||
}
|
||||
|
||||
|
||||
protected override void OnRenderObject()
|
||||
{
|
||||
base.OnRenderObject();
|
||||
|
||||
if (!QSBCore.WorldObjectsReady
|
||||
|| !QSBCore.ShowLinesInDebug
|
||||
|| !IsReady
|
||||
|| ReferenceTransform == null
|
||||
|| ((OWRigidbody)AttachedObject).IsSuspended())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var jellyfish = _qsbJellyfish.AttachedObject;
|
||||
var position = ReferenceTransform.position;
|
||||
var dir = Vector3.Normalize(jellyfish.transform.position - position);
|
||||
Popcron.Gizmos.Line(position + dir * jellyfish._lowerLimit, position + dir * jellyfish._upperLimit, Color.magenta);
|
||||
Popcron.Gizmos.Sphere(position + dir * jellyfish._lowerLimit, 10f, Color.magenta);
|
||||
Popcron.Gizmos.Sphere(position + dir * jellyfish._upperLimit, 10f, Color.magenta);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user