Skip to content

Commit 889b455

Browse files
committed
Fixed a typo, not failing with null inputsource on a pointer.
1 parent 40fd913 commit 889b455

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

Source/Assets/TouchScript/Scripts/Core/TouchManagerInstance.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ public void CancelPointer(int id, bool shouldReturn)
297297
Pointer pointer;
298298
if (idToPointer.TryGetValue(id, out pointer))
299299
{
300-
pointer.InputSource.CancelPointer(pointer, shouldReturn);
300+
if (pointer.InputSource != null) pointer.InputSource.CancelPointer(pointer, shouldReturn);
301301
}
302302
}
303303

@@ -877,7 +877,7 @@ private void updateRemoved(List<int> pointers)
877877
for (var i = 0; i < removedCount; i++)
878878
{
879879
var pointer = list[i];
880-
pointer.InputSource.INTERNAL_DiscardPointer(pointer);
880+
if (pointer.InputSource != null) pointer.InputSource.INTERNAL_DiscardPointer(pointer);
881881
}
882882
pointerListPool.Release(list);
883883

@@ -937,7 +937,7 @@ private void updateCancelled(List<int> pointers)
937937
for (var i = 0; i < cancelledCount; i++)
938938
{
939939
var pointer = list[i];
940-
pointer.InputSource.INTERNAL_DiscardPointer(pointer);
940+
if (pointer.InputSource != null) pointer.InputSource.INTERNAL_DiscardPointer(pointer);
941941
}
942942
pointerListPool.Release(list);
943943

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public TouchHandler(PointerDelegate addPointer, PointerDelegate updatePointer, P
7575
touchPool.Name = "Touch";
7676

7777
#if UNITY_5_6_OR_NEWER
78-
updateSampler = CustomSampler.Create("[TouchScript] Update touch");
78+
updateSampler = CustomSampler.Create("[TouchScript] Update Touch");
7979
#endif
8080
}
8181

0 commit comments

Comments
 (0)