From 7365df818973a24bd29aeb725f6113f0a82cb9c6 Mon Sep 17 00:00:00 2001 From: chai <215380520@qq.com> Date: Wed, 3 Apr 2024 22:51:42 +0800 Subject: *scope --- ActiveRagdoll/Assets/TABG/Scripts/Debug/GLHandle.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'ActiveRagdoll/Assets/TABG/Scripts/Debug/GLHandle.cs') diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Debug/GLHandle.cs b/ActiveRagdoll/Assets/TABG/Scripts/Debug/GLHandle.cs index 7f2eeae..ea64cec 100644 --- a/ActiveRagdoll/Assets/TABG/Scripts/Debug/GLHandle.cs +++ b/ActiveRagdoll/Assets/TABG/Scripts/Debug/GLHandle.cs @@ -6,14 +6,17 @@ namespace Rigging.Debugging public class GLScope : IDisposable { + bool bScopeBefore; + public GLScope(bool enabled) { + bScopeBefore = GLHandle.bScopeEnabled; GLHandle.EnterScope(enabled); } public void Dispose() { - GLHandle.EndScope(); + GLHandle.EndScope(bScopeBefore); } } @@ -27,7 +30,7 @@ namespace Rigging.Debugging private static Material lineMaterial; - private static bool bScopeEnabled; + public static bool bScopeEnabled; static GLHandle() { @@ -87,7 +90,7 @@ namespace Rigging.Debugging bScopeEnabled = enabled; } - public static void EndScope() + public static void EndScope(bool enabled = true) { bScopeEnabled = true; } -- cgit v1.1-26-g67d0