A graphic component with zero draw calls, useful (when paired with a click script or the Selectable Extension) for invisible buttons or hit test blockers.
1 Overview
3 Methods
4 Usage
6 See also
The Non Drawing Graphic component allows you to add a graphic hit testable area with zero draw calls. The Raycast hit test can also be enabled or disabled (instead of using a CanvasGroup)
It is also very useful when paired with the Selectable Extension to add Click, Release and Hold capabilities.
The properties of the Non Drawing Graphic component are as follows:
Property | Description |
---|---|
Raycast Target | Should this GO block raycasts or not. Changeable in code or editor. |
Simply add the default Non Drawing Graphic component to a RectTransform using “UI / Extensions / Non Drawing Graphic” in the Editor “Component” menu.
It is also available as a Game Component menu in “UI / Extensions / Non Drawing Graphic”.
There is also a “Clickable” version, which includes the additional components to make the NonDrawing Graphic support events when clicked.
*Note, in Source there are also two Editor menu’s to add an Empty GO with the component attached and on to add the Non Drawing Graphic with the additional Selectable Extension. These will be added to the asset in the next update.
Click to play
Credit Slipp Douglas Thompson / capnslipp Submitted by PixelEnvision
Sourced from - https://gist.github.com/capnslipp/349c18283f2fea316369/