diff options
author | chai <215380520@qq.com> | 2024-03-15 21:03:07 +0800 |
---|---|---|
committer | chai <215380520@qq.com> | 2024-03-15 21:03:07 +0800 |
commit | 78304183fb59e243a2d6da4a00a4311ae21c9717 (patch) | |
tree | aeae48561b9a5c25a1d58de28b8b3e2af37598e4 /_Debug/DebugRigidBody.cs | |
parent | dbba1ae118a70db8be668806c0af8655e7b4afe7 (diff) |
*misc
Diffstat (limited to '_Debug/DebugRigidBody.cs')
-rw-r--r-- | _Debug/DebugRigidBody.cs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/_Debug/DebugRigidBody.cs b/_Debug/DebugRigidBody.cs index 8267f50..a83d1ed 100644 --- a/_Debug/DebugRigidBody.cs +++ b/_Debug/DebugRigidBody.cs @@ -1,4 +1,5 @@ +using System; using UnityEngine; public class DebugRigidBody : MonoBehaviour @@ -9,6 +10,7 @@ public class DebugRigidBody : MonoBehaviour Axis, Cube, Axis_Cube, + Custom, } public EMode mode = EMode.Axis; @@ -21,6 +23,8 @@ public class DebugRigidBody : MonoBehaviour public float cubeLen = 0.05f; + public Action customDraw; + static Material lineMaterial; static void CreateLineMaterial() { @@ -87,7 +91,7 @@ public class DebugRigidBody : MonoBehaviour // match our transform GL.MultMatrix(transform.localToWorldMatrix); - float len = cubeLen; + float len = cubeLen/2.0f; GL.wireframe = true; @@ -135,6 +139,13 @@ public class DebugRigidBody : MonoBehaviour GL.PopMatrix(); } + if(mode == EMode.Custom) + { + if(customDraw != null) + { + customDraw.Invoke(); + } + } } } |