Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using UnityEngine.UI;
- /// A concrete subclass of the Unity UI `Graphic` class that just skips drawing.
- /// Useful for providing a raycast target without actually drawing anything.
- public class RaycastTarget : Graphic
- {
- 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;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement