Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


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

alphaCutoffThe minimum alpha value used by the mask to select the area of influence defined over the mask's sprite.
backSortingLayerIDUnique ID of the sorting layer defining the end of the custom range.
backSortingOrderOrder within the back sorting layer defining the end of the custom range.
frontSortingLayerIDUnique ID of the sorting layer defining the start of the custom range.
frontSortingOrderOrder within the front sorting layer defining the start of the custom range.
isCustomRangeActiveMask sprites from front to back sorting values only.
maskSourceThe source used for generating the mask for this SpriteMask.
spriteThe Sprite used to define the mask.
spriteSortPointDetermines the position of the Sprite used for sorting the SpriteMask.

Enums

Enum

Description

SpriteMask.MaskSourceSets which source to use when generating the mask.

Inheritance

Inherited Members

Operators

Operator

Description

operator ==Compares two object references to see if they refer to the same object.
boolDetermines whether the object exists.
operator !=Compares if two objects refer to a different object.