Skip to content

Commit

Permalink
fix: pass camera to check the point in rectangle when camera is not null
Browse files Browse the repository at this point in the history
  • Loading branch information
archerfob authored and mob-sakai committed Oct 7, 2020
1 parent a39fcef commit 65a0ad0
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,15 @@ public bool IsRaycastLocationValid(Vector2 sp, Camera eventCamera)
return true;
}

// check inside
return !RectTransformUtility.RectangleContainsScreenPoint ((m_TargetUnmask.transform as RectTransform), sp);
// check inside
if (eventCamera)
{
return !RectTransformUtility.RectangleContainsScreenPoint((m_TargetUnmask.transform as RectTransform), sp, eventCamera);
}
else
{
return !RectTransformUtility.RectangleContainsScreenPoint((m_TargetUnmask.transform as RectTransform), sp);
}
}


Expand Down

0 comments on commit 65a0ad0

Please sign in to comment.