add live select pannel

This commit is contained in:
CroakFang
2023-01-20 07:13:54 +08:00
parent 3b18268252
commit a4dc2516e3
1543 changed files with 107369 additions and 9227 deletions
@@ -0,0 +1,43 @@
using UnityEngine;
namespace Cutt
{
public static class CuttRect_Helper
{
public static Rect Extend(this Rect rect, float extendVal)
{
float num = extendVal / 2f;
rect.x -= num;
rect.y -= num;
rect.width += extendVal;
rect.height += extendVal;
return rect;
}
public static Rect GetTopEdge(this Rect rect, float width)
{
rect.height = width;
return rect;
}
public static Rect GetLeftEdge(this Rect rect, float width)
{
rect.width = width;
return rect;
}
public static Rect GetRightEdge(this Rect rect, float width)
{
rect.x = rect.x + rect.width - width;
rect.width = width;
return rect;
}
public static Rect GetBottomEdge(this Rect rect, float width)
{
rect.y = rect.y + rect.height - width;
rect.height = width;
return rect;
}
}
}