Version: 2022.3
言語: 日本語

RectTransform

class in UnityEngine

/

継承:Transform

マニュアルに切り替える

説明

矩形の位置、サイズ、アンカー、ピボットの情報

RectTransform は GUI のために使用されるだけでなく、他のことにも使われます。 これは矩形の位置、サイズ、アンカーを記録や操作するために使われており、親 RectTransform にもとづいてさまざまなスケーリングをサポートしています。

Note: The Inspector changes which properties are exposed based on which anchor preset is in use. For more information see Rect Transform and Basic Layout.

変数

anchoredPositionアンカー基準点に対する RectTransform の相対的なピボットの位置
anchoredPosition3Dアンカー基準点に対する RectTransform の相対的なピボットの 3D の位置
anchorMax右上の角をアンカーした親 RectTransform で正規化された位置
anchorMin左下の角をアンカーした親 RectTransform で正規化された位置
drivenByObjectこの RectTransform の値で動作するオブジェクト。動作しない場合、値は null を返します。
offsetMax右上のアンカーを基準にした矩形の右上角のオフセット
offsetMin左下のアンカーを基準にした矩形の左下角のオフセット
pivotRectTransform で正規化された位置の周りをに回転します
rect Transform のローカル空間で計算された矩形
sizeDeltaアンカー間の距離と比較した RectTransform のサイズ。

Public 関数

ForceUpdateRectTransformsForce the recalculation of RectTransforms internal data.
GetLocalCornersトランスフォームのローカル空間で計算された長方形の角を取得する。
GetWorldCornersワールドスペースで計算された長方形の角を取得します。
SetInsetAndSizeFromParentEdge親の矩形の指定されたエッジにそのサイズを設定しながら矩形の相対的な距離を設定します。
SetSizeWithCurrentAnchorsRectTransform で計算された矩形が指定された軸上で任意のサイズにします。

Events

reapplyDrivenPropertiesRectTransform が呼び出されるイベントは再適用されるためにドリブンプロパティーを持っていることが必要があります

デリゲート

ReapplyDrivenPropertiesデリゲートは reapplyDrivenProperties イベントで使います

継承メンバー

変数

gameObjectこのコンポーネントはゲームオブジェクトにアタッチされます。コンポーネントはいつもゲームオブジェクトにアタッチされています。
tagゲームオブジェクトのタグ
transformThe Transform attached to this GameObject.
hideFlagsShould the object be hidden, saved with the Scene or modifiable by the user?
nameオブジェクト名
childCountThe number of children the parent Transform has.
eulerAnglesオイラー角としての角度
forwardReturns a normalized vector representing the blue axis of the transform in world space.
hasChangedフラグが最後に 'false' に設定されたときから Transform になんらかの変更があったかどうか
hierarchyCapacitytransform のヒエラルキーデータ構造の transform 容量
hierarchyCounttransform のヒエラルキーデータ構造の transform の数
localEulerAngles親の Transform オブジェクトから見た相対的なオイラー角としての回転値
localPosition親の Transform オブジェクトから見た相対的な位置
localRotationThe rotation of the transform relative to the transform rotation of the parent.
localScaleThe scale of the transform relative to the GameObjects parent.
localToWorldMatrixローカル座標からワールド座標へ変換した行列(読み取り専用)
lossyScaleオブジェクトのグローバルスケール(読み取り専用)
parentTransform の親
positionThe world space position of the Transform.
rightワールド空間の Transform の赤軸
root階層の一番上の Transform
rotationA Quaternion that stores the rotation of the Transform in world space.
upワールド空間の Transform の緑軸
worldToLocalMatrixワールド座標からローカル座標へ変換した行列(読み取り専用)

Public 関数

