namespace UnityEngine.UI { /// /// Interface that can be used to recieve clipping callbacks as part of the canvas update loop. /// public interface IClipper { /// /// Function to to cull / clip children elements. /// /// /// Called after layout and before Graphic update of the Canvas update loop. /// void PerformClipping(); } /// /// Interface for elements that can be clipped if they are under an IClipper /// public interface IClippable { /// /// GameObject of the IClippable object /// GameObject gameObject { get; } /// /// Will be called when the state of a parent IClippable changed. /// void RecalculateClipping(); /// /// The RectTransform of the clippable. /// RectTransform rectTransform { get; } /// /// Clip and cull the IClippable given a specific clipping rect /// /// The Rectangle in which to clip against. /// Is the Rect valid. If not then the rect has 0 size. void Cull(Rect clipRect, bool validRect); /// /// Set the clip rect for the IClippable. /// /// The Rectangle for the clipping /// Is the rect valid. void SetClipRect(Rect value, bool validRect); /// /// Set the clip softness for the IClippable. /// /// The softness is a linear alpha falloff over clipSoftness pixels. /// /// The number of pixels to apply the softness to void SetClipSoftness(Vector2 clipSoftness); } }