Filter raycasts by a mask UnityEngine.Texture2D
for non-rectangle area of effect.
More...
Inherits MonoBehaviour, and ICanvasRaycastFilter.
Public Member Functions | |
bool | IsRaycastLocationValid (Vector2 sp, Camera eventCamera) |
Check if the raycast valid, i.e., the hit mask pixel is over the threshold . More... | |
Public Attributes | |
Texture2D | mask |
The readable UnityEngine.Texture2D as the filter mask. More... | |
ColorChannel | channel = ColorChannel.A |
The channel to read the mask pixels. More... | |
float | threshold |
The minimum pixel value to pass raycasts. More... | |
bool | reverse |
The flag to reverse the threshold as maximum. More... | |
Filter raycasts by a mask UnityEngine.Texture2D
for non-rectangle area of effect.
bool IsRaycastLocationValid | ( | Vector2 | sp, |
Camera | eventCamera | ||
) |
Check if the raycast valid, i.e., the hit mask
pixel is over the threshold
.
sp | Screen position. |
eventCamera | Raycast camera. |
true
if raycast valid; otherwise, false
.Texture2D mask |
The readable UnityEngine.Texture2D
as the filter mask.
ColorChannel channel = ColorChannel.A |
The channel to read the mask pixels.
float threshold |
The minimum pixel value to pass raycasts.
bool reverse |
The flag to reverse the threshold
as maximum.