From 86a871889dd4ae00c371d694f76cb02174145fc6 Mon Sep 17 00:00:00 2001 From: Mister_Nebula <41904486+misternebula@users.noreply.github.com> Date: Sun, 2 May 2021 09:09:37 +0100 Subject: [PATCH] make conv. boxes ignore Z always, fix multiple AttachedObjects --- QSB/ConversationSync/ConversationManager.cs | 1 + QSB/QSB.csproj | 2 +- QSB/QSBCore.cs | 4 ---- QSB/TransformSync/BaseTransformSync.cs | 2 +- QSB/Utility/DebugBoxManager.cs | 2 +- QSB/Utility/{DebugZOverride.cs => ZOverride.cs} | 2 +- 6 files changed, 5 insertions(+), 8 deletions(-) rename QSB/Utility/{DebugZOverride.cs => ZOverride.cs} (95%) diff --git a/QSB/ConversationSync/ConversationManager.cs b/QSB/ConversationSync/ConversationManager.cs index 2ebc8af3..9a68577d 100644 --- a/QSB/ConversationSync/ConversationManager.cs +++ b/QSB/ConversationSync/ConversationManager.cs @@ -122,6 +122,7 @@ namespace QSB.ConversationSync lookAt.SetValue("_localFacingVector", Vector3.back); lookAt.SetValue("_localRotationAxis", Vector3.up); newBox.GetComponent().text = text; + newBox.AddComponent(); newBox.SetActive(true); return newBox; } diff --git a/QSB/QSB.csproj b/QSB/QSB.csproj index 6ca90703..77830d94 100644 --- a/QSB/QSB.csproj +++ b/QSB/QSB.csproj @@ -279,7 +279,7 @@ - + diff --git a/QSB/QSBCore.cs b/QSB/QSBCore.cs index 4cf52c2e..00726406 100644 --- a/QSB/QSBCore.cs +++ b/QSB/QSBCore.cs @@ -246,10 +246,6 @@ namespace QSB QSBNetworkManager.Instance.networkPort = Port; } DebugMode = config.GetSettingsValue("debugMode"); - if (!DebugMode) - { - FindObjectsOfType().ToList().ForEach(x => Destroy(x.gameObject)); - } ShowLinesInDebug = config.GetSettingsValue("showLinesInDebug"); SocketedObjToDebug = config.GetSettingsValue("socketedObjToDebug"); } diff --git a/QSB/TransformSync/BaseTransformSync.cs b/QSB/TransformSync/BaseTransformSync.cs index f9fa79f3..d8762ffc 100644 --- a/QSB/TransformSync/BaseTransformSync.cs +++ b/QSB/TransformSync/BaseTransformSync.cs @@ -62,7 +62,7 @@ namespace QSB.TransformSync protected virtual void Init() { - if (AttachedObject != null) + if (!HasAuthority && AttachedObject != null) { Destroy(AttachedObject); } diff --git a/QSB/Utility/DebugBoxManager.cs b/QSB/Utility/DebugBoxManager.cs index b1b6240d..bf39c21f 100644 --- a/QSB/Utility/DebugBoxManager.cs +++ b/QSB/Utility/DebugBoxManager.cs @@ -33,7 +33,7 @@ namespace QSB.Utility lookAt.SetValue("_localFacingVector", Vector3.back); lookAt.SetValue("_localRotationAxis", Vector3.up); newBox.GetComponent().text = text; - newBox.AddComponent(); + newBox.AddComponent(); newBox.SetActive(true); return newBox; } diff --git a/QSB/Utility/DebugZOverride.cs b/QSB/Utility/ZOverride.cs similarity index 95% rename from QSB/Utility/DebugZOverride.cs rename to QSB/Utility/ZOverride.cs index b92c805c..8eddd18a 100644 --- a/QSB/Utility/DebugZOverride.cs +++ b/QSB/Utility/ZOverride.cs @@ -4,7 +4,7 @@ using UnityEngine.UI; namespace QSB.Utility { - public class DebugZOverride : MonoBehaviour + public class ZOverride : MonoBehaviour { private const string shaderTestMode = "unity_GUIZTestMode"; private readonly UnityEngine.Rendering.CompareFunction desiredUIComparison = UnityEngine.Rendering.CompareFunction.Always;