|
static bool | IsChildFullyVisible (this RectTransform rectTransform, RectTransform child) |
|
static bool | IsChildVisible (this RectTransform rectTransform, RectTransform child) |
|
Definition at line 5 of file RectTransformExtensions.cs.
◆ CountCornersVisibleWithin()
static int BGC.Extensions.RectTransformExtensions.CountCornersVisibleWithin |
( |
this RectTransform |
rectTransform, |
|
|
RectTransform |
child |
|
) |
| |
|
inlinestaticprivate |
Definition at line 7 of file RectTransformExtensions.cs.
9 Vector3[] parentCorners =
new Vector3[4];
10 rectTransform.GetWorldCorners(parentCorners);
12 Rect worldRect =
new Rect(parentCorners[0], parentCorners[2] - parentCorners[0]);
14 Vector3[] childCorners =
new Vector3[4];
15 child.GetWorldCorners(childCorners);
17 int visibleCorners = 0;
18 for (var i = 0; i < childCorners.Length; i++)
20 if (worldRect.Contains(childCorners[i]))
25 return visibleCorners;
◆ IsChildFullyVisible()
static bool BGC.Extensions.RectTransformExtensions.IsChildFullyVisible |
( |
this RectTransform |
rectTransform, |
|
|
RectTransform |
child |
|
) |
| |
|
inlinestatic |
◆ IsChildVisible()
static bool BGC.Extensions.RectTransformExtensions.IsChildVisible |
( |
this RectTransform |
rectTransform, |
|
|
RectTransform |
child |
|
) |
| |
|
inlinestatic |
The documentation for this class was generated from the following file: