From 821b1efcd85dc6757ca855419ad1958dc81b16cd Mon Sep 17 00:00:00 2001 From: NotAKidoS <37721153+NotAKidOnSteam@users.noreply.github.com> Date: Thu, 15 Sep 2022 13:12:37 -0500 Subject: [PATCH] Tweaked Invoke time, properly disable Gizmos, added debug lines to CVRAvatar. Invoke time is now 0f, so toggling and refreshing Gizmos are now instant... oops. GizmosInstance is now properly disabled when not in use. Also removed the default gizmos line drawing at 0,0,0 that was purely there to clear gizmos queue. CVRAvatar debugging now has useful lines coming from the viewpoint and mouth positions. Later on might actually parent these gizmos to the head : shrug : --- CVRGizmos/CVRGizmoManager.cs | 4 +++- CVRGizmos/GizmoTypes/CVRAvatar.cs | 4 ++++ CVRGizmos/Popcron.Gizmos/GizmosInstance.cs | 10 +++++----- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CVRGizmos/CVRGizmoManager.cs b/CVRGizmos/CVRGizmoManager.cs index 948783c..4d398b5 100644 --- a/CVRGizmos/CVRGizmoManager.cs +++ b/CVRGizmos/CVRGizmoManager.cs @@ -1,4 +1,5 @@ using CVRGizmos.GismoTypes; +using Gizmos = Popcron.Gizmos; using UnityEngine; namespace CVRGizmos @@ -41,6 +42,7 @@ namespace CVRGizmos for (int i = 0; i < GizmoTypes.Count(); i++) { managed[i].enabled = able; + Gizmos.Enabled = able; } RefreshGizmos(); } @@ -49,7 +51,7 @@ namespace CVRGizmos { for (int i = 0; i < GizmoTypes.Count(); i++) { - managed[i].Invoke("CacheGizmos", 1f); + managed[i].Invoke("CacheGizmos", 0f); } } } diff --git a/CVRGizmos/GizmoTypes/CVRAvatar.cs b/CVRGizmos/GizmoTypes/CVRAvatar.cs index 3686fc0..a7c3be5 100644 --- a/CVRGizmos/GizmoTypes/CVRAvatar.cs +++ b/CVRGizmos/GizmoTypes/CVRAvatar.cs @@ -37,8 +37,12 @@ namespace CVRGizmos.GismoTypes Gizmos.Color = Color.green; Gizmos.Matrix = Matrix4x4.TRS(references[i].transform.position, references[i].transform.rotation, references[i].transform.localScale); Gizmos.Sphere(references[i].viewPosition, 0.01f); + Gizmos.Line(references[i].viewPosition, references[i].viewPosition + Vector3.forward * 0.05f); + Gizmos.Line(references[i].viewPosition, references[i].viewPosition + Vector3.right * 0.05f); Gizmos.Color = Color.red; Gizmos.Sphere(references[i].voicePosition, 0.01f); + Gizmos.Line(references[i].voicePosition, references[i].voicePosition + Vector3.forward * 0.05f); + Gizmos.Line(references[i].voicePosition, references[i].voicePosition + Vector3.right * 0.05f); } } } diff --git a/CVRGizmos/Popcron.Gizmos/GizmosInstance.cs b/CVRGizmos/Popcron.Gizmos/GizmosInstance.cs index 4743ed4..b68eb78 100644 --- a/CVRGizmos/Popcron.Gizmos/GizmosInstance.cs +++ b/CVRGizmos/Popcron.Gizmos/GizmosInstance.cs @@ -329,11 +329,11 @@ namespace Popcron return false; } - private void Update() - { - //always render something - Gizmos.Line(default, default); - } + //private void Update() + //{ + // //always render something + // Gizmos.Line(default, default); + //} private void OnRendered(Camera camera) {