Change how children are resize.
Using rect.width & rect.height instead of sizeDelta. Like that you can have the top container use stretch anchors --HG-- branch : Ziboo/change-how-children-are-resize-using-rec-1443606808122pull/413/head
parent
0992ad3df2
commit
8a32994697
|
@ -211,7 +211,7 @@ namespace UnityEngine.UI.Extensions
|
||||||
RectTransform child = _screensContainer.transform.GetChild(i).gameObject.GetComponent<RectTransform>();
|
RectTransform child = _screensContainer.transform.GetChild(i).gameObject.GetComponent<RectTransform>();
|
||||||
currentXPosition = _offset + i * _step;
|
currentXPosition = _offset + i * _step;
|
||||||
child.anchoredPosition = new Vector2(currentXPosition, 0f);
|
child.anchoredPosition = new Vector2(currentXPosition, 0f);
|
||||||
child.sizeDelta = new Vector2(gameObject.GetComponent<RectTransform>().sizeDelta.x, gameObject.GetComponent<RectTransform>().sizeDelta.y);
|
child.sizeDelta = new Vector2(gameObject.GetComponent<RectTransform>().rect.width, gameObject.GetComponent<RectTransform>().rect.height);
|
||||||
}
|
}
|
||||||
|
|
||||||
_dimension = currentXPosition + _offset * -1;
|
_dimension = currentXPosition + _offset * -1;
|
||||||
|
|
Loading…
Reference in New Issue