internal static void CalculateAnchorSnapValues(Transform parentSpace, Transform self, RectTransform gui, int minmaxX, int minmaxY)
{
for (int i = 0; i < 2; i++)
{
s_SnapGuides[i].Clear();
parentSpace.GetComponent<RectTransform>().GetWorldCorners(s_Corners);
for (int j = 0; j < kSidesAndMiddle.Length; j++)
{
float alongMainAxis = kSidesAndMiddle[j];
Vector3[] vertices = new Vector3[] { GetInterpolatedCorner(s_Corners, i, alongMainAxis, 0f), GetInterpolatedCorner(s_Corners, i, alongMainAxis, 1f) };
s_SnapGuides[i].AddGuide(new SnapGuide(alongMainAxis, vertices));
}
IEnumerator enumerator = parentSpace.GetEnumerator();
try
{
while (enumerator.MoveNext())
{
Transform current = (Transform) enumerator.Current;
if (current != self)
{
RectTransform component = current.GetComponent<RectTransform>();
if (component != null)
{
s_SnapGuides[i].AddGuide(new SnapGuide(component.anchorMin[i], new Vector3[0]));
s_SnapGuides[i].AddGuide(new SnapGuide(component.anchorMax[i], new Vector3[0]));
}
}
}
}
finally
{
IDisposable disposable = enumerator as IDisposable;
if (disposable != null)
{
disposable.Dispose();
}
}
switch (((i != 0) ? minmaxY : minmaxX))
{
case 0:
s_SnapGuides[i].AddGuide(new SnapGuide(gui.anchorMax[i], new Vector3[0]));
break;
case 1:
s_SnapGuides[i].AddGuide(new SnapGuide(gui.anchorMin[i], new Vector3[0]));
break;
}
}
}