Esempio n. 1
0
 public bool Equals(Boundary2D other)
 {
     return(xMin == other.xMin &&
            xMax == other.xMax &&
            yMin == other.yMin &&
            yMax == other.yMax);
 }
Esempio n. 2
0
        private void OnValidate()
        {
            CalculateRectDimension();

            if (lastDimension != dimension)
            {
                lastDimension = dimension;
                boundary2D    = new Boundary2D(transform.position, lastDimension);
            }
        }
Esempio n. 3
0
        private void OnDrawGizmos()
        {
            if (lastPosition != transform.position)
            {
                lastPosition = transform.position;
                boundary2D   = new Boundary2D(lastPosition, dimension);
            }

            Gizmos.color = Color.red;
            ExtraGizmos.DrawRect(boundary2D);
        }
Esempio n. 4
0
 public static void DrawRect(Boundary2D boundary2D)
 {
     DrawRect(boundary2D.TopLeft, boundary2D.TopRight, boundary2D.BottomRight, boundary2D.BottomLeft);
 }