Skip to content

Instantly share code, notes, and snippets.

View KorStrix's full-sized avatar
🧭
Fast is fine, but accuracy is final

Strix KorStrix

🧭
Fast is fine, but accuracy is final
View GitHub Profile
@KorStrix
KorStrix / NonDrawingGraphic.cs
Created June 3, 2020 05:45 — forked from capnslipp/NonDrawingGraphic.cs
A UnityEngine.UI.Graphic subclass that provides only raycast targeting, skipping all drawing.
/// @creator: Slipp Douglas Thompson
/// @license: Public Domain per The Unlicense. See <http://unlicense.org/>.
/// @purpose: A UnityEngine.UI.Graphic subclass that provides only raycast targeting, skipping all drawing.
/// @why: Because this functionality should be built-into Unity.
/// @usage: Add a `NonDrawingGraphic` component to the GameObject you want clickable, but without its own image/graphics.
/// @intended project path: Assets/Plugins/UnityEngine UI Extensions/NonDrawingGraphic.cs
/// @interwebsouce: https://gist.github.com/capnslipp/349c18283f2fea316369
using UnityEngine;
using UnityEngine.UI;