using UnityEngine;
using System.Collections;
public class test2 : MonoBehaviour {
GameObject obj;
// Use this for initialization
void Start () {
<span style="white-space:pre"> </span> <span style="background-color: rgb(102, 102, 204);"> //<span style="font-family: Arial, Helvetica, sans-serif;">GameObject.Find用於尋找名字爲"Cube"的與腳本所依附的物體的同級物體</span></span>
obj = GameObject.Find ("Cube");
}
// Update is called once per frame
void Update () {
// obj.GetComponent<Transform> ().Rotate (0, 0, 5);
<span style="white-space:pre"> </span><span style="background-color: rgb(102, 102, 204);">//<span style="font-family: Arial, Helvetica, sans-serif;">transform.Find ("Cube")用於尋找名字爲"Cube"的子物體;</span></span>
transform.Find ("Cube").transform.Rotate (0, 5, 0);
}
}