I Like to switch to another way of doing it:
I like to chain Sprites and Label's together using Tables and Anchor's.
But a wired misbehavior is occurring if i have a A table with some elements and i like to anchor another Label to one object of the the Table.
There is a very big offset that should not be there.
If i take the same object out of the Table , everything is working fine and the wrong offset is gone.
Edit:
MMM looks like the Draggable Panel is messing around too ... (All Panel's are uniformed scaled at 1).
My setup is
Panel
---UILabel
---UITable + UIAnchor
------Tabel Content
If i activate The UIAnchor (witch is Anchor to the UI label) the object is moved by -4000 Units in Y direction
Edit:
UIAnchor.cs
else if (widgetContainer != null)
{
// Widget is used -- use its bounds as the container's bounds
Transform t = widgetContainer.cachedTransform;
Vector3 ls = t.localScale;
Vector3 lp = t.localPosition;
Vector3 offset = widgetContainer.pivotOffset;
offset.y -= widgetContainer.relativeSize.y;
if(this.gameObject.name == "2")
Debug.Log( offset.y );
/// ergebnis: -12
offset.x *= (widgetContainer.relativeSize.x * ls.x);
offset.y *= (widgetContainer.relativeSize.y * ls.y);
rect.x = lp.x + offset.x;
rect.y = lp.y + offset.y;
rect.width = ls.x;
rect.height = ls.y;
if(this.gameObject.name == "2")
Debug.Log( rect.y + " " + rect.yMin +" " + offset.y + " " +widgetContainer.relativeSize.y + " " + ls.y);
////Ergebis -4032 -4032 -4176 12 29
}
just cant figure out whats going wrong.