UnityEngine.UI.RectMask2D.PerformClipping C# (CSharp) Method

PerformClipping() public method

See: IClipper.PerformClipping.

public PerformClipping ( ) : void
return void
        public virtual void PerformClipping()
        {
            if (this.m_ShouldRecalculateClipRects)
            {
                MaskUtilities.GetRectMasksForClip(this, this.m_Clippers);
                this.m_ShouldRecalculateClipRects = false;
            }
            bool validRect = true;
            Rect rect = Clipping.FindCullAndClipWorldRect(this.m_Clippers, out validRect);
            if ((rect != this.m_LastClipRectCanvasSpace) || this.m_ForceClip)
            {
                foreach (IClippable clippable in this.m_ClipTargets)
                {
                    clippable.SetClipRect(rect, validRect);
                }
                this.m_LastClipRectCanvasSpace = rect;
                this.m_LastValidClipRect = validRect;
            }
            foreach (IClippable clippable2 in this.m_ClipTargets)
            {
                clippable2.Cull(this.m_LastClipRectCanvasSpace, this.m_LastValidClipRect);
            }
        }

Usage Example

 static public int PerformClipping(IntPtr l)
 {
     try {
                     #if DEBUG
         var    method     = System.Reflection.MethodBase.GetCurrentMethod();
         string methodName = GetMethodName(method);
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.BeginSample(methodName);
                     #else
         Profiler.BeginSample(methodName);
                     #endif
                     #endif
         UnityEngine.UI.RectMask2D self = (UnityEngine.UI.RectMask2D)checkSelf(l);
         self.PerformClipping();
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
             #if DEBUG
     finally {
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.EndSample();
                     #else
         Profiler.EndSample();
                     #endif
     }
             #endif
 }
All Usage Examples Of UnityEngine.UI.RectMask2D::PerformClipping