/*
* @author Valentin Simonov / http://va.lent.in/
*/
using TouchScript.Pointers;
using UnityEngine;
namespace TouchScript.Hit
{
///
/// Makes an object it is attached to untouchable, i.e. it completely ignores all pointers landing on it.
///
[AddComponentMenu("TouchScript/Behaviors/Untouchable")]
[HelpURL("http://touchscript.github.io/docs/html/T_TouchScript_Hit_Untouchable.htm")]
public class Untouchable : HitTest
{
#region Public properties
///
/// Indicates if instead of not reacting to pointers the object should completely discard them making it impossible for other gestures to receive them.
///
/// If true pointers are not only prevented but discarded making it impossible for other gestures to receive them.
public bool DiscardPointer = false;
#endregion
#region Public methods
///
public override HitResult IsHit(IPointer pointer, HitData hit)
{
return DiscardPointer ? HitResult.Discard : HitResult.Miss;
}
#endregion
}
}