Class RectMask2D
Inherited Members
UnityEngine.Component.GetComponentInParent<T>(System.Boolean)
UnityEngine.Object.FindObjectsByType<T>(UnityEngine.FindObjectsSortMode)
UnityEngine.Object.FindObjectsOfType<T>(System.Boolean)
UnityEngine.Object.FindObjectsByType<T>(UnityEngine.FindObjectsInactive, UnityEngine.FindObjectsSortMode)
UnityEngine.Object.FindObjectOfType<T>(System.Boolean)
UnityEngine.Object.FindFirstObjectByType<T>()
UnityEngine.Object.FindAnyObjectByType<T>()
UnityEngine.Object.FindFirstObjectByType<T>(UnityEngine.FindObjectsInactive)
UnityEngine.Object.FindAnyObjectByType<T>(UnityEngine.FindObjectsInactive)
Namespace: UnityEngine.UI
Syntax
[AddComponentMenu("UI/Rect Mask 2D", 14)]
[ExecuteAlways]
[DisallowMultipleComponent]
[RequireComponent(typeof(RectTransform))]
public class RectMask2D : UIBehaviour, IClipper, ICanvasRaycastFilter
Constructors
RectMask2D()
Declaration
protected RectMask2D()
Properties
canvasRect
Get the Rect for the mask in canvas space.
Declaration
public Rect canvasRect { get; }
Property Value
| Type | Description |
|---|---|
| Rect |
padding
Padding to be applied to the masking X = Left Y = Bottom Z = Right W = Top
Declaration
public Vector4 padding { get; set; }
Property Value
| Type | Description |
|---|---|
| Vector4 |
rectTransform
Helper function to get the RectTransform for the mask.
Declaration
public RectTransform rectTransform { get; }
Property Value
| Type | Description |
|---|---|
| RectTransform |
softness
The softness to apply to the horizontal and vertical axis.
Declaration
public Vector2Int softness { get; set; }
Property Value
| Type | Description |
|---|---|
| Vector2Int |
Methods
AddClippable(IClippable)
Add a IClippable to be tracked by the mask.
Declaration
public void AddClippable(IClippable clippable)
Parameters
| Type | Name | Description |
|---|---|---|
| IClippable | clippable | Add the clippable object for this mask |
IsRaycastLocationValid(Vector2, Camera)
Declaration
public virtual bool IsRaycastLocationValid(Vector2 sp, Camera eventCamera)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | sp | |
| Camera | eventCamera |
Returns
| Type | Description |
|---|---|
| Boolean |
Implements
OnCanvasHierarchyChanged()
Declaration
protected override void OnCanvasHierarchyChanged()
Overrides
OnDestroy()
Declaration
protected override void OnDestroy()
Overrides
OnDisable()
Declaration
protected override void OnDisable()
Overrides
OnEnable()
Declaration
protected override void OnEnable()
Overrides
OnTransformParentChanged()
Declaration
protected override void OnTransformParentChanged()
Overrides
PerformClipping()
Declaration
public virtual void PerformClipping()
Implements
RemoveClippable(IClippable)
Remove an IClippable from being tracked by the mask.
Declaration
public void RemoveClippable(IClippable clippable)
Parameters
| Type | Name | Description |
|---|---|---|
| IClippable | clippable | Remove the clippable object from this mask |
UpdateClipSoftness()
Declaration
public virtual void UpdateClipSoftness()