docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class MaskUtilities

    Mask related utility class. This class provides masking-specific utility functions.

    Inheritance
    object
    MaskUtilities
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.UI
    Assembly: UnityEngine.UI.dll
    Syntax
    public class MaskUtilities

    Methods

    FindRootSortOverrideCanvas(Transform)

    Find a root Canvas.

    Declaration
    public static Transform FindRootSortOverrideCanvas(Transform start)
    Parameters
    Type Name Description
    Transform start

    Transform to start the search at going up the hierarchy.

    Returns
    Type Description
    Transform

    Finds either the most root canvas, or the first canvas that overrides sorting.

    GetRectMaskForClippable(IClippable)

    Find the correct RectMask2D for a given IClippable.

    Declaration
    public static RectMask2D GetRectMaskForClippable(IClippable clippable)
    Parameters
    Type Name Description
    IClippable clippable

    Clippable to search from.

    Returns
    Type Description
    RectMask2D

    The Correct RectMask2D

    GetRectMasksForClip(RectMask2D, List<RectMask2D>)

    Search for all RectMask2D that apply to the given RectMask2D (includes self).

    Declaration
    public static void GetRectMasksForClip(RectMask2D clipper, List<RectMask2D> masks)
    Parameters
    Type Name Description
    RectMask2D clipper

    Starting clipping object.

    List<RectMask2D> masks

    The list of Rect masks

    GetStencilDepth(Transform, Transform)

    Find the stencil depth for a given element.

    Declaration
    public static int GetStencilDepth(Transform transform, Transform stopAfter)
    Parameters
    Type Name Description
    Transform transform

    The starting transform to search.

    Transform stopAfter

    Where the search of parents should stop

    Returns
    Type Description
    int

    What the proper stencil buffer index should be.

    IsDescendantOrSelf(Transform, Transform)

    Helper function to determine if the child is a descendant of father or is father.

    Declaration
    public static bool IsDescendantOrSelf(Transform father, Transform child)
    Parameters
    Type Name Description
    Transform father

    The transform to compare against.

    Transform child

    The starting transform to search up the hierarchy.

    Returns
    Type Description
    bool

    Is child equal to father or is a descendant.

    Notify2DMaskStateChanged(Component)

    Notify all IClippables under the given component that they need to recalculate clipping.

    Declaration
    public static void Notify2DMaskStateChanged(Component mask)
    Parameters
    Type Name Description
    Component mask

    The object thats changed for whose children should be notified.

    NotifyStencilStateChanged(Component)

    Notify all IMaskable under the given component that they need to recalculate masking.

    Declaration
    public static void NotifyStencilStateChanged(Component mask)
    Parameters
    Type Name Description
    Component mask

    The object thats changed for whose children should be notified.

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)