编辑页面手势应用

This commit is contained in:
Caiyanpeng committed 2021-10-09 10:42:27 +08:00
1 parent fd8f419f09
commit cad2e92fd2
8 files changed
+88 -86

No files matched your search

+9 -1
View File
@@ -76,7 +76,15 @@ namespace Assets.Scripts
}
return output;
}
public static bool isPointInTransfrom(this RectTransform rect,Vector2 point)
{
var MainCanvas = UIManager.Instance.MainCanvas;
if (!MainCanvas) return false;
var size = rect.sizeDelta * MainCanvas.transform.localScale;
var sPoint = new Vector2(rect.position.x - rect.pivot.x * size.x, rect.position.y - rect.pivot.y * size.y);
var ePoint = new Vector2(rect.position.x + (1 - rect.pivot.x) * size.x, rect.position.y + (1 - rect.pivot.y) * size.y);
return point.x >= sPoint.x && point.x <= ePoint.x && point.y >= sPoint.y && point.y <= ePoint.y;
}
public static bool isLowIPhone()
{
var info = SystemInfo.deviceModel;