SRectTransform
| دالة | SetParent | Set the parent of the transform. |
| دالة | SetInsetAndSizeFromParentEdge | Set the distance of this rectangle relative to a specified edge of the parent rectangle, while also setting its size. |
| دالة | SetSizeWithCurrentAnchors | Makes the RectTransform calculated rect be a given size on the specified axis. |
| خاصية | Rect | – |
| خاصية | anchorMin | The normalized position in the parent RectTransform that the lower left corner is anchored to. |
| خاصية | anchorMax | – |
| خاصية | anchoredPosition3D | – |
| خاصية | anchoredPosition | – |
| خاصية | sizeDelta | The size of this RectTransform relative to the distances between the anchors. |
| خاصية | pivot | The normalized position in this RectTransform that it rotates around. |
| خاصية | offsetMin | The offset of the lower left corner of the rectangle relative to the lower left anchor. |
| خاصية | offsetMax | The offset of the upper right corner of the rectangle relative to the upper right anchor. |
| خاصية | GameObject | – |
الدوال
SetParent
Set the parent of the transform.
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| parent | SGameObject | – |
| worldPositionStays | bool | – |
القيم المرجعة
void
مثال
Space.Host.ExecutingObject.RectTransform.SetParent(anotherGameObject)
SetInsetAndSizeFromParentEdge
Set the distance of this rectangle relative to a specified edge of the parent rectangle, while also setting its size.
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| edge | int | – |
| inset | float | – |
| size | float | – |
القيم المرجعة
void
مثال
Space.Host.ExecutingObject.RectTransform.SetInsetAndSizeFromParentEdge(2, 3.0, 10.0)
SetSizeWithCurrentAnchors
Makes the RectTransform calculated rect be a given size on the specified axis.
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| vertical | bool | – |
| size | float | – |
القيم المرجعة
void
مثال
Space.Host.ExecutingObject.RectTransform.SetSizeWithCurrentAnchors(true, 10.0)
الخصائص
Rectللقراءة فقط
مثال
rect = Space.Host.ExecutingObject.RectTransform.Rect
anchorMin
The normalized position in the parent RectTransform that the lower left corner is anchored to.
مثال
Space.Host.ExecutingObject.RectTransform.anchorMin= Vector.New(0.3,0.3,0)
anchorMax
مثال
Space.Host.ExecutingObject.RectTransform.anchorMax= Vector.New(0.7,0.6,0)
anchoredPosition3D
مثال
Space.Host.ExecutingObject.RectTransform.anchoredPosition3D= Vector.New(0.7,0.6,0)
anchoredPosition
مثال
Space.Host.ExecutingObject.RectTransform.anchoredPosition= Vector.New(0.7,0.6,0)
sizeDelta
The size of this RectTransform relative to the distances between the anchors.
مثال
Space.Host.ExecutingObject.RectTransform.sizeDelta= Vector.New(90,90,0)
pivot
The normalized position in this RectTransform that it rotates around.
مثال
Space.Host.ExecutingObject.RectTransform.pivot= Vector.New(0.4,0.4,0)
offsetMin
The offset of the lower left corner of the rectangle relative to the lower left anchor.
مثال
Space.Host.ExecutingObject.RectTransform.offsetMin= Vector.New(-50,-50,0)
offsetMax
The offset of the upper right corner of the rectangle relative to the upper right anchor.
مثال
Space.Host.ExecutingObject.RectTransform.offsetMax= Vector.New(50,50,0)
GameObjectللقراءة فقط
مثال
theGameObject = Space.Host.ExecutingObject.RectTransform.GameObject



