summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchai <215380520@qq.com>2023-10-19 16:16:40 +0800
committerchai <215380520@qq.com>2023-10-19 16:16:40 +0800
commit7ddc0019db27b5a9377342433b3ef0b888bc9b7f (patch)
treea4006077fe97a8119f6b7dbcb005fa8fea7b407c
parentf4a633ea5125025216cc1d260d5dbac66f6ed194 (diff)
*misc
-rw-r--r--Docs/TAB_AddCamera.txt8
-rw-r--r--Docs/TAB_AddDebugRigidBody.txt66
-rw-r--r--Docs/TAB_DebugRigidBody.txt4
-rw-r--r--Docs/TAB_UnityExploerer.txt28
-rw-r--r--Docs/资料.xlsxbin5842601 -> 6608311 bytes
5 files changed, 67 insertions, 39 deletions
diff --git a/Docs/TAB_AddCamera.txt b/Docs/TAB_AddCamera.txt
index d456f6d..e25ce30 100644
--- a/Docs/TAB_AddCamera.txt
+++ b/Docs/TAB_AddCamera.txt
@@ -9,3 +9,11 @@
camera.name = "WanderCamera";
camera.AddComponent<Camera>();
camera.AddComponent<SimpleMoveCamera>();
+
+
+GameObject wanderCam = GameObject.Find("WanderCamera");
+
+GameObject player = GameObject.Find("Player_Target");
+if(player != null){
+ wanderCam.transform.position = player.transform.position;
+}
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;
+}
+
diff --git a/Docs/TAB_DebugRigidBody.txt b/Docs/TAB_DebugRigidBody.txt
index 095c105..e7a7026 100644
--- a/Docs/TAB_DebugRigidBody.txt
+++ b/Docs/TAB_DebugRigidBody.txt
@@ -11,6 +11,8 @@ public class DebugRigidBody : MonoBehaviour
}
public EMode mode = EMode.Axis;
+ public Color color = Color.white;
+
// When added to an object, draws colored rays from the
// transform position.
public int lineCount = 100;
@@ -88,7 +90,7 @@ public class DebugRigidBody : MonoBehaviour
GL.Begin(GL.QUADS);
- GL.Color(Color.white);
+ GL.Color(color);
GL.Vertex3(len, len, -len);
GL.Vertex3(-len, len, -len);
diff --git a/Docs/TAB_UnityExploerer.txt b/Docs/TAB_UnityExploerer.txt
index ed028a6..e69de29 100644
--- a/Docs/TAB_UnityExploerer.txt
+++ b/Docs/TAB_UnityExploerer.txt
@@ -1,28 +0,0 @@
-// To start a Coroutine directly, use "Start(SomeCoroutine());" in REPL mode.
-
-// To declare a coroutine, you will need to compile it separately. For example:
-public class MyCoro
-{
- public static IEnumerator Main()
- {
- while(true){
- GameObject go = GameObject.Find("Player_Target");
- if(go != null ) {
- Rigidbody[] rigs = go.transform.GetComponentsInChildren<Rigidbody>();
- for(int i = 0; i < rigs.Length; i++) {
- var rig = rigs[i];
- //Debug.Log(rig.gameObject.name);
- Debug.DrawLine(rig.transform.position, rig.transform.position + 10*rig.transform.forward);
- }
- }
- yield return null;
- }
- }
-}
-// To run this Coroutine in REPL, it would look like "Start(MyCoro.Main());"
-
-
-
-
-
-Start(MyCoro.Main()); \ No newline at end of file
diff --git a/Docs/资料.xlsx b/Docs/资料.xlsx
index cd5fd1f..cd30696 100644
--- a/Docs/资料.xlsx
+++ b/Docs/资料.xlsx
Binary files differ