Class MaskableGraphic
A Graphic that is capable of being masked out.
Inherited Members
UnityEngine.MonoBehaviour.StartCoroutine_Auto(System.Collections.IEnumerator)
UnityEngine.Component.GetComponent<T>()
UnityEngine.Component.TryGetComponent(System.Type, UnityEngine.Component)
UnityEngine.Component.TryGetComponent<T>(T)
UnityEngine.Component.GetComponentInChildren<T>(System.Boolean)
UnityEngine.Component.GetComponentInChildren<T>()
UnityEngine.Component.GetComponentsInChildren(System.Type)
UnityEngine.Component.GetComponentsInChildren<T>(System.Boolean)
UnityEngine.Component.GetComponentsInChildren<T>(System.Boolean, System.Collections.Generic.List<T>)
UnityEngine.Component.GetComponentsInChildren<T>()
UnityEngine.Component.GetComponentsInChildren<T>(System.Collections.Generic.List<T>)
UnityEngine.Component.GetComponentInParent<T>(System.Boolean)
UnityEngine.Component.GetComponentInParent<T>()
UnityEngine.Component.GetComponentsInParent(System.Type)
UnityEngine.Component.GetComponentsInParent<T>(System.Boolean)
UnityEngine.Component.GetComponentsInParent<T>(System.Boolean, System.Collections.Generic.List<T>)
UnityEngine.Component.GetComponentsInParent<T>()
UnityEngine.Component.GetComponents(System.Type, System.Collections.Generic.List<UnityEngine.Component>)
UnityEngine.Component.GetComponents<T>(System.Collections.Generic.List<T>)
UnityEngine.Component.GetComponents<T>()
UnityEngine.Object.GetHashCode()
UnityEngine.Object.Equals(System.Object)
UnityEngine.Object.Instantiate<T>(T)
UnityEngine.Object.Instantiate<T>(T, UnityEngine.Vector3, UnityEngine.Quaternion)
UnityEngine.Object.Instantiate<T>(T, UnityEngine.Vector3, UnityEngine.Quaternion, UnityEngine.Transform)
UnityEngine.Object.Instantiate<T>(T, UnityEngine.Transform)
UnityEngine.Object.Instantiate<T>(T, UnityEngine.Transform, System.Boolean)
UnityEngine.Object.DestroyObject(UnityEngine.Object, System.Single)
UnityEngine.Object.DestroyObject(UnityEngine.Object)
UnityEngine.Object.FindSceneObjectsOfType(System.Type)
UnityEngine.Object.FindObjectsOfType<T>()
UnityEngine.Object.FindObjectsByType<T>(UnityEngine.FindObjectsSortMode)
UnityEngine.Object.FindObjectsOfType<T>(System.Boolean)
UnityEngine.Object.FindObjectsByType<T>(UnityEngine.FindObjectsInactive, UnityEngine.FindObjectsSortMode)
UnityEngine.Object.FindObjectOfType<T>()
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_IncludeForMasking
Declaration
[NonSerialized]
[Obsolete("Not used anymore.", true)]
protected bool m_IncludeForMasking
Field Value
| Type | Description |
|---|---|
| Boolean |
m_MaskMaterial
Declaration
[NonSerialized]
protected Material m_MaskMaterial
Field Value
| Type | Description |
|---|---|
| Material |
m_ShouldRecalculate
Declaration
[NonSerialized]
[Obsolete("Not used anymore", true)]
protected bool m_ShouldRecalculate
Field Value
| Type | Description |
|---|---|
| Boolean |
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
ParentMaskStateChanged()
Declaration
[Obsolete("Not used anymore.", true)]
public virtual void ParentMaskStateChanged()
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 |