summaryrefslogtreecommitdiff
path: root/Library/Artifacts/29/2942687c50c9841bb58dd72d0a95ad72
blob: 571b577c231dfa588581228eb88be2ade50a4c35 (plain)
ofshex dumpascii
0000 00 00 0f 81 00 00 59 68 00 00 00 15 00 00 10 00 00 00 00 00 32 30 31 39 2e 33 2e 36 66 31 00 fe ......Yh............2019.3.6f1..
0020 ff ff ff 01 02 00 00 00 0b 04 00 00 00 ff ff 66 9a 86 21 eb 14 35 98 39 dd 34 1d 51 0e c1 f3 42 ...............f..!..5.9.4.Q...B
0040 00 00 00 ed 00 00 00 02 00 00 00 00 00 00 00 37 00 00 80 ff ff ff ff 00 00 00 00 00 80 00 00 00 ...............7................
0060 00 00 00 00 00 00 00 01 00 01 00 a6 03 00 80 b2 01 00 80 04 00 00 00 01 00 00 00 01 00 00 00 00 ................................
0080 00 00 00 00 00 00 00 01 00 01 00 0d 00 00 00 45 04 00 80 0c 00 00 00 02 00 00 00 01 00 00 00 00 ...............E................
00a0 00 00 00 00 00 00 00 01 00 02 00 de 00 00 80 23 00 00 00 04 00 00 00 03 00 00 00 01 00 80 00 00 ...............#................
00c0 00 00 00 00 00 00 00 01 00 02 00 2e 03 00 80 2c 00 00 00 08 00 00 00 04 00 00 00 01 00 80 00 00 ...............,................
00e0 00 00 00 00 00 00 00 01 00 01 00 35 00 00 00 61 04 00 80 0c 00 00 00 05 00 00 00 01 00 00 00 00 ...........5...a................
0100 00 00 00 00 00 00 00 01 00 02 00 de 00 00 80 23 00 00 00 04 00 00 00 06 00 00 00 01 00 80 00 00 ...............#................
0120 00 00 00 00 00 00 00 01 00 02 00 2e 03 00 80 2c 00 00 00 08 00 00 00 07 00 00 00 01 00 80 00 00 ...............,................
0140 00 00 00 00 00 00 00 01 00 01 00 86 02 00 80 72 04 00 80 0c 00 00 00 08 00 00 00 01 00 00 00 00 ...............r................
0160 00 00 00 00 00 00 00 01 00 02 00 de 00 00 80 23 00 00 00 04 00 00 00 09 00 00 00 01 00 80 00 00 ...............#................
0180 00 00 00 00 00 00 00 01 00 02 00 2e 03 00 80 2c 00 00 00 08 00 00 00 0a 00 00 00 01 00 80 00 00 ...............,................
01a0 00 00 00 00 00 00 00 01 00 01 00 48 03 00 80 ab 01 00 80 ff ff ff ff 0b 00 00 00 01 80 08 00 00 ...........H....................
01c0 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 00 00 80 ff ff ff ff 0c 00 00 00 01 40 08 00 00 ...........1...1............@...
01e0 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b 03 00 80 04 00 00 00 0d 00 00 00 01 00 08 00 00 ................................
0200 00 00 00 00 00 00 00 01 00 03 00 51 00 00 80 6a 00 00 80 01 00 00 00 0e 00 00 00 01 00 08 00 00 ...........Q...j................
0220 00 00 00 00 00 00 00 01 00 01 00 f1 00 00 80 4a 00 00 00 ff ff ff ff 0f 00 00 00 00 c0 00 00 00 ...............J................
0240 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 00 00 80 ff ff ff ff 10 00 00 00 00 80 00 00 00 ...........1...1................
0260 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b 03 00 80 04 00 00 00 11 00 00 00 00 00 00 00 00 ................................
0280 00 00 00 00 00 00 00 01 00 03 00 1f 02 00 80 6a 00 00 80 ff ff ff ff 12 00 00 00 00 80 00 00 00 ...............j................
02a0 00 00 00 00 00 00 00 01 00 04 00 5c 00 00 00 9b 00 00 80 ff ff ff ff 13 00 00 00 00 80 00 00 00 ...........\....................
02c0 00 00 00 00 00 00 00 01 00 05 00 48 03 00 80 72 00 00 00 ff ff ff ff 14 00 00 00 00 80 00 00 00 ...........H...r................
02e0 00 00 00 00 00 00 00 01 00 06 01 31 00 00 80 31 00 00 80 ff ff ff ff 15 00 00 00 01 40 00 00 00 ...........1...1............@...
0300 00 00 00 00 00 00 00 01 00 07 00 de 00 00 80 1b 03 00 80 04 00 00 00 16 00 00 00 01 00 00 00 00 ................................
0320 00 00 00 00 00 00 00 01 00 07 00 51 00 00 80 6a 00 00 80 01 00 00 00 17 00 00 00 01 00 00 00 00 ...........Q...j................
0340 00 00 00 00 00 00 00 01 00 05 00 48 03 00 80 77 00 00 00 ff ff ff ff 18 00 00 00 00 80 00 00 00 ...........H...w................
0360 00 00 00 00 00 00 00 01 00 06 01 31 00 00 80 31 00 00 80 ff ff ff ff 19 00 00 00 01 40 00 00 00 ...........1...1............@...
0380 00 00 00 00 00 00 00 01 00 07 00 de 00 00 80 1b 03 00 80 04 00 00 00 1a 00 00 00 01 00 00 00 00 ................................
03a0 00 00 00 00 00 00 00 01 00 07 00 51 00 00 80 6a 00 00 80 01 00 00 00 1b 00 00 00 01 00 00 00 00 ...........Q...j................
03c0 00 00 00 00 00 00 00 01 00 05 00 48 03 00 80 80 00 00 00 ff ff ff ff 1c 00 00 00 00 80 00 00 00 ...........H....................
03e0 00 00 00 00 00 00 00 01 00 06 01 31 00 00 80 31 00 00 80 ff ff ff ff 1d 00 00 00 01 40 00 00 00 ...........1...1............@...
0400 00 00 00 00 00 00 00 01 00 07 00 de 00 00 80 1b 03 00 80 04 00 00 00 1e 00 00 00 01 00 00 00 00 ................................
0420 00 00 00 00 00 00 00 01 00 07 00 51 00 00 80 6a 00 00 80 01 00 00 00 1f 00 00 00 01 00 00 00 00 ...........Q...j................
0440 00 00 00 00 00 00 00 01 00 04 00 79 02 00 80 0a 03 00 80 0c 00 00 00 20 00 00 00 00 00 00 00 00 ...........y....................
0460 00 00 00 00 00 00 00 01 00 05 00 de 00 00 80 23 00 00 00 04 00 00 00 21 00 00 00 01 00 80 00 00 ...............#.......!........
0480 00 00 00 00 00 00 00 01 00 05 00 2e 03 00 80 2c 00 00 00 08 00 00 00 22 00 00 00 01 00 80 00 00 ...............,......."........
04a0 00 00 00 00 00 00 00 01 00 01 00 11 03 00 80 85 00 00 00 ff ff ff ff 23 00 00 00 01 40 08 00 00 .......................#....@...
04c0 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 00 00 80 ff ff ff ff 24 00 00 00 01 00 08 00 00 ...........1...1.......$........
04e0 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b 03 00 80 04 00 00 00 25 00 00 00 01 00 08 00 00 .......................%........
0500 00 00 00 00 00 00 00 01 00 03 00 2e 03 00 80 6a 00 00 80 08 00 00 00 26 00 00 00 01 00 08 00 00 ...............j.......&........
0520 00 00 00 00 00 00 00 01 00 01 00 d5 03 00 80 93 00 00 00 ff ff ff ff 27 00 00 00 00 80 00 00 00 .......................'........
0540 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 00 00 80 ff ff ff ff 28 00 00 00 00 c0 00 00 00 ...........1...1.......(........
0560 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b 03 00 80 04 00 00 00 29 00 00 00 00 00 00 00 00 .......................)........
0580 00 00 00 00 00 00 00 01 00 03 00 1f 02 00 80 6a 00 00 80 ff ff ff ff 2a 00 00 00 00 80 00 00 00 ...............j.......*........
05a0 00 00 00 00 00 00 00 01 00 04 00 48 03 00 80 9b 00 00 80 ff ff ff ff 2b 00 00 00 00 80 00 00 00 ...........H...........+........
05c0 00 00 00 00 00 00 00 01 00 05 01 31 00 00 80 31 00 00 80 ff ff ff ff 2c 00 00 00 01 40 00 00 00 ...........1...1.......,....@...
05e0 00 00 00 00 00 00 00 01 00 06 00 de 00 00 80 1b 03 00 80 04 00 00 00 2d 00 00 00 01 00 00 00 00 .......................-........
0600 00 00 00 00 00 00 00 01 00 06 00 51 00 00 80 6a 00 00 80 01 00 00 00 2e 00 00 00 01 00 00 00 00 ...........Q...j................
0620 00 00 00 00 00 00 00 01 00 04 00 79 02 00 80 0a 03 00 80 0c 00 00 00 2f 00 00 00 00 00 00 00 00 ...........y.........../........
0640 00 00 00 00 00 00 00 01 00 05 00 de 00 00 80 23 00 00 00 04 00 00 00 30 00 00 00 01 00 80 00 00 ...............#.......0........
0660 00 00 00 00 00 00 00 01 00 05 00 2e 03 00 80 2c 00 00 00 08 00 00 00 31 00 00 00 01 00 80 00 00 ...............,.......1........
0680 00 00 00 00 00 00 00 01 00 01 00 20 03 00 80 a7 00 00 00 02 00 00 00 32 00 00 00 00 40 00 00 00 .......................2....@...
06a0 00 00 00 00 00 00 00 01 00 01 00 be 02 00 80 b6 00 00 00 0c 00 00 00 33 00 00 00 00 40 00 00 00 .......................3....@...
06c0 00 00 00 00 00 00 00 01 00 02 00 de 00 00 80 23 00 00 00 04 00 00 00 34 00 00 00 01 00 80 00 00 ...............#.......4........
06e0 00 00 00 00 00 00 00 01 00 02 00 2e 03 00 80 2c 00 00 00 08 00 00 00 35 00 00 00 01 00 80 00 00 ...............,.......5........
0700 00 00 00 00 00 00 00 01 00 01 00 48 03 00 80 bb 00 00 00 ff ff ff ff 36 00 00 00 01 80 00 00 00 ...........H...........6........
0720 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 00 00 80 ff ff ff ff 37 00 00 00 01 40 00 00 00 ...........1...1.......7....@...
0740 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b 03 00 80 04 00 00 00 38 00 00 00 01 00 00 00 00 .......................8........
0760 00 00 00 00 00 00 00 01 00 03 00 51 00 00 80 6a 00 00 80 01 00 00 00 39 00 00 00 01 00 00 00 00 ...........Q...j.......9........
0780 00 00 00 00 00 00 00 01 00 01 00 48 03 00 80 c6 00 00 00 ff ff ff ff 3a 00 00 00 01 80 00 00 00 ...........H...........:........
07a0 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 00 00 80 ff ff ff ff 3b 00 00 00 01 40 00 00 00 ...........1...1.......;....@...
07c0 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b 03 00 80 04 00 00 00 3c 00 00 00 01 00 00 00 00 .......................<........
07e0 00 00 00 00 00 00 00 01 00 03 00 51 00 00 80 6a 00 00 80 01 00 00 00 3d 00 00 00 01 00 00 00 00 ...........Q...j.......=........
0800 00 00 00 00 00 00 00 01 00 01 00 48 03 00 80 d8 00 00 00 ff ff ff ff 3e 00 00 00 01 80 00 00 00 ...........H...........>........
0820 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 00 00 80 ff ff ff ff 3f 00 00 00 01 40 00 00 00 ...........1...1.......?....@...
0840 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b 03 00 80 04 00 00 00 40 00 00 00 01 00 00 00 00 .......................@........
0860 00 00 00 00 00 00 00 01 00 03 00 51 00 00 80 6a 00 00 80 01 00 00 00 41 00 00 00 01 00 00 00 00 ...........Q...j.......A........
0880 00 00 00 00 00 00 00 4d 6f 6e 6f 49 6d 70 6f 72 74 65 72 00 50 50 74 72 3c 45 64 69 74 6f 72 45 .......MonoImporter.PPtr<EditorE
08a0 78 74 65 6e 73 69 6f 6e 3e 00 6d 5f 46 69 6c 65 49 44 00 6d 5f 50 61 74 68 49 44 00 50 50 74 72 xtension>.m_FileID.m_PathID.PPtr
08c0 3c 50 72 65 66 61 62 49 6e 73 74 61 6e 63 65 3e 00 6d 5f 45 78 74 65 72 6e 61 6c 4f 62 6a 65 63 <PrefabInstance>.m_ExternalObjec
08e0 74 73 00 53 6f 75 72 63 65 41 73 73 65 74 49 64 65 6e 74 69 66 69 65 72 00 74 79 70 65 00 61 73 ts.SourceAssetIdentifier.type.as
0900 73 65 6d 62 6c 79 00 6e 61 6d 65 00 6d 5f 55 73 65 64 46 69 6c 65 49 44 73 00 6d 5f 44 65 66 61 sembly.name.m_UsedFileIDs.m_Defa
0920 75 6c 74 52 65 66 65 72 65 6e 63 65 73 00 65 78 65 63 75 74 69 6f 6e 4f 72 64 65 72 00 69 63 6f ultReferences.executionOrder.ico
0940 6e 00 6d 5f 55 73 65 72 44 61 74 61 00 6d 5f 41 73 73 65 74 42 75 6e 64 6c 65 4e 61 6d 65 00 6d n.m_UserData.m_AssetBundleName.m
0960 5f 41 73 73 65 74 42 75 6e 64 6c 65 56 61 72 69 61 6e 74 00 00 00 00 00 73 00 00 00 00 ff ff a3 _AssetBundleVariant.....s.......
0980 47 f1 d7 dc 8f 5a 35 36 a0 3a 21 40 69 c1 4a 2a 00 00 00 81 00 00 00 05 00 00 00 15 01 00 80 37 G....Z56.:!@i.J*...............7
09a0 00 00 80 ff ff ff ff 00 00 00 00 00 80 00 00 00 00 00 00 00 00 00 00 01 00 01 00 a6 03 00 80 b2 ................................
09c0 01 00 80 04 00 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 01 00 00 00 00 00 45 ...............................E
09e0 04 00 80 0c 00 00 00 02 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 02 00 de 00 00 80 16 ................................
0a00 00 00 00 04 00 00 00 03 00 00 00 01 00 80 00 00 00 00 00 00 00 00 00 01 00 02 00 2e 03 00 80 1f ................................
0a20 00 00 00 08 00 00 00 04 00 00 00 01 00 80 00 00 00 00 00 00 00 00 00 01 00 01 00 28 00 00 00 61 ...........................(...a
0a40 04 00 80 0c 00 00 00 05 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 02 00 de 00 00 80 16 ................................
0a60 00 00 00 04 00 00 00 06 00 00 00 01 00 80 00 00 00 00 00 00 00 00 00 01 00 02 00 2e 03 00 80 1f ................................
0a80 00 00 00 08 00 00 00 07 00 00 00 01 00 80 00 00 00 00 00 00 00 00 00 01 00 01 00 86 02 00 80 72 ...............................r
0aa0 04 00 80 0c 00 00 00 08 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 02 00 de 00 00 80 16 ................................
0ac0 00 00 00 04 00 00 00 09 00 00 00 01 00 80 00 00 00 00 00 00 00 00 00 01 00 02 00 2e 03 00 80 1f ................................
0ae0 00 00 00 08 00 00 00 0a 00 00 00 01 00 80 00 00 00 00 00 00 00 00 00 01 00 01 00 48 03 00 80 ab ...........................H....
0b00 01 00 80 ff ff ff ff 0b 00 00 00 01 80 08 00 00 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 ...........................1...1
0b20 00 00 80 ff ff ff ff 0c 00 00 00 01 40 08 00 00 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b ............@...................
0b40 03 00 80 04 00 00 00 0d 00 00 00 01 00 08 00 00 00 00 00 00 00 00 00 01 00 03 00 51 00 00 80 6a ...........................Q...j
0b60 00 00 80 01 00 00 00 0e 00 00 00 01 00 08 00 00 00 00 00 00 00 00 00 01 00 01 00 48 03 00 80 ea ...........................H....
0b80 01 00 80 ff ff ff ff 0f 00 00 00 01 80 00 00 00 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 ...........................1...1
0ba0 00 00 80 ff ff ff ff 10 00 00 00 01 40 00 00 00 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b ............@...................
0bc0 03 00 80 04 00 00 00 11 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 03 00 51 00 00 80 6a ...........................Q...j
0be0 00 00 80 01 00 00 00 12 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 01 00 f1 00 00 80 3d ...............................=
0c00 00 00 00 ff ff ff ff 13 00 00 00 01 80 00 00 00 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 ...........................1...1
0c20 00 00 80 ff ff ff ff 14 00 00 00 01 80 00 00 00 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b ................................
0c40 03 00 80 04 00 00 00 15 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 03 00 1f 02 00 80 6a ...............................j
0c60 00 00 80 ff ff ff ff 16 00 00 00 01 80 00 00 00 00 00 00 00 00 00 00 01 00 04 00 48 03 00 80 9b ...........................H....
0c80 00 00 80 ff ff ff ff 17 00 00 00 01 80 00 00 00 00 00 00 00 00 00 00 01 00 05 01 31 00 00 80 31 ...........................1...1
0ca0 00 00 80 ff ff ff ff 18 00 00 00 01 40 00 00 00 00 00 00 00 00 00 00 01 00 06 00 de 00 00 80 1b ............@...................
0cc0 03 00 80 04 00 00 00 19 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 06 00 51 00 00 80 6a ...........................Q...j
0ce0 00 00 80 01 00 00 00 1a 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 04 00 79 02 00 80 0a ...........................y....
0d00 03 00 80 0c 00 00 00 1b 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 05 00 de 00 00 80 16 ................................
0d20 00 00 00 04 00 00 00 1c 00 00 00 01 00 80 00 00 00 00 00 00 00 00 00 01 00 05 00 2e 03 00 80 1f ................................
0d40 00 00 00 08 00 00 00 1d 00 00 00 01 00 80 00 00 00 00 00 00 00 00 00 01 00 01 00 79 02 00 80 51 ...........................y...Q
0d60 00 00 00 0c 00 00 00 1e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 02 00 de 00 00 80 16 ................................
0d80 00 00 00 04 00 00 00 1f 00 00 00 01 00 80 00 00 00 00 00 00 00 00 00 01 00 02 00 2e 03 00 80 1f ................................
0da0 00 00 00 08 00 00 00 20 00 00 00 01 00 80 00 00 00 00 00 00 00 00 00 01 00 01 00 de 00 00 80 58 ...............................X
0dc0 00 00 00 04 00 00 00 21 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 01 00 01 00 48 03 00 80 69 .......!...................H...i
0de0 00 00 00 ff ff ff ff 22 00 00 00 10 80 00 00 00 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 ......."...................1...1
0e00 00 00 80 ff ff ff ff 23 00 00 00 11 40 00 00 00 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b .......#....@...................
0e20 03 00 80 04 00 00 00 24 00 00 00 11 00 00 00 00 00 00 00 00 00 00 00 01 00 03 00 51 00 00 80 6a .......$...................Q...j
0e40 00 00 80 01 00 00 00 25 00 00 00 11 00 00 00 00 00 00 00 00 00 00 00 01 00 01 00 48 03 00 80 75 .......%...................H...u
0e60 00 00 00 ff ff ff ff 26 00 00 00 10 80 00 00 00 00 00 00 00 00 00 00 01 00 02 01 31 00 00 80 31 .......&...................1...1
0e80 00 00 80 ff ff ff ff 27 00 00 00 11 40 00 00 00 00 00 00 00 00 00 00 01 00 03 00 de 00 00 80 1b .......'....@...................
0ea0 03 00 80 04 00 00 00 28 00 00 00 11 00 00 00 00 00 00 00 00 00 00 00 01 00 03 00 51 00 00 80 6a .......(...................Q...j
0ec0 00 00 80 01 00 00 00 29 00 00 00 11 00 00 00 00 00 00 00 00 00 00 00 50 50 74 72 3c 45 64 69 74 .......)...............PPtr<Edit
0ee0 6f 72 45 78 74 65 6e 73 69 6f 6e 3e 00 6d 5f 46 69 6c 65 49 44 00 6d 5f 50 61 74 68 49 44 00 50 orExtension>.m_FileID.m_PathID.P
0f00 50 74 72 3c 50 72 65 66 61 62 49 6e 73 74 61 6e 63 65 3e 00 6d 5f 44 65 66 61 75 6c 74 52 65 66 Ptr<PrefabInstance>.m_DefaultRef
0f20 65 72 65 6e 63 65 73 00 6d 5f 49 63 6f 6e 00 6d 5f 45 78 65 63 75 74 69 6f 6e 4f 72 64 65 72 00 erences.m_Icon.m_ExecutionOrder.
0f40 6d 5f 43 6c 61 73 73 4e 61 6d 65 00 6d 5f 4e 61 6d 65 73 70 61 63 65 00 00 00 00 00 02 00 00 00 m_ClassName.m_Namespace.........
0f60 03 00 00 00 00 00 00 00 00 00 00 00 5c 00 00 00 00 00 00 00 e0 79 af 00 00 00 00 00 60 00 00 00 ............\........y......`...
0f80 08 49 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 .I..............................
0fa0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
0fc0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
0fe0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
1000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
1020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 e0 79 af 00 00 00 00 00 00 00 00 00 .....................y..........
1040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
1060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
1080 00 00 00 00 00 00 00 00 0f 00 00 00 53 63 72 6f 6c 6c 52 65 63 74 54 65 73 74 73 00 99 48 00 00 ............ScrollRectTests..H..
10a0 75 73 69 6e 67 20 53 79 73 74 65 6d 3b 0a 75 73 69 6e 67 20 53 79 73 74 65 6d 2e 43 6f 6c 6c 65 using.System;.using.System.Colle
10c0 63 74 69 6f 6e 73 3b 0a 75 73 69 6e 67 20 53 79 73 74 65 6d 2e 52 65 66 6c 65 63 74 69 6f 6e 3b ctions;.using.System.Reflection;
10e0 0a 75 73 69 6e 67 20 53 79 73 74 65 6d 2e 49 4f 3b 0a 75 73 69 6e 67 20 4e 55 6e 69 74 2e 46 72 .using.System.IO;.using.NUnit.Fr
1100 61 6d 65 77 6f 72 6b 3b 0a 75 73 69 6e 67 20 55 6e 69 74 79 45 64 69 74 6f 72 3b 0a 75 73 69 6e amework;.using.UnityEditor;.usin
1120 67 20 55 6e 69 74 79 45 6e 67 69 6e 65 3b 0a 75 73 69 6e 67 20 55 6e 69 74 79 45 6e 67 69 6e 65 g.UnityEngine;.using.UnityEngine
1140 2e 55 49 3b 0a 75 73 69 6e 67 20 55 6e 69 74 79 45 6e 67 69 6e 65 2e 45 76 65 6e 74 53 79 73 74 .UI;.using.UnityEngine.EventSyst
1160 65 6d 73 3b 0a 75 73 69 6e 67 20 55 6e 69 74 79 45 6e 67 69 6e 65 2e 54 65 73 74 54 6f 6f 6c 73 ems;.using.UnityEngine.TestTools
1180 3b 0a 75 73 69 6e 67 20 53 79 73 74 65 6d 2e 52 75 6e 74 69 6d 65 2e 43 6f 6d 70 69 6c 65 72 53 ;.using.System.Runtime.CompilerS
11a0 65 72 76 69 63 65 73 3b 0a 0a 70 75 62 6c 69 63 20 63 6c 61 73 73 20 53 63 72 6f 6c 6c 52 65 63 ervices;..public.class.ScrollRec
11c0 74 54 65 73 74 73 20 3a 20 49 50 72 65 62 75 69 6c 64 53 65 74 75 70 0a 7b 0a 20 20 20 20 63 6f tTests.:.IPrebuildSetup.{.....co
11e0 6e 73 74 20 69 6e 74 20 53 63 72 6f 6c 6c 53 65 6e 73 69 74 69 76 69 74 79 20 3d 20 33 3b 0a 20 nst.int.ScrollSensitivity.=.3;..
1200 20 20 20 47 61 6d 65 4f 62 6a 65 63 74 20 6d 5f 50 72 65 66 61 62 52 6f 6f 74 3b 0a 20 20 20 20 ...GameObject.m_PrefabRoot;.....
1220 63 6f 6e 73 74 20 73 74 72 69 6e 67 20 6b 50 72 65 66 61 62 50 61 74 68 20 3d 20 22 41 73 73 65 const.string.kPrefabPath.=."Asse
1240 74 73 2f 52 65 73 6f 75 72 63 65 73 2f 53 63 72 6f 6c 6c 52 65 63 74 50 72 65 66 61 62 2e 70 72 ts/Resources/ScrollRectPrefab.pr
1260 65 66 61 62 22 3b 0a 0a 20 20 20 20 70 75 62 6c 69 63 20 76 6f 69 64 20 53 65 74 75 70 28 29 0a efab";......public.void.Setup().
1280 20 20 20 20 7b 0a 23 69 66 20 55 4e 49 54 59 5f 45 44 49 54 4f 52 0a 20 20 20 20 20 20 20 20 76 ....{.#if.UNITY_EDITOR.........v
12a0 61 72 20 72 6f 6f 74 47 4f 20 3d 20 6e 65 77 20 47 61 6d 65 4f 62 6a 65 63 74 28 22 72 6f 6f 74 ar.rootGO.=.new.GameObject("root
12c0 47 6f 22 29 3b 0a 20 20 20 20 20 20 20 20 47 61 6d 65 4f 62 6a 65 63 74 20 65 76 65 6e 74 53 79 Go");.........GameObject.eventSy
12e0 73 74 65 6d 47 4f 20 3d 20 6e 65 77 20 47 61 6d 65 4f 62 6a 65 63 74 28 22 45 76 65 6e 74 53 79 stemGO.=.new.GameObject("EventSy
1300 73 74 65 6d 22 2c 20 74 79 70 65 6f 66 28 45 76 65 6e 74 53 79 73 74 65 6d 29 29 3b 0a 20 20 20 stem",.typeof(EventSystem));....
1320 20 20 20 20 20 65 76 65 6e 74 53 79 73 74 65 6d 47 4f 2e 74 72 61 6e 73 66 6f 72 6d 2e 53 65 74 .....eventSystemGO.transform.Set
1340 50 61 72 65 6e 74 28 72 6f 6f 74 47 4f 2e 74 72 61 6e 73 66 6f 72 6d 29 3b 0a 0a 20 20 20 20 20 Parent(rootGO.transform);.......
1360 20 20 20 76 61 72 20 63 61 6e 76 61 73 47 4f 20 3d 20 6e 65 77 20 47 61 6d 65 4f 62 6a 65 63 74 ...var.canvasGO.=.new.GameObject
1380 28 22 43 61 6e 76 61 73 22 2c 20 74 79 70 65 6f 66 28 43 61 6e 76 61 73 29 29 3b 0a 20 20 20 20 ("Canvas",.typeof(Canvas));.....
13a0 20 20 20 20 63 61 6e 76 61 73 47 4f 2e 74 72 61 6e 73 66 6f 72 6d 2e 53 65 74 50 61 72 65 6e 74 ....canvasGO.transform.SetParent
13c0 28 72 6f 6f 74 47 4f 2e 74 72 61 6e 73 66 6f 72 6d 29 3b 0a 20 20 20 20 20 20 20 20 76 61 72 20 (rootGO.transform);.........var.
13e0 63 61 6e 76 61 73 20 3d 20 63 61 6e 76 61 73 47 4f 2e 47 65 74 43 6f 6d 70 6f 6e 65 6e 74 3c 43 canvas.=.canvasGO.GetComponent<C
1400 61 6e 76 61 73 3e 28 29 3b 0a 20 20 20 20 20 20 20 20 63 61 6e 76 61 73 2e 72 65 66 65 72 65 6e anvas>();.........canvas.referen
1420 63 65 50 69 78 65 6c 73 50 65 72 55 6e 69 74 20 3d 20 31 30 30 3b 0a 0a 20 20 20 20 20 20 20 20 cePixelsPerUnit.=.100;..........
1440 47 61 6d 65 4f 62 6a 65 63 74 20 73 63 72 6f 6c 6c 52 65 63 74 47 4f 20 3d 20 6e 65 77 20 47 61 GameObject.scrollRectGO.=.new.Ga
1460 6d 65 4f 62 6a 65 63 74 28 22 53 63 72 6f 6c 6c 52 65 63 74 22 2c 20 74 79 70 65 6f 66 28 52 65 meObject("ScrollRect",.typeof(Re
1480 63 74 54 72 61 6e 73 66 6f 72 6d 29 2c 20 74 79 70 65 6f 66 28 53 63 72 6f 6c 6c 52 65 63 74 29 ctTransform),.typeof(ScrollRect)
14a0 29 3b 0a 20 20 20 20 20 20 20 20 73 63 72 6f 6c 6c 52 65 63 74 47 4f 2e 74 72 61 6e 73 66 6f 72 );.........scrollRectGO.transfor
14c0 6d 2e 53 65 74 50 61 72 65 6e 74 28 63 61 6e 76 61 73 47 4f 2e 74 72 61 6e 73 66 6f 72 6d 29 3b m.SetParent(canvasGO.transform);
14e0 0a 0a 20 20 20 20 20 20 20 20 47 61 6d 65 4f 62 6a 65 63 74 20 63 6f 6e 74 65 6e 74 47 4f 20 3d ..........GameObject.contentGO.=
1500 20 6e 65 77 20 47 61 6d 65 4f 62 6a 65 63 74 28 22 43 6f 6e 74 65 6e 74 22 2c 20 74 79 70 65 6f .new.GameObject("Content",.typeo
1520 66 28 52 65 63 74 54 72 61 6e 73 66 6f 72 6d 29 29 3b 0a 20 20 20 20 20 20 20 20 63 6f 6e 74 65 f(RectTransform));.........conte
1540 6e 74 47 4f 2e 74 72 61 6e 73 66 6f 72 6d 2e 53 65 74 50 61 72 65 6e 74 28 73 63 72 6f 6c 6c 52 ntGO.transform.SetParent(scrollR
1560 65 63 74 47 4f 2e 74 72 61 6e 73 66 6f 72 6d 29 3b 0a 0a 20 20 20 20 20 20 20 20 47 61 6d 65 4f ectGO.transform);..........GameO
1580 62 6a 65 63 74 20 68 6f 72 69 7a 6f 6e 74 61 6c 53 63 72 6f 6c 6c 42 61 72 47 4f 20 3d 20 6e 65 bject.horizontalScrollBarGO.=.ne
15a0 77 20 47 61 6d 65 4f 62 6a 65 63 74 28 22 48 6f 72 69 7a 6f 6e 74 61 6c 53 63 72 6f 6c 6c 42 61 w.GameObject("HorizontalScrollBa
15c0 72 22 2c 20 74 79 70 65 6f 66 28 53 63 72 6f 6c 6c 62 61 72 29 29 3b 0a 20 20 20 20 20 20 20 20 r",.typeof(Scrollbar));.........
15e0 68 6f 72 69 7a 6f 6e 74 61 6c 53 63 72 6f 6c 6c 42 61 72 47 4f 2e 74 72 61 6e 73 66 6f 72 6d 2e horizontalScrollBarGO.transform.
1600 53 65 74 50 61 72 65 6e 74 28 73 63 72 6f 6c 6c 52 65 63 74 47 4f 2e 74 72 61 6e 73 66 6f 72 6d SetParent(scrollRectGO.transform
1620 29 3b 0a 0a 20 20 20 20 20 20 20 20 47 61 6d 65 4f 62 6a 65 63 74 20 76 65 72 74 69 63 61 6c 53 );..........GameObject.verticalS
1640 63 72 6f 6c 6c 42 61 72 47 4f 20 3d 20 6e 65 77 20 47 61 6d 65 4f 62 6a 65 63 74 28 22 56 65 72 crollBarGO.=.new.GameObject("Ver
1660 74 69 63 61 6c 53 63 72 6f 6c 6c 42 61 72 22 2c 20 74 79 70 65 6f 66 28 53 63 72 6f 6c 6c 62 61 ticalScrollBar",.typeof(Scrollba
1680 72 29 29 3b 0a 20 20 20 20 20 20 20 20 76 65 72 74 69 63 61 6c 53 63 72 6f 6c 6c 42 61 72 47 4f r));.........verticalScrollBarGO
16a0 2e 74 72 61 6e 73 66 6f 72 6d 2e 53 65 74 50 61 72 65 6e 74 28 73 63 72 6f 6c 6c 52 65 63 74 47 .transform.SetParent(scrollRectG
16c0 4f 2e 74 72 61 6e 73 66 6f 72 6d 29 3b 0a 0a 20 20 20 20 20 20 20 20 53 63 72 6f 6c 6c 52 65 63 O.transform);..........ScrollRec
16e0 74 20 73 63 72 6f 6c 6c 52 65 63 74 20 3d 20 73 63 72 6f 6c 6c 52 65 63 74 47 4f 2e 47 65 74 43 t.scrollRect.=.scrollRectGO.GetC
1700 6f 6d 70 6f 6e 65 6e 74 3c 53 63 72 6f 6c 6c 52 65 63 74 3e 28 29 3b 0a 20 20 20 20 20 20 20 20 omponent<ScrollRect>();.........
1720 73 63 72 6f 6c 6c 52 65 63 74 2e 74 72 61 6e 73 66 6f 72 6d 2e 70 6f 73 69 74 69 6f 6e 20 3d 20 scrollRect.transform.position.=.
1740 56 65 63 74 6f 72 33 2e 7a 65 72 6f 3b 0a 20 20 20 20 20 20 20 20 73 63 72 6f 6c 6c 52 65 63 74 Vector3.zero;.........scrollRect
1760 2e 74 72 61 6e 73 66 6f 72 6d 2e 72 6f 74 61 74 69 6f 6e 20 3d 20 51 75 61 74 65 72 6e 69 6f 6e .transform.rotation.=.Quaternion
1780 2e 69 64 65 6e 74 69 74 79 3b 0a 20 20 20 20 20 20 20 20 73 63 72 6f 6c 6c 52 65 63 74 2e 74 72 .identity;.........scrollRect.tr
17a0 61 6e 73 66 6f 72 6d 2e 6c 6f 63 61 6c 53 63 61 6c 65 20 3d 20 56 65 63 74 6f 72 33 2e 6f 6e 65 ansform.localScale.=.Vector3.one
17c0 3b 0a 20 20 20 20 20 20 20 20 28 73 63 72 6f 6c 6c 52 65 63 74 2e 74 72 61 6e 73 66 6f 72 6d 20 ;.........(scrollRect.transform.
17e0 61 73 20 52 65 63 74 54 72 61 6e 73 66 6f 72 6d 29 2e 73 69 7a 65 44 65 6c 74 61 20 3d 20 6e 65 as.RectTransform).sizeDelta.=.ne
1800 77 20 56 65 63 74 6f 72 33 28 30 2e 35 66 2c 20 30 2e 35 66 29 3b 0a 20 20 20 20 20 20 20 20 73 w.Vector3(0.5f,.0.5f);.........s
1820 63 72 6f 6c 6c 52 65 63 74 2e 68 6f 72 69 7a 6f 6e 74 61 6c 53 63 72 6f 6c 6c 62 61 72 20 3d 20 crollRect.horizontalScrollbar.=.
1840 68 6f 72 69 7a 6f 6e 74 61 6c 53 63 72 6f 6c 6c 42 61 72 47 4f 2e 47 65 74 43 6f 6d 70 6f 6e 65 horizontalScrollBarGO.GetCompone
1860 6e 74 3c 53 63 72 6f 6c 6c 62 61 72 3e 28 29 3b 0a 20 20 20 20 20 20 20 20 73 63 72 6f 6c 6c 52 nt<Scrollbar>();.........scrollR
1880 65 63 74 2e 76 65 72 74 69 63 61 6c 53 63 72 6f 6c 6c 62 61 72 20 3d 20 76 65 72 74 69 63 61 6c ect.verticalScrollbar.=.vertical
18a0 53 63 72 6f 6c 6c 42 61 72 47 4f 2e 47 65 74 43 6f 6d 70 6f 6e 65 6e 74 3c 53 63 72 6f 6c 6c 62 ScrollBarGO.GetComponent<Scrollb
18c0 61 72 3e 28 29 3b 0a 20 20 20 20 20 20 20 20 73 63 72 6f 6c 6c 52 65 63 74 2e 63 6f 6e 74 65 6e ar>();.........scrollRect.conten
18e0 74 20 3d 20 63 6f 6e 74 65 6e 74 47 4f 2e 47 65 74 43 6f 6d 70 6f 6e 65 6e 74 3c 52 65 63 74 54 t.=.contentGO.GetComponent<RectT
1900 72 61 6e 73 66 6f 72 6d 3e 28 29 3b 0a 20 20 20 20 20 20 20 20 73 63 72 6f 6c 6c 52 65 63 74 2e ransform>();.........scrollRect.
1920 63 6f 6e 74 65 6e 74 2e 61 6e 63 68 6f 72 65 64 50 6f 73 69 74 69 6f 6e 20 3d 20 56 65 63 74 6f content.anchoredPosition.=.Vecto
1940 72 32 2e 7a 65 72 6f 3b 0a 20 20 20 20 20 20 20 20 73 63 72 6f 6c 6c 52 65 63 74 2e 63 6f 6e 74 r2.zero;.........scrollRect.cont
1960 65 6e 74 2e 73 69 7a 65 44 65 6c 74 61 20 3d 20 6e 65 77 20 56 65 63 74 6f 72 32 28 33 2c 20 33 ent.sizeDelta.=.new.Vector2(3,.3
1980 29 3b 0a 20 20 20 20 20 20 20 20 73 63 72 6f 6c 6c 52 65 63 74 2e 73 63 72 6f 6c 6c 53 65 6e 73 );.........scrollRect.scrollSens
19a0 69 74 69 76 69 74 79 20 3d 20 53 63 72 6f 6c 6c 53 65 6e 73 69 74 69 76 69 74 79 3b 0a 20 20 20 itivity.=.ScrollSensitivity;....
19c0 20 20 20 20 20 73 63 72 6f 6c 6c 52 65 63 74 2e 47 65 74 43 6f 6d 70 6f 6e 65 6e 74 3c 52 65 63 .....scrollRect.GetComponent<Rec
19e0 74 54 72 61 6e 73 66 6f 72 6d 3e 28 29 2e 73 69 7a 65 44 65 6c 74 61 20 3d 20 6e 65 77 20 56 65 tTransform>().sizeDelta.=.new.Ve
1a00 63 74 6f 72 32 28 31 2c 20 31 29 3b 0a 0a 20 20 20 20 20 20 20 20 69 66 20 28 21 44 69 72 65 63 ctor2(1,.1);..........if.(!Direc
1a20 74 6f 72 79 2e 45 78 69 73 74 73 28 22 41 73 73 65 74 73 2f 52 65 73 6f 75 72 63 65 73 2f 22 29 tory.Exists("Assets/Resources/")
1a40 29 0a 20 20 20 20 20 20 20 20 20 20 20 20 44 69 72 65 63 74 6f 72 79 2e 43 72 65 61 74 65 44 69 ).............Directory.CreateDi
1a60 72 65 63 74 6f 72 79 28 22 41 73 73 65 74 73 2f 52 65 73 6f 75 72 63 65 73 2f 22 29 3b 0a 0a 20 rectory("Assets/Resources/");...
1a80 20 20 20 20 20 20 20 50 72 65 66 61 62 55 74 69 6c 69 74 79 2e 53 61 76 65 41 73 50 72 65 66 61 .......PrefabUtility.SaveAsPrefa
1aa0 62 41 73 73 65 74 28 72 6f 6f 74 47 4f 2c 20 6b 50 72 65 66 61 62 50 61 74 68 29 3b 0a 20 20 20 bAsset(rootGO,.kPrefabPath);....
1ac0 20 20 20 20 20 47 61 6d 65 4f 62 6a 65 63 74 2e 44 65 73 74 72 6f 79 49 6d 6d 65 64 69 61 74 65 .....GameObject.DestroyImmediate
1ae0 28 72 6f 6f 74 47 4f 29 3b 0a 23 65 6e 64 69 66 0a 20 20 20 20 7d 0a 0a 20 20 20 20 5b 53 65 74 (rootGO);.#endif.....}......[Set
1b00 55 70 5d 0a 20 20 20 20 70 75 62 6c 69 63 20 76 6f 69 64 20 54 65 73 74 53 65 74 75 70 28 29 0a Up].....public.void.TestSetup().
1b20 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 6d 5f 50 72 65 66 61 62 52 6f 6f 74 20 3d 20 55 6e 69 ....{.........m_PrefabRoot.=.Uni
1b40 74 79 45 6e 67 69 6e 65 2e 4f 62 6a 65 63 74 2e 49 6e 73 74 61 6e 74 69 61 74 65 28 52 65 73 6f tyEngine.Object.Instantiate(Reso
1b60 75 72 63 65 73 2e 4c 6f 61 64 28 22 53 63 72 6f 6c 6c 52 65 63 74 50 72 65 66 61 62 22 29 29 20 urces.Load("ScrollRectPrefab")).
1b80 61 73 20 47 61 6d 65 4f 62 6a 65 63 74 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 5b 54 65 61 72 44 as.GameObject;.....}......[TearD
1ba0 6f 77 6e 5d 0a 20 20 20 20 70 75 62 6c 69 63 20 76 6f 69 64 20 54 65 61 72 44 6f 77 6e 28 29 0a own].....public.void.TearDown().
1bc0 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 45 76 65 6e 74 53 79 73 74 65 6d 2e 63 75 72 72 65 6e ....{.........EventSystem.curren
1be0 74 20 3d 20 6e 75 6c 6c 3b 0a 20 20 20 20 20 20 20 20 47 61 6d 65 4f 62 6a 65 63 74 2e 44 65 73 t.=.null;.........GameObject.Des
1c00 74 72 6f 79 49 6d 6d 65 64 69 61 74 65 28 6d 5f 50 72 65 66 61 62 52 6f 6f 74 29 3b 0a 20 20 20 troyImmediate(m_PrefabRoot);....
1c20 20 7d 0a 0a 20 20 20 20 5b 4f 6e 65 54 69 6d 65 54 65 61 72 44 6f 77 6e 5d 0a 20 20 20 20 70 75 .}......[OneTimeTearDown].....pu
1c40 62 6c 69 63 20 76 6f 69 64 20 4f 6e 65 54 69 6d 65 54 65 61 72 44 6f 77 6e 28 29 0a 20 20 20 20 blic.void.OneTimeTearDown().....
1c60 7b 0a 23 69 66 20 55 4e 49 54 59 5f 45 44 49 54 4f 52 0a 20 20 20 20 20 20 20 20 41 73 73 65 74 {.#if.UNITY_EDITOR.........Asset
1c80 44 61 74 61 62 61 73 65 2e 44 65 6c 65 74 65 41 73 73 65 74 28 6b 50 72 65 66 61 62 50 61 74 68 Database.DeleteAsset(kPrefabPath
1ca0 29 3b 0a 23 65 6e 64 69 66 0a 20 20 20 20 7d 0a 0a 20 20 20 20 23 72 65 67 69 6f 6e 20 45 6e 61 );.#endif.....}......#region.Ena
1cc0 62 6c 65 20 64 69 73 61 62 6c 65 20 73 63 72 6f 6c 6c 62 61 72 73 0a 0a 20 20 20 20 5b 55 6e 69 ble.disable.scrollbars......[Uni
1ce0 74 79 54 65 73 74 5d 0a 20 20 20 20 5b 54 65 73 74 43 61 73 65 28 74 72 75 65 2c 20 45 78 70 65 tyTest].....[TestCase(true,.Expe
1d00 63 74 65 64 52 65 73 75 6c 74 20 3d 20 6e 75 6c 6c 29 5d 0a 20 20 20 20 5b 54 65 73 74 43 61 73 ctedResult.=.null)].....[TestCas
1d20 65 28 66 61 6c 73 65 2c 20 45 78 70 65 63 74 65 64 52 65 73 75 6c 74 20 3d 20 6e 75 6c 6c 29 5d e(false,.ExpectedResult.=.null)]
1d40 0a 20 20 20 20 70 75 62 6c 69 63 20 49 45 6e 75 6d 65 72 61 74 6f 72 20 4f 6e 45 6e 61 62 6c 65 .....public.IEnumerator.OnEnable
1d60 53 68 6f 75 6c 64 41 64 64 4c 69 73 74 65 6e 65 72 73 28 62 6f 6f 6c 20 69 73 48 6f 72 69 7a 6f ShouldAddListeners(bool.isHorizo
1d80 6e 74 61 6c 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 53 63 72 6f 6c 6c 52 65 63 74 20 73 ntal).....{.........ScrollRect.s
1da0 63 72 6f 6c 6c 52 65 63 74 20 3d 20 6d 5f 50 72 65 66 61 62 52 6f 6f 74 2e 47 65 74 43 6f 6d 70 crollRect.=.m_PrefabRoot.GetComp
1dc0 6f 6e 65 6e 74 49 6e 43 68 69 6c 64 72 65 6e 3c 53 63 72 6f 6c 6c 52 65 63 74 3e 28 29 3b 0a 20 onentInChildren<ScrollRect>();..
1de0 20 20 20 20 20 20 20 53 63 72 6f 6c 6c 62 61 72 20 73 63 72 6f 6c 6c 62 61 72 20 3d 20 69 73 48 .......Scrollbar.scrollbar.=.isH
1e00 6f 72 69 7a 6f 6e 74 61 6c 20 3f 20 73 63 72 6f 6c 6c 52 65 63 74 2e 68 6f 72 69 7a 6f 6e 74 61 orizontal.?.scrollRect.horizonta
1e20 6c 53 63 72 6f 6c 6c 62 61 72 20 3a 20 73 63 72 6f 6c 6c 52 65 63 74 2e 76 65 72 74 69 63 61 6c lScrollbar.:.scrollRect.vertical
1e40 53 63 72 6f 6c 6c 62 61 72 3b 0a 0a 20 20 20 20 20 20 20 20 73 63 72 6f 6c 6c 52 65 63 74 2e 65 Scrollbar;..........scrollRect.e
1e60 6e 61 62 6c 65 64 20 3d 20 66 61 6c 73 65 3b 0a 0a 20 20 20 20 20 20 20 20 79 69 65 6c 64 20 72 nabled.=.false;..........yield.r
1e80 65 74 75 72 6e 20 6e 75 6c 6c 3b 0a 0a 20 20 20 20 20 20 20 20 46 69 65 6c 64 49 6e 66 6f 20 66 eturn.null;..........FieldInfo.f
1ea0 69 65 6c 64 20 3d 20 73 63 72 6f 6c 6c 62 61 72 2e 6f 6e 56 61 6c 75 65 43 68 61 6e 67 65 64 2e ield.=.scrollbar.onValueChanged.
1ec0 47 65 74 54 79 70 65 28 29 2e 42 61 73 65 54 79 70 65 2e 42 61 73 65 54 79 70 65 2e 47 65 74 46 GetType().BaseType.BaseType.GetF
1ee0 69 65 6c 64 28 22 6d 5f 43 61 6c 6c 73 22 2c 20 42 69 6e 64 69 6e 67 46 6c 61 67 73 2e 4e 6f 6e ield("m_Calls",.BindingFlags.Non
1f00 50 75 62 6c 69 63 20 7c 20 42 69 6e 64 69 6e 67 46 6c 61 67 73 2e 49 6e 73 74 61 6e 63 65 29 3b Public.|.BindingFlags.Instance);
1f20 0a 20 20 20 20 20 20 20 20 6f 62 6a 65 63 74 20 69 6e 76 6f 6b 65 61 62 6c 65 43 61 6c 6c 4c 69 .........object.invokeableCallLi
1f40 73 74 20 3d 20 66 69 65 6c 64 2e 47 65 74 56 61 6c 75 65 28 73 63 72 6f 6c 6c 62 61 72 2e 6f 6e st.=.field.GetValue(scrollbar.on
1f60 56 61 6c 75 65 43 68 61 6e 67 65 64 29 3b 0a 20 20 20 20 20 20 20 20 50 72 6f 70 65 72 74 79 49 ValueChanged);.........PropertyI
1f80 6e 66 6f 20 70 72 6f 70 65 72 74 79 20 3d 20 69 6e 76 6f 6b 65 61 62 6c 65 43 61 6c 6c 4c 69 73 nfo.property.=.invokeableCallLis
1fa0 74 2e 47 65 74 54 79 70 65 28 29 2e 47 65 74 50 72 6f 70 65 72 74 79 28 22 43 6f 75 6e 74 22 2c t.GetType().GetProperty("Count",
1fc0 20 42 69 6e 64 69 6e 67 46 6c 61 67 73 2e 50 75 62 6c 69 63 20 7c 20 42 69 6e 64 69 6e 67 46 6c .BindingFlags.Public.|.BindingFl
1fe0 61 67 73 2e 49 6e 73 74 61 6e 63 65 29 3b 0a 0a 20 20 20 20 20 20 20 20 69 6e 74 20 63 61 6c 6c ags.Instance);..........int.call
2000 43 6f 75 6e 74 20 3d 20 28 69 6e 74 29 70 72 6f 70 65 72 74 79 2e 47 65 74 56 61 6c 75 65 28 69 Count.=.(int)property.GetValue(i
2020 6e 76 6f 6b 65 61 62 6c 65 43 61 6c 6c 4c 69 73 74 2c 20 6e 75 6c 6c 29 3b 0a 0a 20 20 20 20 20 nvokeableCallList,.null);.......
2040 20 20 20 73 63 72 6f 6c 6c 52 65 63 74 2e 65 6e 61 62 6c 65 64 20 3d 20 74 72 75 65 3b 0a 0a 20 ...scrollRect.enabled.=.true;...
2060 20 20 20 20 20 20 20 79 69 65 6c 64 20 72 65 74 75 72 6e 20 6e 75 6c 6c 3b 0a 20 20 20 20 20 20 .......yield.return.null;.......
2080 20 20 41 73 73 65 72 74 2e 41 72 65 45 71 75 61 6c 28 63 61 6c 6c 43 6f 75 6e 74 20 2b 20 31 2c ..Assert.AreEqual(callCount.+.1,
20a0 20 28 69 6e 74 29 70 72 6f 70 65 72 74 79 2e 47 65 74 56 61 6c 75 65 28 69 6e 76 6f 6b 65 61 62 .(int)property.GetValue(invokeab
20c0 6c 65 43 61 6c 6c 4c 69 73 74 2c 20 6e 75 6c 6c 29 29 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 5b leCallList,.null));.....}......[
20e0 55 6e 69 74 79 54 65 73 74 5d 0a 20 20 20 20 5b 54 65 73 74 43 61 73 65 28 74 72 75 65 2c 20 45 UnityTest].....[TestCase(true,.E
2100 78 70 65 63 74 65 64 52 65 73 75 6c 74 20 3d 20 6e 75 6c 6c 29 5d 0a 20 20 20 20 5b 54 65 73 74 xpectedResult.=.null)].....[Test
2120 43 61 73 65 28 66 61 6c 73 65 2c 20 45 78 70 65 63 74 65 64 52 65 73 75 6c 74 20 3d 20 6e 75 6c Case(false,.ExpectedResult.=.nul
2140 6c 29 5d 0a 20 20 20 20 70 75 62 6c 69 63 20 49 45 6e 75 6d 65 72 61 74 6f 72 20 4f 6e 44 69 73 l)].....public.IEnumerator.OnDis
2160 61 62 6c 65 53 68 6f 75 6c 64 52 65 6d 6f 76 65 4c 69 73 74 65 6e 65 72 73 28 62 6f 6f 6c 20 69 ableShouldRemoveListeners(bool.i
2180 73 48 6f 72 69 7a 6f 6e 74 61 6c 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 53 63 72 6f 6c sHorizontal).....{.........Scrol
21a0 6c 52 65 63 74 20 73 63 72 6f 6c 6c 52 65 63 74 20 3d 20 6d 5f 50 72 65 66 61 62 52 6f 6f 74 2e lRect.scrollRect.=.m_PrefabRoot.
21c0 47 65 74 43 6f 6d 70 6f 6e 65 6e 74 49 6e 43 68 69 6c 64 72 65 6e 3c 53 63 72 6f 6c 6c 52 65 63 GetComponentInChildren<ScrollRec
21e0 74 3e 28 29 3b 0a 20 20 20 20 20 20 20 20 53 63 72 6f 6c 6c 62 61 72 20 73 63 72 6f 6c 6c 62 61 t>();.........Scrollbar.scrollba
2200 72 20 3d 20 69 73 48 6f 72 69 7a 6f 6e 74 61 6c 20 3f 20 73 63 72 6f 6c 6c 52 65 63 74 2e 68 6f r.=.isHorizontal.?.scrollRect.ho
2220 72 69 7a 6f 6e 74 61 6c 53 63 72 6f 6c 6c 62 61 72 20 3a 20 73 63 72 6f 6c 6c 52 65 63 74 2e 76 rizontalScrollbar.:.scrollRect.v
2240 65 72 74 69 63 61 6c 53 63 72 6f 6c 6c 62 61 72 3b 0a 0a 20 20 20 20 20 20 20 20 73 63 72 6f 6c erticalScrollbar;..........scrol
2260 6c 52 65 63 74 2e 65 6e 61 62 6c 65 64 20 3d 20 74 72 75 65 3b 0a 20 20 20 20 20 20 20 20 79 69 lRect.enabled.=.true;.........yi
2280 65 6c 64 20 72 65 74 75 72 6e 20 6e 75 6c 6c 3b 0a 0a 20 20 20 20 20 20 20 20 46 69 65 6c 64 49 eld.return.null;..........FieldI
22a0 6e 66 6f 20 66 69 65 6c 64 20 3d 20 73 63 72 6f 6c 6c 62 61 72 2e 6f 6e 56 61 6c 75 65 43 68 61 nfo.field.=.scrollbar.onValueCha
22c0 6e 67 65 64 2e 47 65 74 54 79 70 65 28 29 2e 42 61 73 65 54 79 70 65 2e 42 61 73 65 54 79 70 65 nged.GetType().BaseType.BaseType
22e0 2e 47 65 74 46 69 65 6c 64 28 22 6d 5f 43 61 6c 6c 73 22 2c 20 42 69 6e 64 69 6e 67 46 6c 61 67 .GetField("m_Calls",.BindingFlag
2300 73 2e 4e 6f 6e 50 75 62 6c 69 63 20 7c 20 42 69 6e 64 69 6e 67 46 6c 61 67 73 2e 49 6e 73 74 61 s.NonPublic.|.BindingFlags.Insta
2320 6e 63 65 29 3b 0a 20 20 20 20 20 20 20 20 6f 62 6a 65 63 74 20 69 6e 76 6f 6b 65 61 62 6c 65 43 nce);.........object.invokeableC
2340 61 6c 6c 4c 69 73 74 20 3d 20 66 69 65 6c 64 2e 47 65 74 56 61 6c 75 65 28 73 63 72 6f 6c 6c 62 allList.=.field.GetValue(scrollb
2360 61 72 2e 6f 6e 56 61 6c 75 65 43 68 61 6e 67 65 64 29 3b 0a 20 20 20 20 20 20 20 20 50 72 6f 70 ar.onValueChanged);.........Prop
2380 65 72 74 79 49 6e 66 6f 20 70 72 6f 70 65 72 74 79 20 3d 20 69 6e 76 6f 6b 65 61 62 6c 65 43 61 ertyInfo.property.=.invokeableCa
23a0 6c 6c 4c 69 73 74 2e 47 65 74 54 79 70 65 28 29 2e 47 65 74 50 72 6f 70 65 72 74 79 28 22 43 6f llList.GetType().GetProperty("Co
23c0 75 6e 74 22 2c 20 42 69 6e 64 69 6e 67 46 6c 61 67 73 2e 50 75 62 6c 69 63 20 7c 20 42 69 6e 64 unt",.BindingFlags.Public.|.Bind
23e0 69 6e 67 46 6c 61 67 73 2e 49 6e 73 74 61 6e 63 65 29 3b 0a 0a 20 20 20 20 20 20 20 20 41 73 73 ingFlags.Instance);..........Ass
2400 65 72 74 2e 41 72 65 4e 6f 74 45 71 75 61 6c 28 30 2c 20 28 69 6e 74 29 70 72 6f 70 65 72 74 79 ert.AreNotEqual(0,.(int)property
2420 2e 47 65 74 56 61 6c 75 65 28 69 6e 76 6f 6b 65 61 62 6c 65 43 61 6c 6c 4c 69 73 74 2c 20 6e 75 .GetValue(invokeableCallList,.nu
2440 6c 6c 29 29 3b 0a 0a 20 20 20 20 20 20 20 20 73 63 72 6f 6c 6c 52 65 63 74 2e 65 6e 61 62 6c 65 ll));..........scrollRect.enable
2460 64 20 3d 20 66 61 6c 73 65 3b 0a 20 20 20 20 20 20 20 20 79 69 65 6c 64 20 72 65 74 75 72 6e 20 d.=.false;.........yield.return.
2480 6e 75 6c 6c 3b 0a 20 20 20 20 20 20 20 20 41 73 73 65 72 74 2e 41 72 65 45 71 75 61 6c 28 30 2c null;.........Assert.AreEqual(0,
24a0 20 28 69 6e 74 29 70 72 6f 70 65 72 74 79 2e 47 65 74 56 61 6c 75 65 28 69 6e 76 6f 6b 65 61 62 .(int)property.GetValue(invokeab
24c0 6c 65 43 61 6c 6c 4c 69 73 74 2c 20 6e 75 6c 6c 29 29 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 5b leCallList,.null));.....}......[
24e0 54 65 73 74 5d 0a 20 20 20 20 5b 54 65 73 74 43 61 73 65 28 74 72 75 65 29 5d 0a 20 20 20 20 5b Test].....[TestCase(true)].....[
2500 54 65 73 74 43 61 73 65 28 66 61 6c 73 65 29 5d 0a 20 20 20 20 70 75 62 6c 69 63 20 76 6f 69 64 TestCase(false)].....public.void
2520 20 53 65 74 74 69 6e 67 53 63 72 6f 6c 6c 62 61 72 53 68 6f 75 6c 64 52 65 6d 6f 76 65 54 68 65 .SettingScrollbarShouldRemoveThe
2540 6e 41 64 64 4c 69 73 74 65 6e 65 72 73 28 62 6f 6f 6c 20 74 65 73 74 48 6f 72 69 7a 6f 6e 74 61 nAddListeners(bool.testHorizonta
2560 6c 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 53 63 72 6f 6c 6c 52 65 63 74 20 73 63 72 6f l).....{.........ScrollRect.scro
2580 6c 6c 52 65 63 74 20 3d 20 6d 5f 50 72 65 66 61 62 52 6f 6f 74 2e 47 65 74 43 6f 6d 70 6f 6e 65 llRect.=.m_PrefabRoot.GetCompone
25a0 6e 74 49 6e 43 68 69 6c 64 72 65 6e 3c 53 63 72 6f 6c 6c 52 65 63 74 3e 28 29 3b 0a 20 20 20 20 ntInChildren<ScrollRect>();.....
25c0 20 20 20 20 53 63 72 6f 6c 6c 62 61 72 20 73 63 72 6f 6c 6c 62 61 72 20 3d 20 74 65 73 74 48 6f ....Scrollbar.scrollbar.=.testHo
25e0 72 69 7a 6f 6e 74 61 6c 20 3f 20 73 63 72 6f 6c 6c 52 65 63 74 2e 68 6f 72 69 7a 6f 6e 74 61 6c rizontal.?.scrollRect.horizontal
2600 53 63 72 6f 6c 6c 62 61 72 20 3a 20 73 63 72 6f 6c 6c 52 65 63 74 2e 76 65 72 74 69 63 61 6c 53 Scrollbar.:.scrollRect.verticalS
2620 63 72 6f 6c 6c 62 61 72 3b 0a 0a 20 20 20 20 20 20 20 20 47 61 6d 65 4f 62 6a 65 63 74 20 73 63 crollbar;..........GameObject.sc
2640 72 6f 6c 6c 42 61 72 47 4f 20 3d 20 6e 65 77 20 47 61 6d 65 4f 62 6a 65 63 74 28 22 73 63 72 6f rollBarGO.=.new.GameObject("scro
2660 6c 6c 42 61 72 22 2c 20 74 79 70 65 6f 66 28 52 65 63 74 54 72 61 6e 73 66 6f 72 6d 29 2c 20 74 llBar",.typeof(RectTransform),.t
2680 79 70 65 6f 66 28 53 63 72 6f 6c 6c 62 61 72 29 29 3b 0a 20 20 20 20 20 20 20 20 73 63 72 6f 6c ypeof(Scrollbar));.........scrol
26a0 6c 42 61 72 47 4f 2e 74 72 61 6e 73 66 6f 72 6d 2e 53 65 74 50 61 72 65 6e 74 28 73 63 72 6f 6c lBarGO.transform.SetParent(scrol
26c0 6c 52 65 63 74 2e 74 72 61 6e 73 66 6f 72 6d 29 3b 0a 20 20 20 20 20 20 20 20 53 63 72 6f 6c 6c lRect.transform);.........Scroll
26e0 62 61 72 20 6e 65 77 53 63 72 6f 6c 6c 62 61 72 20 3d 20 73 63 72 6f 6c 6c 42 61 72 47 4f 2e 47 bar.newScrollbar.=.scrollBarGO.G
2700 65 74 43 6f 6d 70 6f 6e 65 6e 74 3c 53 63 72 6f 6c 6c 62 61 72 3e 28 29 3b 0a 0a 20 20 20 20 20 etComponent<Scrollbar>();.......
2720 20 20 20 46 69 65 6c 64 49 6e 66 6f 20 66 69 65 6c 64 20 3d 20 6e 65 77 53 63 72 6f 6c 6c 62 61 ...FieldInfo.field.=.newScrollba
2740 72 2e 6f 6e 56 61 6c 75 65 43 68 61 6e 67 65 64 2e 47 65 74 54 79 70 65 28 29 2e 42 61 73 65 54 r.onValueChanged.GetType().BaseT
2760 79 70 65 2e 42 61 73 65 54 79 70 65 2e 47 65 74 46 69 65 6c 64 28 22 6d 5f 43 61 6c 6c 73 22 2c ype.BaseType.GetField("m_Calls",
2780 20 42 69 6e 64 69 6e 67 46 6c 61 67 73 2e 4e 6f 6e 50 75 62 6c 69 63 20 7c 20 42 69 6e 64 69 6e .BindingFlags.NonPublic.|.Bindin
27a0 67 46 6c 61 67 73 2e 49 6e 73 74 61 6e 63 65 29 3b 0a 20 20 20 20 20 20 20 20 50 72 6f 70 65 72 gFlags.Instance);.........Proper
27c0 74 79 49 6e 66 6f 20 70 72 6f 70 65 72 74 79 20 3d 20 66 69 65 6c 64 2e 47 65 74 56 61 6c 75 65 tyInfo.property.=.field.GetValue
27e0 28 6e 65 77 53 63 72 6f 6c 6c 62 61 72 2e 6f 6e 56 61 6c 75 65 43 68 61 6e 67 65 64 29 2e 47 65 (newScrollbar.onValueChanged).Ge
2800 74 54 79 70 65 28 29 2e 47 65 74 50 72 6f 70 65 72 74 79 28 22 43 6f 75 6e 74 22 2c 20 42 69 6e tType().GetProperty("Count",.Bin
2820 64 69 6e 67 46 6c 61 67 73 2e 50 75 62 6c 69 63 20 7c 20 42 69 6e 64 69 6e 67 46 6c 61 67 73 2e dingFlags.Public.|.BindingFlags.
2840 49 6e 73 74 61 6e 63 65 29 3b 0a 0a 20 20 20 20 20 20 20 20 69 6e 74 20 6e 65 77 43 61 6c 6c 43 Instance);..........int.newCallC
2860 6f 75 6e 74 20 3d 20 28 69 6e 74 29 70 72 6f 70 65 72 74 79 2e 47 65 74 56 61 6c 75 65 28 66 69 ount.=.(int)property.GetValue(fi
2880 65 6c 64 2e 47 65 74 56 61 6c 75 65 28 6e 65 77 53 63 72 6f 6c 6c 62 61 72 2e 6f 6e 56 61 6c 75 eld.GetValue(newScrollbar.onValu
28a0 65 43 68 61 6e 67 65 64 29 2c 20 6e 75 6c 6c 29 3b 0a 20 20 20 20 20 20 20 20 69 66 20 28 74 65 eChanged),.null);.........if.(te
28c0 73 74 48 6f 72 69 7a 6f 6e 74 61 6c 29 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 63 72 6f 6c 6c stHorizontal).............scroll
28e0 52 65 63 74 2e 68 6f 72 69 7a 6f 6e 74 61 6c 53 63 72 6f 6c 6c 62 61 72 20 3d 20 6e 65 77 53 63 Rect.horizontalScrollbar.=.newSc
2900 72 6f 6c 6c 62 61 72 3b 0a 20 20 20 20 20 20 20 20 65 6c 73 65 0a 20 20 20 20 20 20 20 20 20 20 rollbar;.........else...........
2920 20 20 73 63 72 6f 6c 6c 52 65 63 74 2e 76 65 72 74 69 63 61 6c 53 63 72 6f 6c 6c 62 61 72 20 3d ..scrollRect.verticalScrollbar.=
2940 20 6e 65 77 53 63 72 6f 6c 6c 62 61 72 3b 0a 0a 20 20 20 20 20 20 20 20 41 73 73 65 72 74 2e 41 .newScrollbar;..........Assert.A
2960 72 65 45 71 75 61 6c 28 30 2c 20 28 69 6e 74 29 70 72 6f 70 65 72 74 79 2e 47 65 74 56 61 6c 75 reEqual(0,.(int)property.GetValu
2980 65 28 66 69 65 6c 64 2e 47 65 74 56 61 6c 75 65 28 73 63 72 6f 6c 6c 62 61 72 2e 6f 6e 56 61 6c e(field.GetValue(scrollbar.onVal
29a0 75 65 43 68 61 6e 67 65 64 29 2c 20 6e 75 6c 6c 29 2c 20 22 54 68 65 20 70 72 65 76 69 6f 75 73 ueChanged),.null),."The.previous
29c0 20 73 63 72 6f 6c 6c 62 61 72 20 73 68 6f 75 6c 64 20 6e 6f 74 20 68 61 76 65 20 6c 69 73 74 65 .scrollbar.should.not.have.liste
29e0 6e 65 72 73 20 61 6e 79 6d 6f 72 65 22 29 3b 0a 20 20 20 20 20 20 20 20 41 73 73 65 72 74 2e 41 ners.anymore");.........Assert.A
2a00 72 65 45 71 75 61 6c 28 6e 65 77 43 61 6c 6c 43 6f 75 6e 74 20 2b 20 31 2c 20 28 69 6e 74 29 70 reEqual(newCallCount.+.1,.(int)p
2a20 72 6f 70 65 72 74 79 2e 47 65 74 56 61 6c 75 65 28 66 69 65 6c 64 2e 47 65 74 56 61 6c 75 65 28 roperty.GetValue(field.GetValue(
2a40 6e 65 77 53 63 72 6f 6c 6c 62 61 72 2e 6f 6e 56 61 6c 75 65 43 68 61 6e 67 65 64 29 2c 20 6e 75 newScrollbar.onValueChanged),.nu
2a60 6c 6c 29 2c 20 22 54 68 65 20 6e 65 77 20 73 63 72 6f 6c 6c 62 61 72 20 73 68 6f 75 6c 64 20 68 ll),."The.new.scrollbar.should.h
2a80 61 76 65 20 6c 69 73 74 65 6e 65 72 73 20 6e 6f 77 22 29 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 ave.listeners.now");.....}......
2aa0 23 65 6e 64 72 65 67 69 6f 6e 0a 0a 20 20 20 20 23 72 65 67 69 6f 6e 20 44 72 61 67 0a 0a 20 20 #endregion......#region.Drag....
2ac0 20 20 5b 54 65 73 74 5d 0a 20 20 20 20 5b 54 65 73 74 43 61 73 65 28 50 6f 69 6e 74 65 72 45 76 ..[Test].....[TestCase(PointerEv
2ae0 65 6e 74 44 61 74 61 2e 49 6e 70 75 74 42 75 74 74 6f 6e 2e 4c 65 66 74 2c 20 74 72 75 65 29 5d entData.InputButton.Left,.true)]
2b00 0a 20 20 20 20 5b 54 65 73 74 43 61 73 65 28 50 6f 69 6e 74 65 72 45 76 65 6e 74 44 61 74 61 2e .....[TestCase(PointerEventData.
2b20 49 6e 70 75 74 42 75 74 74 6f 6e 2e 52 69 67 68 74 2c 20 66 61 6c 73 65 29 5d 0a 20 20 20 20 5b InputButton.Right,.false)].....[
2b40 54 65 73 74 43 61 73 65 28 50 6f 69 6e 74 65 72 45 76 65 6e 74 44 61 74 61 2e 49 6e 70 75 74 42 TestCase(PointerEventData.InputB
2b60 75 74 74 6f 6e 2e 4d 69 64 64 6c 65 2c 20 66 61 6c 73 65 29 5d 0a 20 20 20 20 70 75 62 6c 69 63 utton.Middle,.false)].....public
2b80 20 76 6f 69 64 20 50 6f 74 65 6e 74 69 61 6c 44 72 61 67 4e 65 65 64 73 4c 65 66 74 43 6c 69 63 .void.PotentialDragNeedsLeftClic
2ba0 6b 28 50 6f 69 6e 74 65 72 45 76 65 6e 74 44 61 74 61 2e 49 6e 70 75 74 42 75 74 74 6f 6e 20 62 k(PointerEventData.InputButton.b
2bc0 75 74 74 6f 6e 2c 20 62 6f 6f 6c 20 65 78 70 65 63 74 65 64 45 71 75 61 6c 73 5a 65 72 6f 29 0a utton,.bool.expectedEqualsZero).
2be0 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 53 63 72 6f 6c 6c 52 65 63 74 20 73 63 72 6f 6c 6c 52 ....{.........ScrollRect.scrollR
2c00 65 63 74 20 3d 20 6d 5f 50 72 65 66 61 62 52 6f 6f 74 2e 47 65 74 43 6f 6d 70 6f 6e 65 6e 74 49 ect.=.m_PrefabRoot.GetComponentI
2c20 6e 43 68 69 6c 64 72 65 6e 3c 53 63 72 6f 6c 6c 52 65 63 74 3e 28 29 3b 0a 20 20 20 20 20 20 20 nChildren<ScrollRect>();........
2c40 20 73 63 72 6f 6c 6c 52 65 63 74 2e 76 65 6c 6f 63 69 74 79 20 3d 20 56 65 63 74 6f 72 32 2e 6f .scrollRect.velocity.=.Vector2.o
2c60 6e 65 3b 0a 20 20 20 20 20 20 20 20 41 73 73 65 72 74 2e 41 72 65 4e 6f 74 45 71 75 61 6c 28 56 ne;.........Assert.AreNotEqual(V
2c80 65 63 74 6f 72 32 2e 7a 65 72 6f 2c 20 73 63 72 6f 6c 6c 52 65 63 74 2e 76 65 6c 6f 63 69 74 79 ector2.zero,.scrollRect.velocity
2ca0 29 3b 0a 0a 20 20 20 20 20 20 20 20 73 63 72 6f 6c 6c 52 65 63 74 2e 4f 6e 49 6e 69 74 69 61 6c );..........scrollRect.OnInitial
2cc0 69 7a 65 50 6f 74 65 6e 74 69 61 6c 44 72 61 67 28 6e 65 77 20 50 6f 69 6e 74 65 72 45 76 65 6e izePotentialDrag(new.PointerEven
2ce0 74 44 61 74 61 28 6d 5f 50 72 65 66 61 62 52 6f 6f 74 2e 47 65 74 43 6f 6d 70 6f 6e 65 6e 74 49 tData(m_PrefabRoot.GetComponentI
2d00 6e 43 68 69 6c 64 72 65 6e 3c 45 76 65 6e 74 53 79 73 74 65 6d 3e 28 29 29 20 7b 20 62 75 74 74 nChildren<EventSystem>()).{.butt
2d20 6f 6e 20 3d 20 62 75 74 74 6f 6e 20 7d 29 3b 0a 20 20 20 20 20 20 20 20 69 66 20 28 65 78 70 65 on.=.button.});.........if.(expe
2d40 63 74 65 64 45 71 75 61 6c 73 5a 65 72 6f 29 0a 20 20 20 20 20 20 20 20 20 20 20 20 41 73 73 65 ctedEqualsZero).............Asse
2d60 72 74 2e 41 72 65 45 71 75 61 6c 28 56 65 63 74 6f 72 32 2e 7a 65 72 6f 2c 20 73 63 72 6f 6c 6c rt.AreEqual(Vector2.zero,.scroll
2d80 52 65 63 74 2e 76 65 6c 6f 63 69 74 79 29 3b 0a 20 20 20 20 20 20 20 20 65 6c 73 65 0a 20 20 20 Rect.velocity);.........else....
2da0 20 20 20 20 20 20 20 20 20 41 73 73 65 72 74 2e 41 72 65 4e 6f 74 45 71 75 61 6c 28 56 65 63 74 .........Assert.AreNotEqual(Vect
2dc0 6f 72 32 2e 7a 65 72 6f 2c 20 73 63 72 6f 6c 6c 52 65 63 74 2e 76 65 6c 6f 63 69 74 79 29 3b 0a or2.zero,.scrollRect.velocity);.
2de0 20 20 20 20 7d 0a 0a 20 20 20 20 5b 54 65 73 74 5d 0a 20 20 20 20 5b 54 65 73 74 43 61 73 65 28 ....}......[Test].....[TestCase(
2e00 50 6f 69 6e 74 65 72 45 76 65 6e 74 44 61 74 61 2e 49 6e 70 75 74 42 75 74 74 6f 6e 2e 4c 65 66 PointerEventData.InputButton.Lef
2e20 74 2c 20 74 72 75 65 2c 20 74 72 75 65 29 5d 0a 20 20 20 20 5b 54 65 73 74 43 61 73 65 28 50 6f t,.true,.true)].....[TestCase(Po
2e40 69 6e 74 65 72 45 76 65 6e 74 44 61 74 61 2e 49 6e 70 75 74 42 75 74 74 6f 6e 2e 4c 65 66 74 2c interEventData.InputButton.Left,
2e60 20 66 61 6c 73 65 2c 20 66 61 6c 73 65 29 5d 0a 20 20 20 20 5b 54 65 73 74 43 61 73 65 28 50 6f .false,.false)].....[TestCase(Po
2e80 69 6e 74 65 72 45 76 65 6e 74 44 61 74 61 2e 49 6e 70 75 74 42 75 74 74 6f 6e 2e 52 69 67 68 74 interEventData.InputButton.Right
2ea0 2c 20 74 72 75 65 2c 20 66 61 6c 73 65 29 5d 0a 20 20 20 20 5b 54 65 73 74 43 61 73 65 28 50 6f ,.true,.false)].....[TestCase(Po
2ec0 69 6e 74 65 72 45 76 65 6e 74 44 61 74 61 2e 49 6e 70 75 74 42 75 74 74 6f 6e 2e 4d 69 64 64 6c interEventData.InputButton.Middl
2ee0 65 2c 20 74 72 75 65 2c 20 66 61 6c 73 65 29 5d 0a 20 20 20 20 70 75 62 6c 69 63 20 76 6f 69 64 e,.true,.false)].....public.void
2f00 20 4c 65 66 74 43 6c 69 63 6b 53 68 6f 75 6c 64 53 74 61 72 74 44 72 61 67 28 50 6f 69 6e 74 65 .LeftClickShouldStartDrag(Pointe
2f20 72 45 76 65 6e 74 44 61 74 61 2e 49 6e 70 75 74 42 75 74 74 6f 6e 20 62 75 74 74 6f 6e 2c 20 62 rEventData.InputButton.button,.b
2f40 6f 6f 6c 20 61 63 74 69 76 65 2c 20 62 6f 6f 6c 20 65 78 70 65 63 74 65 64 49 73 44 72 61 67 67 ool.active,.bool.expectedIsDragg
2f60 69 6e 67 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 53 63 72 6f 6c 6c 52 65 63 74 20 73 63 ing).....{.........ScrollRect.sc
2f80 72 6f 6c 6c 52 65 63 74 20 3d 20 6d 5f 50 72 65 66 61 62 52 6f 6f 74 2e 47 65 74 43 6f 6d 70 6f rollRect.=.m_PrefabRoot.GetCompo
2fa0 6e 65 6e 74 49 6e 43 68 69 6c 64 72 65 6e 3c 53 63 72 6f 6c 6c 52 65 63 74 3e 28 29 3b 0a 20 20 nentInChildren<ScrollRect>();...
2fc0 20 20 20 20 20 20 73 63 72 6f 6c 6c 52 65 63 74 2e 65 6e 61 62 6c 65 64 20 3d 20 61 63 74 69 76 ......scrollRect.enabled.=.activ
2fe0 65 3b 0a 0a 20 20 20 20 20 20 20 20 73 63 72 6f 6c 6c 52 65 63 74 2e 76 65 6c 6f 63 69 74 79 20 e;..........scrollRect.velocity.
3000 3d 20 56 65 63 74 6f 72 32 2e 6f 6e 65 3b 0a 20 20 20 20 20 20 20 20 41 73 73 65 72 74 2e 41 72 =.Vector2.one;.........Assert.Ar
3020 65 4e 6f 74 45 71 75 61 6c 28 56 65 63 74 6f 72 32 2e 7a 65 72 6f 2c 20 73 63 72 6f 6c 6c 52 65 eNotEqual(Vector2.zero,.scrollRe
3040 63 74 2e 76 65 6c 6f 63 69 74 79 29 3b 0a 0a 20 20 20 20 20 20 20 20 76 61 72 20 70 6f 69 6e 74 ct.velocity);..........var.point
3060 65 72 45 76 65 6e 74 44 61 74 61 20 3d 20 6e 65 77 20 50 6f 69 6e 74 65 72 45 76 65 6e 74 44 61 erEventData.=.new.PointerEventDa
3080 74 61 28 6d 5f 50 72 65 66 61 62 52 6f 6f 74 2e 47 65 74 43 6f 6d 70 6f 6e 65 6e 74 49 6e 43 68 ta(m_PrefabRoot.GetComponentInCh
30a0 69 6c 64 72 65 6e 3c 45 76 65 6e 74 53 79 73 74 65 6d 3e 28 29 29 20 7b 20 62 75 74 74 6f 6e 20 ildren<EventSystem>()).{.button.
30c0 3d 20 62 75 74 74 6f 6e 20 7d 3b 0a 20 20 20 20 20 20 20 20 73 63 72 6f 6c 6c 52 65 63 74 2e 4f =.button.};.........scrollRect.O
30e0 6e 49 6e 69 74 69 61 6c 69 7a 65 50 6f 74 65 6e 74 69 61 6c 44 72 61 67 28 70 6f 69 6e 74 65 72 nInitializePotentialDrag(pointer
3100 45 76 65 6e 74 44 61 74 61 29 3b 0a 0a 20 20 20 20 20 20 20 20 46 69 65 6c 64 49 6e 66 6f 20 66 EventData);..........FieldInfo.f
3120 69 65 6c 64 20 3d 20 74 79 70 65 6f 66 28 53 63 72 6f 6c 6c 52 65 63 74 29 2e 47 65 74 46 69 65 ield.=.typeof(ScrollRect).GetFie
3140 6c 64 28 22 6d 5f 44 72 61 67 67 69 6e 67 22 2c 20 42 69 6e 64 69 6e 67 46 6c 61 67 73 2e 4e 6f ld("m_Dragging",.BindingFlags.No
3160 6e 50 75 62 6c 69 63 20 7c 20 42 69 6e 64 69 6e 67 46 6c 61 67 73 2e 49 6e 73 74 61 6e 63 65 29 nPublic.|.BindingFlags.Instance)
3180 3b 0a 0a 20 20 20 20 20 20 20 20 41 73 73 65 72 74 2e 49 73 46 61 6c 73 65 28 28 62 6f 6f 6c 29 ;..........Assert.IsFalse((bool)
31a0 66 69 65 6c 64 2e 47 65 74 56 61 6c 75 65 28 73 63 72 6f 6c 6c 52 65 63 74 29 29 3b 0a 20 20 20 field.GetValue(scrollRect));....
31c0 20 20 20 20 20 73 63 72 6f 6c 6c 52 65 63 74 2e 4f 6e 42 65 67 69 6e 44 72 61 67 28 70 6f 69 6e .....scrollRect.OnBeginDrag(poin
31e0 74 65 72 45 76 65 6e 74 44 61 74 61 29 3b 0a 20 20 20 20 20 20 20 20 41 73 73 65 72 74 2e 41 72 terEventData);.........Assert.Ar
3200 65 45 71 75 61 6c 28 65 78 70 65 63 74 65 64 49 73 44 72 61 67 67 69 6e 67 2c 20 28 62 6f 6f 6c eEqual(expectedIsDragging,.(bool
3220 29 66 69 65 6c 64 2e 47 65 74 56 61 6c 75 65 28 73 63 72 6f 6c 6c 52 65 63 74 29 29 3b 0a 20 20 )field.GetValue(scrollRect));...
3240 20 20 7d 0a 0a 20 20 20 20 5b 54 65 73 74 5d 0a 20 20 20 20 5b 54 65 73 74 43 61 73 65 28 50 6f ..}......[Test].....[TestCase(Po
3260 69 6e 74 65 72 45 76 65 6e 74 44 61 74 61 2e 49 6e 70 75 74 42 75 74 74 6f 6e 2e 4c 65 66 74 2c interEventData.InputButton.Left,
3280 20 74 72 75 65 2c 20 66 61 6c 73 65 29 5d 0a 20 20 20 20 5b 54 65 73 74 43 61 73 65 28 50 6f 69 .true,.false)].....[TestCase(Poi
32a0 6e 74 65 72 45 76 65 6e 74 44 61 74 61 2e 49 6e 70 75 74 42 75 74 74 6f 6e 2e 4c 65 66 74 2c 20 nterEventData.InputButton.Left,.
32c0 66 61 6c 73 65 2c 20 66 61 6c 73 65 29 5d 0a 20 20 20 20 5b 54 65 73 74 43 61 73 65 28 50 6f 69 false,.false)].....[TestCase(Poi
32e0 6e 74 65 72 45 76 65 6e 74 44 61 74 61 2e 49 6e 70 75 74 42 75 74 74 6f 6e 2e 52 69 67 68 74 2c nterEventData.InputButton.Right,
3300 20 66 61 6c 73 65 2c 20 66 61 6c 73 65 29 5d 0a 20 20 20 20 5b 54 65 73 74 43 61 73 65 28 50 6f .false,.false)].....[TestCase(Po
3320 69 6e 74 65 72 45 76 65 6e 74 44 61 74 61 2e 49 6e 70 75 74 42 75 74 74 6f 6e 2e 52 69 67 68 74 interEventData.InputButton.Right
3340 2c 20 74 72 75 65 2c 20 74 72 75 65 29 5d 0a 20 20 20 20 5b 54 65 73 74 43 61 73 65 28 50 6f 69 ,.true,.true)].....[TestCase(Poi
3360 6e 74 65 72 45 76 65 6e 74 44 61 74 61 2e 49 6e 70 75 74 42 75 74 74 6f 6e 2e 4d 69 64 64 6c 65 nterEventData.InputButton.Middle
3380 2c 20 74 72 75 65 2c 20 74 72 75 65 29 5d 0a 20 20 20 20 5b 54 65 73 74 43 61 73 65 28 50 6f 69 ,.true,.true)].....[TestCase(Poi
33a0 6e 74 65 72 45 76 65 6e 74 44 61 74 61 2e 49 6e 70 75 74 42 75 74 74 6f 6e 2e 4d 69 64 64 6c 65 nterEventData.InputButton.Middle
33c0 2c 20 66 61 6c 73 65 2c 20 66 61 6c 73 65 29 5d 0a 20 20 20 20 70 75 62 6c 69 63 20 76 6f 69 64 ,.false,.false)].....public.void
33e0 20 4c 65 66 74 43 6c 69 63 6b 55 70 53 68 6f 75 6c 64 45 6e 64 44 72 61 67 28 50 6f 69 6e 74 65 .LeftClickUpShouldEndDrag(Pointe
3400 72 45 76 65 6e 74 44 61 74 61 2e 49 6e 70 75 74 42 75 74 74 6f 6e 20 62 75 74 74 6f 6e 2c 20 62 rEventData.InputButton.button,.b
3420 6f 6f 6c 20 61 63 74 69 76 65 2c 20 62 6f 6f 6c 20 65 78 70 65 63 74 65 64 49 73 44 72 61 67 67 ool.active,.bool.expectedIsDragg
3440 69 6e 67 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 53 63 72 6f 6c 6c 52 65 63 74 20 73 63 ing).....{.........ScrollRect.sc
3460 72 6f 6c 6c 52 65 63 74 20 3d 20 6d 5f 50 72 65 66 61 62 52 6f 6f 74 2e 47 65 74 43 6f 6d 70 6f rollRect.=.m_PrefabRoot.GetCompo
3480 6e 65 6e 74 49 6e 43 68 69 6c 64 72 65 6e 3c 53 63 72 6f 6c 6c 52 65 63 74 3e 28 29 3b 0a 20 20 nentInChildren<ScrollRect>();...
34a0 20 20 20 20 20 20 73 63 72 6f 6c 6c 52 65 63 74 2e 76 65 6c 6f 63 69 74 79 20 3d 20 56 65 63 74 ......scrollRect.velocity.=.Vect
34c0 6f 72 32 2e 6f 6e 65 3b 0a 20 20 20 20 20 20 20 20 41 73 73 65 72 74 2e 41 72 65 4e 6f 74 45 71 or2.one;.........Assert.AreNotEq
34e0 75 61 6c 28 56 65 63 74 6f 72 32 2e 7a 65 72 6f 2c 20 73 63 72 6f 6c 6c 52 65 63 74 2e 76 65 6c ual(Vector2.zero,.scrollRect.vel
3500 6f 63 69 74 79 29 3b 0a 0a 20 20 20 20 20 20 20 20 76 61 72 20 73 74 61 72 74 44 72 61 67 45 76 ocity);..........var.startDragEv
3520 65 6e 74 44 61 74 61 20 3d 20 6e 65 77 20 50 6f 69 6e 74 65 72 45 76 65 6e 74 44 61 74 61 28 6d entData.=.new.PointerEventData(m
3540 5f 50 72 65 66 61 62 52 6f 6f 74 2e 47 65 74 43 6f 6d 70 6f 6e 65 6e 74 49 6e 43 68 69 6c 64 72 _PrefabRoot.GetComponentInChildr
3560 65 6e 3c 45 76 65 6e 74 53 79 73 74 65 6d 3e 28 29 29 20 7b 20 62 75 74 74 6f 6e 20 3d 20 50 6f en<EventSystem>()).{.button.=.Po
3580 69 6e 74 65 72 45 76 65 6e 74 44 61 74 61 2e 49 6e 70 75 74 42 75 74 74 6f 6e 2e 4c 65 66 74 20 interEventData.InputButton.Left.
35a0 7d 3b 0a 0a 20 20 20 20 20 20 20 20 73 63 72 6f 6c 6c 52 65 63 74 2e 4f 6e 49 6e 69 74 69 61 6c };..........scrollRect.OnInitial
35c0 69 7a 65 50 6f 74 65 6e 74 69 61 6c 44 72 61 67 28 73 74 61 72 74 44 72 61 67 45 76 65 6e 74 44 izePotentialDrag(startDragEventD
35e0 61 74 61 29 3b 0a 0a 20 20 20 20 20 20 20 20 46 69 65 6c 64 49 6e 66 6f 20 66 69 65 6c 64 20 3d ata);..........FieldInfo.field.=
3600 20 74 79 70 65 6f 66 28 53 63 72 6f 6c 6c 52 65 63 74 29 2e 47 65 74 46 69 65 6c 64 28 22 6d 5f .typeof(ScrollRect).GetField("m_
3620 44 72 61 67 67 69 6e 67 22 2c 20 42 69 6e 64 69 6e 67 46 6c 61 67 73 2e 4e 6f 6e 50 75 62 6c 69 Dragging",.BindingFlags.NonPubli
3640 63 20 7c 20 42 69 6e 64 69 6e 67 46 6c 61 67 73 2e 49 6e 73 74 61 6e 63 65 29 3b 0a 0a 20 20 20 c.|.BindingFlags.Instance);.....
3660 20 20 20 20 20 41 73 73 65 72 74 2e 49 73 46 61 6c 73 65 28 28 62 6f 6f 6c 29 66 69 65 6c 64 2e .....Assert.IsFalse((bool)field.
3680 47 65 74 56 61 6c 75 65 28 73 63 72 6f 6c 6c 52 65 63 74 29 29 3b 0a 20 20 20 20 20 20 20 20 73 GetValue(scrollRect));.........s
36a0 63 72 6f 6c 6c 52 65 63 74 2e 4f 6e 42 65 67 69 6e 44 72 61 67 28 73 74 61 72 74 44 72 61 67 45 crollRect.OnBeginDrag(startDragE
36c0 76 65 6e 74 44 61 74 61 29 3b 0a 20 20 20 20 20 20 20 20 41 73 73 65 72 74 2e 49 73 54 72 75 65 ventData);.........Assert.IsTrue
36e0 28 28 62 6f 6f 6c 29 66 69 65 6c 64 2e 47 65 74 56 61 6c 75 65 28 73 63 72 6f 6c 6c 52 65 63 74 ((bool)field.GetValue(scrollRect
3700 29 2c 20 22 50 72 65 72 65 71 75 69 73 69 74 65 3a 20 64 72 61 67 67 69 6e 67 20 73 68 6f 75 6c ),."Prerequisite:.dragging.shoul
3720 64 20 62 65 20 74 72 75 65 20 74 6f 20 74 65 73 74 20 69 66 20 69 74 20 69 73 20 73 65 74 20 74 d.be.true.to.test.if.it.is.set.t
3740 6f 20 66 61 6c 73 65 20 6c 61 74 65 72 22 29 3b 0a 0a 20 20 20 20 20 20 20 20 73 63 72 6f 6c 6c o.false.later");..........scroll
3760 52 65 63 74 2e 65 6e 61 62 6c 65 64 20 3d 20 61 63 74 69 76 65 3b 0a 0a 20 20 20 20 20 20 20 20 Rect.enabled.=.active;..........
3780 76 61 72 20 65 6e 64 44 72 61 67 45 76 65 6e 74 44 61 74 61 20 3d 20 6e 65 77 20 50 6f 69 6e 74 var.endDragEventData.=.new.Point
37a0 65 72 45 76 65 6e 74 44 61 74 61 28 6d 5f 50 72 65 66 61 62 52 6f 6f 74 2e 47 65 74 43 6f 6d 70 erEventData(m_PrefabRoot.GetComp
37c0 6f 6e 65 6e 74 49 6e 43 68 69 6c 64 72 65 6e 3c 45 76 65 6e 74 53 79 73 74 65 6d 3e 28 29 29 20 onentInChildren<EventSystem>()).
37e0 7b 20 62 75 74 74 6f 6e 20 3d 20 62 75 74 74 6f 6e 20 7d 3b 0a 20 20 20 20 20 20 20 20 73 63 72 {.button.=.button.};.........scr
3800 6f 6c 6c 52 65 63 74 2e 4f 6e 45 6e 64 44 72 61 67 28 65 6e 64 44 72 61 67 45 76 65 6e 74 44 61 ollRect.OnEndDrag(endDragEventDa
3820 74 61 29 3b 0a 20 20 20 20 20 20 20 20 41 73 73 65 72 74 2e 41 72 65 45 71 75 61 6c 28 65 78 70 ta);.........Assert.AreEqual(exp
3840 65 63 74 65 64 49 73 44 72 61 67 67 69 6e 67 2c 20 28 62 6f 6f 6c 29 66 69 65 6c 64 2e 47 65 74 ectedIsDragging,.(bool)field.Get
3860 56 61 6c 75 65 28 73 63 72 6f 6c 6c 52 65 63 74 29 29 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 23 Value(scrollRect));.....}......#
3880 65 6e 64 72 65 67 69 6f 6e 0a 0a 20 20 20 20 23 72 65 67 69 6f 6e 20 4c 61 74 65 55 70 64 61 74 endregion......#region.LateUpdat
38a0 65 0a 0a 20 20 20 20 5b 55 6e 69 74 79 54 65 73 74 5d 0a 20 20 20 20 70 75 62 6c 69 63 20 49 45 e......[UnityTest].....public.IE
38c0 6e 75 6d 65 72 61 74 6f 72 20 4c 61 74 65 55 70 64 61 74 65 57 69 74 68 6f 75 74 49 6e 65 72 74 numerator.LateUpdateWithoutInert
38e0 69 61 4f 72 45 6c 61 73 74 69 63 53 68 6f 75 6c 64 5a 65 72 6f 56 65 6c 6f 63 69 74 79 28 29 0a iaOrElasticShouldZeroVelocity().
3900 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 53 63 72 6f 6c 6c 52 65 63 74 20 73 63 72 6f 6c 6c 52 ....{.........ScrollRect.scrollR
3920 65 63 74 20 3d 20 6d 5f 50 72 65 66 61 62 52 6f 6f 74 2e 47 65 74 43 6f 6d 70 6f 6e 65 6e 74 49 ect.=.m_PrefabRoot.GetComponentI
3940 6e 43 68 69 6c 64 72 65 6e 3c 53 63 72 6f 6c 6c 52 65 63 74 3e 28 29 3b 0a 20 20 20 20 20 20 20 nChildren<ScrollRect>();........
3960 20 73 63 72 6f 6c 6c 52 65 63 74 2e 76 65 6c 6f 63 69 74 79 20 3d 20 56 65 63 74 6f 72 32 2e 6f .scrollRect.velocity.=.Vector2.o
3980 6e 65 3b 0a 20 20 20 20 20 20 20 20 73 63 72 6f 6c 6c 52 65 63 74 2e 69 6e 65 72 74 69 61 20 3d ne;.........scrollRect.inertia.=
39a0 20 66 61 6c 73 65 3b 0a 20 20 20 20 20 20 20 20 73 63 72 6f 6c 6c 52 65 63 74 2e 6d 6f 76 65 6d .false;.........scrollRect.movem
39c0 65 6e 74 54 79 70 65 20 3d 20 53 63 72 6f 6c 6c 52 65 63 74 2e 4d 6f 76 65 6d 65 6e 74 54 79 70 entType.=.ScrollRect.MovementTyp
39e0 65 2e 43 6c 61 6d 70 65 64 3b 0a 20 20 20 20 20 20 20 20 79 69 65 6c 64 20 72 65 74 75 72 6e 20 e.Clamped;.........yield.return.
3a00 6e 75 6c 6c 3b 0a 0a 20 20 20 20 20 20 20 20 41 73 73 65 72 74 2e 41 72 65 45 71 75 61 6c 28 56 null;..........Assert.AreEqual(V
3a20 65 63 74 6f 72 32 2e 7a 65 72 6f 2c 20 73 63 72 6f 6c 6c 52 65 63 74 2e 76 65 6c 6f 63 69 74 79 ector2.zero,.scrollRect.velocity
3a40 29 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 5b 55 6e 69 74 79 54 65 73 74 5d 0a 20 20 20 20 70 75 );.....}......[UnityTest].....pu
3a60 62 6c 69 63 20 49 45 6e 75 6d 65 72 61 74 6f 72 20 4c 61 74 65 55 70 64 61 74 65 57 69 74 68 49 blic.IEnumerator.LateUpdateWithI
3a80 6e 65 72 74 69 61 53 68 6f 75 6c 64 44 65 63 65 6c 65 72 61 74 65 28 29 0a 20 20 20 20 7b 0a 20 nertiaShouldDecelerate().....{..
3aa0 20 20 20 20 20 20 20 53 63 72 6f 6c 6c 52 65 63 74 20 73 63 72 6f 6c 6c 52 65 63 74 20 3d 20 6d .......ScrollRect.scrollRect.=.m
3ac0 5f 50 72 65 66 61 62 52 6f 6f 74 2e 47 65 74 43 6f 6d 70 6f 6e 65 6e 74 49 6e 43 68 69 6c 64 72 _PrefabRoot.GetComponentInChildr
3ae0 65 6e 3c 53 63 72 6f 6c 6c 52 65 63 74 3e 28 29 3b 0a 20 20 20 20 20 20 20 20 73 63 72 6f 6c 6c en<ScrollRect>();.........scroll
3b00 52 65 63 74 2e 76 65 6c 6f 63 69 74 79 20 3d 20 56 65 63 74 6f 72 32 2e 6f 6e 65 3b 0a 20 20 20 Rect.velocity.=.Vector2.one;....
3b20 20 20 20 20 20 73 63 72 6f 6c 6c 52 65 63 74 2e 69 6e 65 72 74 69 61 20 3d 20 74 72 75 65 3b 0a .....scrollRect.inertia.=.true;.
3b40 20 20 20 20 20 20 20 20 73 63 72 6f 6c 6c 52 65 63 74 2e 6d 6f 76 65 6d 65 6e 74 54 79 70 65 20 ........scrollRect.movementType.
3b60 3d 20 53 63 72 6f 6c 6c 52 65 63 74 2e 4d 6f 76 65 6d 65 6e 74 54 79 70 65 2e 43 6c 61 6d 70 65 =.ScrollRect.MovementType.Clampe
3b80 64 3b 0a 20 20 20 20 20 20 20 20 79 69 65 6c 64 20 72 65 74 75 72 6e 20 6e 75 6c 6c 3b 0a 20 20 d;.........yield.return.null;...
3ba0 20 20 20 20 20 20 41 73 73 65 72 74 2e 4c 65 73 73 28 73 63 72 6f 6c 6c 52 65 63 74 2e 76 65 6c ......Assert.Less(scrollRect.vel
3bc0 6f 63 69 74 79 2e 6d 61 67 6e 69 74 75 64 65 2c 20 31 29 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 ocity.magnitude,.1);.....}......
3be0 5b 55 6e 69 74 79 54 65 73 74 5d 5b 49 67 6e 6f 72 65 28 22 46 61 69 6c 73 22 29 5d 0a 20 20 20 [UnityTest][Ignore("Fails")]....
3c00 20 70 75 62 6c 69 63 20 49 45 6e 75 6d 65 72 61 74 6f 72 20 4c 61 74 65 55 70 64 61 74 65 57 69 .public.IEnumerator.LateUpdateWi
3c20 74 68 45 6c 61 73 74 69 63 53 68 6f 75 6c 64 44 65 63 65 6c 65 72 61 74 65 28 29 0a 20 20 20 20 thElasticShouldDecelerate().....
3c40 7b 0a 20 20 20 20 20 20 20 20 53 63 72 6f 6c 6c 52 65 63 74 20 73 63 72 6f 6c 6c 52 65 63 74 20 {.........ScrollRect.scrollRect.
3c60 3d 20 6d 5f 50 72 65 66 61 62 52 6f 6f 74 2e 47 65 74 43 6f 6d 70 6f 6e 65 6e 74 49 6e 43 68 69 =.m_PrefabRoot.GetComponentInChi
3c80 6c 64 72 65 6e 3c 53 63 72 6f 6c 6c 52 65 63 74 3e 28 29 3b 0a 20 20 20 20 20 20 20 20 73 63 72 ldren<ScrollRect>();.........scr
3ca0 6f 6c 6c 52 65 63 74 2e 76 65 6c 6f 63 69 74 79 20 3d 20 56 65 63 74 6f 72 32 2e 6f 6e 65 3b 0a ollRect.velocity.=.Vector2.one;.
3cc0 20 20 20 20 20 20 20 20 73 63 72 6f 6c 6c 52 65 63 74 2e 69 6e 65 72 74 69 61 20 3d 20 66 61 6c ........scrollRect.inertia.=.fal
3ce0 73 65 3b 0a 20 20 20 20 20 20 20 20 73 63 72 6f 6c 6c 52 65 63 74 2e 63 6f 6e 74 65 6e 74 2e 61 se;.........scrollRect.content.a
3d00 6e 63 68 6f 72 65 64 50 6f 73 69 74 69 6f 6e 20 3d 20 56 65 63 74 6f 72 32 2e 6f 6e 65 20 2a 20 nchoredPosition.=.Vector2.one.*.
3d20 32 3b 0a 20 20 20 20 20 20 20 20 73 63 72 6f 6c 6c 52 65 63 74 2e 6d 6f 76 65 6d 65 6e 74 54 79 2;.........scrollRect.movementTy
3d40 70 65 20 3d 20 53 63 72 6f 6c 6c 52 65 63 74 2e 4d 6f 76 65 6d 65 6e 74 54 79 70 65 2e 45 6c 61 pe.=.ScrollRect.MovementType.Ela
3d60 73 74 69 63 3b 0a 0a 20 20 20 20 20 20 20 20 79 69 65 6c 64 20 72 65 74 75 72 6e 20 6e 75 6c 6c stic;..........yield.return.null
3d80 3b 0a 20 20 20 20 20 20 20 20 41 73 73 65 72 74 2e 41 72 65 4e 6f 74 45 71 75 61 6c 28 31 2c 20 ;.........Assert.AreNotEqual(1,.
3da0 73 63 72 6f 6c 6c 52 65 63 74 2e 76 65 6c 6f 63 69 74 79 2e 6d 61 67 6e 69 74 75 64 65 29 3b 0a scrollRect.velocity.magnitude);.
3dc0 20 20 20 20 20 20 20 20 76 61 72 20 6e 65 77 4d 61 67 6e 69 74 75 64 65 20 3d 20 73 63 72 6f 6c ........var.newMagnitude.=.scrol
3de0 6c 52 65 63 74 2e 76 65 6c 6f 63 69 74 79 2e 6d 61 67 6e 69 74 75 64 65 3b 0a 0a 20 20 20 20 20 lRect.velocity.magnitude;.......
3e00 20 20 20 79 69 65 6c 64 20 72 65 74 75 72 6e 20 6e 75 6c 6c 3b 0a 20 20 20 20 20 20 20 20 41 73 ...yield.return.null;.........As
3e20 73 65 72 74 2e 41 72 65 4e 6f 74 45 71 75 61 6c 28 6e 65 77 4d 61 67 6e 69 74 75 64 65 2c 20 73 sert.AreNotEqual(newMagnitude,.s
3e40 63 72 6f 6c 6c 52 65 63 74 2e 76 65 6c 6f 63 69 74 79 2e 6d 61 67 6e 69 74 75 64 65 29 3b 0a 20 crollRect.velocity.magnitude);..
3e60 20 20 20 7d 0a 0a 20 20 20 20 5b 55 6e 69 74 79 54 65 73 74 5d 0a 20 20 20 20 70 75 62 6c 69 63 ...}......[UnityTest].....public
3e80 20 49 45 6e 75 6d 65 72 61 74 6f 72 20 4c 61 74 65 55 70 64 61 74 65 57 69 74 68 45 6c 61 73 74 .IEnumerator.LateUpdateWithElast
3ea0 69 63 4e 6f 4f 66 66 73 65 74 53 68 6f 75 6c 64 5a 65 72 6f 56 65 6c 6f 63 69 74 79 28 29 0a 20 icNoOffsetShouldZeroVelocity()..
3ec0 20 20 20 7b 0a 20 20 20 20 20 20 20 20 53 63 72 6f 6c 6c 52 65 63 74 20 73 63 72 6f 6c 6c 52 65 ...{.........ScrollRect.scrollRe
3ee0 63 74 20 3d 20 6d 5f 50 72 65 66 61 62 52 6f 6f 74 2e 47 65 74 43 6f 6d 70 6f 6e 65 6e 74 49 6e ct.=.m_PrefabRoot.GetComponentIn
3f00 43 68 69 6c 64 72 65 6e 3c 53 63 72 6f 6c 6c 52 65 63 74 3e 28 29 3b 0a 20 20 20 20 20 20 20 20 Children<ScrollRect>();.........
3f20 73 63 72 6f 6c 6c 52 65 63 74 2e 76 65 6c 6f 63 69 74 79 20 3d 20 56 65 63 74 6f 72 32 2e 6f 6e scrollRect.velocity.=.Vector2.on
3f40 65 3b 0a 20 20 20 20 20 20 20 20 73 63 72 6f 6c 6c 52 65 63 74 2e 69 6e 65 72 74 69 61 20 3d 20 e;.........scrollRect.inertia.=.
3f60 66 61 6c 73 65 3b 0a 20 20 20 20 20 20 20 20 73 63 72 6f 6c 6c 52 65 63 74 2e 6d 6f 76 65 6d 65 false;.........scrollRect.moveme
3f80 6e 74 54 79 70 65 20 3d 20 53 63 72 6f 6c 6c 52 65 63 74 2e 4d 6f 76 65 6d 65 6e 74 54 79 70 65 ntType.=.ScrollRect.MovementType
3fa0 2e 45 6c 61 73 74 69 63 3b 0a 20 20 20 20 20 20 20 20 79 69 65 6c 64 20 72 65 74 75 72 6e 20 6e .Elastic;.........yield.return.n
3fc0 75 6c 6c 3b 0a 20 20 20 20 20 20 20 20 41 73 73 65 72 74 2e 41 72 65 45 71 75 61 6c 28 56 65 63 ull;.........Assert.AreEqual(Vec
3fe0 74 6f 72 32 2e 7a 65 72 6f 2c 20 73 63 72 6f 6c 6c 52 65 63 74 2e 76 65 6c 6f 63 69 74 79 29 3b tor2.zero,.scrollRect.velocity);
4000 0a 20 20 20 20 7d 0a 0a 20 20 20 20 23 65 6e 64 72 65 67 69 6f 6e 0a 0a 20 20 20 20 5b 54 65 73 .....}......#endregion......[Tes
4020 74 5d 0a 20 20 20 20 70 75 62 6c 69 63 20 76 6f 69 64 20 53 65 74 4e 6f 72 6d 61 6c 69 7a 65 64 t].....public.void.SetNormalized
4040 50 6f 73 69 74 69 6f 6e 53 68 6f 75 6c 64 53 65 74 43 6f 6e 74 65 6e 74 4c 6f 63 61 6c 50 6f 73 PositionShouldSetContentLocalPos
4060 69 74 69 6f 6e 28 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 53 63 72 6f 6c 6c 52 65 63 74 ition().....{.........ScrollRect
4080 20 73 63 72 6f 6c 6c 52 65 63 74 20 3d 20 6d 5f 50 72 65 66 61 62 52 6f 6f 74 2e 47 65 74 43 6f .scrollRect.=.m_PrefabRoot.GetCo
40a0 6d 70 6f 6e 65 6e 74 49 6e 43 68 69 6c 64 72 65 6e 3c 53 63 72 6f 6c 6c 52 65 63 74 3e 28 29 3b mponentInChildren<ScrollRect>();
40c0 0a 20 20 20 20 20 20 20 20 73 63 72 6f 6c 6c 52 65 63 74 2e 6e 6f 72 6d 61 6c 69 7a 65 64 50 6f .........scrollRect.normalizedPo
40e0 73 69 74 69 6f 6e 20 3d 20 56 65 63 74 6f 72 32 2e 6f 6e 65 3b 0a 20 20 20 20 20 20 20 20 41 73 sition.=.Vector2.one;.........As
4100 73 65 72 74 2e 41 72 65 45 71 75 61 6c 28 6e 65 77 20 56 65 63 74 6f 72 33 28 2d 31 66 2c 20 2d sert.AreEqual(new.Vector3(-1f,.-
4120 31 66 2c 20 30 29 2c 20 73 63 72 6f 6c 6c 52 65 63 74 2e 63 6f 6e 74 65 6e 74 2e 6c 6f 63 61 6c 1f,.0),.scrollRect.content.local
4140 50 6f 73 69 74 69 6f 6e 29 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 23 72 65 67 69 6f 6e 20 53 63 Position);.....}......#region.Sc
4160 72 6f 6c 6c 2c 20 6f 66 66 73 65 74 2c 20 2e 2e 2e 0a 0a 20 20 20 20 5b 54 65 73 74 5d 0a 20 20 roll,.offset,..........[Test]...
4180 20 20 5b 54 65 73 74 43 61 73 65 28 31 2c 20 31 2c 20 74 72 75 65 2c 20 74 72 75 65 2c 20 31 2c ..[TestCase(1,.1,.true,.true,.1,
41a0 20 2d 31 2c 20 54 65 73 74 4e 61 6d 65 20 3d 20 22 48 6f 72 69 7a 6f 6e 74 61 6c 20 61 6e 64 20 .-1,.TestName.=."Horizontal.and.
41c0 76 65 72 74 69 63 61 6c 20 73 63 72 6f 6c 6c 22 29 5d 0a 20 20 20 20 5b 54 65 73 74 43 61 73 65 vertical.scroll")].....[TestCase
41e0 28 31 2c 20 31 2c 20 66 61 6c 73 65 2c 20 74 72 75 65 2c 20 30 2c 20 2d 31 2c 20 54 65 73 74 4e (1,.1,.false,.true,.0,.-1,.TestN
4200 61 6d 65 20 3d 20 22 56 65 72 74 69 63 61 6c 20 73 63 72 6f 6c 6c 22 29 5d 0a 20 20 20 20 5b 54 ame.=."Vertical.scroll")].....[T
4220 65 73 74 43 61 73 65 28 31 2c 20 31 2c 20 74 72 75 65 2c 20 66 61 6c 73 65 2c 20 31 2c 20 30 2c estCase(1,.1,.true,.false,.1,.0,
4240 20 54 65 73 74 4e 61 6d 65 20 3d 20 22 48 6f 72 69 7a 6f 6e 74 61 6c 20 73 63 72 6f 6c 6c 22 29 .TestName.=."Horizontal.scroll")
4260 5d 0a 20 20 20 20 70 75 62 6c 69 63 20 76 6f 69 64 20 4f 6e 53 63 72 6f 6c 6c 43 6c 61 6d 70 65 ].....public.void.OnScrollClampe
4280 64 53 68 6f 75 6c 64 4d 6f 76 65 43 6f 6e 74 65 6e 74 41 6e 63 68 6f 72 65 64 50 6f 73 69 74 69 dShouldMoveContentAnchoredPositi
42a0 6f 6e 28 69 6e 74 20 73 63 72 6f 6c 6c 44 65 6c 74 61 58 2c 20 69 6e 74 20 73 63 72 6f 6c 6c 44 on(int.scrollDeltaX,.int.scrollD
42c0 65 6c 74 61 59 2c 20 62 6f 6f 6c 20 68 6f 72 69 7a 6f 6e 74 61 6c 2c 0a 20 20 20 20 20 20 20 20 eltaY,.bool.horizontal,.........
42e0 62 6f 6f 6c 20 76 65 72 74 69 63 61 6c 2c 20 69 6e 74 20 65 78 70 65 63 74 65 64 50 6f 73 58 2c bool.vertical,.int.expectedPosX,
4300 20 69 6e 74 20 65 78 70 65 63 74 65 64 50 6f 73 59 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 .int.expectedPosY).....{........
4320 20 53 63 72 6f 6c 6c 52 65 63 74 20 73 63 72 6f 6c 6c 52 65 63 74 20 3d 20 6d 5f 50 72 65 66 61 .ScrollRect.scrollRect.=.m_Prefa
4340 62 52 6f 6f 74 2e 47 65 74 43 6f 6d 70 6f 6e 65 6e 74 49 6e 43 68 69 6c 64 72 65 6e 3c 53 63 72 bRoot.GetComponentInChildren<Scr
4360 6f 6c 6c 52 65 63 74 3e 28 29 3b 0a 20 20 20 20 20 20 20 20 56 65 63 74 6f 72 32 20 73 63 72 6f ollRect>();.........Vector2.scro
4380 6c 6c 44 65 6c 74 61 20 3d 20 6e 65 77 20 56 65 63 74 6f 72 32 28 73 63 72 6f 6c 6c 44 65 6c 74 llDelta.=.new.Vector2(scrollDelt
43a0 61 58 2c 20 73 63 72 6f 6c 6c 44 65 6c 74 61 59 29 3b 0a 20 20 20 20 20 20 20 20 76 61 72 20 65 aX,.scrollDeltaY);.........var.e
43c0 78 70 65 63 74 65 64 20 3d 20 6e 65 77 20 56 65 63 74 6f 72 32 28 65 78 70 65 63 74 65 64 50 6f xpected.=.new.Vector2(expectedPo
43e0 73 58 2c 20 65 78 70 65 63 74 65 64 50 6f 73 59 29 20 2a 20 53 63 72 6f 6c 6c 53 65 6e 73 69 74 sX,.expectedPosY).*.ScrollSensit
4400 69 76 69 74 79 3b 0a 0a 20 20 20 20 20 20 20 20 73 63 72 6f 6c 6c 52 65 63 74 2e 68 6f 72 69 7a ivity;..........scrollRect.horiz
4420 6f 6e 74 61 6c 20 3d 20 68 6f 72 69 7a 6f 6e 74 61 6c 3b 0a 20 20 20 20 20 20 20 20 73 63 72 6f ontal.=.horizontal;.........scro
4440 6c 6c 52 65 63 74 2e 76 65 72 74 69 63 61 6c 20 3d 20 76 65 72 74 69 63 61 6c 3b 0a 0a 20 20 20 llRect.vertical.=.vertical;.....
4460 20 20 20 20 20 73 63 72 6f 6c 6c 52 65 63 74 2e 4f 6e 53 63 72 6f 6c 6c 28 6e 65 77 20 50 6f 69 .....scrollRect.OnScroll(new.Poi
4480 6e 74 65 72 45 76 65 6e 74 44 61 74 61 28 6d 5f 50 72 65 66 61 62 52 6f 6f 74 2e 47 65 74 43 6f nterEventData(m_PrefabRoot.GetCo
44a0 6d 70 6f 6e 65 6e 74 49 6e 43 68 69 6c 64 72 65 6e 3c 45 76 65 6e 74 53 79 73 74 65 6d 3e 28 29 mponentInChildren<EventSystem>()
44c0 29 0a 20 20 20 20 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 63 72 6f 6c 6c 44 65 ).........{.............scrollDe
44e0 6c 74 61 20 3d 20 73 63 72 6f 6c 6c 44 65 6c 74 61 0a 20 20 20 20 20 20 20 20 7d 29 3b 0a 0a 20 lta.=.scrollDelta.........});...
4500 20 20 20 20 20 20 20 41 73 73 65 72 74 2e 41 72 65 45 71 75 61 6c 28 65 78 70 65 63 74 65 64 2c .......Assert.AreEqual(expected,
4520 20 73 63 72 6f 6c 6c 52 65 63 74 2e 63 6f 6e 74 65 6e 74 2e 61 6e 63 68 6f 72 65 64 50 6f 73 69 .scrollRect.content.anchoredPosi
4540 74 69 6f 6e 29 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 5b 54 65 73 74 5d 5b 49 67 6e 6f 72 65 28 tion);.....}......[Test][Ignore(
4560 22 54 65 73 74 73 20 66 61 69 6c 20 77 69 74 68 6f 75 74 20 6d 6f 63 6b 69 6e 67 22 29 5d 0a 20 "Tests.fail.without.mocking")]..
4580 20 20 20 5b 54 65 73 74 43 61 73 65 28 53 63 72 6f 6c 6c 52 65 63 74 2e 4d 6f 76 65 6d 65 6e 74 ...[TestCase(ScrollRect.Movement
45a0 54 79 70 65 2e 43 6c 61 6d 70 65 64 2c 20 31 66 2c 20 31 66 29 5d 0a 20 20 20 20 5b 54 65 73 74 Type.Clamped,.1f,.1f)].....[Test
45c0 43 61 73 65 28 53 63 72 6f 6c 6c 52 65 63 74 2e 4d 6f 76 65 6d 65 6e 74 54 79 70 65 2e 55 6e 72 Case(ScrollRect.MovementType.Unr
45e0 65 73 74 72 69 63 74 65 64 2c 20 31 35 30 2c 20 31 35 30 29 5d 0a 20 20 20 20 5b 54 65 73 74 43 estricted,.150,.150)].....[TestC
4600 61 73 65 28 53 63 72 6f 6c 6c 52 65 63 74 2e 4d 6f 76 65 6d 65 6e 74 54 79 70 65 2e 45 6c 61 73 ase(ScrollRect.MovementType.Elas
4620 74 69 63 2c 20 31 35 30 2c 20 31 35 30 29 5d 0a 20 20 20 20 70 75 62 6c 69 63 20 76 6f 69 64 20 tic,.150,.150)].....public.void.
4640 4f 6e 53 63 72 6f 6c 6c 43 6c 61 6d 70 65 64 53 68 6f 75 6c 64 43 6c 61 6d 70 43 6f 6e 74 65 6e OnScrollClampedShouldClampConten
4660 74 41 6e 63 68 6f 72 65 64 50 6f 73 69 74 69 6f 6e 28 53 63 72 6f 6c 6c 52 65 63 74 2e 4d 6f 76 tAnchoredPosition(ScrollRect.Mov
4680 65 6d 65 6e 74 54 79 70 65 20 6d 6f 76 65 6d 65 6e 74 54 79 70 65 2c 20 66 6c 6f 61 74 20 61 6e ementType.movementType,.float.an
46a0 63 68 6f 72 65 64 50 6f 73 58 2c 0a 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 61 6e 63 68 6f 72 choredPosX,.........float.anchor
46c0 65 64 50 6f 73 59 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 53 63 72 6f 6c 6c 52 65 63 74 edPosY).....{.........ScrollRect
46e0 20 73 63 72 6f 6c 6c 52 65 63 74 20 3d 20 6d 5f 50 72 65 66 61 62 52 6f 6f 74 2e 47 65 74 43 6f .scrollRect.=.m_PrefabRoot.GetCo
4700 6d 70 6f 6e 65 6e 74 49 6e 43 68 69 6c 64 72 65 6e 3c 53 63 72 6f 6c 6c 52 65 63 74 3e 28 29 3b mponentInChildren<ScrollRect>();
4720 0a 20 20 20 20 20 20 20 20 56 65 63 74 6f 72 32 20 73 63 72 6f 6c 6c 44 65 6c 74 61 20 3d 20 6e .........Vector2.scrollDelta.=.n
4740 65 77 20 56 65 63 74 6f 72 32 28 35 30 2c 20 2d 35 30 29 3b 0a 20 20 20 20 20 20 20 20 73 63 72 ew.Vector2(50,.-50);.........scr
4760 6f 6c 6c 52 65 63 74 2e 6d 6f 76 65 6d 65 6e 74 54 79 70 65 20 3d 20 6d 6f 76 65 6d 65 6e 74 54 ollRect.movementType.=.movementT
4780 79 70 65 3b 0a 20 20 20 20 20 20 20 20 73 63 72 6f 6c 6c 52 65 63 74 2e 63 6f 6e 74 65 6e 74 2e ype;.........scrollRect.content.
47a0 61 6e 63 68 6f 72 65 64 50 6f 73 69 74 69 6f 6e 20 3d 20 6e 65 77 20 56 65 63 74 6f 72 32 28 32 anchoredPosition.=.new.Vector2(2
47c0 2e 35 66 2c 20 32 2e 35 66 29 3b 0a 0a 20 20 20 20 20 20 20 20 73 63 72 6f 6c 6c 52 65 63 74 2e .5f,.2.5f);..........scrollRect.
47e0 4f 6e 53 63 72 6f 6c 6c 28 6e 65 77 20 50 6f 69 6e 74 65 72 45 76 65 6e 74 44 61 74 61 28 6d 5f OnScroll(new.PointerEventData(m_
4800 50 72 65 66 61 62 52 6f 6f 74 2e 47 65 74 43 6f 6d 70 6f 6e 65 6e 74 49 6e 43 68 69 6c 64 72 65 PrefabRoot.GetComponentInChildre
4820 6e 3c 45 76 65 6e 74 53 79 73 74 65 6d 3e 28 29 29 0a 20 20 20 20 20 20 20 20 7b 0a 20 20 20 20 n<EventSystem>()).........{.....
4840 20 20 20 20 20 20 20 20 73 63 72 6f 6c 6c 44 65 6c 74 61 20 3d 20 73 63 72 6f 6c 6c 44 65 6c 74 ........scrollDelta.=.scrollDelt
4860 61 0a 20 20 20 20 20 20 20 20 7d 29 3b 0a 20 20 20 20 20 20 20 20 41 73 73 65 72 74 2e 41 72 65 a.........});.........Assert.Are
4880 45 71 75 61 6c 28 6e 65 77 20 56 65 63 74 6f 72 32 28 61 6e 63 68 6f 72 65 64 50 6f 73 58 2c 20 Equal(new.Vector2(anchoredPosX,.
48a0 61 6e 63 68 6f 72 65 64 50 6f 73 59 29 2c 20 73 63 72 6f 6c 6c 52 65 63 74 2e 63 6f 6e 74 65 6e anchoredPosY),.scrollRect.conten
48c0 74 2e 61 6e 63 68 6f 72 65 64 50 6f 73 69 74 69 6f 6e 29 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 t.anchoredPosition);.....}......
48e0 5b 54 65 73 74 5d 0a 20 20 20 20 70 75 62 6c 69 63 20 76 6f 69 64 20 47 65 74 42 6f 75 6e 64 73 [Test].....public.void.GetBounds
4900 53 68 6f 75 6c 64 45 6e 63 61 70 73 75 6c 61 74 65 41 6c 6c 43 6f 72 6e 65 72 73 28 29 0a 20 20 ShouldEncapsulateAllCorners()...
4920 20 20 7b 0a 20 20 20 20 20 20 20 20 4d 61 74 72 69 78 34 78 34 20 6d 61 74 72 69 78 20 3d 20 4d ..{.........Matrix4x4.matrix.=.M
4940 61 74 72 69 78 34 78 34 2e 69 64 65 6e 74 69 74 79 3b 0a 20 20 20 20 20 20 20 20 6f 62 6a 65 63 atrix4x4.identity;.........objec
4960 74 5b 5d 20 61 72 67 75 6d 65 6e 74 73 20 3d 20 6e 65 77 20 6f 62 6a 65 63 74 5b 32 5d 0a 20 20 t[].arguments.=.new.object[2]...
4980 20 20 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 6e 65 77 20 56 65 63 74 6f 72 33 5b ......{.............new.Vector3[
49a0 5d 20 7b 20 56 65 63 74 6f 72 33 2e 7a 65 72 6f 2c 20 56 65 63 74 6f 72 33 2e 6f 6e 65 2c 20 56 ].{.Vector3.zero,.Vector3.one,.V
49c0 65 63 74 6f 72 33 2e 6f 6e 65 20 2a 20 32 2c 20 56 65 63 74 6f 72 33 2e 6f 6e 65 20 7d 2c 0a 20 ector3.one.*.2,.Vector3.one.},..
49e0 20 20 20 20 20 20 20 20 20 20 20 6d 61 74 72 69 78 0a 20 20 20 20 20 20 20 20 7d 3b 0a 20 20 20 ...........matrix.........};....
4a00 20 20 20 20 20 4d 65 74 68 6f 64 49 6e 66 6f 20 6d 65 74 68 6f 64 20 3d 20 74 79 70 65 6f 66 28 .....MethodInfo.method.=.typeof(
4a20 53 63 72 6f 6c 6c 52 65 63 74 29 2e 47 65 74 4d 65 74 68 6f 64 28 22 49 6e 74 65 72 6e 61 6c 47 ScrollRect).GetMethod("InternalG
4a40 65 74 42 6f 75 6e 64 73 22 2c 20 42 69 6e 64 69 6e 67 46 6c 61 67 73 2e 4e 6f 6e 50 75 62 6c 69 etBounds",.BindingFlags.NonPubli
4a60 63 20 7c 20 42 69 6e 64 69 6e 67 46 6c 61 67 73 2e 53 74 61 74 69 63 29 3b 0a 20 20 20 20 20 20 c.|.BindingFlags.Static);.......
4a80 20 20 76 61 72 20 62 6f 75 6e 64 73 20 3d 20 28 42 6f 75 6e 64 73 29 6d 65 74 68 6f 64 2e 49 6e ..var.bounds.=.(Bounds)method.In
4aa0 76 6f 6b 65 28 6e 75 6c 6c 2c 20 61 72 67 75 6d 65 6e 74 73 29 3b 0a 0a 20 20 20 20 20 20 20 20 voke(null,.arguments);..........
4ac0 41 73 73 65 72 74 2e 41 72 65 45 71 75 61 6c 28 56 65 63 74 6f 72 33 2e 7a 65 72 6f 2c 20 62 6f Assert.AreEqual(Vector3.zero,.bo
4ae0 75 6e 64 73 2e 6d 69 6e 29 3b 0a 20 20 20 20 20 20 20 20 41 73 73 65 72 74 2e 41 72 65 45 71 75 unds.min);.........Assert.AreEqu
4b00 61 6c 28 56 65 63 74 6f 72 33 2e 6f 6e 65 20 2a 20 32 2c 20 62 6f 75 6e 64 73 2e 6d 61 78 29 3b al(Vector3.one.*.2,.bounds.max);
4b20 0a 20 20 20 20 7d 0a 0a 20 20 20 20 5b 54 65 73 74 5d 0a 20 20 20 20 70 75 62 6c 69 63 20 76 6f .....}......[Test].....public.vo
4b40 69 64 20 55 70 64 61 74 65 42 6f 75 6e 64 73 53 68 6f 75 6c 64 50 61 64 28 29 0a 20 20 20 20 7b id.UpdateBoundsShouldPad().....{
4b60 0a 20 20 20 20 20 20 20 20 42 6f 75 6e 64 73 20 76 69 65 77 42 6f 75 6e 64 73 20 3d 20 6e 65 77 .........Bounds.viewBounds.=.new
4b80 20 42 6f 75 6e 64 73 28 56 65 63 74 6f 72 33 2e 7a 65 72 6f 2c 20 56 65 63 74 6f 72 33 2e 6f 6e .Bounds(Vector3.zero,.Vector3.on
4ba0 65 20 2a 20 32 29 3b 0a 20 20 20 20 20 20 20 20 56 65 63 74 6f 72 33 20 63 6f 6e 74 65 6e 74 53 e.*.2);.........Vector3.contentS
4bc0 69 7a 65 20 3d 20 56 65 63 74 6f 72 33 2e 6f 6e 65 3b 0a 20 20 20 20 20 20 20 20 56 65 63 74 6f ize.=.Vector3.one;.........Vecto
4be0 72 33 20 63 6f 6e 74 65 6e 74 50 6f 73 20 3d 20 56 65 63 74 6f 72 33 2e 6f 6e 65 3b 0a 20 20 20 r3.contentPos.=.Vector3.one;....
4c00 20 20 20 20 20 76 61 72 20 63 6f 6e 74 65 6e 74 50 69 76 6f 74 20 3d 20 6e 65 77 20 56 65 63 74 .....var.contentPivot.=.new.Vect
4c20 6f 72 32 28 30 2e 35 66 2c 20 30 2e 35 66 29 3b 0a 0a 20 20 20 20 20 20 20 20 6f 62 6a 65 63 74 or2(0.5f,.0.5f);..........object
4c40 5b 5d 20 61 72 67 75 6d 65 6e 74 73 20 3d 20 6e 65 77 20 6f 62 6a 65 63 74 5b 5d 20 7b 20 76 69 [].arguments.=.new.object[].{.vi
4c60 65 77 42 6f 75 6e 64 73 2c 20 63 6f 6e 74 65 6e 74 50 69 76 6f 74 2c 20 63 6f 6e 74 65 6e 74 53 ewBounds,.contentPivot,.contentS
4c80 69 7a 65 2c 20 63 6f 6e 74 65 6e 74 50 6f 73 20 7d 3b 0a 20 20 20 20 20 20 20 20 4d 65 74 68 6f ize,.contentPos.};.........Metho
4ca0 64 49 6e 66 6f 20 6d 65 74 68 6f 64 20 3d 20 74 79 70 65 6f 66 28 53 63 72 6f 6c 6c 52 65 63 74 dInfo.method.=.typeof(ScrollRect
4cc0 29 2e 47 65 74 4d 65 74 68 6f 64 28 22 41 64 6a 75 73 74 42 6f 75 6e 64 73 22 2c 20 42 69 6e 64 ).GetMethod("AdjustBounds",.Bind
4ce0 69 6e 67 46 6c 61 67 73 2e 4e 6f 6e 50 75 62 6c 69 63 20 7c 20 42 69 6e 64 69 6e 67 46 6c 61 67 ingFlags.NonPublic.|.BindingFlag
4d00 73 2e 53 74 61 74 69 63 29 3b 0a 20 20 20 20 20 20 20 20 6d 65 74 68 6f 64 2e 49 6e 76 6f 6b 65 s.Static);.........method.Invoke
4d20 28 6e 75 6c 6c 2c 20 61 72 67 75 6d 65 6e 74 73 29 3b 0a 0a 20 20 20 20 20 20 20 20 2f 2f 53 63 (null,.arguments);..........//Sc
4d40 72 6f 6c 6c 52 65 63 74 2e 41 64 6a 75 73 74 42 6f 75 6e 64 73 28 72 65 66 20 76 69 65 77 42 6f rollRect.AdjustBounds(ref.viewBo
4d60 75 6e 64 73 2c 20 72 65 66 20 63 6f 6e 74 65 6e 74 50 69 76 6f 74 2c 20 72 65 66 20 63 6f 6e 74 unds,.ref.contentPivot,.ref.cont
4d80 65 6e 74 53 69 7a 65 2c 20 72 65 66 20 63 6f 6e 74 65 6e 74 50 6f 73 29 3b 0a 20 20 20 20 20 20 entSize,.ref.contentPos);.......
4da0 20 20 41 73 73 65 72 74 2e 41 72 65 45 71 75 61 6c 28 6e 65 77 20 56 65 63 74 6f 72 33 28 32 2c ..Assert.AreEqual(new.Vector3(2,
4dc0 20 32 2c 20 31 29 2c 20 61 72 67 75 6d 65 6e 74 73 5b 32 5d 29 3b 0a 20 20 20 20 7d 0a 0a 20 20 .2,.1),.arguments[2]);.....}....
4de0 20 20 5b 54 65 73 74 5d 0a 20 20 20 20 5b 54 65 73 74 43 61 73 65 28 74 72 75 65 2c 20 74 72 75 ..[Test].....[TestCase(true,.tru
4e00 65 2c 20 32 2c 20 34 2c 20 2d 32 2c 20 2d 32 2c 20 54 65 73 74 4e 61 6d 65 20 3d 20 22 53 68 6f e,.2,.4,.-2,.-2,.TestName.=."Sho
4e20 75 6c 64 20 63 6c 61 6d 70 20 6f 66 66 73 65 74 22 29 5d 0a 20 20 20 20 5b 54 65 73 74 43 61 73 uld.clamp.offset")].....[TestCas
4e40 65 28 66 61 6c 73 65 2c 20 74 72 75 65 2c 20 32 2c 20 34 2c 20 30 2c 20 2d 32 2c 20 54 65 73 74 e(false,.true,.2,.4,.0,.-2,.Test
4e60 4e 61 6d 65 20 3d 20 22 56 65 72 74 69 63 61 6c 20 73 68 6f 75 6c 64 20 63 6c 61 6d 70 20 6f 66 Name.=."Vertical.should.clamp.of
4e80 66 73 65 74 20 6f 6e 20 6f 6e 65 20 61 78 69 73 22 29 5d 0a 20 20 20 20 5b 54 65 73 74 43 61 73 fset.on.one.axis")].....[TestCas
4ea0 65 28 74 72 75 65 2c 20 66 61 6c 73 65 2c 20 32 2c 20 34 2c 20 2d 32 2c 20 30 2c 20 54 65 73 74 e(true,.false,.2,.4,.-2,.0,.Test
4ec0 4e 61 6d 65 20 3d 20 22 48 6f 72 69 7a 6f 6e 74 61 6c 20 73 68 6f 75 6c 64 20 63 6c 61 6d 70 20 Name.=."Horizontal.should.clamp.
4ee0 6f 66 66 73 65 74 20 6f 6e 20 6f 6e 65 20 61 78 69 73 22 29 5d 0a 20 20 20 20 5b 54 65 73 74 43 offset.on.one.axis")].....[TestC
4f00 61 73 65 28 66 61 6c 73 65 2c 20 66 61 6c 73 65 2c 20 32 2c 20 34 2c 20 30 2c 20 30 2c 20 54 65 ase(false,.false,.2,.4,.0,.0,.Te
4f20 73 74 4e 61 6d 65 20 3d 20 22 4e 6f 20 61 78 69 73 20 73 68 6f 75 6c 64 20 6e 6f 74 20 63 6c 61 stName.=."No.axis.should.not.cla
4f40 6d 70 20 6f 66 66 73 65 74 22 29 5d 0a 20 20 20 20 5b 54 65 73 74 43 61 73 65 28 74 72 75 65 2c mp.offset")].....[TestCase(true,
4f60 20 74 72 75 65 2c 20 38 2c 20 31 30 2c 20 32 2c 20 32 2c 20 54 65 73 74 4e 61 6d 65 20 3d 20 22 .true,.8,.10,.2,.2,.TestName.=."
4f80 53 68 6f 75 6c 64 20 63 6c 61 6d 70 20 6e 65 67 61 74 69 76 65 20 6f 66 66 73 65 74 22 29 5d 0a Should.clamp.negative.offset")].
4fa0 20 20 20 20 5b 54 65 73 74 43 61 73 65 28 66 61 6c 73 65 2c 20 74 72 75 65 2c 20 38 2c 20 31 30 ....[TestCase(false,.true,.8,.10
4fc0 2c 20 30 2c 20 32 2c 20 54 65 73 74 4e 61 6d 65 20 3d 20 22 56 65 72 74 69 63 61 6c 20 73 68 6f ,.0,.2,.TestName.=."Vertical.sho
4fe0 75 6c 64 20 63 6c 61 6d 70 20 6e 65 67 61 74 69 76 65 20 6f 66 66 73 65 74 20 6f 6e 20 6f 6e 65 uld.clamp.negative.offset.on.one
5000 20 61 78 69 73 22 29 5d 0a 20 20 20 20 5b 54 65 73 74 43 61 73 65 28 74 72 75 65 2c 20 66 61 6c .axis")].....[TestCase(true,.fal
5020 73 65 2c 20 38 2c 20 31 30 2c 20 32 2c 20 30 2c 20 54 65 73 74 4e 61 6d 65 20 3d 20 22 48 6f 72 se,.8,.10,.2,.0,.TestName.=."Hor
5040 69 7a 6f 6e 74 61 6c 20 73 68 6f 75 6c 64 20 63 6c 61 6d 70 20 6e 65 67 61 74 69 76 65 20 6f 66 izontal.should.clamp.negative.of
5060 66 73 65 74 20 6f 6e 20 6f 6e 65 20 61 78 69 73 22 29 5d 0a 20 20 20 20 5b 54 65 73 74 43 61 73 fset.on.one.axis")].....[TestCas
5080 65 28 66 61 6c 73 65 2c 20 66 61 6c 73 65 2c 20 38 2c 20 31 30 2c 20 30 2c 20 30 2c 20 54 65 73 e(false,.false,.8,.10,.0,.0,.Tes
50a0 74 4e 61 6d 65 20 3d 20 22 4e 6f 20 61 78 69 73 20 73 68 6f 75 6c 64 20 6e 6f 74 20 63 6c 61 6d tName.=."No.axis.should.not.clam
50c0 70 20 6e 65 67 61 74 69 76 65 20 6f 66 66 73 65 74 22 29 5d 0a 20 20 20 20 70 75 62 6c 69 63 20 p.negative.offset")].....public.
50e0 76 6f 69 64 20 43 61 6c 63 75 6c 61 74 65 4f 66 66 73 65 74 53 68 6f 75 6c 64 43 6c 61 6d 70 28 void.CalculateOffsetShouldClamp(
5100 62 6f 6f 6c 20 68 6f 72 69 7a 6f 6e 74 61 6c 2c 20 62 6f 6f 6c 20 76 65 72 74 69 63 61 6c 2c 20 bool.horizontal,.bool.vertical,.
5120 69 6e 74 20 76 69 65 77 58 2c 20 66 6c 6f 61 74 20 76 69 65 77 59 2c 20 66 6c 6f 61 74 20 72 65 int.viewX,.float.viewY,.float.re
5140 73 58 2c 20 66 6c 6f 61 74 20 72 65 73 59 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 54 65 sX,.float.resY).....{.........Te
5160 73 74 43 61 6c 63 75 6c 61 74 65 4f 66 66 73 65 74 28 53 63 72 6f 6c 6c 52 65 63 74 2e 4d 6f 76 stCalculateOffset(ScrollRect.Mov
5180 65 6d 65 6e 74 54 79 70 65 2e 43 6c 61 6d 70 65 64 2c 20 68 6f 72 69 7a 6f 6e 74 61 6c 2c 20 76 ementType.Clamped,.horizontal,.v
51a0 65 72 74 69 63 61 6c 2c 20 76 69 65 77 58 2c 20 76 69 65 77 59 2c 20 72 65 73 58 2c 20 72 65 73 ertical,.viewX,.viewY,.resX,.res
51c0 59 2c 20 6e 65 77 20 42 6f 75 6e 64 73 28 6e 65 77 20 56 65 63 74 6f 72 33 28 35 2c 20 37 29 2c Y,.new.Bounds(new.Vector3(5,.7),
51e0 20 6e 65 77 20 56 65 63 74 6f 72 33 28 34 2c 20 34 29 29 29 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 .new.Vector3(4,.4)));.....}.....
5200 20 5b 54 65 73 74 5d 0a 20 20 20 20 5b 54 65 73 74 43 61 73 65 28 74 72 75 65 2c 20 74 72 75 65 .[Test].....[TestCase(true,.true
5220 2c 20 32 2c 20 34 2c 20 2d 32 2c 20 2d 32 2c 20 54 65 73 74 4e 61 6d 65 20 3d 20 22 53 68 6f 75 ,.2,.4,.-2,.-2,.TestName.=."Shou
5240 6c 64 20 63 6c 61 6d 70 20 6f 66 66 73 65 74 22 29 5d 0a 20 20 20 20 5b 54 65 73 74 43 61 73 65 ld.clamp.offset")].....[TestCase
5260 28 66 61 6c 73 65 2c 20 74 72 75 65 2c 20 32 2c 20 34 2c 20 30 2c 20 2d 32 2c 20 54 65 73 74 4e (false,.true,.2,.4,.0,.-2,.TestN
5280 61 6d 65 20 3d 20 22 56 65 72 74 69 63 61 6c 20 73 68 6f 75 6c 64 20 63 6c 61 6d 70 20 6f 66 66 ame.=."Vertical.should.clamp.off
52a0 73 65 74 20 6f 6e 20 6f 6e 65 20 61 78 69 73 22 29 5d 0a 20 20 20 20 5b 54 65 73 74 43 61 73 65 set.on.one.axis")].....[TestCase
52c0 28 74 72 75 65 2c 20 66 61 6c 73 65 2c 20 32 2c 20 34 2c 20 2d 32 2c 20 30 2c 20 54 65 73 74 4e (true,.false,.2,.4,.-2,.0,.TestN
52e0 61 6d 65 20 3d 20 22 48 6f 72 69 7a 6f 6e 74 61 6c 20 73 68 6f 75 6c 64 20 63 6c 61 6d 70 20 6f ame.=."Horizontal.should.clamp.o
5300 66 66 73 65 74 20 6f 6e 20 6f 6e 65 20 61 78 69 73 22 29 5d 0a 20 20 20 20 5b 54 65 73 74 43 61 ffset.on.one.axis")].....[TestCa
5320 73 65 28 66 61 6c 73 65 2c 20 66 61 6c 73 65 2c 20 32 2c 20 34 2c 20 30 2c 20 30 2c 20 54 65 73 se(false,.false,.2,.4,.0,.0,.Tes
5340 74 4e 61 6d 65 20 3d 20 22 4e 6f 20 61 78 69 73 20 73 68 6f 75 6c 64 20 6e 6f 74 20 63 6c 61 6d tName.=."No.axis.should.not.clam
5360 70 20 6f 66 66 73 65 74 22 29 5d 0a 20 20 20 20 5b 54 65 73 74 43 61 73 65 28 74 72 75 65 2c 20 p.offset")].....[TestCase(true,.
5380 74 72 75 65 2c 20 38 2c 20 31 30 2c 20 32 2c 20 32 2c 20 54 65 73 74 4e 61 6d 65 20 3d 20 22 53 true,.8,.10,.2,.2,.TestName.=."S
53a0 68 6f 75 6c 64 20 63 6c 61 6d 70 20 6e 65 67 61 74 69 76 65 20 6f 66 66 73 65 74 22 29 5d 0a 20 hould.clamp.negative.offset")]..
53c0 20 20 20 5b 54 65 73 74 43 61 73 65 28 66 61 6c 73 65 2c 20 74 72 75 65 2c 20 38 2c 20 31 30 2c ...[TestCase(false,.true,.8,.10,
53e0 20 30 2c 20 32 2c 20 54 65 73 74 4e 61 6d 65 20 3d 20 22 56 65 72 74 69 63 61 6c 20 73 68 6f 75 .0,.2,.TestName.=."Vertical.shou
5400 6c 64 20 63 6c 61 6d 70 20 6e 65 67 61 74 69 76 65 20 6f 66 66 73 65 74 20 6f 6e 20 6f 6e 65 20 ld.clamp.negative.offset.on.one.
5420 61 78 69 73 22 29 5d 0a 20 20 20 20 5b 54 65 73 74 43 61 73 65 28 74 72 75 65 2c 20 66 61 6c 73 axis")].....[TestCase(true,.fals
5440 65 2c 20 38 2c 20 31 30 2c 20 32 2c 20 30 2c 20 54 65 73 74 4e 61 6d 65 20 3d 20 22 48 6f 72 69 e,.8,.10,.2,.0,.TestName.=."Hori
5460 7a 6f 6e 74 61 6c 20 73 68 6f 75 6c 64 20 63 6c 61 6d 70 20 6e 65 67 61 74 69 76 65 20 6f 66 66 zontal.should.clamp.negative.off
5480 73 65 74 20 6f 6e 20 6f 6e 65 20 61 78 69 73 22 29 5d 0a 20 20 20 20 5b 54 65 73 74 43 61 73 65 set.on.one.axis")].....[TestCase
54a0 28 66 61 6c 73 65 2c 20 66 61 6c 73 65 2c 20 38 2c 20 31 30 2c 20 30 2c 20 30 2c 20 54 65 73 74 (false,.false,.8,.10,.0,.0,.Test
54c0 4e 61 6d 65 20 3d 20 22 4e 6f 20 61 78 69 73 20 73 68 6f 75 6c 64 20 6e 6f 74 20 63 6c 61 6d 70 Name.=."No.axis.should.not.clamp
54e0 20 6e 65 67 61 74 69 76 65 20 6f 66 66 73 65 74 22 29 5d 0a 20 20 20 20 70 75 62 6c 69 63 20 76 .negative.offset")].....public.v
5500 6f 69 64 20 43 61 6c 63 75 6c 61 74 65 4f 66 66 73 65 74 55 6e 72 65 73 74 72 69 63 74 65 64 53 oid.CalculateOffsetUnrestrictedS
5520 68 6f 75 6c 64 4e 6f 74 43 6c 61 6d 70 28 62 6f 6f 6c 20 68 6f 72 69 7a 6f 6e 74 61 6c 2c 20 62 houldNotClamp(bool.horizontal,.b
5540 6f 6f 6c 20 76 65 72 74 69 63 61 6c 2c 20 69 6e 74 20 76 69 65 77 58 2c 20 66 6c 6f 61 74 20 76 ool.vertical,.int.viewX,.float.v
5560 69 65 77 59 2c 20 66 6c 6f 61 74 20 72 65 73 58 2c 20 66 6c 6f 61 74 20 72 65 73 59 29 0a 20 20 iewY,.float.resX,.float.resY)...
5580 20 20 7b 0a 20 20 20 20 20 20 20 20 54 65 73 74 43 61 6c 63 75 6c 61 74 65 4f 66 66 73 65 74 28 ..{.........TestCalculateOffset(
55a0 53 63 72 6f 6c 6c 52 65 63 74 2e 4d 6f 76 65 6d 65 6e 74 54 79 70 65 2e 55 6e 72 65 73 74 72 69 ScrollRect.MovementType.Unrestri
55c0 63 74 65 64 2c 20 68 6f 72 69 7a 6f 6e 74 61 6c 2c 20 76 65 72 74 69 63 61 6c 2c 20 76 69 65 77 cted,.horizontal,.vertical,.view
55e0 58 2c 20 76 69 65 77 59 2c 20 30 2c 20 30 2c 20 6e 65 77 20 42 6f 75 6e 64 73 28 6e 65 77 20 56 X,.viewY,.0,.0,.new.Bounds(new.V
5600 65 63 74 6f 72 33 28 35 2c 20 37 29 2c 20 6e 65 77 20 56 65 63 74 6f 72 33 28 34 2c 20 34 29 29 ector3(5,.7),.new.Vector3(4,.4))
5620 29 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 70 72 69 76 61 74 65 20 73 74 61 74 69 63 20 76 6f 69 );.....}......private.static.voi
5640 64 20 54 65 73 74 43 61 6c 63 75 6c 61 74 65 4f 66 66 73 65 74 28 53 63 72 6f 6c 6c 52 65 63 74 d.TestCalculateOffset(ScrollRect
5660 2e 4d 6f 76 65 6d 65 6e 74 54 79 70 65 20 6d 6f 76 65 6d 65 6e 74 54 79 70 65 2c 20 62 6f 6f 6c .MovementType.movementType,.bool
5680 20 68 6f 72 69 7a 6f 6e 74 61 6c 2c 20 62 6f 6f 6c 20 76 65 72 74 69 63 61 6c 2c 20 69 6e 74 20 .horizontal,.bool.vertical,.int.
56a0 76 69 65 77 58 2c 20 66 6c 6f 61 74 20 76 69 65 77 59 2c 20 66 6c 6f 61 74 20 72 65 73 58 2c 20 viewX,.float.viewY,.float.resX,.
56c0 66 6c 6f 61 74 20 72 65 73 59 2c 20 42 6f 75 6e 64 73 20 63 6f 6e 74 65 6e 74 42 6f 75 6e 64 73 float.resY,.Bounds.contentBounds
56e0 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 42 6f 75 6e 64 73 20 76 69 65 77 42 6f 75 6e 64 ).....{.........Bounds.viewBound
5700 73 20 3d 20 6e 65 77 20 42 6f 75 6e 64 73 28 6e 65 77 20 56 65 63 74 6f 72 33 28 76 69 65 77 58 s.=.new.Bounds(new.Vector3(viewX
5720 2c 20 76 69 65 77 59 29 2c 20 6e 65 77 20 56 65 63 74 6f 72 33 28 32 2c 20 32 29 29 3b 0a 20 20 ,.viewY),.new.Vector3(2,.2));...
5740 20 20 20 20 20 20 2f 2f 20 63 6f 6e 74 65 6e 74 20 69 73 20 73 6f 75 74 68 20 65 61 73 74 20 6f ......//.content.is.south.east.o
5760 66 20 76 69 65 77 0a 20 20 20 20 20 20 20 20 56 65 63 74 6f 72 32 20 64 65 6c 74 61 20 3d 20 56 f.view.........Vector2.delta.=.V
5780 65 63 74 6f 72 32 2e 7a 65 72 6f 3b 0a 0a 20 20 20 20 20 20 20 20 6f 62 6a 65 63 74 5b 5d 20 61 ector2.zero;..........object[].a
57a0 72 67 75 6d 65 6e 74 73 20 3d 20 6e 65 77 20 6f 62 6a 65 63 74 5b 5d 20 7b 20 76 69 65 77 42 6f rguments.=.new.object[].{.viewBo
57c0 75 6e 64 73 2c 20 63 6f 6e 74 65 6e 74 42 6f 75 6e 64 73 2c 20 68 6f 72 69 7a 6f 6e 74 61 6c 2c unds,.contentBounds,.horizontal,
57e0 20 76 65 72 74 69 63 61 6c 2c 20 6d 6f 76 65 6d 65 6e 74 54 79 70 65 2c 20 64 65 6c 74 61 20 7d .vertical,.movementType,.delta.}
5800 3b 0a 20 20 20 20 20 20 20 20 4d 65 74 68 6f 64 49 6e 66 6f 20 6d 65 74 68 6f 64 20 3d 20 74 79 ;.........MethodInfo.method.=.ty
5820 70 65 6f 66 28 53 63 72 6f 6c 6c 52 65 63 74 29 2e 47 65 74 4d 65 74 68 6f 64 28 22 49 6e 74 65 peof(ScrollRect).GetMethod("Inte
5840 72 6e 61 6c 43 61 6c 63 75 6c 61 74 65 4f 66 66 73 65 74 22 2c 20 42 69 6e 64 69 6e 67 46 6c 61 rnalCalculateOffset",.BindingFla
5860 67 73 2e 4e 6f 6e 50 75 62 6c 69 63 20 7c 20 42 69 6e 64 69 6e 67 46 6c 61 67 73 2e 53 74 61 74 gs.NonPublic.|.BindingFlags.Stat
5880 69 63 29 3b 0a 20 20 20 20 20 20 20 20 76 61 72 20 72 65 73 75 6c 74 20 3d 20 28 56 65 63 74 6f ic);.........var.result.=.(Vecto
58a0 72 32 29 6d 65 74 68 6f 64 2e 49 6e 76 6f 6b 65 28 6e 75 6c 6c 2c 20 61 72 67 75 6d 65 6e 74 73 r2)method.Invoke(null,.arguments
58c0 29 3b 0a 0a 20 20 20 20 20 20 20 20 43 6f 6e 73 6f 6c 65 2e 57 72 69 74 65 4c 69 6e 65 28 72 65 );..........Console.WriteLine(re
58e0 73 75 6c 74 29 3b 0a 20 20 20 20 20 20 20 20 41 73 73 65 72 74 2e 41 72 65 45 71 75 61 6c 28 6e sult);.........Assert.AreEqual(n
5900 65 77 20 56 65 63 74 6f 72 32 28 72 65 73 58 2c 20 72 65 73 59 29 2c 20 72 65 73 75 6c 74 29 3b ew.Vector2(resX,.resY),.result);
5920 0a 20 20 20 20 7d 0a 0a 20 20 20 20 23 65 6e 64 72 65 67 69 6f 6e 0a 7d 0a 00 00 00 00 00 00 00 .....}......#endregion.}........
5940 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0f 00 00 00 53 63 72 6f 6c 6c 52 65 63 74 54 65 ....................ScrollRectTe
5960 73 74 73 00 00 00 00 00 sts.....