fix(NetworkTransformBase) Debug Options Dropdown

This commit is contained in:
MrGadget 2024-04-16 23:59:36 -04:00
parent 5882674b8f
commit 5f0c2467fb

View File

@ -43,6 +43,14 @@ public enum BandwidthSavingsOptions
Default = OnlySyncOnChange | CompressRotation Default = OnlySyncOnChange | CompressRotation
} }
[Flags]
public enum DebugOptions
{
Nothing,
ShowGizmos = 1 << 0,
ShowOverlay = 1 << 1
}
public abstract class NetworkTransformBase : NetworkBehaviour public abstract class NetworkTransformBase : NetworkBehaviour
{ {
// target transform to sync. can be on a child. // 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; protected double offset => timelineOffset ? NetworkServer.sendInterval * sendIntervalMultiplier : 0;
// debugging /////////////////////////////////////////////////////////// // debugging ///////////////////////////////////////////////////////////
[Header("Debug")] [Header("Debug Settings")]
public bool showGizmos; [SerializeField, Tooltip("Debug Options")]
public bool showOverlay; 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); public Color overlayColor = new Color(0, 0, 0, 0.5f);
// initialization ////////////////////////////////////////////////////// // initialization //////////////////////////////////////////////////////