BroadcastMessageゲームオブジェクトまたは子オブジェクトにあるすべての MonoBehaviour を継承したクラスにある methodName 名のメソッドを呼び出します。
CompareTagChecks the GameObject's tag against the defined tag.
GetComponentGets a reference to a component of type T on the same GameObject as the component specified.
GetComponentInChildrenGets a reference to a component of type T on the same GameObject as the component specified, or any child of the GameObject.
GetComponentInParentGets a reference to a component of type T on the same GameObject as the component specified, or any parent of the GameObject.
GetComponentsGets references to all components of type T on the same GameObject as the component specified.
GetComponentsInChildrenGets references to all components of type T on the same GameObject as the component specified, and any child of the GameObject.
GetComponentsInParentGets references to all components of type T on the same GameObject as the component specified, and any parent of the GameObject.
SendMessageゲームオブジェクトにアタッチされているすべての MonoBehaviour にある methodName と名付けたメソッドを呼び出します
SendMessageUpwardsゲームオブジェクトと親(の親、さらに親 ... )にアタッチされているすべての MonoBehaviour にある methodName と名付けたメソッドを呼び出します
TryGetComponentGets the component of the specified type, if it exists.
GetInstanceIDGets the instance ID of the object.
ToStringReturns the name of the object.
DetachChildrenすべての子オブジェクトを親オブジェクトから切り離します
FindFinds a child by name n and returns it.
GetChildインデックスから子の transform を取得します
GetLocalPositionAndRotationGets the position and rotation of the Transform component in local space (that is, relative to its parent transform).
GetPositionAndRotationGets the position and rotation of the Transform component in world space.
GetSiblingIndex現在の Transform のインデックスを取得します
InverseTransformDirectionTransforms a direction from world space to local space. The opposite of Transform.TransformDirection.
InverseTransformDirectionsTransforms multiple directions from world space to local space overwriting each original position with the transformed version. The opposite of Transform.TransformDirections.
InverseTransformPointワールド空間からローカル空間へ position を変換します。
InverseTransformPointsTransforms multiple positions from world space to local space overwriting each original position with the transformed version.
InverseTransformVectorTransforms a vector from world space to local space. The opposite of Transform.TransformVector.
InverseTransformVectorsTransforms multiple vectors from world space to local space overwriting each original position with the transformed version. The opposite of Transform.TransformVectors.
IsChildOf親の子を変換するかどうか
LookAt対象の Transform を設定し、その方向へと向かせます
RotateUse Transform.Rotate to rotate GameObjects in a variety of ways. The rotation is often provided as an Euler angle and not a Quaternion.
RotateAroundワールド座標の point を中心とした軸( axis )で angle 度回転させま
SetAsFirstSiblingローカルの Transform リストで、一番最初の順番になるよう移動します。
SetAsLastSiblingローカルの Transform リストで、一番最後の順番になるよう移動します。
SetLocalPositionAndRotationSets the position and rotation of the Transform component in local space (i.e. relative to its parent transform).
SetParentTransform の親を設定します
SetPositionAndRotationSets the world space position and rotation of the Transform component.
SetSiblingIndex指定のインデックスに Transform を移動させます。
TransformDirectionローカル空間からワールド空間へ direction を変換します
TransformDirectionsTransforms multiple directions from local space to world space overwriting each original direction with the transformed version.
TransformPointローカル空間からワールド空間へ position を変換します。
TransformPointsTransforms multiple points from local space to world space overwriting each original point with the transformed version.
TransformVectorローカル空間からワールド空間へ vector を変換します。
TransformVectorsTransforms multiple vectors from local space to world space overwriting each original vector with the transformed version.
Translatetranslation の方向と距離に移動します

Static 関数

DestroyRemoves a GameObject, component or asset.
DestroyImmediateDestroys the object obj immediately. You are strongly recommended to use Destroy instead.
DontDestroyOnLoadDo not destroy the target Object when loading a new Scene.
FindAnyObjectByTypeRetrieves any active loaded object of Type type.
FindFirstObjectByTypeRetrieves the first active loaded object of Type type.
FindObjectOfTypeタイプ type から最初に見つけたアクティブのオブジェクトを返します
FindObjectsByTypeRetrieves a list of all loaded objects of Type type.
FindObjectsOfTypeGets a list of all loaded objects of Type type.
Instantiateoriginal のオブジェクトをクローンします

Operator

boolオブジェクトが存在するかどうか
operator !=二つのオブジェクトが異なるオブジェクトを参照しているか比較します
operator ==2つのオブジェクト参照が同じオブジェクトを参照しているか比較します。