@@ -1719,7 +1719,6 @@ public IEnumerator UI_CanReleaseAndPressTouchesOnSameFrame()
17191719
17201720 scene . leftChildReceiver . events . Clear ( ) ;
17211721
1722- Assert . That ( scene . eventSystem . IsPointerOverGameObject ( ) , Is . False ) ;
17231722 Assert . That ( scene . eventSystem . IsPointerOverGameObject ( 1 ) , Is . False ) ;
17241723 Assert . That ( scene . eventSystem . IsPointerOverGameObject ( 2 ) , Is . False ) ;
17251724
@@ -1730,8 +1729,8 @@ public IEnumerator UI_CanReleaseAndPressTouchesOnSameFrame()
17301729
17311730 var pointerIdTouch1 = ExtendedPointerEventData . MakePointerIdForTouch ( touchScreen . deviceId , 1 ) ;
17321731 var pointerIdTouch2 = ExtendedPointerEventData . MakePointerIdForTouch ( touchScreen . deviceId , 2 ) ;
1732+ var pointerIdTouch3 = ExtendedPointerEventData . MakePointerIdForTouch ( touchScreen . deviceId , 3 ) ;
17331733
1734- Assert . That ( scene . eventSystem . IsPointerOverGameObject ( ) , Is . True ) ;
17351734 Assert . That ( scene . eventSystem . IsPointerOverGameObject ( 1 ) , Is . True ) ;
17361735 Assert . That ( scene . eventSystem . IsPointerOverGameObject ( 2 ) , Is . False ) ;
17371736
@@ -1749,7 +1748,9 @@ public IEnumerator UI_CanReleaseAndPressTouchesOnSameFrame()
17491748 . Matches ( ( UICallbackReceiver . Event e ) => e . pointerData . pointerId == pointerIdTouch1 ) . And
17501749 . Matches ( ( UICallbackReceiver . Event e ) => e . pointerData . pointerType == UIPointerType . Touch ) . And
17511750 . Matches ( ( UICallbackReceiver . Event e ) => e . pointerData . position == firstPosition ) ) ;
1751+
17521752 Assert . That ( scene . rightChildReceiver . events , Is . Empty ) ;
1753+ Assert . That ( scene . uiModule . m_PointerStates . length , Is . EqualTo ( 1 ) ) ;
17531754
17541755 scene . leftChildReceiver . events . Clear ( ) ;
17551756 scene . rightChildReceiver . events . Clear ( ) ;
@@ -1758,12 +1759,15 @@ public IEnumerator UI_CanReleaseAndPressTouchesOnSameFrame()
17581759 var secondPosition = scene . From640x480ToScreen ( 350 , 200 ) ;
17591760 EndTouch ( 1 , firstPosition ) ;
17601761 BeginTouch ( 2 , secondPosition ) ;
1762+ BeginTouch ( 3 , secondPosition ) ;
1763+ MoveTouch ( 2 , secondPosition ) ;
17611764 yield return null ;
17621765
1763- Assert . That ( scene . eventSystem . IsPointerOverGameObject ( ) , Is . True ) ;
17641766 Assert . That ( scene . eventSystem . IsPointerOverGameObject ( 1 ) , Is . True ) ;
17651767 Assert . That ( scene . eventSystem . IsPointerOverGameObject ( 2 ) , Is . True ) ;
1768+ Assert . That ( scene . eventSystem . IsPointerOverGameObject ( 3 ) , Is . True ) ;
17661769
1770+ // Pointer 1
17671771 Assert . That ( scene . leftChildReceiver . events ,
17681772 Has . Exactly ( 1 ) . With . Property ( "type" ) . EqualTo ( EventType . PointerUp ) . And
17691773 . Matches ( ( UICallbackReceiver . Event e ) => e . pointerData . device == touchScreen ) . And
@@ -1772,6 +1776,7 @@ public IEnumerator UI_CanReleaseAndPressTouchesOnSameFrame()
17721776 . Matches ( ( UICallbackReceiver . Event e ) => e . pointerData . pointerType == UIPointerType . Touch ) . And
17731777 . Matches ( ( UICallbackReceiver . Event e ) => e . pointerData . position == firstPosition ) ) ;
17741778
1779+ // Pointer 2
17751780 Assert . That ( scene . rightChildReceiver . events ,
17761781 Has . Exactly ( 1 ) . With . Property ( "type" ) . EqualTo ( EventType . PointerEnter ) . And
17771782 . Matches ( ( UICallbackReceiver . Event e ) => e . pointerData . device == touchScreen ) . And
@@ -1788,16 +1793,44 @@ public IEnumerator UI_CanReleaseAndPressTouchesOnSameFrame()
17881793 . Matches ( ( UICallbackReceiver . Event e ) => e . pointerData . pointerType == UIPointerType . Touch ) . And
17891794 . Matches ( ( UICallbackReceiver . Event e ) => e . pointerData . position == secondPosition ) ) ;
17901795
1796+ Assert . That ( scene . rightChildReceiver . events ,
1797+ Has . Exactly ( 1 ) . With . Property ( "type" ) . EqualTo ( EventType . PointerMove ) . And
1798+ . Matches ( ( UICallbackReceiver . Event e ) => e . pointerData . device == touchScreen ) . And
1799+ . Matches ( ( UICallbackReceiver . Event e ) => e . pointerData . touchId == 2 ) . And
1800+ . Matches ( ( UICallbackReceiver . Event e ) => e . pointerData . pointerId == pointerIdTouch2 ) . And
1801+ . Matches ( ( UICallbackReceiver . Event e ) => e . pointerData . pointerType == UIPointerType . Touch ) . And
1802+ . Matches ( ( UICallbackReceiver . Event e ) => e . pointerData . position == secondPosition ) ) ;
1803+
1804+ // Pointer 3
1805+ Assert . That ( scene . rightChildReceiver . events ,
1806+ Has . Exactly ( 1 ) . With . Property ( "type" ) . EqualTo ( EventType . PointerEnter ) . And
1807+ . Matches ( ( UICallbackReceiver . Event e ) => e . pointerData . device == touchScreen ) . And
1808+ . Matches ( ( UICallbackReceiver . Event e ) => e . pointerData . touchId == 3 ) . And
1809+ . Matches ( ( UICallbackReceiver . Event e ) => e . pointerData . pointerId == pointerIdTouch3 ) . And
1810+ . Matches ( ( UICallbackReceiver . Event e ) => e . pointerData . pointerType == UIPointerType . Touch ) . And
1811+ . Matches ( ( UICallbackReceiver . Event e ) => e . pointerData . position == secondPosition ) ) ;
1812+
1813+ Assert . That ( scene . rightChildReceiver . events ,
1814+ Has . Exactly ( 1 ) . With . Property ( "type" ) . EqualTo ( EventType . PointerDown ) . And
1815+ . Matches ( ( UICallbackReceiver . Event e ) => e . pointerData . device == touchScreen ) . And
1816+ . Matches ( ( UICallbackReceiver . Event e ) => e . pointerData . touchId == 3 ) . And
1817+ . Matches ( ( UICallbackReceiver . Event e ) => e . pointerData . pointerId == pointerIdTouch3 ) . And
1818+ . Matches ( ( UICallbackReceiver . Event e ) => e . pointerData . pointerType == UIPointerType . Touch ) . And
1819+ . Matches ( ( UICallbackReceiver . Event e ) => e . pointerData . position == secondPosition ) ) ;
1820+
1821+ Assert . That ( scene . uiModule . m_PointerStates . length , Is . EqualTo ( 3 ) ) ;
1822+
17911823 scene . leftChildReceiver . events . Clear ( ) ;
17921824 scene . rightChildReceiver . events . Clear ( ) ;
17931825
17941826 // End second touch.
17951827 EndTouch ( 2 , secondPosition ) ;
1828+ EndTouch ( 3 , secondPosition ) ;
17961829 yield return null ;
17971830
1798- Assert . That ( scene . eventSystem . IsPointerOverGameObject ( ) , Is . True ) ;
17991831 Assert . That ( scene . eventSystem . IsPointerOverGameObject ( 1 ) , Is . True ) ;
18001832 Assert . That ( scene . eventSystem . IsPointerOverGameObject ( 2 ) , Is . True ) ;
1833+ Assert . That ( scene . eventSystem . IsPointerOverGameObject ( 3 ) , Is . True ) ;
18011834
18021835 Assert . That ( scene . leftChildReceiver . events ,
18031836 Has . Exactly ( 1 ) . With . Property ( "type" ) . EqualTo ( EventType . PointerExit ) . And
@@ -1815,15 +1848,25 @@ public IEnumerator UI_CanReleaseAndPressTouchesOnSameFrame()
18151848 . Matches ( ( UICallbackReceiver . Event e ) => e . pointerData . pointerType == UIPointerType . Touch ) . And
18161849 . Matches ( ( UICallbackReceiver . Event e ) => e . pointerData . position == secondPosition ) ) ;
18171850
1851+ Assert . That ( scene . rightChildReceiver . events ,
1852+ Has . Exactly ( 1 ) . With . Property ( "type" ) . EqualTo ( EventType . PointerUp ) . And
1853+ . Matches ( ( UICallbackReceiver . Event e ) => e . pointerData . device == touchScreen ) . And
1854+ . Matches ( ( UICallbackReceiver . Event e ) => e . pointerData . touchId == 3 ) . And
1855+ . Matches ( ( UICallbackReceiver . Event e ) => e . pointerData . pointerId == pointerIdTouch3 ) . And
1856+ . Matches ( ( UICallbackReceiver . Event e ) => e . pointerData . pointerType == UIPointerType . Touch ) . And
1857+ . Matches ( ( UICallbackReceiver . Event e ) => e . pointerData . position == secondPosition ) ) ;
1858+
1859+ Assert . That ( scene . uiModule . m_PointerStates . length , Is . EqualTo ( 2 ) ) ;
1860+
18181861 scene . leftChildReceiver . events . Clear ( ) ;
18191862 scene . rightChildReceiver . events . Clear ( ) ;
18201863
18211864 // Next frame
18221865 yield return null ;
18231866
1824- Assert . That ( scene . eventSystem . IsPointerOverGameObject ( ) , Is . False ) ;
18251867 Assert . That ( scene . eventSystem . IsPointerOverGameObject ( 1 ) , Is . False ) ;
18261868 Assert . That ( scene . eventSystem . IsPointerOverGameObject ( 2 ) , Is . False ) ;
1869+ Assert . That ( scene . eventSystem . IsPointerOverGameObject ( 3 ) , Is . False ) ;
18271870
18281871 Assert . That ( scene . leftChildReceiver . events , Is . Empty ) ;
18291872 Assert . That ( scene . rightChildReceiver . events ,
@@ -1833,6 +1876,16 @@ public IEnumerator UI_CanReleaseAndPressTouchesOnSameFrame()
18331876 . Matches ( ( UICallbackReceiver . Event e ) => e . pointerData . pointerId == pointerIdTouch2 ) . And
18341877 . Matches ( ( UICallbackReceiver . Event e ) => e . pointerData . pointerType == UIPointerType . Touch ) . And
18351878 . Matches ( ( UICallbackReceiver . Event e ) => e . pointerData . position == secondPosition ) ) ;
1879+
1880+ Assert . That ( scene . rightChildReceiver . events ,
1881+ Has . Exactly ( 1 ) . With . Property ( "type" ) . EqualTo ( EventType . PointerExit ) . And
1882+ . Matches ( ( UICallbackReceiver . Event e ) => e . pointerData . device == touchScreen ) . And
1883+ . Matches ( ( UICallbackReceiver . Event e ) => e . pointerData . touchId == 3 ) . And
1884+ . Matches ( ( UICallbackReceiver . Event e ) => e . pointerData . pointerId == pointerIdTouch3 ) . And
1885+ . Matches ( ( UICallbackReceiver . Event e ) => e . pointerData . pointerType == UIPointerType . Touch ) . And
1886+ . Matches ( ( UICallbackReceiver . Event e ) => e . pointerData . position == secondPosition ) ) ;
1887+
1888+ Assert . That ( scene . uiModule . m_PointerStates . length , Is . Zero ) ;
18361889 }
18371890
18381891 // https://fogbugz.unity3d.com/f/cases/1190150/
@@ -1866,8 +1919,6 @@ public IEnumerator UI_CanUseTouchSimulationWithUI()
18661919
18671920 Assert . That ( scene . uiModule . m_CurrentPointerType , Is . EqualTo ( UIPointerType . Touch ) ) ;
18681921 Assert . That ( scene . uiModule . m_PointerIds . length , Is . EqualTo ( 1 ) ) ;
1869- Assert . That ( scene . uiModule . m_PointerTouchControls . length , Is . EqualTo ( 1 ) ) ;
1870- Assert . That ( scene . uiModule . m_PointerTouchControls [ 0 ] , Is . SameAs ( Touchscreen . current . touches [ 0 ] ) ) ;
18711922 Assert . That ( scene . leftChildReceiver . events ,
18721923 EventSequence (
18731924 AllEvents ( "pointerType" , UIPointerType . Touch ) ,
@@ -1891,8 +1942,6 @@ public IEnumerator UI_CanUseTouchSimulationWithUI()
18911942
18921943 Assert . That ( scene . uiModule . m_CurrentPointerType , Is . EqualTo ( UIPointerType . Touch ) ) ;
18931944 Assert . That ( scene . uiModule . m_PointerIds . length , Is . EqualTo ( 1 ) ) ;
1894- Assert . That ( scene . uiModule . m_PointerTouchControls . length , Is . EqualTo ( 1 ) ) ;
1895- Assert . That ( scene . uiModule . m_PointerTouchControls [ 0 ] , Is . SameAs ( Touchscreen . current . touches [ 0 ] ) ) ;
18961945 Assert . That ( scene . leftChildReceiver . events ,
18971946 EventSequence (
18981947 AllEvents ( "pointerType" , UIPointerType . Touch ) ,
@@ -1909,7 +1958,6 @@ public IEnumerator UI_CanUseTouchSimulationWithUI()
19091958
19101959 Assert . That ( scene . uiModule . m_CurrentPointerType , Is . EqualTo ( UIPointerType . None ) ) ;
19111960 Assert . That ( scene . uiModule . m_PointerIds . length , Is . Zero ) ;
1912- Assert . That ( scene . uiModule . m_PointerTouchControls . length , Is . Zero ) ;
19131961 Assert . That ( scene . leftChildReceiver . events ,
19141962 EventSequence (
19151963 AllEvents ( "pointerType" , UIPointerType . Touch ) ,
0 commit comments