Class MaskableGraphic
A Graphic that is capable of being masked out.
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
public abstract class MaskableGraphic : Graphic, ICanvasElement, IClippable, IMaskable, IMaterialModifier
Fields
m_MaskMaterial
Declaration
[NonSerialized]
protected Material m_MaskMaterial
Field Value
Type | Description |
---|---|
Material |
m_ShouldRecalculateStencil
Declaration
[NonSerialized]
protected bool m_ShouldRecalculateStencil
Field Value
Type | Description |
---|---|
Boolean |
m_StencilValue
Declaration
[NonSerialized]
protected int m_StencilValue
Field Value
Type | Description |
---|---|
Int32 |
Properties
isMaskingGraphic
Is this graphic the graphic on the same object as a Mask that is enabled.
Declaration
public bool isMaskingGraphic { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Remarks
If toggled ensure to call MaskUtilities.NotifyStencilStateChanged(this); manually as it changes how stenciles are calculated for this image.
maskable
Does this graphic allow masking.
Declaration
public bool maskable { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
onCullStateChanged
Callback issued when culling changes.
Declaration
public MaskableGraphic.CullStateChangedEvent onCullStateChanged { get; set; }
Property Value
Type | Description |
---|---|
MaskableGraphic.CullStateChangedEvent |
Remarks
Called whene the culling state of this MaskableGraphic either becomes culled or visible. You can use this to control other elements of your UI as culling happens.
Methods
Cull(Rect, Boolean)
See IClippable.Cull
Declaration
public virtual void Cull(Rect clipRect, bool validRect)
Parameters
Type | Name | Description |
---|---|---|
Rect | clipRect | |
Boolean | validRect |
Implements
GetModifiedMaterial(Material)
See IMaterialModifier.GetModifiedMaterial
Declaration
public virtual Material GetModifiedMaterial(Material baseMaterial)
Parameters
Type | Name | Description |
---|---|---|
Material | baseMaterial |
Returns
Type | Description |
---|---|
Material |
Implements
OnCanvasHierarchyChanged()
Declaration
protected override void OnCanvasHierarchyChanged()
Overrides
OnDisable()
Declaration
protected override void OnDisable()
Overrides
OnEnable()
Declaration
protected override void OnEnable()
Overrides
OnTransformParentChanged()
Declaration
protected override void OnTransformParentChanged()
Overrides
RecalculateClipping()
See IClippable.RecalculateClipping
Declaration
public virtual void RecalculateClipping()
Implements
RecalculateMasking()
See IMaskable.RecalculateMasking
Declaration
public virtual void RecalculateMasking()
Implements
SetClipRect(Rect, Boolean)
See IClippable.SetClipRect
Declaration
public virtual void SetClipRect(Rect clipRect, bool validRect)
Parameters
Type | Name | Description |
---|---|---|
Rect | clipRect | |
Boolean | validRect |
Implements
SetClipSoftness(Vector2)
Declaration
public virtual void SetClipSoftness(Vector2 clipSoftness)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | clipSoftness |