Skip to content

Commit 5de6181

Browse files
committed
Updated some docs.
1 parent 67a3e67 commit 5de6181

21 files changed

Lines changed: 223 additions & 83 deletions

File tree

Source/Assets/TouchScript/Examples/Camera/Scripts/CameraController.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77

88
namespace TouchScript.Examples.CameraControl
99
{
10+
/// <summary>
11+
/// This component controls camera movement.
12+
/// </summary>
1013
public class CameraController : MonoBehaviour
1114
{
1215
public ScreenTransformGesture TwoFingerMoveGesture;

Source/Assets/TouchScript/Examples/_misc/Scripts/Checker.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99

1010
namespace TouchScript.Examples
1111
{
12+
/// <summary>
13+
/// This component controlls the movement of a Checker on the Board.
14+
/// </summary>
1215
public class Checker : MonoBehaviour
1316
{
1417
private TransformGesture gesture;
@@ -17,24 +20,30 @@ public class Checker : MonoBehaviour
1720

1821
private void OnEnable()
1922
{
23+
// The gesture
2024
gesture = GetComponent<TransformGesture>();
25+
// Transformer component actually MOVES the object
2126
transformer = GetComponent<Transformer>();
2227
rb = GetComponent<Rigidbody>();
2328

2429
transformer.enabled = false;
2530
rb.isKinematic = false;
31+
32+
// Subscribe to gesture events
2633
gesture.TransformStarted += transformStartedHandler;
2734
gesture.TransformCompleted += transformCompletedHandler;
2835
}
2936

3037
private void OnDisable()
3138
{
39+
// Unsubscribe from gesture events
3240
gesture.TransformStarted -= transformStartedHandler;
3341
gesture.TransformCompleted -= transformCompletedHandler;
3442
}
3543

3644
private void transformStartedHandler(object sender, EventArgs e)
3745
{
46+
// When movement starts we need to tell physics that now WE are moving this object manually
3847
rb.isKinematic = true;
3948
transformer.enabled = true;
4049
}

Source/Assets/TouchScript/Examples/_misc/Scripts/KillMe.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77

88
namespace TouchScript.Examples
99
{
10+
/// <summary>
11+
/// When enabled this component destroys the GameObject it is attached to in <see cref="Delay"/> seconds.
12+
/// </summary>
1013
public class KillMe : MonoBehaviour
1114
{
1215
public float Delay = 1f;

Source/Assets/TouchScript/Examples/_misc/Scripts/Runner.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010

1111
namespace TouchScript.Examples
1212
{
13+
/// <summary>
14+
/// This component loads demo scenes in a loop.
15+
/// </summary>
1316
public class Runner : MonoBehaviour
1417
{
1518
private static Runner instance;

Source/Assets/TouchScript/Modules/TUIO/Scripts/InputSources/TuioInput.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ public InputType SupportedInputs
108108
public TuioInput()
109109
{
110110
touchPool = new ObjectPool<TouchPointer>(20, () => new TouchPointer(this), null, (t) => t.INTERNAL_Reset());
111-
touchPool.Name = "TUIO";
112111
objectPool = new ObjectPool<ObjectPointer>(10, () => new ObjectPointer(this), null, (t) => t.INTERNAL_Reset());
113112
}
114113

@@ -211,6 +210,7 @@ public override bool CancelPointer(Pointer pointer, bool shouldReturn)
211210

212211
#region Internal methods
213212

213+
/// <inheritdoc />
214214
public override void INTERNAL_DiscardPointer(Pointer pointer)
215215
{
216216
if (pointer.Type == Pointer.PointerType.Touch)

Source/Assets/TouchScript/Scripts/Behaviors/Visualizer/PointerProxy.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace TouchScript.Behaviors.Visualizer
1212
/// <summary>
1313
/// Visual cursor implementation used by TouchScript.
1414
/// </summary>
15-
[HelpURL("http://touchscript.github.io/docs/html/T_TouchScript_Behaviors_TouchProxy.htm")]
15+
[HelpURL("http://touchscript.github.io/docs/html/T_TouchScript_Behaviors_Visualizer_TouchProxy.htm")]
1616
public class PointerProxy : PointerProxyBase
1717
{
1818
/// <summary>

Source/Assets/TouchScript/Scripts/Behaviors/Visualizer/PointerVisualizer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace TouchScript.Behaviors.Visualizer
1313
/// <para>Pointer visualizer which shows pointer circles with debug text using Unity UI.</para>
1414
/// <para>The script should be placed on an element with RectTransform or a Canvas. A reference prefab is provided in TouchScript package.</para>
1515
/// </summary>
16-
[HelpURL("http://touchscript.github.io/docs/html/T_TouchScript_Behaviors_TouchVisualizer.htm")]
16+
[HelpURL("http://touchscript.github.io/docs/html/T_TouchScript_Behaviors_Visualizer_TouchVisualizer.htm")]
1717
public class PointerVisualizer : MonoBehaviour
1818
{
1919
#region Public properties

Source/Assets/TouchScript/Scripts/ITouchManager.cs

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ namespace TouchScript
2020
/// <para>Every frame pointer events are dispatched in this order:</para>
2121
/// <list type="number">
2222
/// <item><description>FrameStarted</description></item>
23-
/// <item><description>PointersPressed</description></item>
23+
/// <item><description>PointersAdded</description></item>
2424
/// <item><description>PointersUpdated</description></item>
25+
/// <item><description>PointersPressed</description></item>
2526
/// <item><description>PointersReleased</description></item>
27+
/// <item><description>PointersRemoved</description></item>
2628
/// <item><description>PointersCancelled</description></item>
2729
/// <item><description>FrameFinished</description></item>
2830
/// </list>
@@ -125,18 +127,25 @@ public interface ITouchManager
125127
float DotsPerCentimeter { get; }
126128

127129
/// <summary>
128-
/// Gets number of active pointers.
130+
/// Gets number of pointers in the system.
129131
/// </summary>
130132
int PointersCount { get; }
131133

134+
/// <summary>
135+
/// Gets the number of pressed pointer in the system.
136+
/// </summary>
132137
int PressedPointersCount { get; }
133138

134139
/// <summary>
135-
/// Gets the list of active pointers.
140+
/// Gets the list of pointers.
136141
/// </summary>
137-
/// <value>An unsorted list of all pointers which began but have not ended yet.</value>
142+
/// <value>An unsorted list of all pointers.</value>
138143
IList<Pointer> Pointers { get; }
139144

145+
/// <summary>
146+
/// Gets the list of pressed pointers.
147+
/// </summary>
148+
/// <value>An unsorted list of all pointers which were pressed but not released yet.</value>
140149
IList<Pointer> PressedPointers { get; }
141150

142151
/// <summary>

Source/Assets/TouchScript/Scripts/InputSources/IInputSource.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,18 @@ public interface IInputSource : INTERNAL_IInputSource
3131
/// Cancels the pointer.
3232
/// </summary>
3333
/// <param name="pointer">The pointer.</param>
34-
/// <param name="return">if set to <c>true</c> returns the pointer back to the system with different id.</param>
34+
/// <param name="shouldReturn">if set to <c>true</c> returns the pointer back to the system with different id.</param>
3535
/// <returns><c>True</c> if the pointer belongs to this Input and was successfully cancelled; <c>false</c> otherwise.</returns>
3636
bool CancelPointer(Pointer pointer, bool shouldReturn);
3737
}
3838

3939
public interface INTERNAL_IInputSource
4040
{
41+
/// <summary>
42+
/// Used by <see cref="TouchManagerInstance"/> to return a pointer to input source.
43+
/// DO NOT CALL IT DIRECTLY FROM YOUR CODE!
44+
/// </summary>
45+
/// <param name="pointer">The pointer.</param>
4146
void INTERNAL_DiscardPointer(Pointer pointer);
4247
}
4348
}

Source/Assets/TouchScript/Scripts/InputSources/InputHandlers/MouseHandler.cs

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,15 @@ public class MouseHandler : IInputSource, IDisposable
1616
{
1717
#region Public properties
1818

19+
/// <inheritdoc />
1920
public ICoordinatesRemapper CoordinatesRemapper { get; set; }
2021

22+
/// <summary>
23+
/// Gets or sets a value indicating whether second pointer emulation using ALT+CLICK should be enabled.
24+
/// </summary>
25+
/// <value>
26+
/// <c>true</c> if second pointer emulation is enabled; otherwise, <c>false</c>.
27+
/// </value>
2128
public bool EmulateSecondMousePointer
2229
{
2330
get { return emulateSecondMousePointer; }
@@ -50,10 +57,12 @@ public bool EmulateSecondMousePointer
5057
/// <summary>
5158
/// Initializes a new instance of the <see cref="MouseHandler" /> class.
5259
/// </summary>
53-
/// <param name="pressPointer">A function called when a new pointer is detected. As <see cref="InputSource.pressPointer" /> this function must accept a Vector2 position of the new pointer and return an instance of <see cref="Pointer" />.</param>
54-
/// <param name="_updatePointer">A function called when a pointer is moved. As <see cref="InputSource.movePointer" /> this function must accept an int id and a Vector2 position.</param>
55-
/// <param name="releasePointer">A function called when a pointer is lifted off. As <see cref="InputSource.releasePointer" /> this function must accept an int id.</param>
56-
/// <param name="cancelPointer">A function called when a pointer is cancelled. As <see cref="InputSource.cancelPointer" /> this function must accept an int id.</param>
60+
/// <param name="addPointer">A function called when a new pointer is detected.</param>
61+
/// <param name="updatePointer">A function called when a pointer is moved or its parameter is updated.</param>
62+
/// <param name="pressPointer">A function called when a pointer touches the surface.</param>
63+
/// <param name="releasePointer">A function called when a pointer is lifted off.</param>
64+
/// <param name="removePointer">A function called when a pointer is removed.</param>
65+
/// <param name="cancelPointer">A function called when a pointer is cancelled.</param>
5766
public MouseHandler(PointerDelegate addPointer, PointerDelegate updatePointer, PointerDelegate pressPointer, PointerDelegate releasePointer, PointerDelegate removePointer, PointerDelegate cancelPointer)
5867
{
5968
this.addPointer = addPointer;
@@ -71,9 +80,7 @@ public MouseHandler(PointerDelegate addPointer, PointerDelegate updatePointer, P
7180

7281
#region Public methods
7382

74-
/// <summary>
75-
/// Updates this instance.
76-
/// </summary>
83+
/// <inheritdoc />
7784
public void UpdateInput()
7885
{
7986
if (fakeMousePointer != null
@@ -180,6 +187,7 @@ public void Dispose()
180187

181188
#region Internal methods
182189

190+
/// <inheritdoc />
183191
public void INTERNAL_DiscardPointer(Pointer pointer)
184192
{
185193
var p = pointer as MousePointer;

0 commit comments

Comments
 (0)