Author Topic: Advanced Anchors setup problem  (Read 10962 times)

dandrea

  • Newbie
  • *
  • Thank You
  • -Given: 6
  • -Receive: 2
  • Posts: 23
    • View Profile
Advanced Anchors setup problem
« on: December 14, 2016, 09:19:23 AM »
Hello

I'm having a hard time setting advanced anchors up on my widgets. It seems it's impossible to add other targets to advanced anchors, they reverting to unified anchors. It's happened multiple times. The scenario is always as follows:
  • I have a "slave" widget with unified anchors set and a "target" widget as target.
  • I change the anchors to advanced, so I have four target slots pointing to "target" in the inspector, as expected.
  • Then I drag a "new target" widget from the hierarchy to one of those slots in the inspector. Here, things break.
  • The "new target" flashes briefly in the inspector, the "target" one gets back into it and, depending on the arrangement of the widgets on the scene, "slave" dimensions get messed up.

Seemingly, parenting doesn't seem to be the cause (I've tested multiple arrangements in this sense). I've also checked if I was inadvertently creating any cyclic references, but that's not the case.

NGUI version 3.9.9 on Unity 5.3.3.

What am I missing?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Advanced Anchors setup problem
« Reply #1 on: December 15, 2016, 09:14:36 AM »
Well, first please update to the latest. 3.9.9 is quite old now.

I just did a quick check on my end -- made a new scene, ALT+SHIFT+S to make a new sprite, added a new game object, advanced anchor on sprite and changed the left side to be using the new object as its target. Dragging the object resizes the widget as expected, and of course it remains as "advanced" when I select it because it has more than one anchor target.

Unified simply means all 4 anchor targets are the same.

dandrea

  • Newbie
  • *
  • Thank You
  • -Given: 6
  • -Receive: 2
  • Posts: 23
    • View Profile
Re: Advanced Anchors setup problem
« Reply #2 on: December 15, 2016, 11:57:07 AM »
That's not what's happening here, as you can see. Anyway, this answer means that this is an unknown problem and/or not trivially reproducible one.

Is it viable for you to give a hint or identifier of where in NGUI's code I can find where anchor widgets are set so I can debug the problem here?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Advanced Anchors setup problem
« Reply #3 on: December 19, 2016, 10:58:18 PM »
UIRectEditor.DrawAnchorTransform, on line 153 of UIRectEditor.cs.