Question by
puchingeralexander · Jun 17, 2019 at 02:49 PM ·
c#unity 5scriptingbasicsoffsetaddcomponent
Access Top and Right Variables from RectTransform
Hello there, i have googled a lot about this topic but i cannot get it right.
I create a new GameObject called Panel, and I add the following Components to it:
panel.AddComponent(); panel.AddComponent(); panel.AddComponent();
the next step was, to change the anchor Min & Max to my Custom settings, this worked fine, but if i want to change the Left/Bottom/Right/Top Values with:
panel.GetComponent().offsetMin = new Vector2(10, 20); panel.GetComponent().offsetMax = new Vector2(-30, -40); (because i read that they are inverted)
I can only change the offsetMin. My offsetMax dont get any changes.
Any Ideas?
Comment