オブジェクトの位置、回転、スケールを扱うクラス
シーン内のすべてのオブジェクトは Transform を持ちます。 Transform はオブジェクトの位置、回転、スケールを格納し、操作するために使用されます。 すべての Transform は親を持ち、階層的に位置、回転、スケールを適用することができます。これはヒエラルキーウインドウで階層を見ることができます。 また、以下のようにループを使って子の Transform を使用する列挙体をサポートしています。
using UnityEngine; using System.Collections;
public class ExampleClass : MonoBehaviour { void Example() { foreach (Transform child in transform) { child.position += Vector3.up * 10.0F; } } }
関連項目: Transform コンポーネント、Physics クラス .
| childCount | Transform の持つ子の数 |
| eulerAngles | オイラー角としての角度 |
| forward | ワールド空間の Transform の青軸 |
| hasChanged | フラグが最後に 'false' に設定されたときから Transform になんらかの変更があったかどうか |
| hierarchyCapacity | transform のヒエラルキーデータ構造の transform 容量 |
| hierarchyCount | transform のヒエラルキーデータ構造の transform の数 |
| localEulerAngles | 親の Transform オブジェクトから見た相対的なオイラー角としての回転値 |
| localPosition | 親の Transform オブジェクトから見た相対的な位置 |
| localRotation | The rotation of the transform relative to the transform rotation of the parent. |
| localScale | 親の Transform オブジェクトから見た相対的なスケール |
| localToWorldMatrix | ローカル座標からワールド座標へ変換した行列(読み取り専用) |
| lossyScale | オブジェクトのグローバルスケール(読み取り専用) |
| parent | Transform の親 |
| position | ワールド空間の Transform の位置 |
| right | ワールド空間の Transform の赤軸 |
| root | 階層の一番上の Transform |
| rotation | Quaternion として保存されるワールド空間での Transform の回転 |
| up | ワールド空間の Transform の緑軸 |
| worldToLocalMatrix | ワールド座標からローカル座標へ変換した行列(読み取り専用) |
| DetachChildren | すべての子オブジェクトを親オブジェクトから切り離します |
| Find | Finds a child by n and returns it. |
| GetChild | インデックスから子の transform を取得します |
| GetSiblingIndex | 現在の Transform のインデックスを取得します |
| InverseTransformDirection | ワールド空間からローカル空間へ direction を変換します。Transform.TransformDirection とは逆の機能になります |
| InverseTransformPoint | ワールド空間からローカル空間へ position を変換します。 |
| InverseTransformVector | ワールド空間からローカル空間へ vector を変換します。Transform.TransformVector の逆の機能です。 |
| IsChildOf | 親の子を変換するかどうか |
| LookAt | 対象の Transform を設定し、その方向へと向かせます |
| Rotate | Z 軸で eulerAngles.z 度回転、X 軸で eulerAngles.x 度回転、Y 軸で eulerAngles.y 度回転します (順番は説明した順) |
| RotateAround | ワールド座標の point を中心とした軸( axis )で angle 度回転させま |
| SetAsFirstSibling | ローカルの Transform リストで、一番最初の順番になるよう移動します。 |
| SetAsLastSibling | ローカルの Transform リストで、一番最後の順番になるよう移動します。 |
| SetParent | Transform の親を設定します |
| SetPositionAndRotation | Sets the world space position and rotation of the Transform component. |
| SetSiblingIndex | 指定のインデックスに Transform を移動させます。 |
| TransformDirection | ローカル空間からワールド空間へ direction を変換します |
| TransformPoint | ローカル空間からワールド空間へ position を変換します。 |
| TransformVector | ローカル空間からワールド空間へ vector を変換します。 |
| Translate | translation の方向と距離に移動します |
| gameObject | このコンポーネントはゲームオブジェクトにアタッチされます。コンポーネントはいつもゲームオブジェクトにアタッチされています。 |
| tag | ゲームオブジェクトのタグ |
| transform | The Transform attached to this GameObject. |
| hideFlags | オブジェクトは非表示、シーンに保存、ユーザーが編集可能、などを設定する。 |
| name | オブジェクト名 |
| BroadcastMessage | ゲームオブジェクトまたは子オブジェクトにあるすべての MonoBehaviour を継承したクラスにある methodName 名のメソッドを呼び出します。 |
| CompareTag | このゲームオブジェクトは tag とタグ付けされているかどうか |
| GetComponent | ゲームオブジェクトに type がアタッチされている場合は type のタイプを使用してコンポーネントを返します。ない場合は null です |
| GetComponentInChildren | GameObject や深さ優先探索を活用して、親子関係にある子オブジェクトから type のタイプのコンポーネントを取得します。 |
| GetComponentInParent | GameObject や深さ優先探索を活用して、親子関係にある親オブジェクトから type のタイプのコンポーネントを取得します。 |
| GetComponents | GameObject から type のタイプのコンポーネントを「すべて」取得します。 |
| GetComponentsInChildren | GameObject や深さ優先探索を活用して、親子関係にある子オブジェクトから type のタイプのコンポーネントを「すべて」取得します。 |
| GetComponentsInParent | GameObject や深さ優先探索を活用して、親子関係にある親オブジェクトから type のタイプのコンポーネントを「すべて」取得します。 |
| SendMessage | ゲームオブジェクトにアタッチされているすべての MonoBehaviour にある methodName と名付けたメソッドを呼び出します |
| SendMessageUpwards | ゲームオブジェクトと親(の親、さらに親 ... )にアタッチされているすべての MonoBehaviour にある methodName と名付けたメソッドを呼び出します |
| GetInstanceID | オブジェクトのインスタンス ID を返します |
| ToString | Returns the name of the GameObject. |
| Destroy | ゲームオブジェクトやコンポーネント、アセットを削除します |
| DestroyImmediate | Destroys the object obj immediately. You are strongly recommended to use Destroy instead. |
| DontDestroyOnLoad | 新しいシーンを読み込んでもオブジェクトが自動で破壊されないように設定します |
| FindObjectOfType | タイプ type から最初に見つけたアクティブのオブジェクトを返します |
| FindObjectsOfType | タイプから見つけたすべてのアクティブのオブジェクト配列を返します |
| Instantiate | original のオブジェクトをクローンします |
| bool | オブジェクトが存在するかどうか |
| operator != | 二つのオブジェクトが異なるオブジェクトを参照しているか比較します |
| operator == | 2つのオブジェクト参照が同じオブジェクトを参照しているか比較します。 |