From 5f0c2467fbcac9ccf5438886e0acd61519c1c627 Mon Sep 17 00:00:00 2001 From: MrGadget <9826063+MrGadget1024@users.noreply.github.com> Date: Tue, 16 Apr 2024 23:59:36 -0400 Subject: [PATCH] fix(NetworkTransformBase) Debug Options Dropdown --- .../NetworkTransform/NetworkTransformBase.cs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/Assets/Mirror/Components/NetworkTransform/NetworkTransformBase.cs b/Assets/Mirror/Components/NetworkTransform/NetworkTransformBase.cs index b8743942a..78f3d9811 100644 --- a/Assets/Mirror/Components/NetworkTransform/NetworkTransformBase.cs +++ b/Assets/Mirror/Components/NetworkTransform/NetworkTransformBase.cs @@ -43,6 +43,14 @@ public enum BandwidthSavingsOptions Default = OnlySyncOnChange | CompressRotation } + [Flags] + public enum DebugOptions + { + Nothing, + ShowGizmos = 1 << 0, + ShowOverlay = 1 << 1 + } + public abstract class NetworkTransformBase : NetworkBehaviour { // target transform to sync. can be on a child. @@ -113,9 +121,13 @@ public abstract class NetworkTransformBase : NetworkBehaviour protected double offset => timelineOffset ? NetworkServer.sendInterval * sendIntervalMultiplier : 0; // debugging /////////////////////////////////////////////////////////// - [Header("Debug")] - public bool showGizmos; - public bool showOverlay; + [Header("Debug Settings")] + [SerializeField, Tooltip("Debug Options")] + internal DebugOptions debugOptions = DebugOptions.Nothing; + + public bool showGizmos => (debugOptions & DebugOptions.ShowGizmos) == DebugOptions.ShowGizmos; + public bool showOverlay => (debugOptions & DebugOptions.ShowOverlay) == DebugOptions.ShowOverlay; + public Color overlayColor = new Color(0, 0, 0, 0.5f); // initialization //////////////////////////////////////////////////////