diff options
Diffstat (limited to 'Docs/TAB_AddDebugRigidBody.txt')
-rw-r--r-- | Docs/TAB_AddDebugRigidBody.txt | 66 |
1 files changed, 56 insertions, 10 deletions
diff --git a/Docs/TAB_AddDebugRigidBody.txt b/Docs/TAB_AddDebugRigidBody.txt index 0af5869..48ec04a 100644 --- a/Docs/TAB_AddDebugRigidBody.txt +++ b/Docs/TAB_AddDebugRigidBody.txt @@ -44,7 +44,7 @@ if (mainCam != null) string name = "RotationTarget"; -GameObject go = GameObject.Find(name); +go = GameObject.Find(name); if (go != null) { var comps = go.gameObject.GetComponents<MonoBehaviour>(); @@ -62,8 +62,8 @@ if (go != null) go.AddComponent<DebugRigidBody>(); } -string name = "AvaragePosition"; -GameObject go = GameObject.Find(name); + name = "AvaragePosition"; + go = GameObject.Find(name); if (go != null) { var comps = go.gameObject.GetComponents<MonoBehaviour>(); @@ -81,8 +81,8 @@ if (go != null) go.AddComponent<DebugRigidBody>(); } -string name = "CameraRotationY"; -GameObject go = GameObject.Find(name); + name = "CameraRotationY"; + go = GameObject.Find(name); if (go != null) { var comps = go.gameObject.GetComponents<MonoBehaviour>(); @@ -101,8 +101,8 @@ if (go != null) } -string name = "CameraRotationX"; -GameObject go = GameObject.Find(name); + name = "CameraRotationX"; + go = GameObject.Find(name); if (go != null) { var comps = go.gameObject.GetComponents<MonoBehaviour>(); @@ -122,8 +122,8 @@ if (go != null) -string name = "CameraMovement"; -GameObject go = GameObject.Find(name); + name = "CameraMovement"; + go = GameObject.Find(name); if (go != null) { var comps = go.gameObject.GetComponents<MonoBehaviour>(); @@ -140,4 +140,50 @@ if (go != null) Debug.Log(go.name); var drb = go.AddComponent<DebugRigidBody>(); drb.mode = DebugRigidBody.EMode.Cube; -}
\ No newline at end of file +} + + + + name = "Player_Target"; + go = GameObject.Find(name); +if (go != null) +{ + var comps = go.gameObject.GetComponents<MonoBehaviour>(); + if (comps != null) + { + for (int j = 0; j < comps.Length; j++) + { + if (comps[j].GetType().Name == "DebugRigidBody" || comps[j].GetType().Name == "DebugRigidBody2") + { + UnityEngine.Object.DestroyImmediate(comps[j]); + } + } + } + Debug.Log(go.name); + var drb = go.AddComponent<DebugRigidBody>(); + drb.mode = DebugRigidBody.EMode.Cube; + drb.color = Color.red; +} + + + name = "CameraPos"; + go = GameObject.Find(name); +if (go != null) +{ + var comps = go.gameObject.GetComponents<MonoBehaviour>(); + if (comps != null) + { + for (int j = 0; j < comps.Length; j++) + { + if (comps[j].GetType().Name == "DebugRigidBody" || comps[j].GetType().Name == "DebugRigidBody2") + { + UnityEngine.Object.DestroyImmediate(comps[j]); + } + } + } + Debug.Log(go.name); + var drb = go.AddComponent<DebugRigidBody>(); + drb.mode = DebugRigidBody.EMode.Cube; + drb.color = Color.green; +} + |