SpriteMask
A component for masking Sprites and Particles.
Read time 9 minutesLast updated 4 days ago
Definition
- Type: Class
- Namespace: UnityEngine
- Assembly: UnityEngine.SpriteMaskModule
- Inherits from: Renderer
public sealed class SpriteMask : Renderer
Remarks
By default it will mask all Sorting Layers. A custom range of Sorting Layers can be set. If a SortingGroup is present, it will act local to the SortingGroup.
Properties
Property | Description |
|---|---|
| alphaCutoff | The minimum alpha value used by the mask to select the area of influence defined over the mask's sprite. |
| backSortingLayerID | Unique ID of the sorting layer defining the end of the custom range. |
| backSortingOrder | Order within the back sorting layer defining the end of the custom range. |
| frontSortingLayerID | Unique ID of the sorting layer defining the start of the custom range. |
| frontSortingOrder | Order within the front sorting layer defining the start of the custom range. |
| isCustomRangeActive | Mask sprites from front to back sorting values only. |
| maskSource | The source used for generating the mask for this SpriteMask. |
| sprite | The Sprite used to define the mask. |
| spriteSortPoint | Determines the position of the Sprite used for sorting the SpriteMask. |
Enums
Enum | Description |
|---|---|
| SpriteMask.MaskSource | Sets which source to use when generating the mask. |
Inheritance
Operators
Operator | Description |
|---|---|
| operator == | Compares two object references to see if they refer to the same object. |
| bool | Determines whether the object exists. |
| operator != | Compares if two objects refer to a different object. |