/// A facade object to configure and hold parameters for an instance of <see cref="ITouchManager"/>. Contains constants used throughout the library.
/// <seealso cref="ITouchManager"/>
/// </summary>
/// <remarks>
/// <para>An instance of <see cref="TouchManager"/> may be added to a Unity scene to hold (i.e. serialize them to the scene) parameters needed to configure an instance of <see cref="ITouchManager"/> used in application. Which can be accessed via <see cref="TouchManager.Instance"/> static property.</para>
/// <para>Though it's not required it is a convenient way to configure <b>TouchScript</b> for your scene. You can use different configuration options for different scenes.</para>
/// Values of a bit-mask representing which Unity messages an instance of <see cref="TouchManager"/> will dispatch.
/// </summary>
[Flags]
publicenumMessageType
{
/// <summary>
/// Pointer frame started.
/// </summary>
FrameStarted=1<<0,
/// <summary>
/// Pointer frame finished.
/// </summary>
FrameFinished=1<<1,
/// <summary>
/// Some pointers were added during the frame.
/// </summary>
PointersAdded=1<<2,
/// <summary>
/// Some pointers were updated during the frame.
/// </summary>
PointersUpdated=1<<3,
/// <summary>
/// Some pointers have touched the surface during the frame.
/// </summary>
PointersPressed=1<<4,
/// <summary>
/// Some pointers were released during the frame.
/// </summary>
PointersReleased=1<<5,
/// <summary>
/// Some pointers were removed during the frame.
/// </summary>
PointersRemoved=1<<6,
/// <summary>
/// Some pointers were cancelled during the frame.
/// </summary>
PointersCancelled=1<<7
}
/// <summary>
/// Names of dispatched Unity messages.
/// </summary>
publicenumMessageName
{
/// <summary>
/// Pointer frame started.
/// </summary>
OnFrameStart=MessageType.FrameStarted,
/// <summary>
/// Pointer frame finished.
/// </summary>
OnFrameFinish=MessageType.FrameFinished,
/// <summary>
/// Some pointers were added during the frame.
/// </summary>
OnPointersAdd=MessageType.PointersAdded,
/// <summary>
/// Some pointers have updated during the frame.
/// </summary>
OnPointersUpdate=MessageType.PointersUpdated,
/// <summary>
/// Some pointers have touched the surface during the frame.
/// </summary>
OnPointersPress=MessageType.PointersPressed,
/// <summary>
/// Some pointers were released during the frame.
/// </summary>
OnPointersRelease=MessageType.PointersReleased,
/// <summary>
/// Some pointers were removed during the frame.
/// </summary>
OnPointersRemove=MessageType.PointersRemoved,
/// <summary>
/// Some pointers were cancelled during the frame.
/// </summary>
OnPointersCancel=MessageType.PointersCancelled
}
/// <summary>
/// Centimeter to inch ratio to be used in DPI calculations.
/// </summary>
publicconstfloatCM_TO_INCH=0.393700787f;
/// <summary>
/// Inch to centimeter ratio to be used in DPI calculations.
/// </summary>
publicconstfloatINCH_TO_CM=1/CM_TO_INCH;
/// <summary>
/// The value used to represent an unknown state of a screen position. Use <see cref="TouchManager.IsInvalidPosition"/> to check if a point has unknown value.
/// Indicates if TouchScript should create a CameraLayer for you if no layers present in a scene.
/// </summary>
/// <value><c>true</c> if a CameraLayer should be created on startup; otherwise, <c>false</c>.</value>
/// <remarks>This is usually a desired behavior but sometimes you would want to turn this off if you are using TouchScript only to get pointer input from some device.</remarks>
publicboolShouldCreateCameraLayer
{
get{returnshouldCreateCameraLayer;}
set{shouldCreateCameraLayer=value;}
}
/// <summary>
/// Gets or sets a value indicating whether a <see cref="TouchScript.InputSources.StandardInput"/> should be created in scene if no inputs present.
/// </summary>
/// <value> <c>true</c> if StandardInput should be created; otherwise, <c>false</c>. </value>
/// <remarks>This is usually a desired behavior but sometimes you would want to turn this off.</remarks>
publicboolShouldCreateStandardInput
{
get{returnshouldCreateStandardInput;}
set{shouldCreateStandardInput=value;}
}
/// <summary>
/// Gets or sets a value indicating whether Unity messages are sent when <see cref="ITouchManager"/> dispatches events.
/// </summary>
/// <value><c>true</c> if Unity messages are used; otherwise, <c>false</c>.</value>
/// <remarks>If Unity messages are used they are sent to an object set as a value of <see cref="SendMessageTarget"/> property or to TouchManager's GameObject if it's <c>null</c>.</remarks>
publicboolUseSendMessage
{
get{returnuseSendMessage;}
set
{
if(value==useSendMessage)return;
useSendMessage=value;
updateSendMessageSubscription();
}
}
/// <summary>
/// Gets or sets the bit-mask which indicates which events from an instance of <see cref="ITouchManager"/> are sent as Unity messages.
/// </summary>
/// <value>Bit-mask with corresponding bits for used events.</value>
publicMessageTypeSendMessageEvents
{
get{returnsendMessageEvents;}
set
{
if(sendMessageEvents==value)return;
sendMessageEvents=value;
updateSendMessageSubscription();
}
}
/// <summary>
/// Gets or sets the SendMessage target GameObject.
/// </summary>
/// <value>Which GameObject to use to dispatch Unity messages. If <c>null</c>, TouchManager's GameObject is used.</value>
publicGameObjectSendMessageTarget
{
get{returnsendMessageTarget;}
set
{
sendMessageTarget=value;
if(value==null)sendMessageTarget=gameObject;
}
}
/// <summary>
/// Gets or sets a value indicating whether Unity Events should be used.
/// </summary>
/// <value>
/// <c>true</c> if TouchManager should use Unity Events; otherwise, <c>false</c>.