UnityEditor.SnapEdge.ShouldEdgesSnap C# (CSharp) Method

ShouldEdgesSnap() private static method

private static ShouldEdgesSnap ( SnapEdge a, SnapEdge b ) : bool
a SnapEdge
b SnapEdge
return bool
        private static bool ShouldEdgesSnap(SnapEdge a, SnapEdge b)
        {
            return ((((a.dir == EdgeDir.CenterX) || (a.dir == EdgeDir.CenterY)) && (a.dir == b.dir)) || ((a.dir == OppositeEdge(b.dir)) && ((a.start <= b.end) && (a.end >= b.start))));
        }

Usage Example

コード例 #1
0
ファイル: SnapEdge.cs プロジェクト: zlhtech/unity-decompiled
 internal static void Snap(SnapEdge edge, List <SnapEdge> otherEdges, ref float maxDist, ref float snapVal, List <KeyValuePair <SnapEdge, SnapEdge> > activeEdges)
 {
     using (List <SnapEdge> .Enumerator enumerator = otherEdges.GetEnumerator())
     {
         while (enumerator.MoveNext())
         {
             SnapEdge current = enumerator.Current;
             if (SnapEdge.ShouldEdgesSnap(edge, current))
             {
                 float num = Mathf.Abs(current.pos - edge.pos);
                 if ((double)num < (double)maxDist)
                 {
                     maxDist = num;
                     snapVal = current.pos - edge.pos;
                     activeEdges.Clear();
                     activeEdges.Add(new KeyValuePair <SnapEdge, SnapEdge>(edge, current));
                 }
                 else if ((double)num == (double)maxDist)
                 {
                     activeEdges.Add(new KeyValuePair <SnapEdge, SnapEdge>(edge, current));
                 }
             }
         }
     }
 }
All Usage Examples Of UnityEditor.SnapEdge::ShouldEdgesSnap