函数说明
    DetachChildren所有子对象解除父子关系。
    Find通过名字查找子对象并返回它。
    GetChild通过索引返回一个变换的子对象。
    GetSiblingIndex获取该对象的同级索引。
    InverseTransformDirection变换的方向从世界坐标转换到局部坐标。和Transform.TransformDirection相反。
    InverseTransformPoint变换位置从世界坐标到局部坐标。和Transform.TransformPoint相反。
    InverseTransformVector变换一个向量从世界坐标空间到局部坐标空间。这个操作与Transform.TransformVector相反。
    IsChildOf这个变换是parent的子对象?
    LookAt旋转此变换,让向前向量指向target的当前位置。(照相机的视口对准目标)
    Rotate应用一个欧拉角的旋转角度,eulerAngles.z度围绕z轴,eulerAngles.x度围绕x轴,eulerAngles.y度围绕y轴(这样的顺序)。
    RotateAround围绕世界坐标的point点的axis旋转该变换angle度。
    SetAsFirstSibling移动该变换到此局部变换列表的开始。
    SetAsLastSibling移动该变换到此局部变换列表的末尾。
    SetParent设置该变换的父级。
    SetSiblingIndex设置同级对象的索引。
    TransformDirection变换方向从局部坐标转换到世界坐标。
    TransformPoint变换位置从局部坐标到世界坐标。
    TransformVector变换一个向量从局部坐标空间到世界坐标空间。
    Translate移动transform在translation的方向和距离。

    示例2:

    1. using System.Collections;
    2. public class ExampleClass : MonoBehaviour {
    3. void Update() {
    4. transform.Translate(0, 0, Time.deltaTime);
    5. transform.Translate(0, Time.deltaTime, 0, Space.World);
    6. }
    7. }

    示例3:

    1. using UnityEngine;
    2. using System.Collections;
    3. public class ExampleClass : MonoBehaviour {
    4. void Update() {
    5. transform.Translate(Vector3.right * Time.deltaTime, Camera.main.transform);
    6. }
    7. }

    示例4:

    1. using UnityEngine;
    2. using System.Collections;
    3. public class ExampleClass : MonoBehaviour {
    4. void Update() {
    5. transform.Translate(Time.deltaTime, 0, 0, Camera.main.transform);
    6. }

    示例2:

    1. using UnityEngine;
    2. {
    3. void Update()
    4. {
    5. // Rotate the object around its local Y axis at 1 degree per second
    6. transform.Rotate(Time.deltaTime, 0, 0);
    7. // ...also rotate around the World's Y axis
    8. transform.Rotate(0, Time.deltaTime, 0, Space.World);
    9. }
    10. }

    示例3:

    1. using UnityEngine;
    2. public class ExampleClass : MonoBehaviour
    3. {
    4. void Update()
    5. {
    6. // Rotate the object around its local Y axis at 1 degree per second
    7. transform.Rotate(Vector3.right, Time.deltaTime);
    8. // ...also rotate around the World's Y axis
    9. transform.Rotate(Vector3.up, Time.deltaTime, Space.World);
    10. }
    11. }

    1. using UnityEngine;
    2. using System.Collections;
    3. transform.RotateAround(Vector3.zero, Vector3.up, 20 * Time.deltaTime);
    4. }
    5. }

    实例1:

    1. transform.LookAt(Vector3.zero);

    实例1:

    1. using UnityEngine;
    2. using System.Collections;
    3. public class ExampleClass : MonoBehaviour {
    4. public GameObject someObject;
    5. public Vector3 thePosition;
    6. void Start() {
    7. // Instantiate an object to the right of the current object
    8. thePosition = transform.TransformPoint(Vector3.right * 2);
    9. Instantiate(someObject, thePosition, someObject.transform.rotation);
    10. }
    11. }

    实例2:

    1. using UnityEngine;
    2. using System.Collections;
    3. public class ExampleClass : MonoBehaviour {
    4. public GameObject someObject;
    5. void Start() {
    6. // Instantiate an object to the right of the current object
    7. Vector3 thePosition = transform.TransformPoint(2, 0, 0);
    8. Instantiate(someObject, thePosition, someObject.transform.rotation);
    9. }

    ?