Skip to content

Instantly share code, notes, and snippets.

@JT5D
Forked from unitycoder/FixMouseClicksForUI.cs
Last active August 29, 2015 14:23
Show Gist options
  • Select an option

  • Save JT5D/50165f6d977e956f86cb to your computer and use it in GitHub Desktop.

Select an option

Save JT5D/50165f6d977e956f86cb to your computer and use it in GitHub Desktop.
using UnityEngine;
// http://answers.unity3d.com/questions/816861/46-ui-image-is-capturing-clicks-how-to-prevent.html
public class UIIgnoreRaycast : MonoBehaviour, ICanvasRaycastFilter
{
public bool IsRaycastLocationValid(Vector2 screenPoint, Camera eventCamera)
{
return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment