/*
* @author Valentin Simonov / http://va.lent.in/
*/
using TouchScript.Hit;
using TouchScript.InputSources;
using UnityEngine;
namespace TouchScript.Pointers
{
///
/// Fake pointer.
///
///
public class FakePointer : IPointer
{
#region Public properties
///
public int Id { get; private set; }
///
public Pointer.PointerType Type { get; private set; }
///
public IInputSource InputSource { get; private set; }
///
public Vector2 Position { get; set; }
///
public uint Flags { get; private set; }
///
public Pointer.PointerButtonState Buttons { get; private set; }
///
public Vector2 PreviousPosition { get; private set; }
#endregion
#region Constructors
///
/// Initializes a new instance of the class.
///
/// The position.
public FakePointer(Vector2 position) : this()
{
Position = position;
}
///
/// Initializes a new instance of the class.
///
public FakePointer()
{
Id = Pointer.INVALID_POINTER;
Type = Pointer.PointerType.Unknown;
Flags = Pointer.FLAG_ARTIFICIAL;
}
#endregion
#region Public methods
///
public HitData GetOverData(bool forceRecalculate = false)
{
HitData overData;
LayerManager.Instance.GetHitTarget(this, out overData);
return overData;
}
#endregion
}
}