diff --git a/QSB/QuantumSync/QuantumManager.cs b/QSB/QuantumSync/QuantumManager.cs index 10c17fb9..f4815a68 100644 --- a/QSB/QuantumSync/QuantumManager.cs +++ b/QSB/QuantumSync/QuantumManager.cs @@ -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(); } + 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"); + 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); diff --git a/QSB/TransformSync/PlayerCameraSync.cs b/QSB/TransformSync/PlayerCameraSync.cs index 4e085a53..5aec542d 100644 --- a/QSB/TransformSync/PlayerCameraSync.cs +++ b/QSB/TransformSync/PlayerCameraSync.cs @@ -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) diff --git a/QSB/TransformSync/PlayerTransformSync.cs b/QSB/TransformSync/PlayerTransformSync.cs index 868cfc3a..f3f975d1 100644 --- a/QSB/TransformSync/PlayerTransformSync.cs +++ b/QSB/TransformSync/PlayerTransformSync.cs @@ -54,7 +54,7 @@ namespace QSB.TransformSync private void OnRenderObject() { - if (!QSBCore.HasWokenUp) + if (!QSBCore.HasWokenUp || !Player.IsReady) { return; }