This commit is contained in:
Mister_Nebula 2021-01-03 16:09:58 +00:00
parent 57f01903bb
commit a7284cf945
3 changed files with 31 additions and 2 deletions

View File

@ -1,4 +1,5 @@
using QSB.QuantumSync.WorldObjects;
using OWML.Utils;
using QSB.QuantumSync.WorldObjects;
using QSB.WorldSync;
using System.Collections.Generic;
using UnityEngine;
@ -30,6 +31,25 @@ namespace QSB.QuantumSync
_quantumShuffleObjects = QSBWorldSync.Init<QSBQuantumShuffleObject, QuantumShuffleObject>();
}
private void OnRenderObject()
{
if (!QSBCore.HasWokenUp)
{
return;
}
foreach (var item in _socketedQuantumObjects)
{
if (!item.gameObject.activeInHierarchy)
{
continue;
}
Popcron.Gizmos.Sphere(item.transform.position, 5f, item.IsVisible() ? Color.green : Color.red);
}
Popcron.Gizmos.Sphere(Locator.GetQuantumMoon().transform.position, 120f, Color.cyan, true);
var visTracker = Locator.GetQuantumMoon().GetValue<VisibilityTracker>("_visibilityTracker");
Popcron.Gizmos.Sphere(visTracker.transform.position, 130f, visTracker.IsVisibleUsingCameraFrustum() ? Color.green : Color.red);
}
public int GetId(SocketedQuantumObject obj) => _socketedQuantumObjects.IndexOf(obj);
public int GetId(MultiStateQuantumObject obj) => _multiStateQuantumObjects.IndexOf(obj);
public int GetId(QuantumSocket obj) => _quantumSockets.IndexOf(obj);

View File

@ -38,6 +38,15 @@ namespace QSB.TransformSync
return body.transform;
}
private void OnRenderObject()
{
if (!QSBCore.HasWokenUp || !Player.IsReady)
{
return;
}
Popcron.Gizmos.Cone(Player.CameraBody.transform.position, Player.CameraBody.transform.rotation, 10f, 45f);
}
public override bool IsReady => Locator.GetPlayerTransform() != null
&& Player != null
&& QSBPlayerManager.PlayerExists(Player.PlayerId)

View File

@ -54,7 +54,7 @@ namespace QSB.TransformSync
private void OnRenderObject()
{
if (!QSBCore.HasWokenUp)
if (!QSBCore.HasWokenUp || !Player.IsReady)
{
return;
}