Advertisement
Guest User

Untitled

a guest
Apr 21st, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.64 KB | None | 0 0
  1. using UnityEngine;
  2. using UnityEngine.UI;
  3.  
  4. /// A concrete subclass of the Unity UI `Graphic` class that just skips drawing.
  5. /// Useful for providing a raycast target without actually drawing anything.
  6. public class RaycastTarget : Graphic
  7. {
  8.     public override void SetMaterialDirty() { return; }
  9.     public override void SetVerticesDirty() { return; }
  10.  
  11.     /// Probably not necessary since the chain of calls `Rebuild()`->`UpdateGeometry()`->`DoMeshGeneration()`->`OnPopulateMesh()` won't happen; so here really just as a fail-safe.
  12.     protected override void OnPopulateMesh(VertexHelper vh)
  13.     {
  14.         vh.Clear();
  15.         return;
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement