diff options
author | chai <215380520@qq.com> | 2023-10-19 15:36:59 +0800 |
---|---|---|
committer | chai <215380520@qq.com> | 2023-10-19 15:36:59 +0800 |
commit | f4a633ea5125025216cc1d260d5dbac66f6ed194 (patch) | |
tree | 2c1d70c22b712dd895afcdc41bda158b1e2ee2ae /Docs/TAB_UnityExploerer.txt | |
parent | bc77bc7bc8b1a9b04ff598ff45eec0a1df5c6d8c (diff) |
*doc
Diffstat (limited to 'Docs/TAB_UnityExploerer.txt')
-rw-r--r-- | Docs/TAB_UnityExploerer.txt | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Docs/TAB_UnityExploerer.txt b/Docs/TAB_UnityExploerer.txt new file mode 100644 index 0000000..ed028a6 --- /dev/null +++ b/Docs/TAB_UnityExploerer.txt @@ -0,0 +1,28 @@ +// 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 |