internal static void CalculatePositionSnapValues(Transform parentSpace, Transform self, RectTransform parentRect, RectTransform rect)
 {
     for (int index = 0; index < 2; ++index)
     {
         RectTransformSnapping.s_SnapGuides[index].Clear();
     }
     if ((Object)parentSpace == (Object)null)
     {
         return;
     }
     for (int axis = 0; axis < 2; ++axis)
     {
         for (int side = 0; side < RectTransformSnapping.kSidesAndMiddle.Length; ++side)
         {
             using (List <SnapGuide> .Enumerator enumerator = RectTransformSnapping.GetSnapGuides(parentSpace, self, parentRect, rect, axis, side).GetEnumerator())
             {
                 while (enumerator.MoveNext())
                 {
                     SnapGuide current = enumerator.Current;
                     current.value = RectTransformSnapping.GetGuideValueForRect(rect, current.value, axis, RectTransformSnapping.kSidesAndMiddle[side]);
                     RectTransformSnapping.s_SnapGuides[axis].AddGuide(current);
                 }
             }
         }
     }
 }
 internal static void CalculateOffsetSnapValues(Transform parentSpace, Transform self, RectTransform parentRect, RectTransform rect, int xHandle, int yHandle)
 {
     for (int index = 0; index < 2; ++index)
     {
         RectTransformSnapping.s_SnapGuides[index].Clear();
     }
     if ((Object)parentSpace == (Object)null)
     {
         return;
     }
     for (int axis = 0; axis < 2; ++axis)
     {
         int side = axis != 0 ? yHandle : xHandle;
         if (side != 1)
         {
             using (List <SnapGuide> .Enumerator enumerator = RectTransformSnapping.GetSnapGuides(parentSpace, self, parentRect, rect, axis, side).GetEnumerator())
             {
                 while (enumerator.MoveNext())
                 {
                     SnapGuide current = enumerator.Current;
                     RectTransformSnapping.s_SnapGuides[axis].AddGuide(current);
                 }
             }
         }
     }
 }
Ejemplo n.º 3
0
 public void AddGuide(SnapGuide guide)
 {
     List<SnapGuide> list;
     if (!this.guides.TryGetValue(guide.value, out list))
     {
         list = new List<SnapGuide>();
         this.guides.Add(guide.value, list);
     }
     list.Add(guide);
 }
 public void AddGuide(SnapGuide guide)
 {
   List<SnapGuide> snapGuideList;
   if (!this.guides.TryGetValue(guide.value, out snapGuideList))
   {
     snapGuideList = new List<SnapGuide>();
     this.guides.Add(guide.value, snapGuideList);
   }
   snapGuideList.Add(guide);
 }
Ejemplo n.º 5
0
        public void AddGuide(SnapGuide guide)
        {
            List <SnapGuide> list;

            if (!this.guides.TryGetValue(guide.value, out list))
            {
                list = new List <SnapGuide>();
                this.guides.Add(guide.value, list);
            }
            list.Add(guide);
        }
        public void AddGuide(SnapGuide guide)
        {
            List <SnapGuide> snapGuideList;

            if (!this.guides.TryGetValue(guide.value, out snapGuideList))
            {
                snapGuideList = new List <SnapGuide>();
                this.guides.Add(guide.value, snapGuideList);
            }
            snapGuideList.Add(guide);
        }
        public void AddGuide(SnapGuide guide)
        {
            List <SnapGuide> guideList;

            if (!guides.TryGetValue(guide.value, out guideList))
            {
                guideList = new List <SnapGuide>();
                guides.Add(guide.value, guideList);
            }
            guideList.Add(guide);
        }