Author Topic: Set the anchors type  (Read 2948 times)

Dean

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
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
« Last Edit: April 18, 2015, 11:08:53 AM by Dean »