SetLocalRight(float, bool)
Moves the right edge of this RectTransform to the specified position in its parent's coordinate space.
Read time 1 minuteLast updated 4 days ago
Definition
- Type: Method
- Namespace: UnityEngine
- Assembly: UnityEngine.CoreModule
public void SetLocalRight(float value, bool preserveSize = true)
Parameters
The target x coordinate for the right edge, in the parent's coordinate space.
When true (default), the element translates so the right edge reaches while width is unchanged. When false, only the right edge moves: the left edge stays fixed and RectTransform.sizeDelta is adjusted to match the new width.
valueRemarks
When is true, adjusts RectTransform.anchoredPosition so that RectTransform.GetLocalRight returns ; the element's size (RectTransform.sizeDelta) and left edge are not affected. When is false, the left edge remains at its current position and the width is resized to reach .
preserveSizevaluepreserveSizevalueAdditional Resources: RectTransform.GetLocalRight, RectTransform.SetLocalLeft.