From 78304183fb59e243a2d6da4a00a4311ae21c9717 Mon Sep 17 00:00:00 2001 From: chai <215380520@qq.com> Date: Fri, 15 Mar 2024 21:03:07 +0800 Subject: *misc --- _Debug/REPL.cs | 55 +++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 43 insertions(+), 12 deletions(-) (limited to '_Debug/REPL.cs') diff --git a/_Debug/REPL.cs b/_Debug/REPL.cs index 29209ef..8195a56 100644 --- a/_Debug/REPL.cs +++ b/_Debug/REPL.cs @@ -4,11 +4,15 @@ using UnityEngine; class REPL { + public static Transform footCenter; + public static void StartREPL() { + AddHeightBox(); AddCamera(); AddRigidbodyDebug(); AddCubes(); + AddFootCenter(); } public static void AddCamera() @@ -39,18 +43,18 @@ class REPL public static void AddRigidbodyDebug() { string[] targets = { - "Head", - "Neck", - "Torso", - "Arm_Right", - "Arm_Left", - "Hand_Right", - "Hand_Left", - "Hip", - "Leg_Left", - "Leg_Right", - "Foot_Left", - "Foot_Right", + //"Head", + //"Neck", + //"Torso", + //"Arm_Right", + //"Arm_Left", + //"Hand_Right", + //"Hand_Left", + //"Hip", + //"Leg_Left", + //"Leg_Right", + //"Foot_Left", + //"Foot_Right", "Knee_Left", "Knee_Right", }; @@ -121,4 +125,31 @@ class REPL } } } + + public static void AddHeightBox() + { + float height = 2; + GameObject cube = new GameObject(); + cube.transform.position = new Vector3(4.39f, 31.397f + height / 2.0f, -9.96f); + var drb = cube.AddComponent(); + drb.mode = DebugRigidBody.EMode.Cube; + drb.color = UnityEngine.Color.red; + drb.cubeLen = height; + } + + public static void AddFootCenter() + { + float height = 2; + GameObject cube = new GameObject(); + footCenter = cube.transform; + cube.transform.position = new Vector3(4.39f, 31.397f + height / 2.0f, -9.96f); + var drb = cube.AddComponent(); + drb.mode = DebugRigidBody.EMode.Custom; + drb.color = UnityEngine.Color.white; + drb.cubeLen = 0.1f; + drb.customDraw = () => { + //Draw.Sphere(drb.transform.position, 0.05f); + }; + } + } -- cgit v1.1-26-g67d0