UnityEngine.UI.MaskUtilities.Notify2DMaskStateChanged C# (CSharp) Method

Notify2DMaskStateChanged() public static method

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

public static Notify2DMaskStateChanged ( Component mask ) : void
mask UnityEngine.Component
return void
        public static void Notify2DMaskStateChanged(Component mask)
        {
            List<Component> results = ListPool<Component>.Get();
            mask.GetComponentsInChildren<Component>(results);
            for (int i = 0; i < results.Count; i++)
            {
                if ((results[i] != null) && (results[i].gameObject != mask.gameObject))
                {
                    IClippable clippable = results[i] as IClippable;
                    if (clippable != null)
                    {
                        clippable.RecalculateClipping();
                    }
                }
            }
            ListPool<Component>.Release(results);
        }

Usage Example

 protected override void OnEnable()
 {
     base.OnEnable();
     m_ShouldRecalculateClipRects = true;
     ClipperRegistry.Register(this);
     MaskUtilities.Notify2DMaskStateChanged(this);
 }
All Usage Examples Of UnityEngine.UI.MaskUtilities::Notify2DMaskStateChanged