/*
* @author Valentin Simonov / http://va.lent.in/
*/
using TouchScript.Pointers;
using UnityEngine;
namespace TouchScript.Hit
{
///
/// Result of a check to find if a hit object should recieve this pointer or not.
///
public enum HitResult
{
///
/// This is a hit, object should recieve pointer.
///
Hit = 1,
///
/// Object should not recieve pointer.
///
Miss = 2,
///
/// Object should not recieve pointer and this pointer should be discarded and not tested with any other object.
///
Discard = 3
}
///
/// Base class for all hit test handlers.
///
public abstract class HitTest : MonoBehaviour
{
#region Public methods
///
/// Determines whether a pointer hit the object.
///
/// Pointer to raycast.
/// Data from a raycast.
/// if pointer hits the object, if it doesn't, if it doesn't and this pointer must be ignored, Error otherwise.
public virtual HitResult IsHit(IPointer pointer, HitData hit)
{
return HitResult.Hit;
}
#endregion
#region Unity methods
private void OnEnable() {}
#endregion
}
}