1
NGUI 3 Support / Set the anchors type
« on: April 18, 2015, 10:08:23 AM »
Hellow, help me please with this problem:
How can I set Anchors type to "Unified" by code?
And also in the box "Right" put "Target's left" or in the "Bottom" -> "Target's top" by code to?

Upd. I found a solution for the 1st quiestion:
SetAnchor(GameObject.Find("Camera"), 0, 0, 0, 0);
Upd2. Found and for the 2nd:
GetComponent<UIWidget>().leftAnchor.Set(0, int offset); - Target's left;
GetComponent<UIWidget>().leftAnchor.Set(1, int offset); - Target's right
the same for top/bot
How can I set Anchors type to "Unified" by code?
And also in the box "Right" put "Target's left" or in the "Bottom" -> "Target's top" by code to?

Upd. I found a solution for the 1st quiestion:
SetAnchor(GameObject.Find("Camera"), 0, 0, 0, 0);
Upd2. Found and for the 2nd:
GetComponent<UIWidget>().leftAnchor.Set(0, int offset); - Target's left;
GetComponent<UIWidget>().leftAnchor.Set(1, int offset); - Target's right
the same for top/bot

