mirror of
https://github.com/RHeavenStudioPlus/HeavenStudioPlus.git
synced 2024-11-14 13:45:10 +00:00
21 lines
878 B
C#
21 lines
878 B
C#
|
/// Credit Slipp Douglas Thompson
|
|||
|
/// Sourced from - https://gist.github.com/capnslipp/349c18283f2fea316369
|
|||
|
|
|||
|
namespace UnityEngine.UI.Extensions
|
|||
|
{
|
|||
|
/// A concrete subclass of the Unity UI `Graphic` class that just skips drawing.
|
|||
|
/// Useful for providing a raycast target without actually drawing anything.
|
|||
|
[AddComponentMenu("Layout/Extensions/NonDrawingGraphic")]
|
|||
|
public class NonDrawingGraphic : MaskableGraphic
|
|||
|
{
|
|||
|
public override void SetMaterialDirty() { return; }
|
|||
|
public override void SetVerticesDirty() { return; }
|
|||
|
|
|||
|
/// Probably not necessary since the chain of calls `Rebuild()`->`UpdateGeometry()`->`DoMeshGeneration()`->`OnPopulateMesh()` won't happen; so here really just as a fail-safe.
|
|||
|
protected override void OnPopulateMesh(VertexHelper vh)
|
|||
|
{
|
|||
|
vh.Clear();
|
|||
|
return;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|