Hi, I’ve created a simple canvas with image inside. Image is an attack, which player can drag and drop on screen (my game is 2d). So I’ve just added BeginDrag, OnDrag and EndDrag events and moving special sprite with it, which represents attack range area. However I want to left user possibility to cancel his attack. So if he’d drop attack on image on canvas it should not fire. And I’m struggling how to calculate this. I only found a function, which can convert mouse position to rect transform coordinates:
RectTransformUtility.ScreenPointToLocalPointInRectangle (rect, screenPoint, Camera.main, out localPoint);
However how to check if this “localPoint” is in rect transform bounds?