public void GetLocalCorners(Vector3[] fourCornersArray)
{
if ((fourCornersArray == null) || (fourCornersArray.Length < 4))
{
Debug.LogError("Calling GetLocalCorners with an array that is null or has less than 4 elements.");
}
else
{
Rect rect = this.rect;
float x = rect.x;
float y = rect.y;
float xMax = rect.xMax;
float yMax = rect.yMax;
fourCornersArray[0] = new Vector3(x, y, 0f);
fourCornersArray[1] = new Vector3(x, yMax, 0f);
fourCornersArray[2] = new Vector3(xMax, yMax, 0f);
fourCornersArray[3] = new Vector3(xMax, y, 0f);
}
}