summaryrefslogtreecommitdiff
path: root/Library/Artifacts/85/856288e33efa9a5b36a89c6204e892dd
blob: 81d25ad5f9de5a82bb0b4597c97ebb0c3eacfc49 (plain)
ofshex dumpascii
0000 00 00 0f 81 00 01 b3 84 00 00 00 15 00 00 10 00 00 00 00 00 32 30 31 39 2e 33 2e 36 66 31 00 fe ....................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 24 a3 01 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 $...............................
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 11 00 00 00 54 4d 50 5f 54 65 78 74 55 74 69 6c 69 74 69 65 73 00 00 00 ............TMP_TextUtilities...
10a0 a6 a2 01 00 75 73 69 6e 67 20 55 6e 69 74 79 45 6e 67 69 6e 65 3b 0d 0a 75 73 69 6e 67 20 53 79 ....using.UnityEngine;..using.Sy
10c0 73 74 65 6d 2e 43 6f 6c 6c 65 63 74 69 6f 6e 73 3b 0d 0a 0d 0a 0d 0a 6e 61 6d 65 73 70 61 63 65 stem.Collections;......namespace
10e0 20 54 4d 50 72 6f 0d 0a 7b 0d 0a 20 20 20 20 70 75 62 6c 69 63 20 65 6e 75 6d 20 43 61 72 65 74 .TMPro..{......public.enum.Caret
1100 50 6f 73 69 74 69 6f 6e 20 7b 20 4e 6f 6e 65 2c 20 4c 65 66 74 2c 20 52 69 67 68 74 20 7d 0d 0a Position.{.None,.Left,.Right.}..
1120 0d 0a 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 2f 2f 2f 20 53 74 72 ......///.<summary>......///.Str
1140 75 63 74 75 72 65 20 77 68 69 63 68 20 63 6f 6e 74 61 69 6e 73 20 74 68 65 20 63 68 61 72 61 63 ucture.which.contains.the.charac
1160 74 65 72 20 69 6e 64 65 78 20 61 6e 64 20 70 6f 73 69 74 69 6f 6e 20 6f 66 20 63 61 72 65 74 20 ter.index.and.position.of.caret.
1180 72 65 6c 61 74 69 76 65 20 74 6f 20 74 68 65 20 63 68 61 72 61 63 74 65 72 2e 0d 0a 20 20 20 20 relative.to.the.character.......
11a0 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 70 75 62 6c 69 63 20 73 74 72 75 63 ///.</summary>......public.struc
11c0 74 20 43 61 72 65 74 49 6e 66 6f 0d 0a 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c t.CaretInfo......{..........publ
11e0 69 63 20 69 6e 74 20 69 6e 64 65 78 3b 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 43 61 ic.int.index;..........public.Ca
1200 72 65 74 50 6f 73 69 74 69 6f 6e 20 70 6f 73 69 74 69 6f 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 retPosition.position;...........
1220 20 70 75 62 6c 69 63 20 43 61 72 65 74 49 6e 66 6f 28 69 6e 74 20 69 6e 64 65 78 2c 20 43 61 72 .public.CaretInfo(int.index,.Car
1240 65 74 50 6f 73 69 74 69 6f 6e 20 70 6f 73 69 74 69 6f 6e 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d etPosition.position)..........{.
1260 0a 20 20 20 20 20 20 20 20 20 20 20 20 74 68 69 73 2e 69 6e 64 65 78 20 3d 20 69 6e 64 65 78 3b .............this.index.=.index;
1280 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 74 68 69 73 2e 70 6f 73 69 74 69 6f 6e 20 3d 20 70 6f ..............this.position.=.po
12a0 73 69 74 69 6f 6e 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 sition;..........}......}.......
12c0 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 63 6c 61 73 73 20 54 4d 50 5f 54 65 78 74 55 74 69 .public.static.class.TMP_TextUti
12e0 6c 69 74 69 65 73 0d 0a 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 73 lities......{..........private.s
1300 74 61 74 69 63 20 56 65 63 74 6f 72 33 5b 5d 20 6d 5f 72 65 63 74 57 6f 72 6c 64 43 6f 72 6e 65 tatic.Vector3[].m_rectWorldCorne
1320 72 73 20 3d 20 6e 65 77 20 56 65 63 74 6f 72 33 5b 34 5d 3b 0d 0a 20 20 20 20 20 20 20 20 0d 0a rs.=.new.Vector3[4];............
1340 20 20 20 20 20 20 20 20 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 54 45 58 54 20 49 4e 50 55 54 20 ..................//.TEXT.INPUT.
1360 43 4f 4d 50 4f 4e 45 4e 54 20 52 45 4c 41 54 45 44 20 46 55 4e 43 54 49 4f 4e 53 0d 0a 0d 0a 20 COMPONENT.RELATED.FUNCTIONS.....
1380 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f .......///.<summary>..........//
13a0 2f 20 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 /...........///.</summary>......
13c0 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 74 65 78 74 43 6f 6d 70 6f 6e 65 ....///.<param.name="textCompone
13e0 6e 74 22 3e 41 20 72 65 66 65 72 65 6e 63 65 20 74 6f 20 74 68 65 20 74 65 78 74 20 6f 62 6a 65 nt">A.reference.to.the.text.obje
1400 63 74 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 ct.</param>..........///.<param.
1420 6e 61 6d 65 3d 22 70 6f 73 69 74 69 6f 6e 22 3e 50 6f 73 69 74 69 6f 6e 20 74 6f 20 63 68 65 63 name="position">Position.to.chec
1440 6b 20 66 6f 72 20 69 6e 74 65 72 73 65 63 74 69 6f 6e 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 k.for.intersection.</param>.....
1460 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 63 61 6d 65 72 61 22 3e 54 68 .....///.<param.name="camera">Th
1480 65 20 73 63 65 6e 65 20 63 61 6d 65 72 61 20 77 68 69 63 68 20 6d 61 79 20 62 65 20 61 73 73 69 e.scene.camera.which.may.be.assi
14a0 67 6e 65 64 20 74 6f 20 61 20 43 61 6e 76 61 73 20 75 73 69 6e 67 20 53 63 72 65 65 6e 53 70 61 gned.to.a.Canvas.using.ScreenSpa
14c0 63 65 20 43 61 6d 65 72 61 20 6f 72 20 57 6f 72 6c 64 53 70 61 63 65 20 72 65 6e 64 65 72 20 6d ce.Camera.or.WorldSpace.render.m
14e0 6f 64 65 2e 20 53 65 74 20 74 6f 20 6e 75 6c 6c 20 69 73 20 75 73 69 6e 67 20 53 63 72 65 65 6e ode..Set.to.null.is.using.Screen
1500 53 70 61 63 65 20 4f 76 65 72 6c 61 79 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 Space.Overlay.</param>..........
1520 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 20 ///.<returns></returns>.........
1540 20 2f 2f 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 43 61 72 65 74 49 6e 66 6f 20 47 65 74 43 75 .//public.static.CaretInfo.GetCu
1560 72 73 6f 72 49 6e 73 65 72 74 69 6f 6e 49 6e 64 65 78 28 54 4d 50 5f 54 65 78 74 20 74 65 78 74 rsorInsertionIndex(TMP_Text.text
1580 43 6f 6d 70 6f 6e 65 6e 74 2c 20 56 65 63 74 6f 72 33 20 70 6f 73 69 74 69 6f 6e 2c 20 43 61 6d Component,.Vector3.position,.Cam
15a0 65 72 61 20 63 61 6d 65 72 61 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 7b 0d 0a 20 20 20 20 20 20 era.camera)..........//{........
15c0 20 20 2f 2f 20 20 20 20 69 6e 74 20 69 6e 64 65 78 20 3d 20 54 4d 50 5f 54 65 78 74 55 74 69 6c ..//....int.index.=.TMP_TextUtil
15e0 69 74 69 65 73 2e 46 69 6e 64 4e 65 61 72 65 73 74 43 68 61 72 61 63 74 65 72 28 74 65 78 74 43 ities.FindNearestCharacter(textC
1600 6f 6d 70 6f 6e 65 6e 74 2c 20 70 6f 73 69 74 69 6f 6e 2c 20 63 61 6d 65 72 61 2c 20 66 61 6c 73 omponent,.position,.camera,.fals
1620 65 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 52 65 63 74 54 72 61 6e 73 66 6f e);............//....RectTransfo
1640 72 6d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 20 3d 20 74 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 rm.rectTransform.=.textComponent
1660 2e 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 .rectTransform;............//...
1680 20 2f 2f 20 43 6f 6e 76 65 72 74 20 70 6f 73 69 74 69 6f 6e 20 69 6e 74 6f 20 57 6f 72 6c 64 73 .//.Convert.position.into.Worlds
16a0 70 61 63 65 20 63 6f 6f 72 64 69 6e 61 74 65 73 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 pace.coordinates..........//....
16c0 53 63 72 65 65 6e 50 6f 69 6e 74 54 6f 57 6f 72 6c 64 50 6f 69 6e 74 49 6e 52 65 63 74 61 6e 67 ScreenPointToWorldPointInRectang
16e0 6c 65 28 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2c 20 70 6f 73 69 74 69 6f 6e 2c 20 63 61 6d 65 le(rectTransform,.position,.came
1700 72 61 2c 20 6f 75 74 20 70 6f 73 69 74 69 6f 6e 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f ra,.out.position);............//
1720 20 20 20 20 54 4d 50 5f 43 68 61 72 61 63 74 65 72 49 6e 66 6f 20 63 49 6e 66 6f 20 3d 20 74 65 ....TMP_CharacterInfo.cInfo.=.te
1740 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 65 78 74 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 49 6e xtComponent.textInfo.characterIn
1760 66 6f 5b 69 6e 64 65 78 5d 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 2f 2f 20 47 fo[index];............//....//.G
1780 65 74 20 42 6f 74 74 6f 6d 20 4c 65 66 74 20 61 6e 64 20 54 6f 70 20 52 69 67 68 74 20 70 6f 73 et.Bottom.Left.and.Top.Right.pos
17a0 69 74 69 6f 6e 20 6f 66 20 74 68 65 20 63 75 72 72 65 6e 74 20 63 68 61 72 61 63 74 65 72 0d 0a ition.of.the.current.character..
17c0 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 56 65 63 74 6f 72 33 20 62 6c 20 3d 20 72 65 63 74 54 ........//....Vector3.bl.=.rectT
17e0 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 63 49 6e 66 6f 2e 62 6f ransform.TransformPoint(cInfo.bo
1800 74 74 6f 6d 4c 65 66 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 2f 2f 56 65 63 74 ttomLeft);..........//....//Vect
1820 6f 72 33 20 74 6c 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d or3.tl.=.rectTransform.Transform
1840 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 63 49 6e 66 6f 2e 62 6f 74 74 6f 6d 4c 65 Point(new.Vector3(cInfo.bottomLe
1860 66 74 2e 78 2c 20 63 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 2e 79 2c 20 30 29 29 3b 0d 0a 20 20 ft.x,.cInfo.topRight.y,.0));....
1880 20 20 20 20 20 20 2f 2f 20 20 20 20 56 65 63 74 6f 72 33 20 74 72 20 3d 20 72 65 63 74 54 72 61 ......//....Vector3.tr.=.rectTra
18a0 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 63 49 6e 66 6f 2e 74 6f 70 52 nsform.TransformPoint(cInfo.topR
18c0 69 67 68 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 2f 2f 56 65 63 74 6f 72 33 20 ight);..........//....//Vector3.
18e0 62 72 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e br.=.rectTransform.TransformPoin
1900 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 63 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 2e 78 2c 20 t(new.Vector3(cInfo.topRight.x,.
1920 63 49 6e 66 6f 2e 62 6f 74 74 6f 6d 4c 65 66 74 2e 79 2c 20 30 29 29 3b 0d 0a 0d 0a 20 20 20 20 cInfo.bottomLeft.y,.0));........
1940 20 20 20 20 2f 2f 20 20 20 20 66 6c 6f 61 74 20 69 6e 73 65 72 74 50 6f 73 69 74 69 6f 6e 20 3d ....//....float.insertPosition.=
1960 20 28 70 6f 73 69 74 69 6f 6e 2e 78 20 2d 20 62 6c 2e 78 29 20 2f 20 28 74 72 2e 78 20 2d 20 62 .(position.x.-.bl.x)./.(tr.x.-.b
1980 6c 2e 78 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 69 66 20 28 69 6e 73 65 72 l.x);............//....if.(inser
19a0 74 50 6f 73 69 74 69 6f 6e 20 3c 20 30 2e 35 66 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 tPosition.<.0.5f)..........//...
19c0 20 20 20 20 20 72 65 74 75 72 6e 20 6e 65 77 20 43 61 72 65 74 49 6e 66 6f 28 69 6e 64 65 78 2c .....return.new.CaretInfo(index,
19e0 20 43 61 72 65 74 50 6f 73 69 74 69 6f 6e 2e 4c 65 66 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f .CaretPosition.Left);........../
1a00 2f 20 20 20 20 65 6c 73 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 72 65 74 /....else..........//........ret
1a20 75 72 6e 20 6e 65 77 20 43 61 72 65 74 49 6e 66 6f 28 69 6e 64 65 78 2c 20 43 61 72 65 74 50 6f urn.new.CaretInfo(index,.CaretPo
1a40 73 69 74 69 6f 6e 2e 52 69 67 68 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 7d 0d 0a 0d 0a 0d sition.Right);..........//}.....
1a60 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 .........///.<summary>..........
1a80 2f 2f 2f 20 46 75 6e 63 74 69 6f 6e 20 72 65 74 75 72 6e 69 6e 67 20 74 68 65 20 69 6e 64 65 78 ///.Function.returning.the.index
1aa0 20 6f 66 20 74 68 65 20 63 68 61 72 61 63 74 65 72 20 77 68 6f 73 65 20 6f 72 69 67 69 6e 20 69 .of.the.character.whose.origin.i
1ac0 73 20 63 6c 6f 73 65 73 74 20 74 6f 20 74 68 65 20 63 75 72 73 6f 72 2e 0d 0a 20 20 20 20 20 20 s.closest.to.the.cursor.........
1ae0 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 ..///.</summary>..........///.<p
1b00 61 72 61 6d 20 6e 61 6d 65 3d 22 74 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 22 3e 41 20 72 65 66 65 aram.name="textComponent">A.refe
1b20 72 65 6e 63 65 20 74 6f 20 74 68 65 20 74 65 78 74 20 6f 62 6a 65 63 74 2e 3c 2f 70 61 72 61 6d rence.to.the.text.object.</param
1b40 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 70 6f 73 69 >..........///.<param.name="posi
1b60 74 69 6f 6e 22 3e 50 6f 73 69 74 69 6f 6e 20 74 6f 20 63 68 65 63 6b 20 66 6f 72 20 69 6e 74 65 tion">Position.to.check.for.inte
1b80 72 73 65 63 74 69 6f 6e 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c rsection.</param>..........///.<
1ba0 70 61 72 61 6d 20 6e 61 6d 65 3d 22 63 61 6d 65 72 61 22 3e 54 68 65 20 73 63 65 6e 65 20 63 61 param.name="camera">The.scene.ca
1bc0 6d 65 72 61 20 77 68 69 63 68 20 6d 61 79 20 62 65 20 61 73 73 69 67 6e 65 64 20 74 6f 20 61 20 mera.which.may.be.assigned.to.a.
1be0 43 61 6e 76 61 73 20 75 73 69 6e 67 20 53 63 72 65 65 6e 53 70 61 63 65 20 43 61 6d 65 72 61 20 Canvas.using.ScreenSpace.Camera.
1c00 6f 72 20 57 6f 72 6c 64 53 70 61 63 65 20 72 65 6e 64 65 72 20 6d 6f 64 65 2e 20 53 65 74 20 74 or.WorldSpace.render.mode..Set.t
1c20 6f 20 6e 75 6c 6c 20 69 73 20 75 73 69 6e 67 20 53 63 72 65 65 6e 53 70 61 63 65 20 4f 76 65 72 o.null.is.using.ScreenSpace.Over
1c40 6c 61 79 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 74 75 72 lay.</param>..........///.<retur
1c60 6e 73 3e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 ns></returns>..........public.st
1c80 61 74 69 63 20 69 6e 74 20 47 65 74 43 75 72 73 6f 72 49 6e 64 65 78 46 72 6f 6d 50 6f 73 69 74 atic.int.GetCursorIndexFromPosit
1ca0 69 6f 6e 28 54 4d 50 5f 54 65 78 74 20 74 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2c 20 56 65 63 74 ion(TMP_Text.textComponent,.Vect
1cc0 6f 72 33 20 70 6f 73 69 74 69 6f 6e 2c 20 43 61 6d 65 72 61 20 63 61 6d 65 72 61 29 0d 0a 20 20 or3.position,.Camera.camera)....
1ce0 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 20 69 6e 64 65 78 20 3d ......{..............int.index.=
1d00 20 54 4d 50 5f 54 65 78 74 55 74 69 6c 69 74 69 65 73 2e 46 69 6e 64 4e 65 61 72 65 73 74 43 68 .TMP_TextUtilities.FindNearestCh
1d20 61 72 61 63 74 65 72 28 74 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2c 20 70 6f 73 69 74 69 6f 6e 2c aracter(textComponent,.position,
1d40 20 63 61 6d 65 72 61 2c 20 66 61 6c 73 65 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 .camera,.false);................
1d60 52 65 63 74 54 72 61 6e 73 66 6f 72 6d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 20 3d 20 74 65 RectTransform.rectTransform.=.te
1d80 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 3b 0d 0a 0d 0a 20 20 xtComponent.rectTransform;......
1da0 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 6f 6e 76 65 72 74 20 70 6f 73 69 74 69 6f 6e 20 69 6e ..........//.Convert.position.in
1dc0 74 6f 20 57 6f 72 6c 64 73 70 61 63 65 20 63 6f 6f 72 64 69 6e 61 74 65 73 0d 0a 20 20 20 20 20 to.Worldspace.coordinates.......
1de0 20 20 20 20 20 20 20 53 63 72 65 65 6e 50 6f 69 6e 74 54 6f 57 6f 72 6c 64 50 6f 69 6e 74 49 6e .......ScreenPointToWorldPointIn
1e00 52 65 63 74 61 6e 67 6c 65 28 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2c 20 70 6f 73 69 74 69 6f Rectangle(rectTransform,.positio
1e20 6e 2c 20 63 61 6d 65 72 61 2c 20 6f 75 74 20 70 6f 73 69 74 69 6f 6e 29 3b 0d 0a 0d 0a 20 20 20 n,.camera,.out.position);.......
1e40 20 20 20 20 20 20 20 20 20 54 4d 50 5f 43 68 61 72 61 63 74 65 72 49 6e 66 6f 20 63 49 6e 66 6f .........TMP_CharacterInfo.cInfo
1e60 20 3d 20 74 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 65 78 74 49 6e 66 6f 2e 63 68 61 72 61 63 .=.textComponent.textInfo.charac
1e80 74 65 72 49 6e 66 6f 5b 69 6e 64 65 78 5d 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f terInfo[index];................/
1ea0 2f 20 47 65 74 20 42 6f 74 74 6f 6d 20 4c 65 66 74 20 61 6e 64 20 54 6f 70 20 52 69 67 68 74 20 /.Get.Bottom.Left.and.Top.Right.
1ec0 70 6f 73 69 74 69 6f 6e 20 6f 66 20 74 68 65 20 63 75 72 72 65 6e 74 20 63 68 61 72 61 63 74 65 position.of.the.current.characte
1ee0 72 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 56 65 63 74 6f 72 33 20 62 6c 20 3d 20 72 65 63 74 r..............Vector3.bl.=.rect
1f00 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 63 49 6e 66 6f 2e 62 Transform.TransformPoint(cInfo.b
1f20 6f 74 74 6f 6d 4c 65 66 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 56 65 63 74 6f 72 33 ottomLeft);..............Vector3
1f40 20 74 72 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 .tr.=.rectTransform.TransformPoi
1f60 6e 74 28 63 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 nt(cInfo.topRight);.............
1f80 20 20 20 66 6c 6f 61 74 20 69 6e 73 65 72 74 50 6f 73 69 74 69 6f 6e 20 3d 20 28 70 6f 73 69 74 ...float.insertPosition.=.(posit
1fa0 69 6f 6e 2e 78 20 2d 20 62 6c 2e 78 29 20 2f 20 28 74 72 2e 78 20 2d 20 62 6c 2e 78 29 3b 0d 0a ion.x.-.bl.x)./.(tr.x.-.bl.x);..
1fc0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 69 6e 73 65 72 74 50 6f 73 69 74 69 6f 6e ..............if.(insertPosition
1fe0 20 3c 20 30 2e 35 66 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e .<.0.5f)..................return
2000 20 69 6e 64 65 78 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 0d 0a 20 20 20 20 20 .index;..............else.......
2020 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 69 6e 64 65 78 20 2b 20 31 3b 0d 0a 0d 0a ...........return.index.+.1;....
2040 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d ........}..............///.<summ
2060 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 46 75 6e 63 74 69 6f 6e 20 72 65 74 75 72 ary>..........///.Function.retur
2080 6e 69 6e 67 20 74 68 65 20 69 6e 64 65 78 20 6f 66 20 74 68 65 20 63 68 61 72 61 63 74 65 72 20 ning.the.index.of.the.character.
20a0 77 68 6f 73 65 20 6f 72 69 67 69 6e 20 69 73 20 63 6c 6f 73 65 73 74 20 74 6f 20 74 68 65 20 63 whose.origin.is.closest.to.the.c
20c0 75 72 73 6f 72 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a ursor...........///.</summary>..
20e0 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 74 65 78 74 43 6f 6d ........///.<param.name="textCom
2100 70 6f 6e 65 6e 74 22 3e 41 20 72 65 66 65 72 65 6e 63 65 20 74 6f 20 74 68 65 20 74 65 78 74 20 ponent">A.reference.to.the.text.
2120 6f 62 6a 65 63 74 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 object.</param>..........///.<pa
2140 72 61 6d 20 6e 61 6d 65 3d 22 70 6f 73 69 74 69 6f 6e 22 3e 50 6f 73 69 74 69 6f 6e 20 74 6f 20 ram.name="position">Position.to.
2160 63 68 65 63 6b 20 66 6f 72 20 69 6e 74 65 72 73 65 63 74 69 6f 6e 2e 3c 2f 70 61 72 61 6d 3e 0d check.for.intersection.</param>.
2180 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 63 61 6d 65 72 61 .........///.<param.name="camera
21a0 22 3e 54 68 65 20 73 63 65 6e 65 20 63 61 6d 65 72 61 20 77 68 69 63 68 20 6d 61 79 20 62 65 20 ">The.scene.camera.which.may.be.
21c0 61 73 73 69 67 6e 65 64 20 74 6f 20 61 20 43 61 6e 76 61 73 20 75 73 69 6e 67 20 53 63 72 65 65 assigned.to.a.Canvas.using.Scree
21e0 6e 53 70 61 63 65 20 43 61 6d 65 72 61 20 6f 72 20 57 6f 72 6c 64 53 70 61 63 65 20 72 65 6e 64 nSpace.Camera.or.WorldSpace.rend
2200 65 72 20 6d 6f 64 65 2e 20 53 65 74 20 74 6f 20 6e 75 6c 6c 20 69 73 20 75 73 69 6e 67 20 53 63 er.mode..Set.to.null.is.using.Sc
2220 72 65 65 6e 53 70 61 63 65 20 4f 76 65 72 6c 61 79 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 reenSpace.Overlay.</param>......
2240 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 63 75 72 73 6f 72 22 3e 54 68 65 ....///.<param.name="cursor">The
2260 20 70 6f 73 69 74 69 6f 6e 20 6f 66 20 74 68 65 20 63 75 72 73 6f 72 20 69 6e 73 65 72 74 69 6f .position.of.the.cursor.insertio
2280 6e 20 70 6f 73 69 74 69 6f 6e 20 72 65 6c 61 74 69 76 65 20 74 6f 20 74 68 65 20 70 6f 73 69 74 n.position.relative.to.the.posit
22a0 69 6f 6e 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 74 75 72 ion.</param>..........///.<retur
22c0 6e 73 3e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 70 75 62 6c 69 63 20 ns></returns>..........//public.
22e0 73 74 61 74 69 63 20 69 6e 74 20 47 65 74 43 75 72 73 6f 72 49 6e 64 65 78 46 72 6f 6d 50 6f 73 static.int.GetCursorIndexFromPos
2300 69 74 69 6f 6e 28 54 4d 50 5f 54 65 78 74 20 74 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2c 20 56 65 ition(TMP_Text.textComponent,.Ve
2320 63 74 6f 72 33 20 70 6f 73 69 74 69 6f 6e 2c 20 43 61 6d 65 72 61 20 63 61 6d 65 72 61 2c 20 6f ctor3.position,.Camera.camera,.o
2340 75 74 20 43 61 72 65 74 50 6f 73 69 74 69 6f 6e 20 63 75 72 73 6f 72 29 0d 0a 20 20 20 20 20 20 ut.CaretPosition.cursor)........
2360 20 20 2f 2f 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 69 6e 74 20 69 6e 64 65 78 20 3d ..//{..........//....int.index.=
2380 20 54 4d 50 5f 54 65 78 74 55 74 69 6c 69 74 69 65 73 2e 46 69 6e 64 4e 65 61 72 65 73 74 43 68 .TMP_TextUtilities.FindNearestCh
23a0 61 72 61 63 74 65 72 28 74 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2c 20 70 6f 73 69 74 69 6f 6e 2c aracter(textComponent,.position,
23c0 20 63 61 6d 65 72 61 2c 20 66 61 6c 73 65 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 .camera,.false);............//..
23e0 20 20 52 65 63 74 54 72 61 6e 73 66 6f 72 6d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 20 3d 20 ..RectTransform.rectTransform.=.
2400 74 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 3b 0d 0a 0d 0a textComponent.rectTransform;....
2420 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 2f 2f 20 43 6f 6e 76 65 72 74 20 70 6f 73 69 74 69 6f ........//....//.Convert.positio
2440 6e 20 69 6e 74 6f 20 57 6f 72 6c 64 73 70 61 63 65 20 63 6f 6f 72 64 69 6e 61 74 65 73 0d 0a 20 n.into.Worldspace.coordinates...
2460 20 20 20 20 20 20 20 2f 2f 20 20 20 20 53 63 72 65 65 6e 50 6f 69 6e 74 54 6f 57 6f 72 6c 64 50 .......//....ScreenPointToWorldP
2480 6f 69 6e 74 49 6e 52 65 63 74 61 6e 67 6c 65 28 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2c 20 70 ointInRectangle(rectTransform,.p
24a0 6f 73 69 74 69 6f 6e 2c 20 63 61 6d 65 72 61 2c 20 6f 75 74 20 70 6f 73 69 74 69 6f 6e 29 3b 0d osition,.camera,.out.position);.
24c0 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 54 4d 50 5f 43 68 61 72 61 63 74 65 72 49 6e ...........//....TMP_CharacterIn
24e0 66 6f 20 63 49 6e 66 6f 20 3d 20 74 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 65 78 74 49 6e 66 fo.cInfo.=.textComponent.textInf
2500 6f 2e 63 68 61 72 61 63 74 65 72 49 6e 66 6f 5b 69 6e 64 65 78 5d 3b 0d 0a 0d 0a 20 20 20 20 20 o.characterInfo[index];.........
2520 20 20 20 2f 2f 20 20 20 20 2f 2f 20 47 65 74 20 42 6f 74 74 6f 6d 20 4c 65 66 74 20 61 6e 64 20 ...//....//.Get.Bottom.Left.and.
2540 54 6f 70 20 52 69 67 68 74 20 70 6f 73 69 74 69 6f 6e 20 6f 66 20 74 68 65 20 63 75 72 72 65 6e Top.Right.position.of.the.curren
2560 74 20 63 68 61 72 61 63 74 65 72 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 56 65 63 74 6f t.character..........//....Vecto
2580 72 33 20 62 6c 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 r3.bl.=.rectTransform.TransformP
25a0 6f 69 6e 74 28 63 49 6e 66 6f 2e 62 6f 74 74 6f 6d 4c 65 66 74 29 3b 0d 0a 20 20 20 20 20 20 20 oint(cInfo.bottomLeft);.........
25c0 20 2f 2f 20 20 20 20 56 65 63 74 6f 72 33 20 74 72 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 .//....Vector3.tr.=.rectTransfor
25e0 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 63 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 29 m.TransformPoint(cInfo.topRight)
2600 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 66 6c 6f 61 74 20 69 6e 73 65 72 74 50 ;............//....float.insertP
2620 6f 73 69 74 69 6f 6e 20 3d 20 28 70 6f 73 69 74 69 6f 6e 2e 78 20 2d 20 62 6c 2e 78 29 20 2f 20 osition.=.(position.x.-.bl.x)./.
2640 28 74 72 2e 78 20 2d 20 62 6c 2e 78 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 (tr.x.-.bl.x);............//....
2660 69 66 20 28 69 6e 73 65 72 74 50 6f 73 69 74 69 6f 6e 20 3c 20 30 2e 35 66 29 0d 0a 20 20 20 20 if.(insertPosition.<.0.5f)......
2680 20 20 20 20 2f 2f 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 63 ....//....{..........//........c
26a0 75 72 73 6f 72 20 3d 20 43 61 72 65 74 50 6f 73 69 74 69 6f 6e 2e 4c 65 66 74 3b 0d 0a 20 20 20 ursor.=.CaretPosition.Left;.....
26c0 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 69 6e 64 65 78 3b 0d 0a 20 20 .....//........return.index;....
26e0 20 20 20 20 20 20 2f 2f 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 65 6c 73 ......//....}..........//....els
2700 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 e..........//....{..........//..
2720 20 20 20 20 20 20 63 75 72 73 6f 72 20 3d 20 43 61 72 65 74 50 6f 73 69 74 69 6f 6e 2e 52 69 67 ......cursor.=.CaretPosition.Rig
2740 68 74 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 69 6e ht;..........//........return.in
2760 64 65 78 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 2f dex;..........//....}........../
2780 2f 7d 0d 0a 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 /}..............///.<summary>...
27a0 20 20 20 20 20 20 20 2f 2f 2f 20 46 75 6e 63 74 69 6f 6e 20 72 65 74 75 72 6e 69 6e 67 20 74 68 .......///.Function.returning.th
27c0 65 20 69 6e 64 65 78 20 6f 66 20 74 68 65 20 63 68 61 72 61 63 74 65 72 20 77 68 6f 73 65 20 6f e.index.of.the.character.whose.o
27e0 72 69 67 69 6e 20 69 73 20 63 6c 6f 73 65 73 74 20 74 6f 20 74 68 65 20 63 75 72 73 6f 72 2e 0d rigin.is.closest.to.the.cursor..
2800 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 .........///.</summary>.........
2820 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 74 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 22 .///.<param.name="textComponent"
2840 3e 41 20 72 65 66 65 72 65 6e 63 65 20 74 6f 20 74 68 65 20 74 65 78 74 20 6f 62 6a 65 63 74 2e >A.reference.to.the.text.object.
2860 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d </param>..........///.<param.nam
2880 65 3d 22 70 6f 73 69 74 69 6f 6e 22 3e 50 6f 73 69 74 69 6f 6e 20 74 6f 20 63 68 65 63 6b 20 66 e="position">Position.to.check.f
28a0 6f 72 20 69 6e 74 65 72 73 65 63 74 69 6f 6e 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 or.intersection.</param>........
28c0 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 63 61 6d 65 72 61 22 3e 54 68 65 20 73 ..///.<param.name="camera">The.s
28e0 63 65 6e 65 20 63 61 6d 65 72 61 20 77 68 69 63 68 20 6d 61 79 20 62 65 20 61 73 73 69 67 6e 65 cene.camera.which.may.be.assigne
2900 64 20 74 6f 20 61 20 43 61 6e 76 61 73 20 75 73 69 6e 67 20 53 63 72 65 65 6e 53 70 61 63 65 20 d.to.a.Canvas.using.ScreenSpace.
2920 43 61 6d 65 72 61 20 6f 72 20 57 6f 72 6c 64 53 70 61 63 65 20 72 65 6e 64 65 72 20 6d 6f 64 65 Camera.or.WorldSpace.render.mode
2940 2e 20 53 65 74 20 74 6f 20 6e 75 6c 6c 20 69 73 20 75 73 69 6e 67 20 53 63 72 65 65 6e 53 70 61 ..Set.to.null.is.using.ScreenSpa
2960 63 65 20 4f 76 65 72 6c 61 79 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f ce.Overlay.</param>..........///
2980 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 63 75 72 73 6f 72 22 3e 54 68 65 20 70 6f 73 69 74 69 .<param.name="cursor">The.positi
29a0 6f 6e 20 6f 66 20 74 68 65 20 63 75 72 73 6f 72 20 69 6e 73 65 72 74 69 6f 6e 20 70 6f 73 69 74 on.of.the.cursor.insertion.posit
29c0 69 6f 6e 20 72 65 6c 61 74 69 76 65 20 74 6f 20 74 68 65 20 70 6f 73 69 74 69 6f 6e 2e 3c 2f 70 ion.relative.to.the.position.</p
29e0 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 3c 2f 72 65 aram>..........///.<returns></re
2a00 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 69 6e turns>..........public.static.in
2a20 74 20 47 65 74 43 75 72 73 6f 72 49 6e 64 65 78 46 72 6f 6d 50 6f 73 69 74 69 6f 6e 28 54 4d 50 t.GetCursorIndexFromPosition(TMP
2a40 5f 54 65 78 74 20 74 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2c 20 56 65 63 74 6f 72 33 20 70 6f 73 _Text.textComponent,.Vector3.pos
2a60 69 74 69 6f 6e 2c 20 43 61 6d 65 72 61 20 63 61 6d 65 72 61 2c 20 6f 75 74 20 43 61 72 65 74 50 ition,.Camera.camera,.out.CaretP
2a80 6f 73 69 74 69 6f 6e 20 63 75 72 73 6f 72 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 osition.cursor)..........{......
2aa0 20 20 20 20 20 20 20 20 69 6e 74 20 6c 69 6e 65 20 3d 20 54 4d 50 5f 54 65 78 74 55 74 69 6c 69 ........int.line.=.TMP_TextUtili
2ac0 74 69 65 73 2e 46 69 6e 64 4e 65 61 72 65 73 74 4c 69 6e 65 28 74 65 78 74 43 6f 6d 70 6f 6e 65 ties.FindNearestLine(textCompone
2ae0 6e 74 2c 20 70 6f 73 69 74 69 6f 6e 2c 20 63 61 6d 65 72 61 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 nt,.position,.camera);..........
2b00 20 20 20 20 20 20 69 6e 74 20 69 6e 64 65 78 20 3d 20 46 69 6e 64 4e 65 61 72 65 73 74 43 68 61 ......int.index.=.FindNearestCha
2b20 72 61 63 74 65 72 4f 6e 4c 69 6e 65 28 74 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2c 20 70 6f 73 69 racterOnLine(textComponent,.posi
2b40 74 69 6f 6e 2c 20 6c 69 6e 65 2c 20 63 61 6d 65 72 61 2c 20 66 61 6c 73 65 29 3b 0d 0a 0d 0a 20 tion,.line,.camera,.false);.....
2b60 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 53 70 65 63 69 61 6c 20 68 61 6e 64 6c 69 6e 67 20 69 ...........//.Special.handling.i
2b80 66 20 6c 69 6e 65 20 63 6f 6e 74 61 69 6e 73 20 6f 6e 6c 79 20 6f 6e 65 20 63 68 61 72 61 63 74 f.line.contains.only.one.charact
2ba0 65 72 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 74 65 78 74 43 6f 6d 70 6f 6e 65 er...............if.(textCompone
2bc0 6e 74 2e 74 65 78 74 49 6e 66 6f 2e 6c 69 6e 65 49 6e 66 6f 5b 6c 69 6e 65 5d 2e 63 68 61 72 61 nt.textInfo.lineInfo[line].chara
2be0 63 74 65 72 43 6f 75 6e 74 20 3d 3d 20 31 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a cterCount.==.1)..............{..
2c00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 75 72 73 6f 72 20 3d 20 43 61 72 65 74 50 6f ................cursor.=.CaretPo
2c20 73 69 74 69 6f 6e 2e 4c 65 66 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 sition.Left;..................re
2c40 74 75 72 6e 20 69 6e 64 65 78 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 turn.index;..............}......
2c60 20 20 20 20 20 20 20 20 20 20 52 65 63 74 54 72 61 6e 73 66 6f 72 6d 20 72 65 63 74 54 72 61 6e ..........RectTransform.rectTran
2c80 73 66 6f 72 6d 20 3d 20 74 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 72 65 63 74 54 72 61 6e 73 66 sform.=.textComponent.rectTransf
2ca0 6f 72 6d 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 6f 6e 76 65 72 74 20 70 orm;................//.Convert.p
2cc0 6f 73 69 74 69 6f 6e 20 69 6e 74 6f 20 57 6f 72 6c 64 73 70 61 63 65 20 63 6f 6f 72 64 69 6e 61 osition.into.Worldspace.coordina
2ce0 74 65 73 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 53 63 72 65 65 6e 50 6f 69 6e 74 54 6f 57 6f tes..............ScreenPointToWo
2d00 72 6c 64 50 6f 69 6e 74 49 6e 52 65 63 74 61 6e 67 6c 65 28 72 65 63 74 54 72 61 6e 73 66 6f 72 rldPointInRectangle(rectTransfor
2d20 6d 2c 20 70 6f 73 69 74 69 6f 6e 2c 20 63 61 6d 65 72 61 2c 20 6f 75 74 20 70 6f 73 69 74 69 6f m,.position,.camera,.out.positio
2d40 6e 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 54 4d 50 5f 43 68 61 72 61 63 74 65 72 n);................TMP_Character
2d60 49 6e 66 6f 20 63 49 6e 66 6f 20 3d 20 74 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 65 78 74 49 Info.cInfo.=.textComponent.textI
2d80 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 49 6e 66 6f 5b 69 6e 64 65 78 5d 3b 0d 0a 0d 0a 20 20 20 nfo.characterInfo[index];.......
2da0 20 20 20 20 20 20 20 20 20 2f 2f 20 47 65 74 20 42 6f 74 74 6f 6d 20 4c 65 66 74 20 61 6e 64 20 .........//.Get.Bottom.Left.and.
2dc0 54 6f 70 20 52 69 67 68 74 20 70 6f 73 69 74 69 6f 6e 20 6f 66 20 74 68 65 20 63 75 72 72 65 6e Top.Right.position.of.the.curren
2de0 74 20 63 68 61 72 61 63 74 65 72 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 56 65 63 74 6f 72 33 t.character..............Vector3
2e00 20 62 6c 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 .bl.=.rectTransform.TransformPoi
2e20 6e 74 28 63 49 6e 66 6f 2e 62 6f 74 74 6f 6d 4c 65 66 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 nt(cInfo.bottomLeft);...........
2e40 20 20 20 56 65 63 74 6f 72 33 20 74 72 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 ...Vector3.tr.=.rectTransform.Tr
2e60 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 63 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 29 3b 0d 0a 0d ansformPoint(cInfo.topRight);...
2e80 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 69 6e 73 65 72 74 50 6f 73 69 74 69 6f .............float.insertPositio
2ea0 6e 20 3d 20 28 70 6f 73 69 74 69 6f 6e 2e 78 20 2d 20 62 6c 2e 78 29 20 2f 20 28 74 72 2e 78 20 n.=.(position.x.-.bl.x)./.(tr.x.
2ec0 2d 20 62 6c 2e 78 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 69 6e 73 65 -.bl.x);................if.(inse
2ee0 72 74 50 6f 73 69 74 69 6f 6e 20 3c 20 30 2e 35 66 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 rtPosition.<.0.5f)..............
2f00 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 75 72 73 6f 72 20 3d 20 43 61 72 65 {..................cursor.=.Care
2f20 74 50 6f 73 69 74 69 6f 6e 2e 4c 65 66 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 tPosition.Left;.................
2f40 20 72 65 74 75 72 6e 20 69 6e 64 65 78 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 .return.index;..............}...
2f60 20 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a ...........else..............{..
2f80 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 75 72 73 6f 72 20 3d 20 43 61 72 65 74 50 6f ................cursor.=.CaretPo
2fa0 73 69 74 69 6f 6e 2e 52 69 67 68 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 sition.Right;..................r
2fc0 65 74 75 72 6e 20 69 6e 64 65 78 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 eturn.index;..............}.....
2fe0 20 20 20 20 20 7d 0d 0a 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 .....}..............///.<summary
3000 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 46 75 6e 63 74 69 6f 6e 20 72 65 74 75 72 6e 69 6e >..........///.Function.returnin
3020 67 20 74 68 65 20 6c 69 6e 65 20 6e 65 61 72 65 73 74 20 74 6f 20 74 68 65 20 70 6f 73 69 74 69 g.the.line.nearest.to.the.positi
3040 6f 6e 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 on...........///.</summary>.....
3060 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 74 65 78 74 43 6f 6d 70 6f 6e .....///.<param.name="textCompon
3080 65 6e 74 22 3e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 ent"></param>..........///.<para
30a0 6d 20 6e 61 6d 65 3d 22 70 6f 73 69 74 69 6f 6e 22 3e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 m.name="position"></param>......
30c0 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 63 61 6d 65 72 61 22 3e 3c 2f 70 ....///.<param.name="camera"></p
30e0 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 3c 2f 72 65 aram>..........///.<returns></re
3100 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 69 6e turns>..........public.static.in
3120 74 20 46 69 6e 64 4e 65 61 72 65 73 74 4c 69 6e 65 28 54 4d 50 5f 54 65 78 74 20 74 65 78 74 2c t.FindNearestLine(TMP_Text.text,
3140 20 56 65 63 74 6f 72 33 20 70 6f 73 69 74 69 6f 6e 2c 20 43 61 6d 65 72 61 20 63 61 6d 65 72 61 .Vector3.position,.Camera.camera
3160 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 52 65 63 74 54 72 )..........{..............RectTr
3180 61 6e 73 66 6f 72 6d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 20 3d 20 74 65 78 74 2e 72 65 63 ansform.rectTransform.=.text.rec
31a0 74 54 72 61 6e 73 66 6f 72 6d 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 6c 6f 61 74 tTransform;................float
31c0 20 64 69 73 74 61 6e 63 65 20 3d 20 4d 61 74 68 66 2e 49 6e 66 69 6e 69 74 79 3b 0d 0a 20 20 20 .distance.=.Mathf.Infinity;.....
31e0 20 20 20 20 20 20 20 20 20 69 6e 74 20 63 6c 6f 73 65 73 74 20 3d 20 2d 31 3b 0d 0a 0d 0a 20 20 .........int.closest.=.-1;......
3200 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 6f 6e 76 65 72 74 20 70 6f 73 69 74 69 6f 6e 20 69 6e ..........//.Convert.position.in
3220 74 6f 20 57 6f 72 6c 64 73 70 61 63 65 20 63 6f 6f 72 64 69 6e 61 74 65 73 0d 0a 20 20 20 20 20 to.Worldspace.coordinates.......
3240 20 20 20 20 20 20 20 53 63 72 65 65 6e 50 6f 69 6e 74 54 6f 57 6f 72 6c 64 50 6f 69 6e 74 49 6e .......ScreenPointToWorldPointIn
3260 52 65 63 74 61 6e 67 6c 65 28 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2c 20 70 6f 73 69 74 69 6f Rectangle(rectTransform,.positio
3280 6e 2c 20 63 61 6d 65 72 61 2c 20 6f 75 74 20 70 6f 73 69 74 69 6f 6e 29 3b 0d 0a 0d 0a 20 20 20 n,.camera,.out.position);.......
32a0 20 20 20 20 20 20 20 20 20 66 6f 72 20 28 69 6e 74 20 69 20 3d 20 30 3b 20 69 20 3c 20 74 65 78 .........for.(int.i.=.0;.i.<.tex
32c0 74 2e 74 65 78 74 49 6e 66 6f 2e 6c 69 6e 65 43 6f 75 6e 74 3b 20 69 2b 2b 29 0d 0a 20 20 20 20 t.textInfo.lineCount;.i++)......
32e0 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 54 4d 50 5f 4c ........{..................TMP_L
3300 69 6e 65 49 6e 66 6f 20 6c 69 6e 65 49 6e 66 6f 20 3d 20 74 65 78 74 2e 74 65 78 74 49 6e 66 6f ineInfo.lineInfo.=.text.textInfo
3320 2e 6c 69 6e 65 49 6e 66 6f 5b 69 5d 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .lineInfo[i];...................
3340 20 66 6c 6f 61 74 20 61 73 63 65 6e 64 65 72 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e .float.ascender.=.rectTransform.
3360 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 30 2c 20 6c 69 TransformPoint(new.Vector3(0,.li
3380 6e 65 49 6e 66 6f 2e 61 73 63 65 6e 64 65 72 2c 20 30 29 29 2e 79 3b 0d 0a 20 20 20 20 20 20 20 neInfo.ascender,.0)).y;.........
33a0 20 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 64 65 73 63 65 6e 64 65 72 20 3d 20 72 65 63 74 54 .........float.descender.=.rectT
33c0 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 ransform.TransformPoint(new.Vect
33e0 6f 72 33 28 30 2c 20 6c 69 6e 65 49 6e 66 6f 2e 64 65 73 63 65 6e 64 65 72 2c 20 30 29 29 2e 79 or3(0,.lineInfo.descender,.0)).y
3400 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 61 73 63 65 6e 64 65 ;....................if.(ascende
3420 72 20 3e 20 70 6f 73 69 74 69 6f 6e 2e 79 20 26 26 20 64 65 73 63 65 6e 64 65 72 20 3c 20 70 6f r.>.position.y.&&.descender.<.po
3440 73 69 74 69 6f 6e 2e 79 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 20 0d 0a 20 sition.y)..................{....
3460 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 44 65 62 75 67 2e 4c 6f 67 28 22 ...................//Debug.Log("
3480 50 6f 73 69 74 69 6f 6e 20 69 73 20 6f 6e 20 6c 69 6e 65 20 22 20 2b 20 69 29 3b 0d 0a 20 20 20 Position.is.on.line.".+.i);.....
34a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 69 3b 0d 0a 20 20 20 20 .................return.i;......
34c0 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ............}...................
34e0 20 66 6c 6f 61 74 20 64 30 20 3d 20 4d 61 74 68 66 2e 41 62 73 28 61 73 63 65 6e 64 65 72 20 2d .float.d0.=.Mathf.Abs(ascender.-
3500 20 70 6f 73 69 74 69 6f 6e 2e 79 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 .position.y);..................f
3520 6c 6f 61 74 20 64 31 20 3d 20 4d 61 74 68 66 2e 41 62 73 28 64 65 73 63 65 6e 64 65 72 20 2d 20 loat.d1.=.Mathf.Abs(descender.-.
3540 70 6f 73 69 74 69 6f 6e 2e 79 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 position.y);....................
3560 66 6c 6f 61 74 20 64 20 3d 20 4d 61 74 68 66 2e 4d 69 6e 28 64 30 2c 20 64 31 29 3b 0d 0a 20 20 float.d.=.Mathf.Min(d0,.d1);....
3580 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 64 20 3c 20 64 69 73 74 61 6e 63 65 29 0d ..............if.(d.<.distance).
35a0 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 .................{..............
35c0 20 20 20 20 20 20 20 20 64 69 73 74 61 6e 63 65 20 3d 20 64 3b 0d 0a 20 20 20 20 20 20 20 20 20 ........distance.=.d;...........
35e0 20 20 20 20 20 20 20 20 20 20 20 63 6c 6f 73 65 73 74 20 3d 20 69 3b 0d 0a 20 20 20 20 20 20 20 ...........closest.=.i;.........
3600 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 .........}..............}.......
3620 20 20 20 20 20 20 20 20 20 2f 2f 44 65 62 75 67 2e 4c 6f 67 28 22 43 6c 6f 73 65 73 74 20 6c 69 .........//Debug.Log("Closest.li
3640 6e 65 20 74 6f 20 70 6f 73 69 74 69 6f 6e 20 69 73 20 22 20 2b 20 63 6c 6f 73 65 73 74 29 3b 0d ne.to.position.is.".+.closest);.
3660 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 63 6c 6f 73 65 73 74 3b 0d 0a 20 20 .............return.closest;....
3680 20 20 20 20 20 20 7d 0d 0a 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 ......}..............///.<summar
36a0 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 46 75 6e 63 74 69 6f 6e 20 72 65 74 75 72 6e 69 y>..........///.Function.returni
36c0 6e 67 20 74 68 65 20 6e 65 61 72 65 73 74 20 63 68 61 72 61 63 74 65 72 20 74 6f 20 70 6f 73 69 ng.the.nearest.character.to.posi
36e0 74 69 6f 6e 20 6f 6e 20 61 20 67 69 76 65 6e 20 6c 69 6e 65 2e 0d 0a 20 20 20 20 20 20 20 20 2f tion.on.a.given.line.........../
3700 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 //.</summary>..........///.<para
3720 6d 20 6e 61 6d 65 3d 22 74 65 78 74 22 3e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 m.name="text"></param>..........
3740 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 70 6f 73 69 74 69 6f 6e 22 3e 3c 2f 70 61 72 ///.<param.name="position"></par
3760 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 6c 69 am>..........///.<param.name="li
3780 6e 65 22 3e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d ne"></param>..........///.<param
37a0 20 6e 61 6d 65 3d 22 63 61 6d 65 72 61 22 3e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 .name="camera"></param>.........
37c0 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 .///.<returns></returns>........
37e0 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 69 6e 74 20 46 69 6e 64 4e 65 61 72 65 73 74 43 ..public.static.int.FindNearestC
3800 68 61 72 61 63 74 65 72 4f 6e 4c 69 6e 65 28 54 4d 50 5f 54 65 78 74 20 74 65 78 74 2c 20 56 65 haracterOnLine(TMP_Text.text,.Ve
3820 63 74 6f 72 33 20 70 6f 73 69 74 69 6f 6e 2c 20 69 6e 74 20 6c 69 6e 65 2c 20 43 61 6d 65 72 61 ctor3.position,.int.line,.Camera
3840 20 63 61 6d 65 72 61 2c 20 62 6f 6f 6c 20 76 69 73 69 62 6c 65 4f 6e 6c 79 29 0d 0a 20 20 20 20 .camera,.bool.visibleOnly)......
3860 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 52 65 63 74 54 72 61 6e 73 66 6f 72 6d ....{..............RectTransform
3880 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 20 3d 20 74 65 78 74 2e 72 65 63 74 54 72 61 6e 73 66 .rectTransform.=.text.rectTransf
38a0 6f 72 6d 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 6f 6e 76 65 72 74 20 70 orm;................//.Convert.p
38c0 6f 73 69 74 69 6f 6e 20 69 6e 74 6f 20 57 6f 72 6c 64 73 70 61 63 65 20 63 6f 6f 72 64 69 6e 61 osition.into.Worldspace.coordina
38e0 74 65 73 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 53 63 72 65 65 6e 50 6f 69 6e 74 54 6f 57 6f tes..............ScreenPointToWo
3900 72 6c 64 50 6f 69 6e 74 49 6e 52 65 63 74 61 6e 67 6c 65 28 72 65 63 74 54 72 61 6e 73 66 6f 72 rldPointInRectangle(rectTransfor
3920 6d 2c 20 70 6f 73 69 74 69 6f 6e 2c 20 63 61 6d 65 72 61 2c 20 6f 75 74 20 70 6f 73 69 74 69 6f m,.position,.camera,.out.positio
3940 6e 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 20 66 69 72 73 74 43 68 61 72 n);................int.firstChar
3960 61 63 74 65 72 20 3d 20 74 65 78 74 2e 74 65 78 74 49 6e 66 6f 2e 6c 69 6e 65 49 6e 66 6f 5b 6c acter.=.text.textInfo.lineInfo[l
3980 69 6e 65 5d 2e 66 69 72 73 74 43 68 61 72 61 63 74 65 72 49 6e 64 65 78 3b 0d 0a 20 20 20 20 20 ine].firstCharacterIndex;.......
39a0 20 20 20 20 20 20 20 69 6e 74 20 6c 61 73 74 43 68 61 72 61 63 74 65 72 20 3d 20 74 65 78 74 2e .......int.lastCharacter.=.text.
39c0 74 65 78 74 49 6e 66 6f 2e 6c 69 6e 65 49 6e 66 6f 5b 6c 69 6e 65 5d 2e 6c 61 73 74 43 68 61 72 textInfo.lineInfo[line].lastChar
39e0 61 63 74 65 72 49 6e 64 65 78 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 6c 6f 61 74 acterIndex;................float
3a00 20 64 69 73 74 61 6e 63 65 53 71 72 20 3d 20 4d 61 74 68 66 2e 49 6e 66 69 6e 69 74 79 3b 0d 0a .distanceSqr.=.Mathf.Infinity;..
3a20 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 20 63 6c 6f 73 65 73 74 20 3d 20 6c 61 73 74 43 68 ............int.closest.=.lastCh
3a40 61 72 61 63 74 65 72 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 20 28 69 6e 74 aracter;................for.(int
3a60 20 69 20 3d 20 66 69 72 73 74 43 68 61 72 61 63 74 65 72 3b 20 69 20 3c 20 6c 61 73 74 43 68 61 .i.=.firstCharacter;.i.<.lastCha
3a80 72 61 63 74 65 72 3b 20 69 2b 2b 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 racter;.i++)..............{.....
3aa0 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 47 65 74 20 63 75 72 72 65 6e 74 20 63 68 61 72 .............//.Get.current.char
3ac0 61 63 74 65 72 20 69 6e 66 6f 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 54 4d 50 acter.info...................TMP
3ae0 5f 43 68 61 72 61 63 74 65 72 49 6e 66 6f 20 63 49 6e 66 6f 20 3d 20 74 65 78 74 2e 74 65 78 74 _CharacterInfo.cInfo.=.text.text
3b00 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 49 6e 66 6f 5b 69 5d 3b 0d 0a 20 20 20 20 20 20 20 20 Info.characterInfo[i];..........
3b20 20 20 20 20 20 20 20 20 69 66 20 28 76 69 73 69 62 6c 65 4f 6e 6c 79 20 26 26 20 21 63 49 6e 66 ........if.(visibleOnly.&&.!cInf
3b40 6f 2e 69 73 56 69 73 69 62 6c 65 29 20 63 6f 6e 74 69 6e 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 o.isVisible).continue;..........
3b60 20 20 20 20 20 20 20 20 20 20 2f 2f 20 47 65 74 20 42 6f 74 74 6f 6d 20 4c 65 66 74 20 61 6e 64 ..........//.Get.Bottom.Left.and
3b80 20 54 6f 70 20 52 69 67 68 74 20 70 6f 73 69 74 69 6f 6e 20 6f 66 20 74 68 65 20 63 75 72 72 65 .Top.Right.position.of.the.curre
3ba0 6e 74 20 63 68 61 72 61 63 74 65 72 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 56 65 nt.character..................Ve
3bc0 63 74 6f 72 33 20 62 6c 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f ctor3.bl.=.rectTransform.Transfo
3be0 72 6d 50 6f 69 6e 74 28 63 49 6e 66 6f 2e 62 6f 74 74 6f 6d 4c 65 66 74 29 3b 0d 0a 20 20 20 20 rmPoint(cInfo.bottomLeft);......
3c00 20 20 20 20 20 20 20 20 20 20 20 20 56 65 63 74 6f 72 33 20 74 6c 20 3d 20 72 65 63 74 54 72 61 ............Vector3.tl.=.rectTra
3c20 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 nsform.TransformPoint(new.Vector
3c40 33 28 63 49 6e 66 6f 2e 62 6f 74 74 6f 6d 4c 65 66 74 2e 78 2c 20 63 49 6e 66 6f 2e 74 6f 70 52 3(cInfo.bottomLeft.x,.cInfo.topR
3c60 69 67 68 74 2e 79 2c 20 30 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 56 65 ight.y,.0));..................Ve
3c80 63 74 6f 72 33 20 74 72 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f ctor3.tr.=.rectTransform.Transfo
3ca0 72 6d 50 6f 69 6e 74 28 63 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 29 3b 0d 0a 20 20 20 20 20 20 rmPoint(cInfo.topRight);........
3cc0 20 20 20 20 20 20 20 20 20 20 56 65 63 74 6f 72 33 20 62 72 20 3d 20 72 65 63 74 54 72 61 6e 73 ..........Vector3.br.=.rectTrans
3ce0 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 form.TransformPoint(new.Vector3(
3d00 63 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 2e 78 2c 20 63 49 6e 66 6f 2e 62 6f 74 74 6f 6d 4c 65 cInfo.topRight.x,.cInfo.bottomLe
3d20 66 74 2e 79 2c 20 30 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 ft.y,.0));....................if
3d40 20 28 50 6f 69 6e 74 49 6e 74 65 72 73 65 63 74 52 65 63 74 61 6e 67 6c 65 28 70 6f 73 69 74 69 .(PointIntersectRectangle(positi
3d60 6f 6e 2c 20 62 6c 2c 20 74 6c 2c 20 74 72 2c 20 62 72 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 on,.bl,.tl,.tr,.br))............
3d80 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 6c 6f ......{......................clo
3da0 73 65 73 74 20 3d 20 69 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 sest.=.i;......................b
3dc0 72 65 61 6b 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 reak;..................}........
3de0 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 46 69 6e 64 20 74 68 65 20 63 6c 6f 73 65 73 74 20 ............//.Find.the.closest.
3e00 63 6f 72 6e 65 72 20 74 6f 20 70 6f 73 69 74 69 6f 6e 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 corner.to.position..............
3e20 20 20 20 20 20 66 6c 6f 61 74 20 64 62 6c 20 3d 20 44 69 73 74 61 6e 63 65 54 6f 4c 69 6e 65 28 .....float.dbl.=.DistanceToLine(
3e40 62 6c 2c 20 74 6c 2c 20 70 6f 73 69 74 69 6f 6e 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 bl,.tl,.position);..............
3e60 20 20 20 20 66 6c 6f 61 74 20 64 74 6c 20 3d 20 44 69 73 74 61 6e 63 65 54 6f 4c 69 6e 65 28 74 ....float.dtl.=.DistanceToLine(t
3e80 6c 2c 20 74 72 2c 20 70 6f 73 69 74 69 6f 6e 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 l,.tr,.position);...............
3ea0 20 20 20 66 6c 6f 61 74 20 64 74 72 20 3d 20 44 69 73 74 61 6e 63 65 54 6f 4c 69 6e 65 28 74 72 ...float.dtr.=.DistanceToLine(tr
3ec0 2c 20 62 72 2c 20 70 6f 73 69 74 69 6f 6e 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ,.br,.position);................
3ee0 20 20 66 6c 6f 61 74 20 64 62 72 20 3d 20 44 69 73 74 61 6e 63 65 54 6f 4c 69 6e 65 28 62 72 2c ..float.dbr.=.DistanceToLine(br,
3f00 20 62 6c 2c 20 70 6f 73 69 74 69 6f 6e 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 .bl,.position);.................
3f20 20 20 20 66 6c 6f 61 74 20 64 20 3d 20 64 62 6c 20 3c 20 64 74 6c 20 3f 20 64 62 6c 20 3a 20 64 ...float.d.=.dbl.<.dtl.?.dbl.:.d
3f40 74 6c 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 64 20 3d 20 64 20 3c 20 64 74 72 tl;..................d.=.d.<.dtr
3f60 20 3f 20 64 20 3a 20 64 74 72 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 64 20 3d .?.d.:.dtr;..................d.=
3f80 20 64 20 3c 20 64 62 72 20 3f 20 64 20 3a 20 64 62 72 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 .d.<.dbr.?.d.:.dbr;.............
3fa0 20 20 20 20 20 20 20 69 66 20 28 64 69 73 74 61 6e 63 65 53 71 72 20 3e 20 64 29 0d 0a 20 20 20 .......if.(distanceSqr.>.d).....
3fc0 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .............{..................
3fe0 20 20 20 20 64 69 73 74 61 6e 63 65 53 71 72 20 3d 20 64 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 ....distanceSqr.=.d;............
4000 20 20 20 20 20 20 20 20 20 20 63 6c 6f 73 65 73 74 20 3d 20 69 3b 0d 0a 20 20 20 20 20 20 20 20 ..........closest.=.i;..........
4020 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 ........}..............}........
4040 20 20 20 20 20 20 72 65 74 75 72 6e 20 63 6c 6f 73 65 73 74 3b 0d 0a 20 20 20 20 20 20 20 20 7d ......return.closest;..........}
4060 0d 0a 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 ..............///.<summary>.....
4080 20 20 20 20 20 2f 2f 2f 20 46 75 6e 63 74 69 6f 6e 20 75 73 65 64 20 74 6f 20 64 65 74 65 72 6d .....///.Function.used.to.determ
40a0 69 6e 65 20 69 66 20 74 68 65 20 70 6f 73 69 74 69 6f 6e 20 69 6e 74 65 72 73 65 63 74 73 20 77 ine.if.the.position.intersects.w
40c0 69 74 68 20 74 68 65 20 52 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 0d 0a 20 20 20 20 20 20 20 20 ith.the.RectTransform...........
40e0 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 ///.</summary>..........///.<par
4100 61 6d 20 6e 61 6d 65 3d 22 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 22 3e 41 20 72 65 66 65 72 65 am.name="rectTransform">A.refere
4120 6e 63 65 20 74 6f 20 74 68 65 20 52 65 63 74 54 72 61 6e 66 6f 72 6d 20 6f 66 20 74 68 65 20 74 nce.to.the.RectTranform.of.the.t
4140 65 78 74 20 6f 62 6a 65 63 74 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f ext.object.</param>..........///
4160 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 70 6f 73 69 74 69 6f 6e 22 3e 50 6f 73 69 74 69 6f 6e .<param.name="position">Position
4180 20 74 6f 20 63 68 65 63 6b 20 66 6f 72 20 69 6e 74 65 72 73 65 63 74 69 6f 6e 2e 3c 2f 70 61 72 .to.check.for.intersection.</par
41a0 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 63 61 am>..........///.<param.name="ca
41c0 6d 65 72 61 22 3e 54 68 65 20 73 63 65 6e 65 20 63 61 6d 65 72 61 20 77 68 69 63 68 20 6d 61 79 mera">The.scene.camera.which.may
41e0 20 62 65 20 61 73 73 69 67 6e 65 64 20 74 6f 20 61 20 43 61 6e 76 61 73 20 75 73 69 6e 67 20 53 .be.assigned.to.a.Canvas.using.S
4200 63 72 65 65 6e 53 70 61 63 65 20 43 61 6d 65 72 61 20 6f 72 20 57 6f 72 6c 64 53 70 61 63 65 20 creenSpace.Camera.or.WorldSpace.
4220 72 65 6e 64 65 72 20 6d 6f 64 65 2e 20 53 65 74 20 74 6f 20 6e 75 6c 6c 20 69 73 20 75 73 69 6e render.mode..Set.to.null.is.usin
4240 67 20 53 63 72 65 65 6e 53 70 61 63 65 20 4f 76 65 72 6c 61 79 2e 3c 2f 70 61 72 61 6d 3e 0d 0a g.ScreenSpace.Overlay.</param>..
4260 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 3c 2f 72 65 74 75 72 6e 73 3e 0d ........///.<returns></returns>.
4280 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 62 6f 6f 6c 20 49 73 49 6e .........public.static.bool.IsIn
42a0 74 65 72 73 65 63 74 69 6e 67 52 65 63 74 54 72 61 6e 73 66 6f 72 6d 28 52 65 63 74 54 72 61 6e tersectingRectTransform(RectTran
42c0 73 66 6f 72 6d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2c 20 56 65 63 74 6f 72 33 20 70 6f 73 sform.rectTransform,.Vector3.pos
42e0 69 74 69 6f 6e 2c 20 43 61 6d 65 72 61 20 63 61 6d 65 72 61 29 0d 0a 20 20 20 20 20 20 20 20 7b ition,.Camera.camera)..........{
4300 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 6f 6e 76 65 72 74 20 70 6f 73 69 74 69 6f ..............//.Convert.positio
4320 6e 20 69 6e 74 6f 20 57 6f 72 6c 64 73 70 61 63 65 20 63 6f 6f 72 64 69 6e 61 74 65 73 0d 0a 20 n.into.Worldspace.coordinates...
4340 20 20 20 20 20 20 20 20 20 20 20 53 63 72 65 65 6e 50 6f 69 6e 74 54 6f 57 6f 72 6c 64 50 6f 69 ...........ScreenPointToWorldPoi
4360 6e 74 49 6e 52 65 63 74 61 6e 67 6c 65 28 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2c 20 70 6f 73 ntInRectangle(rectTransform,.pos
4380 69 74 69 6f 6e 2c 20 63 61 6d 65 72 61 2c 20 6f 75 74 20 70 6f 73 69 74 69 6f 6e 29 3b 0d 0a 0d ition,.camera,.out.position);...
43a0 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 47 65 74 57 6f .............rectTransform.GetWo
43c0 72 6c 64 43 6f 72 6e 65 72 73 28 6d 5f 72 65 63 74 57 6f 72 6c 64 43 6f 72 6e 65 72 73 29 3b 0d rldCorners(m_rectWorldCorners);.
43e0 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 50 6f 69 6e 74 49 6e 74 65 72 73 65 63 ...............if.(PointIntersec
4400 74 52 65 63 74 61 6e 67 6c 65 28 70 6f 73 69 74 69 6f 6e 2c 20 6d 5f 72 65 63 74 57 6f 72 6c 64 tRectangle(position,.m_rectWorld
4420 43 6f 72 6e 65 72 73 5b 30 5d 2c 20 6d 5f 72 65 63 74 57 6f 72 6c 64 43 6f 72 6e 65 72 73 5b 31 Corners[0],.m_rectWorldCorners[1
4440 5d 2c 20 6d 5f 72 65 63 74 57 6f 72 6c 64 43 6f 72 6e 65 72 73 5b 32 5d 2c 20 6d 5f 72 65 63 74 ],.m_rectWorldCorners[2],.m_rect
4460 57 6f 72 6c 64 43 6f 72 6e 65 72 73 5b 33 5d 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b WorldCorners[3]))..............{
4480 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 74 72 75 65 3b 0d 0a ..................return.true;..
44a0 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 ............}................ret
44c0 75 72 6e 20 66 61 6c 73 65 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 0d 0a 20 20 20 20 20 urn.false;..........}...........
44e0 20 20 20 2f 2f 20 43 48 41 52 41 43 54 45 52 20 48 41 4e 44 4c 49 4e 47 0d 0a 0d 0a 20 20 20 20 ...//.CHARACTER.HANDLING........
4500 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 46 ....///.<summary>..........///.F
4520 75 6e 63 74 69 6f 6e 20 72 65 74 75 72 6e 69 6e 67 20 74 68 65 20 69 6e 64 65 78 20 6f 66 20 74 unction.returning.the.index.of.t
4540 68 65 20 63 68 61 72 61 63 74 65 72 20 61 74 20 74 68 65 20 67 69 76 65 6e 20 70 6f 73 69 74 69 he.character.at.the.given.positi
4560 6f 6e 20 28 69 66 20 61 6e 79 29 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d on.(if.any)...........///.</summ
4580 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 74 ary>..........///.<param.name="t
45a0 65 78 74 22 3e 41 20 72 65 66 65 72 65 6e 63 65 20 74 6f 20 74 68 65 20 54 65 78 74 4d 65 73 68 ext">A.reference.to.the.TextMesh
45c0 50 72 6f 20 63 6f 6d 70 6f 6e 65 6e 74 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 Pro.component.</param>..........
45e0 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 70 6f 73 69 74 69 6f 6e 22 3e 50 6f 73 69 74 ///.<param.name="position">Posit
4600 69 6f 6e 20 74 6f 20 63 68 65 63 6b 20 66 6f 72 20 69 6e 74 65 72 73 65 63 74 69 6f 6e 2e 3c 2f ion.to.check.for.intersection.</
4620 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d param>..........///.<param.name=
4640 22 63 61 6d 65 72 61 22 3e 54 68 65 20 73 63 65 6e 65 20 63 61 6d 65 72 61 20 77 68 69 63 68 20 "camera">The.scene.camera.which.
4660 69 73 20 72 65 6e 64 65 72 69 6e 67 20 74 68 65 20 74 65 78 74 20 6f 72 20 77 68 69 63 68 65 76 is.rendering.the.text.or.whichev
4680 65 72 20 6f 6e 65 20 6d 69 67 68 74 20 62 65 20 61 73 73 69 67 6e 65 64 20 74 6f 20 61 20 43 61 er.one.might.be.assigned.to.a.Ca
46a0 6e 76 61 73 20 75 73 69 6e 67 20 53 63 72 65 65 6e 53 70 61 63 65 20 43 61 6d 65 72 61 20 6f 72 nvas.using.ScreenSpace.Camera.or
46c0 20 57 6f 72 6c 64 53 70 61 63 65 20 72 65 6e 64 65 72 20 6d 6f 64 65 2e 20 53 65 74 20 74 6f 20 .WorldSpace.render.mode..Set.to.
46e0 6e 75 6c 6c 20 69 73 20 75 73 69 6e 67 20 53 63 72 65 65 6e 53 70 61 63 65 20 4f 76 65 72 6c 61 null.is.using.ScreenSpace.Overla
4700 79 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e y.</param>..........///.<param.n
4720 61 6d 65 3d 22 76 69 73 69 62 6c 65 4f 6e 6c 79 22 3e 4f 6e 6c 79 20 63 68 65 63 6b 20 66 6f 72 ame="visibleOnly">Only.check.for
4740 20 76 69 73 69 62 6c 65 20 63 68 61 72 61 63 74 65 72 73 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 .visible.characters.</param>....
4760 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 ......///.<returns></returns>...
4780 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 69 6e 74 20 46 69 6e 64 49 6e 74 .......public.static.int.FindInt
47a0 65 72 73 65 63 74 69 6e 67 43 68 61 72 61 63 74 65 72 28 54 4d 50 5f 54 65 78 74 20 74 65 78 74 ersectingCharacter(TMP_Text.text
47c0 2c 20 56 65 63 74 6f 72 33 20 70 6f 73 69 74 69 6f 6e 2c 20 43 61 6d 65 72 61 20 63 61 6d 65 72 ,.Vector3.position,.Camera.camer
47e0 61 2c 20 62 6f 6f 6c 20 76 69 73 69 62 6c 65 4f 6e 6c 79 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d a,.bool.visibleOnly)..........{.
4800 0a 20 20 20 20 20 20 20 20 20 20 20 20 52 65 63 74 54 72 61 6e 73 66 6f 72 6d 20 72 65 63 74 54 .............RectTransform.rectT
4820 72 61 6e 73 66 6f 72 6d 20 3d 20 74 65 78 74 2e 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 3b 0d 0a ransform.=.text.rectTransform;..
4840 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 6f 6e 76 65 72 74 20 70 6f 73 69 74 69 6f ..............//.Convert.positio
4860 6e 20 69 6e 74 6f 20 57 6f 72 6c 64 73 70 61 63 65 20 63 6f 6f 72 64 69 6e 61 74 65 73 0d 0a 20 n.into.Worldspace.coordinates...
4880 20 20 20 20 20 20 20 20 20 20 20 53 63 72 65 65 6e 50 6f 69 6e 74 54 6f 57 6f 72 6c 64 50 6f 69 ...........ScreenPointToWorldPoi
48a0 6e 74 49 6e 52 65 63 74 61 6e 67 6c 65 28 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2c 20 70 6f 73 ntInRectangle(rectTransform,.pos
48c0 69 74 69 6f 6e 2c 20 63 61 6d 65 72 61 2c 20 6f 75 74 20 70 6f 73 69 74 69 6f 6e 29 3b 0d 0a 0d ition,.camera,.out.position);...
48e0 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 20 28 69 6e 74 20 69 20 3d 20 30 3b 20 69 20 3c .............for.(int.i.=.0;.i.<
4900 20 74 65 78 74 2e 74 65 78 74 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 43 6f 75 6e 74 3b 20 69 .text.textInfo.characterCount;.i
4920 2b 2b 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 ++)..............{..............
4940 20 20 20 20 2f 2f 20 47 65 74 20 63 75 72 72 65 6e 74 20 63 68 61 72 61 63 74 65 72 20 69 6e 66 ....//.Get.current.character.inf
4960 6f 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 54 4d 50 5f 43 68 61 72 61 63 74 65 o...................TMP_Characte
4980 72 49 6e 66 6f 20 63 49 6e 66 6f 20 3d 20 74 65 78 74 2e 74 65 78 74 49 6e 66 6f 2e 63 68 61 72 rInfo.cInfo.=.text.textInfo.char
49a0 61 63 74 65 72 49 6e 66 6f 5b 69 5d 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 acterInfo[i];..................i
49c0 66 20 28 76 69 73 69 62 6c 65 4f 6e 6c 79 20 26 26 20 21 63 49 6e 66 6f 2e 69 73 56 69 73 69 62 f.(visibleOnly.&&.!cInfo.isVisib
49e0 6c 65 29 20 63 6f 6e 74 69 6e 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 le).continue;...................
4a00 20 2f 2f 20 47 65 74 20 42 6f 74 74 6f 6d 20 4c 65 66 74 20 61 6e 64 20 54 6f 70 20 52 69 67 68 .//.Get.Bottom.Left.and.Top.Righ
4a20 74 20 70 6f 73 69 74 69 6f 6e 20 6f 66 20 74 68 65 20 63 75 72 72 65 6e 74 20 63 68 61 72 61 63 t.position.of.the.current.charac
4a40 74 65 72 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 56 65 63 74 6f 72 33 20 62 6c 20 ter..................Vector3.bl.
4a60 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 63 =.rectTransform.TransformPoint(c
4a80 49 6e 66 6f 2e 62 6f 74 74 6f 6d 4c 65 66 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 Info.bottomLeft);...............
4aa0 20 20 20 56 65 63 74 6f 72 33 20 74 6c 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 ...Vector3.tl.=.rectTransform.Tr
4ac0 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 63 49 6e 66 6f 2e 62 ansformPoint(new.Vector3(cInfo.b
4ae0 6f 74 74 6f 6d 4c 65 66 74 2e 78 2c 20 63 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 2e 79 2c 20 30 ottomLeft.x,.cInfo.topRight.y,.0
4b00 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 56 65 63 74 6f 72 33 20 74 72 20 ));..................Vector3.tr.
4b20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 63 =.rectTransform.TransformPoint(c
4b40 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 Info.topRight);.................
4b60 20 56 65 63 74 6f 72 33 20 62 72 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e .Vector3.br.=.rectTransform.Tran
4b80 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 63 49 6e 66 6f 2e 74 6f 70 sformPoint(new.Vector3(cInfo.top
4ba0 52 69 67 68 74 2e 78 2c 20 63 49 6e 66 6f 2e 62 6f 74 74 6f 6d 4c 65 66 74 2e 79 2c 20 30 29 29 Right.x,.cInfo.bottomLeft.y,.0))
4bc0 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 50 6f 69 6e 74 49 6e ;....................if.(PointIn
4be0 74 65 72 73 65 63 74 52 65 63 74 61 6e 67 6c 65 28 70 6f 73 69 74 69 6f 6e 2c 20 62 6c 2c 20 74 tersectRectangle(position,.bl,.t
4c00 6c 2c 20 74 72 2c 20 62 72 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 l,.tr,.br)).....................
4c20 20 72 65 74 75 72 6e 20 69 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 .return.i;................}.....
4c40 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 2d 31 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a .........return.-1;..........}..
4c60 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 ............///.<summary>.......
4c80 20 20 20 2f 2f 2f 20 46 75 6e 63 74 69 6f 6e 20 72 65 74 75 72 6e 69 6e 67 20 74 68 65 20 69 6e ...///.Function.returning.the.in
4ca0 64 65 78 20 6f 66 20 74 68 65 20 63 68 61 72 61 63 74 65 72 20 61 74 20 74 68 65 20 67 69 76 65 dex.of.the.character.at.the.give
4cc0 6e 20 70 6f 73 69 74 69 6f 6e 20 28 69 66 20 61 6e 79 29 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f n.position.(if.any)...........//
4ce0 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d /.</summary>..........///.<param
4d00 20 6e 61 6d 65 3d 22 74 65 78 74 22 3e 41 20 72 65 66 65 72 65 6e 63 65 20 74 6f 20 74 68 65 20 .name="text">A.reference.to.the.
4d20 54 65 78 74 4d 65 73 68 50 72 6f 20 55 47 55 49 20 63 6f 6d 70 6f 6e 65 6e 74 2e 3c 2f 70 61 72 TextMeshPro.UGUI.component.</par
4d40 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 70 6f am>..........///.<param.name="po
4d60 73 69 74 69 6f 6e 22 3e 50 6f 73 69 74 69 6f 6e 20 74 6f 20 63 68 65 63 6b 20 66 6f 72 20 69 6e sition">Position.to.check.for.in
4d80 74 65 72 73 65 63 74 69 6f 6e 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f tersection.</param>..........///
4da0 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 63 61 6d 65 72 61 22 3e 54 68 65 20 63 61 6d 65 72 61 .<param.name="camera">The.camera
4dc0 20 77 68 69 63 68 20 69 73 20 72 65 6e 64 65 72 69 6e 67 20 74 68 65 20 74 65 78 74 20 6f 62 6a .which.is.rendering.the.text.obj
4de0 65 63 74 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d ect.</param>..........///.<param
4e00 20 6e 61 6d 65 3d 22 76 69 73 69 62 6c 65 4f 6e 6c 79 22 3e 4f 6e 6c 79 20 63 68 65 63 6b 20 66 .name="visibleOnly">Only.check.f
4e20 6f 72 20 76 69 73 69 62 6c 65 20 63 68 61 72 61 63 74 65 72 73 2e 3c 2f 70 61 72 61 6d 3e 0d 0a or.visible.characters.</param>..
4e40 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 3c 2f 72 65 74 75 72 6e 73 3e 0d ........///.<returns></returns>.
4e60 0a 20 20 20 20 20 20 20 20 2f 2f 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 69 6e 74 20 46 69 6e .........//public.static.int.Fin
4e80 64 49 6e 74 65 72 73 65 63 74 69 6e 67 43 68 61 72 61 63 74 65 72 28 54 65 78 74 4d 65 73 68 50 dIntersectingCharacter(TextMeshP
4ea0 72 6f 20 74 65 78 74 2c 20 56 65 63 74 6f 72 33 20 70 6f 73 69 74 69 6f 6e 2c 20 43 61 6d 65 72 ro.text,.Vector3.position,.Camer
4ec0 61 20 63 61 6d 65 72 61 2c 20 62 6f 6f 6c 20 76 69 73 69 62 6c 65 4f 6e 6c 79 29 0d 0a 20 20 20 a.camera,.bool.visibleOnly).....
4ee0 20 20 20 20 20 2f 2f 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 54 72 61 6e 73 66 6f 72 .....//{..........//....Transfor
4f00 6d 20 74 65 78 74 54 72 61 6e 73 66 6f 72 6d 20 3d 20 74 65 78 74 2e 74 72 61 6e 73 66 6f 72 6d m.textTransform.=.text.transform
4f20 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 2f 2f 20 43 6f 6e 76 65 72 74 20 70 6f ;............//....//.Convert.po
4f40 73 69 74 69 6f 6e 20 69 6e 74 6f 20 57 6f 72 6c 64 73 70 61 63 65 20 63 6f 6f 72 64 69 6e 61 74 sition.into.Worldspace.coordinat
4f60 65 73 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 53 63 72 65 65 6e 50 6f 69 6e 74 54 6f 57 es..........//....ScreenPointToW
4f80 6f 72 6c 64 50 6f 69 6e 74 49 6e 52 65 63 74 61 6e 67 6c 65 28 74 65 78 74 54 72 61 6e 73 66 6f orldPointInRectangle(textTransfo
4fa0 72 6d 2c 20 70 6f 73 69 74 69 6f 6e 2c 20 63 61 6d 65 72 61 2c 20 6f 75 74 20 70 6f 73 69 74 69 rm,.position,.camera,.out.positi
4fc0 6f 6e 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 66 6f 72 20 28 69 6e 74 20 69 on);............//....for.(int.i
4fe0 20 3d 20 30 3b 20 69 20 3c 20 74 65 78 74 2e 74 65 78 74 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 .=.0;.i.<.text.textInfo.characte
5000 72 43 6f 75 6e 74 3b 20 69 2b 2b 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 7b 0d 0a 20 rCount;.i++)..........//....{...
5020 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 2f 2f 20 47 65 74 20 63 75 72 72 65 6e 74 20 .......//........//.Get.current.
5040 63 68 61 72 61 63 74 65 72 20 69 6e 66 6f 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 character.info...........//.....
5060 20 20 20 54 4d 50 5f 43 68 61 72 61 63 74 65 72 49 6e 66 6f 20 63 49 6e 66 6f 20 3d 20 74 65 78 ...TMP_CharacterInfo.cInfo.=.tex
5080 74 2e 74 65 78 74 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 49 6e 66 6f 5b 69 5d 3b 0d 0a 20 20 t.textInfo.characterInfo[i];....
50a0 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 69 66 20 28 28 76 69 73 69 62 6c 65 4f 6e 6c 79 ......//........if.((visibleOnly
50c0 20 26 26 20 21 63 49 6e 66 6f 2e 69 73 56 69 73 69 62 6c 65 29 20 7c 7c 20 28 74 65 78 74 2e 4f .&&.!cInfo.isVisible).||.(text.O
50e0 76 65 72 66 6c 6f 77 4d 6f 64 65 20 3d 3d 20 54 65 78 74 4f 76 65 72 66 6c 6f 77 4d 6f 64 65 73 verflowMode.==.TextOverflowModes
5100 2e 50 61 67 65 20 26 26 20 63 49 6e 66 6f 2e 70 61 67 65 4e 75 6d 62 65 72 20 2b 20 31 20 21 3d .Page.&&.cInfo.pageNumber.+.1.!=
5120 20 74 65 78 74 2e 70 61 67 65 54 6f 44 69 73 70 6c 61 79 29 29 0d 0a 20 20 20 20 20 20 20 20 2f .text.pageToDisplay))........../
5140 2f 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 69 6e 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 /............continue;..........
5160 20 20 2f 2f 20 20 20 20 20 20 20 20 2f 2f 20 47 65 74 20 42 6f 74 74 6f 6d 20 4c 65 66 74 20 61 ..//........//.Get.Bottom.Left.a
5180 6e 64 20 54 6f 70 20 52 69 67 68 74 20 70 6f 73 69 74 69 6f 6e 20 6f 66 20 74 68 65 20 63 75 72 nd.Top.Right.position.of.the.cur
51a0 72 65 6e 74 20 63 68 61 72 61 63 74 65 72 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 rent.character..........//......
51c0 20 20 56 65 63 74 6f 72 33 20 62 6c 20 3d 20 74 65 78 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 ..Vector3.bl.=.textTransform.Tra
51e0 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 63 49 6e 66 6f 2e 62 6f 74 74 6f 6d 4c 65 66 74 29 3b 0d 0a nsformPoint(cInfo.bottomLeft);..
5200 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 56 65 63 74 6f 72 33 20 74 6c 20 3d 20 74 ........//........Vector3.tl.=.t
5220 65 78 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 extTransform.TransformPoint(new.
5240 56 65 63 74 6f 72 33 28 63 49 6e 66 6f 2e 62 6f 74 74 6f 6d 4c 65 66 74 2e 78 2c 20 63 49 6e 66 Vector3(cInfo.bottomLeft.x,.cInf
5260 6f 2e 74 6f 70 52 69 67 68 74 2e 79 2c 20 30 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 o.topRight.y,.0));..........//..
5280 20 20 20 20 20 20 56 65 63 74 6f 72 33 20 74 72 20 3d 20 74 65 78 74 54 72 61 6e 73 66 6f 72 6d ......Vector3.tr.=.textTransform
52a0 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 63 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 29 3b .TransformPoint(cInfo.topRight);
52c0 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 56 65 63 74 6f 72 33 20 62 72 20 3d ..........//........Vector3.br.=
52e0 20 74 65 78 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 .textTransform.TransformPoint(ne
5300 77 20 56 65 63 74 6f 72 33 28 63 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 2e 78 2c 20 63 49 6e 66 w.Vector3(cInfo.topRight.x,.cInf
5320 6f 2e 62 6f 74 74 6f 6d 4c 65 66 74 2e 79 2c 20 30 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 o.bottomLeft.y,.0));............
5340 2f 2f 20 20 20 20 20 20 20 20 69 66 20 28 50 6f 69 6e 74 49 6e 74 65 72 73 65 63 74 52 65 63 74 //........if.(PointIntersectRect
5360 61 6e 67 6c 65 28 70 6f 73 69 74 69 6f 6e 2c 20 62 6c 2c 20 74 6c 2c 20 74 72 2c 20 62 72 29 29 angle(position,.bl,.tl,.tr,.br))
5380 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 69 ..........//............return.i
53a0 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 ;............//....}............
53c0 2f 2f 20 20 20 20 72 65 74 75 72 6e 20 2d 31 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 7d 0d 0a 0d //....return.-1;..........//}...
53e0 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 ...........///.<summary>........
5400 20 20 2f 2f 2f 20 46 75 6e 63 74 69 6f 6e 20 74 6f 20 66 69 6e 64 20 74 68 65 20 6e 65 61 72 65 ..///.Function.to.find.the.neare
5420 73 74 20 63 68 61 72 61 63 74 65 72 20 74 6f 20 70 6f 73 69 74 69 6f 6e 2e 0d 0a 20 20 20 20 20 st.character.to.position........
5440 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c ...///.</summary>..........///.<
5460 70 61 72 61 6d 20 6e 61 6d 65 3d 22 74 65 78 74 22 3e 41 20 72 65 66 65 72 65 6e 63 65 20 74 6f param.name="text">A.reference.to
5480 20 74 68 65 20 54 4d 50 20 54 65 78 74 20 63 6f 6d 70 6f 6e 65 6e 74 2e 3c 2f 70 61 72 61 6d 3e .the.TMP.Text.component.</param>
54a0 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 70 6f 73 69 74 ..........///.<param.name="posit
54c0 69 6f 6e 22 3e 50 6f 73 69 74 69 6f 6e 20 74 6f 20 63 68 65 63 6b 20 66 6f 72 20 69 6e 74 65 72 ion">Position.to.check.for.inter
54e0 73 65 63 74 69 6f 6e 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 section.</param>..........///.<p
5500 61 72 61 6d 20 6e 61 6d 65 3d 22 63 61 6d 65 72 61 22 3e 54 68 65 20 73 63 65 6e 65 20 63 61 6d aram.name="camera">The.scene.cam
5520 65 72 61 20 77 68 69 63 68 20 6d 61 79 20 62 65 20 61 73 73 69 67 6e 65 64 20 74 6f 20 61 20 43 era.which.may.be.assigned.to.a.C
5540 61 6e 76 61 73 20 75 73 69 6e 67 20 53 63 72 65 65 6e 53 70 61 63 65 20 43 61 6d 65 72 61 20 6f anvas.using.ScreenSpace.Camera.o
5560 72 20 57 6f 72 6c 64 53 70 61 63 65 20 72 65 6e 64 65 72 20 6d 6f 64 65 2e 20 53 65 74 20 74 6f r.WorldSpace.render.mode..Set.to
5580 20 6e 75 6c 6c 20 69 73 20 75 73 69 6e 67 20 53 63 72 65 65 6e 53 70 61 63 65 20 4f 76 65 72 6c .null.is.using.ScreenSpace.Overl
55a0 61 79 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 ay.</param>..........///.<param.
55c0 6e 61 6d 65 3d 22 76 69 73 69 62 6c 65 4f 6e 6c 79 22 3e 4f 6e 6c 79 20 63 68 65 63 6b 20 66 6f name="visibleOnly">Only.check.fo
55e0 72 20 76 69 73 69 62 6c 65 20 63 68 61 72 61 63 74 65 72 73 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 r.visible.characters.</param>...
5600 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a .......///.<returns></returns>..
5620 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 69 6e 74 20 46 69 6e 64 4e 65 ........public.static.int.FindNe
5640 61 72 65 73 74 43 68 61 72 61 63 74 65 72 28 54 4d 50 5f 54 65 78 74 20 74 65 78 74 2c 20 56 65 arestCharacter(TMP_Text.text,.Ve
5660 63 74 6f 72 33 20 70 6f 73 69 74 69 6f 6e 2c 20 43 61 6d 65 72 61 20 63 61 6d 65 72 61 2c 20 62 ctor3.position,.Camera.camera,.b
5680 6f 6f 6c 20 76 69 73 69 62 6c 65 4f 6e 6c 79 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 ool.visibleOnly)..........{.....
56a0 20 20 20 20 20 20 20 20 20 52 65 63 74 54 72 61 6e 73 66 6f 72 6d 20 72 65 63 74 54 72 61 6e 73 .........RectTransform.rectTrans
56c0 66 6f 72 6d 20 3d 20 74 65 78 74 2e 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 3b 0d 0a 0d 0a 20 20 form.=.text.rectTransform;......
56e0 20 20 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 64 69 73 74 61 6e 63 65 53 71 72 20 3d 20 4d 61 ..........float.distanceSqr.=.Ma
5700 74 68 66 2e 49 6e 66 69 6e 69 74 79 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 20 63 thf.Infinity;..............int.c
5720 6c 6f 73 65 73 74 20 3d 20 30 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 6f losest.=.0;................//.Co
5740 6e 76 65 72 74 20 70 6f 73 69 74 69 6f 6e 20 69 6e 74 6f 20 57 6f 72 6c 64 73 70 61 63 65 20 63 nvert.position.into.Worldspace.c
5760 6f 6f 72 64 69 6e 61 74 65 73 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 53 63 72 65 65 6e 50 6f oordinates..............ScreenPo
5780 69 6e 74 54 6f 57 6f 72 6c 64 50 6f 69 6e 74 49 6e 52 65 63 74 61 6e 67 6c 65 28 72 65 63 74 54 intToWorldPointInRectangle(rectT
57a0 72 61 6e 73 66 6f 72 6d 2c 20 70 6f 73 69 74 69 6f 6e 2c 20 63 61 6d 65 72 61 2c 20 6f 75 74 20 ransform,.position,.camera,.out.
57c0 70 6f 73 69 74 69 6f 6e 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 20 28 69 position);................for.(i
57e0 6e 74 20 69 20 3d 20 30 3b 20 69 20 3c 20 74 65 78 74 2e 74 65 78 74 49 6e 66 6f 2e 63 68 61 72 nt.i.=.0;.i.<.text.textInfo.char
5800 61 63 74 65 72 43 6f 75 6e 74 3b 20 69 2b 2b 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d acterCount;.i++)..............{.
5820 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 47 65 74 20 63 75 72 72 65 6e 74 20 .................//.Get.current.
5840 63 68 61 72 61 63 74 65 72 20 69 6e 66 6f 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 character.info..................
5860 20 54 4d 50 5f 43 68 61 72 61 63 74 65 72 49 6e 66 6f 20 63 49 6e 66 6f 20 3d 20 74 65 78 74 2e .TMP_CharacterInfo.cInfo.=.text.
5880 74 65 78 74 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 49 6e 66 6f 5b 69 5d 3b 0d 0a 20 20 20 20 textInfo.characterInfo[i];......
58a0 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 76 69 73 69 62 6c 65 4f 6e 6c 79 20 26 26 20 21 ............if.(visibleOnly.&&.!
58c0 63 49 6e 66 6f 2e 69 73 56 69 73 69 62 6c 65 29 20 63 6f 6e 74 69 6e 75 65 3b 0d 0a 0d 0a 20 20 cInfo.isVisible).continue;......
58e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 47 65 74 20 42 6f 74 74 6f 6d 20 4c 65 66 74 ..............//.Get.Bottom.Left
5900 20 61 6e 64 20 54 6f 70 20 52 69 67 68 74 20 70 6f 73 69 74 69 6f 6e 20 6f 66 20 74 68 65 20 63 .and.Top.Right.position.of.the.c
5920 75 72 72 65 6e 74 20 63 68 61 72 61 63 74 65 72 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 urrent.character................
5940 20 20 56 65 63 74 6f 72 33 20 62 6c 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 ..Vector3.bl.=.rectTransform.Tra
5960 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 63 49 6e 66 6f 2e 62 6f 74 74 6f 6d 4c 65 66 74 29 3b 0d 0a nsformPoint(cInfo.bottomLeft);..
5980 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 56 65 63 74 6f 72 33 20 74 6c 20 3d 20 72 65 63 ................Vector3.tl.=.rec
59a0 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 tTransform.TransformPoint(new.Ve
59c0 63 74 6f 72 33 28 63 49 6e 66 6f 2e 62 6f 74 74 6f 6d 4c 65 66 74 2e 78 2c 20 63 49 6e 66 6f 2e ctor3(cInfo.bottomLeft.x,.cInfo.
59e0 74 6f 70 52 69 67 68 74 2e 79 2c 20 30 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 topRight.y,.0));................
5a00 20 20 56 65 63 74 6f 72 33 20 74 72 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 ..Vector3.tr.=.rectTransform.Tra
5a20 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 63 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 29 3b 0d 0a 20 20 nsformPoint(cInfo.topRight);....
5a40 20 20 20 20 20 20 20 20 20 20 20 20 20 20 56 65 63 74 6f 72 33 20 62 72 20 3d 20 72 65 63 74 54 ..............Vector3.br.=.rectT
5a60 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 ransform.TransformPoint(new.Vect
5a80 6f 72 33 28 63 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 2e 78 2c 20 63 49 6e 66 6f 2e 62 6f 74 74 or3(cInfo.topRight.x,.cInfo.bott
5aa0 6f 6d 4c 65 66 74 2e 79 2c 20 30 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 omLeft.y,.0));..................
5ac0 20 20 69 66 20 28 50 6f 69 6e 74 49 6e 74 65 72 73 65 63 74 52 65 63 74 61 6e 67 6c 65 28 70 6f ..if.(PointIntersectRectangle(po
5ae0 73 69 74 69 6f 6e 2c 20 62 6c 2c 20 74 6c 2c 20 74 72 2c 20 62 72 29 29 0d 0a 20 20 20 20 20 20 sition,.bl,.tl,.tr,.br))........
5b00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 69 3b 0d 0a 0d 0a 20 20 20 20 20 ..............return.i;.........
5b20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 46 69 6e 64 20 74 68 65 20 63 6c 6f 73 65 73 74 20 63 ...........//.Find.the.closest.c
5b40 6f 72 6e 65 72 20 74 6f 20 70 6f 73 69 74 69 6f 6e 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 orner.to.position...............
5b60 20 20 20 20 66 6c 6f 61 74 20 64 62 6c 20 3d 20 44 69 73 74 61 6e 63 65 54 6f 4c 69 6e 65 28 62 ....float.dbl.=.DistanceToLine(b
5b80 6c 2c 20 74 6c 2c 20 70 6f 73 69 74 69 6f 6e 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 l,.tl,.position);...............
5ba0 20 20 20 66 6c 6f 61 74 20 64 74 6c 20 3d 20 44 69 73 74 61 6e 63 65 54 6f 4c 69 6e 65 28 74 6c ...float.dtl.=.DistanceToLine(tl
5bc0 2c 20 74 72 2c 20 70 6f 73 69 74 69 6f 6e 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ,.tr,.position);................
5be0 20 20 66 6c 6f 61 74 20 64 74 72 20 3d 20 44 69 73 74 61 6e 63 65 54 6f 4c 69 6e 65 28 74 72 2c ..float.dtr.=.DistanceToLine(tr,
5c00 20 62 72 2c 20 70 6f 73 69 74 69 6f 6e 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .br,.position);.................
5c20 20 66 6c 6f 61 74 20 64 62 72 20 3d 20 44 69 73 74 61 6e 63 65 54 6f 4c 69 6e 65 28 62 72 2c 20 .float.dbr.=.DistanceToLine(br,.
5c40 62 6c 2c 20 70 6f 73 69 74 69 6f 6e 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 bl,.position);..................
5c60 20 20 66 6c 6f 61 74 20 64 20 3d 20 64 62 6c 20 3c 20 64 74 6c 20 3f 20 64 62 6c 20 3a 20 64 74 ..float.d.=.dbl.<.dtl.?.dbl.:.dt
5c80 6c 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 64 20 3d 20 64 20 3c 20 64 74 72 20 l;..................d.=.d.<.dtr.
5ca0 3f 20 64 20 3a 20 64 74 72 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 64 20 3d 20 ?.d.:.dtr;..................d.=.
5cc0 64 20 3c 20 64 62 72 20 3f 20 64 20 3a 20 64 62 72 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 d.<.dbr.?.d.:.dbr;..............
5ce0 20 20 20 20 20 20 69 66 20 28 64 69 73 74 61 6e 63 65 53 71 72 20 3e 20 64 29 0d 0a 20 20 20 20 ......if.(distanceSqr.>.d)......
5d00 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ............{...................
5d20 20 20 20 64 69 73 74 61 6e 63 65 53 71 72 20 3d 20 64 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ...distanceSqr.=.d;.............
5d40 20 20 20 20 20 20 20 20 20 63 6c 6f 73 65 73 74 20 3d 20 69 3b 0d 0a 20 20 20 20 20 20 20 20 20 .........closest.=.i;...........
5d60 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 .......}..............}.........
5d80 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 63 6c 6f 73 65 73 74 3b 0d 0a 20 20 20 20 20 20 20 20 .......return.closest;..........
5da0 7d 0d 0a 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 }..............///.<summary>....
5dc0 20 20 20 20 20 20 2f 2f 2f 20 46 75 6e 63 74 69 6f 6e 20 74 6f 20 66 69 6e 64 20 74 68 65 20 6e ......///.Function.to.find.the.n
5de0 65 61 72 65 73 74 20 63 68 61 72 61 63 74 65 72 20 74 6f 20 70 6f 73 69 74 69 6f 6e 2e 0d 0a 20 earest.character.to.position....
5e00 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f .......///.</summary>........../
5e20 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 74 65 78 74 22 3e 41 20 72 65 66 65 72 65 6e 63 //.<param.name="text">A.referenc
5e40 65 20 74 6f 20 74 68 65 20 54 65 78 74 4d 65 73 68 50 72 6f 20 55 47 55 49 20 63 6f 6d 70 6f 6e e.to.the.TextMeshPro.UGUI.compon
5e60 65 6e 74 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d ent.</param>..........///.<param
5e80 20 6e 61 6d 65 3d 22 70 6f 73 69 74 69 6f 6e 22 3e 50 6f 73 69 74 69 6f 6e 20 74 6f 20 63 68 65 .name="position">Position.to.che
5ea0 63 6b 20 66 6f 72 20 69 6e 74 65 72 73 65 63 74 69 6f 6e 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 ck.for.intersection.</param>....
5ec0 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 63 61 6d 65 72 61 22 3e 54 ......///.<param.name="camera">T
5ee0 68 65 20 73 63 65 6e 65 20 63 61 6d 65 72 61 20 77 68 69 63 68 20 6d 61 79 20 62 65 20 61 73 73 he.scene.camera.which.may.be.ass
5f00 69 67 6e 65 64 20 74 6f 20 61 20 43 61 6e 76 61 73 20 75 73 69 6e 67 20 53 63 72 65 65 6e 53 70 igned.to.a.Canvas.using.ScreenSp
5f20 61 63 65 20 43 61 6d 65 72 61 20 6f 72 20 57 6f 72 6c 64 53 70 61 63 65 20 72 65 6e 64 65 72 20 ace.Camera.or.WorldSpace.render.
5f40 6d 6f 64 65 2e 20 53 65 74 20 74 6f 20 6e 75 6c 6c 20 69 73 20 75 73 69 6e 67 20 53 63 72 65 65 mode..Set.to.null.is.using.Scree
5f60 6e 53 70 61 63 65 20 4f 76 65 72 6c 61 79 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 nSpace.Overlay.</param>.........
5f80 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 76 69 73 69 62 6c 65 4f 6e 6c 79 22 3e 4f .///.<param.name="visibleOnly">O
5fa0 6e 6c 79 20 63 68 65 63 6b 20 66 6f 72 20 76 69 73 69 62 6c 65 20 63 68 61 72 61 63 74 65 72 73 nly.check.for.visible.characters
5fc0 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e .</param>..........///.<returns>
5fe0 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 70 75 62 6c 69 63 20 73 74 61 </returns>..........//public.sta
6000 74 69 63 20 69 6e 74 20 46 69 6e 64 4e 65 61 72 65 73 74 43 68 61 72 61 63 74 65 72 28 54 65 78 tic.int.FindNearestCharacter(Tex
6020 74 4d 65 73 68 50 72 6f 55 47 55 49 20 74 65 78 74 2c 20 56 65 63 74 6f 72 33 20 70 6f 73 69 74 tMeshProUGUI.text,.Vector3.posit
6040 69 6f 6e 2c 20 43 61 6d 65 72 61 20 63 61 6d 65 72 61 2c 20 62 6f 6f 6c 20 76 69 73 69 62 6c 65 ion,.Camera.camera,.bool.visible
6060 4f 6e 6c 79 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 Only)..........//{..........//..
6080 20 20 52 65 63 74 54 72 61 6e 73 66 6f 72 6d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 20 3d 20 ..RectTransform.rectTransform.=.
60a0 74 65 78 74 2e 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f text.rectTransform;............/
60c0 2f 20 20 20 20 66 6c 6f 61 74 20 64 69 73 74 61 6e 63 65 53 71 72 20 3d 20 4d 61 74 68 66 2e 49 /....float.distanceSqr.=.Mathf.I
60e0 6e 66 69 6e 69 74 79 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 69 6e 74 20 63 6c 6f 73 nfinity;..........//....int.clos
6100 65 73 74 20 3d 20 30 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 2f 2f 20 43 6f 6e est.=.0;............//....//.Con
6120 76 65 72 74 20 70 6f 73 69 74 69 6f 6e 20 69 6e 74 6f 20 57 6f 72 6c 64 73 70 61 63 65 20 63 6f vert.position.into.Worldspace.co
6140 6f 72 64 69 6e 61 74 65 73 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 53 63 72 65 65 6e 50 ordinates..........//....ScreenP
6160 6f 69 6e 74 54 6f 57 6f 72 6c 64 50 6f 69 6e 74 49 6e 52 65 63 74 61 6e 67 6c 65 28 72 65 63 74 ointToWorldPointInRectangle(rect
6180 54 72 61 6e 73 66 6f 72 6d 2c 20 70 6f 73 69 74 69 6f 6e 2c 20 63 61 6d 65 72 61 2c 20 6f 75 74 Transform,.position,.camera,.out
61a0 20 70 6f 73 69 74 69 6f 6e 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 66 6f 72 .position);............//....for
61c0 20 28 69 6e 74 20 69 20 3d 20 30 3b 20 69 20 3c 20 74 65 78 74 2e 74 65 78 74 49 6e 66 6f 2e 63 .(int.i.=.0;.i.<.text.textInfo.c
61e0 68 61 72 61 63 74 65 72 43 6f 75 6e 74 3b 20 69 2b 2b 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 haracterCount;.i++)..........//.
6200 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 2f 2f 20 47 65 74 20 63 ...{..........//........//.Get.c
6220 75 72 72 65 6e 74 20 63 68 61 72 61 63 74 65 72 20 69 6e 66 6f 2e 0d 0a 20 20 20 20 20 20 20 20 urrent.character.info...........
6240 2f 2f 20 20 20 20 20 20 20 20 54 4d 50 5f 43 68 61 72 61 63 74 65 72 49 6e 66 6f 20 63 49 6e 66 //........TMP_CharacterInfo.cInf
6260 6f 20 3d 20 74 65 78 74 2e 74 65 78 74 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 49 6e 66 6f 5b o.=.text.textInfo.characterInfo[
6280 69 5d 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 69 66 20 28 28 76 69 73 69 i];..........//........if.((visi
62a0 62 6c 65 4f 6e 6c 79 20 26 26 20 21 63 49 6e 66 6f 2e 69 73 56 69 73 69 62 6c 65 29 20 7c 7c 20 bleOnly.&&.!cInfo.isVisible).||.
62c0 28 74 65 78 74 2e 4f 76 65 72 66 6c 6f 77 4d 6f 64 65 20 3d 3d 20 54 65 78 74 4f 76 65 72 66 6c (text.OverflowMode.==.TextOverfl
62e0 6f 77 4d 6f 64 65 73 2e 50 61 67 65 20 26 26 20 63 49 6e 66 6f 2e 70 61 67 65 4e 75 6d 62 65 72 owModes.Page.&&.cInfo.pageNumber
6300 20 2b 20 31 20 21 3d 20 74 65 78 74 2e 70 61 67 65 54 6f 44 69 73 70 6c 61 79 29 29 0d 0a 20 20 .+.1.!=.text.pageToDisplay))....
6320 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 69 6e 75 65 3b 0d 0a 0d ......//............continue;...
6340 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 2f 2f 20 47 65 74 20 42 6f 74 74 6f 6d .........//........//.Get.Bottom
6360 20 4c 65 66 74 20 61 6e 64 20 54 6f 70 20 52 69 67 68 74 20 70 6f 73 69 74 69 6f 6e 20 6f 66 20 .Left.and.Top.Right.position.of.
6380 74 68 65 20 63 75 72 72 65 6e 74 20 63 68 61 72 61 63 74 65 72 0d 0a 20 20 20 20 20 20 20 20 2f the.current.character........../
63a0 2f 20 20 20 20 20 20 20 20 56 65 63 74 6f 72 33 20 62 6c 20 3d 20 72 65 63 74 54 72 61 6e 73 66 /........Vector3.bl.=.rectTransf
63c0 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 63 49 6e 66 6f 2e 62 6f 74 74 6f 6d 4c orm.TransformPoint(cInfo.bottomL
63e0 65 66 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 56 65 63 74 6f 72 33 eft);..........//........Vector3
6400 20 74 6c 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 .tl.=.rectTransform.TransformPoi
6420 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 63 49 6e 66 6f 2e 62 6f 74 74 6f 6d 4c 65 66 74 2e nt(new.Vector3(cInfo.bottomLeft.
6440 78 2c 20 63 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 2e 79 2c 20 30 29 29 3b 0d 0a 20 20 20 20 20 x,.cInfo.topRight.y,.0));.......
6460 20 20 20 2f 2f 20 20 20 20 20 20 20 20 56 65 63 74 6f 72 33 20 74 72 20 3d 20 72 65 63 74 54 72 ...//........Vector3.tr.=.rectTr
6480 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 63 49 6e 66 6f 2e 74 6f 70 ansform.TransformPoint(cInfo.top
64a0 52 69 67 68 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 56 65 63 74 6f Right);..........//........Vecto
64c0 72 33 20 62 72 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 r3.br.=.rectTransform.TransformP
64e0 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 63 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 2e oint(new.Vector3(cInfo.topRight.
6500 78 2c 20 63 49 6e 66 6f 2e 62 6f 74 74 6f 6d 4c 65 66 74 2e 79 2c 20 30 29 29 3b 0d 0a 0d 0a 20 x,.cInfo.bottomLeft.y,.0));.....
6520 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 69 66 20 28 50 6f 69 6e 74 49 6e 74 65 72 73 .......//........if.(PointInters
6540 65 63 74 52 65 63 74 61 6e 67 6c 65 28 70 6f 73 69 74 69 6f 6e 2c 20 62 6c 2c 20 74 6c 2c 20 74 ectRectangle(position,.bl,.tl,.t
6560 72 2c 20 62 72 29 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 72 r,.br))..........//............r
6580 65 74 75 72 6e 20 69 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 2f 2f eturn.i;............//........//
65a0 20 46 69 6e 64 20 74 68 65 20 63 6c 6f 73 65 73 74 20 63 6f 72 6e 65 72 20 74 6f 20 70 6f 73 69 .Find.the.closest.corner.to.posi
65c0 74 69 6f 6e 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 64 tion...........//........float.d
65e0 62 6c 20 3d 20 44 69 73 74 61 6e 63 65 54 6f 4c 69 6e 65 28 62 6c 2c 20 74 6c 2c 20 70 6f 73 69 bl.=.DistanceToLine(bl,.tl,.posi
6600 74 69 6f 6e 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 tion);..........//........float.
6620 64 74 6c 20 3d 20 44 69 73 74 61 6e 63 65 54 6f 4c 69 6e 65 28 74 6c 2c 20 74 72 2c 20 70 6f 73 dtl.=.DistanceToLine(tl,.tr,.pos
6640 69 74 69 6f 6e 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 66 6c 6f 61 74 ition);..........//........float
6660 20 64 74 72 20 3d 20 44 69 73 74 61 6e 63 65 54 6f 4c 69 6e 65 28 74 72 2c 20 62 72 2c 20 70 6f .dtr.=.DistanceToLine(tr,.br,.po
6680 73 69 74 69 6f 6e 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 66 6c 6f 61 sition);..........//........floa
66a0 74 20 64 62 72 20 3d 20 44 69 73 74 61 6e 63 65 54 6f 4c 69 6e 65 28 62 72 2c 20 62 6c 2c 20 70 t.dbr.=.DistanceToLine(br,.bl,.p
66c0 6f 73 69 74 69 6f 6e 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 66 osition);............//........f
66e0 6c 6f 61 74 20 64 20 3d 20 64 62 6c 20 3c 20 64 74 6c 20 3f 20 64 62 6c 20 3a 20 64 74 6c 3b 0d loat.d.=.dbl.<.dtl.?.dbl.:.dtl;.
6700 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 64 20 3d 20 64 20 3c 20 64 74 72 20 3f .........//........d.=.d.<.dtr.?
6720 20 64 20 3a 20 64 74 72 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 64 20 3d .d.:.dtr;..........//........d.=
6740 20 64 20 3c 20 64 62 72 20 3f 20 64 20 3a 20 64 62 72 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f .d.<.dbr.?.d.:.dbr;............/
6760 2f 20 20 20 20 20 20 20 20 69 66 20 28 64 69 73 74 61 6e 63 65 53 71 72 20 3e 20 64 29 0d 0a 20 /........if.(distanceSqr.>.d)...
6780 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 .......//........{..........//..
67a0 20 20 20 20 20 20 20 20 20 20 64 69 73 74 61 6e 63 65 53 71 72 20 3d 20 64 3b 0d 0a 20 20 20 20 ..........distanceSqr.=.d;......
67c0 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 63 6c 6f 73 65 73 74 20 3d 20 69 3b 0d 0a ....//............closest.=.i;..
67e0 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 ........//........}..........//.
6800 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 2f 2f 44 65 62 75 67 2e 4c 6f ...}............//....//Debug.Lo
6820 67 28 22 52 65 74 75 72 6e 69 6e 67 20 6e 65 61 72 65 73 74 20 63 68 61 72 61 63 74 65 72 20 61 g("Returning.nearest.character.a
6840 74 20 69 6e 64 65 78 3a 20 22 20 2b 20 63 6c 6f 73 65 73 74 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 t.index:.".+.closest);..........
6860 20 20 2f 2f 20 20 20 20 72 65 74 75 72 6e 20 63 6c 6f 73 65 73 74 3b 0d 0a 20 20 20 20 20 20 20 ..//....return.closest;.........
6880 20 2f 2f 7d 0d 0a 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d .//}..............///.<summary>.
68a0 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 46 75 6e 63 74 69 6f 6e 20 74 6f 20 66 69 6e 64 20 74 68 .........///.Function.to.find.th
68c0 65 20 6e 65 61 72 65 73 74 20 63 68 61 72 61 63 74 65 72 20 74 6f 20 70 6f 73 69 74 69 6f 6e 2e e.nearest.character.to.position.
68e0 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 ..........///.</summary>........
6900 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 74 65 78 74 22 3e 41 20 72 65 66 65 72 ..///.<param.name="text">A.refer
6920 65 6e 63 65 20 74 6f 20 74 68 65 20 54 65 78 74 4d 65 73 68 50 72 6f 20 63 6f 6d 70 6f 6e 65 6e ence.to.the.TextMeshPro.componen
6940 74 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e t.</param>..........///.<param.n
6960 61 6d 65 3d 22 70 6f 73 69 74 69 6f 6e 22 3e 50 6f 73 69 74 69 6f 6e 20 74 6f 20 63 68 65 63 6b ame="position">Position.to.check
6980 20 66 6f 72 20 69 6e 74 65 72 73 65 63 74 69 6f 6e 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 .for.intersection.</param>......
69a0 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 63 61 6d 65 72 61 22 3e 54 68 65 ....///.<param.name="camera">The
69c0 20 63 61 6d 65 72 61 20 77 68 69 63 68 20 69 73 20 72 65 6e 64 65 72 69 6e 67 20 74 68 65 20 74 .camera.which.is.rendering.the.t
69e0 65 78 74 20 6f 62 6a 65 63 74 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f ext.object.</param>..........///
6a00 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 76 69 73 69 62 6c 65 4f 6e 6c 79 22 3e 4f 6e 6c 79 20 .<param.name="visibleOnly">Only.
6a20 63 68 65 63 6b 20 66 6f 72 20 76 69 73 69 62 6c 65 20 63 68 61 72 61 63 74 65 72 73 2e 3c 2f 70 check.for.visible.characters.</p
6a40 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 3c 2f 72 65 aram>..........///.<returns></re
6a60 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 turns>..........//public.static.
6a80 69 6e 74 20 46 69 6e 64 4e 65 61 72 65 73 74 43 68 61 72 61 63 74 65 72 28 54 65 78 74 4d 65 73 int.FindNearestCharacter(TextMes
6aa0 68 50 72 6f 20 74 65 78 74 2c 20 56 65 63 74 6f 72 33 20 70 6f 73 69 74 69 6f 6e 2c 20 43 61 6d hPro.text,.Vector3.position,.Cam
6ac0 65 72 61 20 63 61 6d 65 72 61 2c 20 62 6f 6f 6c 20 76 69 73 69 62 6c 65 4f 6e 6c 79 29 0d 0a 20 era.camera,.bool.visibleOnly)...
6ae0 20 20 20 20 20 20 20 2f 2f 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 54 72 61 6e 73 66 .......//{..........//....Transf
6b00 6f 72 6d 20 74 65 78 74 54 72 61 6e 73 66 6f 72 6d 20 3d 20 74 65 78 74 2e 74 72 61 6e 73 66 6f orm.textTransform.=.text.transfo
6b20 72 6d 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 66 6c 6f 61 74 20 64 69 73 74 61 rm;............//....float.dista
6b40 6e 63 65 53 71 72 20 3d 20 4d 61 74 68 66 2e 49 6e 66 69 6e 69 74 79 3b 0d 0a 20 20 20 20 20 20 nceSqr.=.Mathf.Infinity;........
6b60 20 20 2f 2f 20 20 20 20 69 6e 74 20 63 6c 6f 73 65 73 74 20 3d 20 30 3b 0d 0a 0d 0a 20 20 20 20 ..//....int.closest.=.0;........
6b80 20 20 20 20 2f 2f 20 20 20 20 2f 2f 20 43 6f 6e 76 65 72 74 20 70 6f 73 69 74 69 6f 6e 20 69 6e ....//....//.Convert.position.in
6ba0 74 6f 20 57 6f 72 6c 64 73 70 61 63 65 20 63 6f 6f 72 64 69 6e 61 74 65 73 0d 0a 20 20 20 20 20 to.Worldspace.coordinates.......
6bc0 20 20 20 2f 2f 20 20 20 20 53 63 72 65 65 6e 50 6f 69 6e 74 54 6f 57 6f 72 6c 64 50 6f 69 6e 74 ...//....ScreenPointToWorldPoint
6be0 49 6e 52 65 63 74 61 6e 67 6c 65 28 74 65 78 74 54 72 61 6e 73 66 6f 72 6d 2c 20 70 6f 73 69 74 InRectangle(textTransform,.posit
6c00 69 6f 6e 2c 20 63 61 6d 65 72 61 2c 20 6f 75 74 20 70 6f 73 69 74 69 6f 6e 29 3b 0d 0a 0d 0a 20 ion,.camera,.out.position);.....
6c20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 66 6f 72 20 28 69 6e 74 20 69 20 3d 20 30 3b 20 69 20 3c .......//....for.(int.i.=.0;.i.<
6c40 20 74 65 78 74 2e 74 65 78 74 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 43 6f 75 6e 74 3b 20 69 .text.textInfo.characterCount;.i
6c60 2b 2b 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f ++)..........//....{..........//
6c80 20 20 20 20 20 20 20 20 2f 2f 20 47 65 74 20 63 75 72 72 65 6e 74 20 63 68 61 72 61 63 74 65 72 ........//.Get.current.character
6ca0 20 69 6e 66 6f 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 54 4d 50 5f 43 68 .info...........//........TMP_Ch
6cc0 61 72 61 63 74 65 72 49 6e 66 6f 20 63 49 6e 66 6f 20 3d 20 74 65 78 74 2e 74 65 78 74 49 6e 66 aracterInfo.cInfo.=.text.textInf
6ce0 6f 2e 63 68 61 72 61 63 74 65 72 49 6e 66 6f 5b 69 5d 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 o.characterInfo[i];..........//.
6d00 20 20 20 20 20 20 20 69 66 20 28 28 76 69 73 69 62 6c 65 4f 6e 6c 79 20 26 26 20 21 63 49 6e 66 .......if.((visibleOnly.&&.!cInf
6d20 6f 2e 69 73 56 69 73 69 62 6c 65 29 20 7c 7c 20 28 74 65 78 74 2e 4f 76 65 72 66 6c 6f 77 4d 6f o.isVisible).||.(text.OverflowMo
6d40 64 65 20 3d 3d 20 54 65 78 74 4f 76 65 72 66 6c 6f 77 4d 6f 64 65 73 2e 50 61 67 65 20 26 26 20 de.==.TextOverflowModes.Page.&&.
6d60 63 49 6e 66 6f 2e 70 61 67 65 4e 75 6d 62 65 72 20 2b 20 31 20 21 3d 20 74 65 78 74 2e 70 61 67 cInfo.pageNumber.+.1.!=.text.pag
6d80 65 54 6f 44 69 73 70 6c 61 79 29 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 eToDisplay))..........//........
6da0 20 20 20 20 63 6f 6e 74 69 6e 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 ....continue;............//.....
6dc0 20 20 20 2f 2f 20 47 65 74 20 42 6f 74 74 6f 6d 20 4c 65 66 74 20 61 6e 64 20 54 6f 70 20 52 69 ...//.Get.Bottom.Left.and.Top.Ri
6de0 67 68 74 20 70 6f 73 69 74 69 6f 6e 20 6f 66 20 74 68 65 20 63 75 72 72 65 6e 74 20 63 68 61 72 ght.position.of.the.current.char
6e00 61 63 74 65 72 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 56 65 63 74 6f 72 33 acter..........//........Vector3
6e20 20 62 6c 20 3d 20 74 65 78 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 .bl.=.textTransform.TransformPoi
6e40 6e 74 28 63 49 6e 66 6f 2e 62 6f 74 74 6f 6d 4c 65 66 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f nt(cInfo.bottomLeft);........../
6e60 2f 20 20 20 20 20 20 20 20 56 65 63 74 6f 72 33 20 74 6c 20 3d 20 74 65 78 74 54 72 61 6e 73 66 /........Vector3.tl.=.textTransf
6e80 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 63 orm.TransformPoint(new.Vector3(c
6ea0 49 6e 66 6f 2e 62 6f 74 74 6f 6d 4c 65 66 74 2e 78 2c 20 63 49 6e 66 6f 2e 74 6f 70 52 69 67 68 Info.bottomLeft.x,.cInfo.topRigh
6ec0 74 2e 79 2c 20 30 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 56 65 63 t.y,.0));..........//........Vec
6ee0 74 6f 72 33 20 74 72 20 3d 20 74 65 78 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 tor3.tr.=.textTransform.Transfor
6f00 6d 50 6f 69 6e 74 28 63 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 29 3b 0d 0a 20 20 20 20 20 20 20 mPoint(cInfo.topRight);.........
6f20 20 2f 2f 20 20 20 20 20 20 20 20 56 65 63 74 6f 72 33 20 62 72 20 3d 20 74 65 78 74 54 72 61 6e .//........Vector3.br.=.textTran
6f40 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 sform.TransformPoint(new.Vector3
6f60 28 63 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 2e 78 2c 20 63 49 6e 66 6f 2e 62 6f 74 74 6f 6d 4c (cInfo.topRight.x,.cInfo.bottomL
6f80 65 66 74 2e 79 2c 20 30 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 eft.y,.0));............//.......
6fa0 20 69 66 20 28 50 6f 69 6e 74 49 6e 74 65 72 73 65 63 74 52 65 63 74 61 6e 67 6c 65 28 70 6f 73 .if.(PointIntersectRectangle(pos
6fc0 69 74 69 6f 6e 2c 20 62 6c 2c 20 74 6c 2c 20 74 72 2c 20 62 72 29 29 0d 0a 20 20 20 20 20 20 20 ition,.bl,.tl,.tr,.br)).........
6fe0 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 69 3b 0d 0a 0d 0a 20 20 20 20 .//............return.i;........
7000 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 2f 2f 20 46 69 6e 64 20 74 68 65 20 63 6c 6f 73 65 73 ....//........//.Find.the.closes
7020 74 20 63 6f 72 6e 65 72 20 74 6f 20 70 6f 73 69 74 69 6f 6e 2e 0d 0a 20 20 20 20 20 20 20 20 2f t.corner.to.position.........../
7040 2f 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 64 62 6c 20 3d 20 44 69 73 74 61 6e 63 65 54 6f 4c /........float.dbl.=.DistanceToL
7060 69 6e 65 28 62 6c 2c 20 74 6c 2c 20 70 6f 73 69 74 69 6f 6e 29 3b 20 2f 2f 20 28 70 6f 73 69 74 ine(bl,.tl,.position);.//.(posit
7080 69 6f 6e 20 2d 20 62 6c 29 2e 73 71 72 4d 61 67 6e 69 74 75 64 65 3b 0d 0a 20 20 20 20 20 20 20 ion.-.bl).sqrMagnitude;.........
70a0 20 2f 2f 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 64 74 6c 20 3d 20 44 69 73 74 61 6e 63 65 54 .//........float.dtl.=.DistanceT
70c0 6f 4c 69 6e 65 28 74 6c 2c 20 74 72 2c 20 70 6f 73 69 74 69 6f 6e 29 3b 20 2f 2f 20 28 70 6f 73 oLine(tl,.tr,.position);.//.(pos
70e0 69 74 69 6f 6e 20 2d 20 74 6c 29 2e 73 71 72 4d 61 67 6e 69 74 75 64 65 3b 0d 0a 20 20 20 20 20 ition.-.tl).sqrMagnitude;.......
7100 20 20 20 2f 2f 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 64 74 72 20 3d 20 44 69 73 74 61 6e 63 ...//........float.dtr.=.Distanc
7120 65 54 6f 4c 69 6e 65 28 74 72 2c 20 62 72 2c 20 70 6f 73 69 74 69 6f 6e 29 3b 20 2f 2f 20 28 70 eToLine(tr,.br,.position);.//.(p
7140 6f 73 69 74 69 6f 6e 20 2d 20 74 72 29 2e 73 71 72 4d 61 67 6e 69 74 75 64 65 3b 0d 0a 20 20 20 osition.-.tr).sqrMagnitude;.....
7160 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 64 62 72 20 3d 20 44 69 73 74 61 .....//........float.dbr.=.Dista
7180 6e 63 65 54 6f 4c 69 6e 65 28 62 72 2c 20 62 6c 2c 20 70 6f 73 69 74 69 6f 6e 29 3b 20 2f 2f 20 nceToLine(br,.bl,.position);.//.
71a0 28 70 6f 73 69 74 69 6f 6e 20 2d 20 62 72 29 2e 73 71 72 4d 61 67 6e 69 74 75 64 65 3b 0d 0a 0d (position.-.br).sqrMagnitude;...
71c0 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 64 20 3d 20 64 62 6c .........//........float.d.=.dbl
71e0 20 3c 20 64 74 6c 20 3f 20 64 62 6c 20 3a 20 64 74 6c 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 .<.dtl.?.dbl.:.dtl;..........//.
7200 20 20 20 20 20 20 20 64 20 3d 20 64 20 3c 20 64 74 72 20 3f 20 64 20 3a 20 64 74 72 3b 0d 0a 20 .......d.=.d.<.dtr.?.d.:.dtr;...
7220 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 64 20 3d 20 64 20 3c 20 64 62 72 20 3f 20 64 .......//........d.=.d.<.dbr.?.d
7240 20 3a 20 64 62 72 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 69 66 20 .:.dbr;............//........if.
7260 28 64 69 73 74 61 6e 63 65 53 71 72 20 3e 20 64 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 (distanceSqr.>.d)..........//...
7280 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 64 69 .....{..........//............di
72a0 73 74 61 6e 63 65 53 71 72 20 3d 20 64 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 stanceSqr.=.d;..........//......
72c0 20 20 20 20 20 20 63 6c 6f 73 65 73 74 20 3d 20 69 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 ......closest.=.i;..........//..
72e0 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 ......}..........//....}........
7300 20 20 20 20 2f 2f 20 20 20 20 2f 2f 44 65 62 75 67 2e 4c 6f 67 28 22 52 65 74 75 72 6e 69 6e 67 ....//....//Debug.Log("Returning
7320 20 6e 65 61 72 65 73 74 20 63 68 61 72 61 63 74 65 72 20 61 74 20 69 6e 64 65 78 3a 20 22 20 2b .nearest.character.at.index:.".+
7340 20 63 6c 6f 73 65 73 74 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 72 65 74 75 .closest);............//....retu
7360 72 6e 20 63 6c 6f 73 65 73 74 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 7d 0d 0a 0d 0a 0d 0a 20 20 rn.closest;..........//}........
7380 20 20 20 20 20 20 2f 2f 20 57 4f 52 44 20 48 41 4e 44 4c 49 4e 47 0d 0a 20 20 20 20 20 20 20 20 ......//.WORD.HANDLING..........
73a0 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 46 75 6e 63 74 ///.<summary>..........///.Funct
73c0 69 6f 6e 20 72 65 74 75 72 6e 69 6e 67 20 74 68 65 20 69 6e 64 65 78 20 6f 66 20 74 68 65 20 77 ion.returning.the.index.of.the.w
73e0 6f 72 64 20 61 74 20 74 68 65 20 67 69 76 65 6e 20 70 6f 73 69 74 69 6f 6e 20 28 69 66 20 61 6e ord.at.the.given.position.(if.an
7400 79 29 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 y)...........///.</summary>.....
7420 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 74 65 78 74 22 3e 41 20 72 65 .....///.<param.name="text">A.re
7440 66 65 72 65 6e 63 65 20 74 6f 20 74 68 65 20 54 4d 50 5f 54 65 78 74 20 63 6f 6d 70 6f 6e 65 6e ference.to.the.TMP_Text.componen
7460 74 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e t.</param>..........///.<param.n
7480 61 6d 65 3d 22 70 6f 73 69 74 69 6f 6e 22 3e 50 6f 73 69 74 69 6f 6e 20 74 6f 20 63 68 65 63 6b ame="position">Position.to.check
74a0 20 66 6f 72 20 69 6e 74 65 72 73 65 63 74 69 6f 6e 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 .for.intersection.</param>......
74c0 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 63 61 6d 65 72 61 22 3e 54 68 65 ....///.<param.name="camera">The
74e0 20 73 63 65 6e 65 20 63 61 6d 65 72 61 20 77 68 69 63 68 20 6d 61 79 20 62 65 20 61 73 73 69 67 .scene.camera.which.may.be.assig
7500 6e 65 64 20 74 6f 20 61 20 43 61 6e 76 61 73 20 75 73 69 6e 67 20 53 63 72 65 65 6e 53 70 61 63 ned.to.a.Canvas.using.ScreenSpac
7520 65 20 43 61 6d 65 72 61 20 6f 72 20 57 6f 72 6c 64 53 70 61 63 65 20 72 65 6e 64 65 72 20 6d 6f e.Camera.or.WorldSpace.render.mo
7540 64 65 2e 20 53 65 74 20 74 6f 20 6e 75 6c 6c 20 69 73 20 75 73 69 6e 67 20 53 63 72 65 65 6e 53 de..Set.to.null.is.using.ScreenS
7560 70 61 63 65 20 4f 76 65 72 6c 61 79 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f pace.Overlay.</param>........../
7580 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 20 20 //.<returns></returns>..........
75a0 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 69 6e 74 20 46 69 6e 64 49 6e 74 65 72 73 65 63 74 69 public.static.int.FindIntersecti
75c0 6e 67 57 6f 72 64 28 54 4d 50 5f 54 65 78 74 20 74 65 78 74 2c 20 56 65 63 74 6f 72 33 20 70 6f ngWord(TMP_Text.text,.Vector3.po
75e0 73 69 74 69 6f 6e 2c 20 43 61 6d 65 72 61 20 63 61 6d 65 72 61 29 0d 0a 20 20 20 20 20 20 20 20 sition,.Camera.camera)..........
7600 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 52 65 63 74 54 72 61 6e 73 66 6f 72 6d 20 72 65 63 {..............RectTransform.rec
7620 74 54 72 61 6e 73 66 6f 72 6d 20 3d 20 74 65 78 74 2e 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 3b tTransform.=.text.rectTransform;
7640 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 6f 6e 76 65 72 74 20 70 6f 73 69 74 ................//.Convert.posit
7660 69 6f 6e 20 69 6e 74 6f 20 57 6f 72 6c 64 73 70 61 63 65 20 63 6f 6f 72 64 69 6e 61 74 65 73 0d ion.into.Worldspace.coordinates.
7680 0a 20 20 20 20 20 20 20 20 20 20 20 20 53 63 72 65 65 6e 50 6f 69 6e 74 54 6f 57 6f 72 6c 64 50 .............ScreenPointToWorldP
76a0 6f 69 6e 74 49 6e 52 65 63 74 61 6e 67 6c 65 28 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2c 20 70 ointInRectangle(rectTransform,.p
76c0 6f 73 69 74 69 6f 6e 2c 20 63 61 6d 65 72 61 2c 20 6f 75 74 20 70 6f 73 69 74 69 6f 6e 29 3b 0d osition,.camera,.out.position);.
76e0 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 20 28 69 6e 74 20 69 20 3d 20 30 3b 20 69 ...............for.(int.i.=.0;.i
7700 20 3c 20 74 65 78 74 2e 74 65 78 74 49 6e 66 6f 2e 77 6f 72 64 43 6f 75 6e 74 3b 20 69 2b 2b 29 .<.text.textInfo.wordCount;.i++)
7720 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ..............{.................
7740 20 54 4d 50 5f 57 6f 72 64 49 6e 66 6f 20 77 49 6e 66 6f 20 3d 20 74 65 78 74 2e 74 65 78 74 49 .TMP_WordInfo.wInfo.=.text.textI
7760 6e 66 6f 2e 77 6f 72 64 49 6e 66 6f 5b 69 5d 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 nfo.wordInfo[i];................
7780 20 20 20 20 62 6f 6f 6c 20 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 3d 20 66 61 6c 73 65 3b 0d ....bool.isBeginRegion.=.false;.
77a0 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 56 65 63 74 6f 72 33 20 62 6c 20 3d 20 ...................Vector3.bl.=.
77c0 56 65 63 74 6f 72 33 2e 7a 65 72 6f 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 56 Vector3.zero;..................V
77e0 65 63 74 6f 72 33 20 74 6c 20 3d 20 56 65 63 74 6f 72 33 2e 7a 65 72 6f 3b 0d 0a 20 20 20 20 20 ector3.tl.=.Vector3.zero;.......
7800 20 20 20 20 20 20 20 20 20 20 20 56 65 63 74 6f 72 33 20 62 72 20 3d 20 56 65 63 74 6f 72 33 2e ...........Vector3.br.=.Vector3.
7820 7a 65 72 6f 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 56 65 63 74 6f 72 33 20 74 zero;..................Vector3.t
7840 72 20 3d 20 56 65 63 74 6f 72 33 2e 7a 65 72 6f 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 r.=.Vector3.zero;...............
7860 20 20 20 20 20 66 6c 6f 61 74 20 6d 61 78 41 73 63 65 6e 64 65 72 20 3d 20 2d 4d 61 74 68 66 2e .....float.maxAscender.=.-Mathf.
7880 49 6e 66 69 6e 69 74 79 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 6c 6f 61 74 Infinity;..................float
78a0 20 6d 69 6e 44 65 73 63 65 6e 64 65 72 20 3d 20 4d 61 74 68 66 2e 49 6e 66 69 6e 69 74 79 3b 0d .minDescender.=.Mathf.Infinity;.
78c0 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 74 65 72 61 74 65 20 74 68 ...................//.Iterate.th
78e0 72 6f 75 67 68 20 65 61 63 68 20 63 68 61 72 61 63 74 65 72 20 6f 66 20 74 68 65 20 77 6f 72 64 rough.each.character.of.the.word
7900 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 20 28 69 6e 74 20 6a 20 3d 20 30 ..................for.(int.j.=.0
7920 3b 20 6a 20 3c 20 77 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 43 6f 75 6e 74 3b 20 6a 2b 2b 29 ;.j.<.wInfo.characterCount;.j++)
7940 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ..................{.............
7960 20 20 20 20 20 20 20 20 20 69 6e 74 20 63 68 61 72 61 63 74 65 72 49 6e 64 65 78 20 3d 20 77 49 .........int.characterIndex.=.wI
7980 6e 66 6f 2e 66 69 72 73 74 43 68 61 72 61 63 74 65 72 49 6e 64 65 78 20 2b 20 6a 3b 0d 0a 20 20 nfo.firstCharacterIndex.+.j;....
79a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 54 4d 50 5f 43 68 61 72 61 63 74 65 72 49 ..................TMP_CharacterI
79c0 6e 66 6f 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 20 3d 20 74 65 78 74 2e 74 65 78 74 49 nfo.currentCharInfo.=.text.textI
79e0 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 49 6e 66 6f 5b 63 68 61 72 61 63 74 65 72 49 6e 64 65 78 nfo.characterInfo[characterIndex
7a00 5d 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 20 63 75 72 72 ];......................int.curr
7a20 65 6e 74 4c 69 6e 65 20 3d 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 6c 69 6e 65 4e 75 entLine.=.currentCharInfo.lineNu
7a40 6d 62 65 72 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 6f 6f mber;........................boo
7a60 6c 20 69 73 43 68 61 72 61 63 74 65 72 56 69 73 69 62 6c 65 20 3d 20 63 75 72 72 65 6e 74 43 68 l.isCharacterVisible.=.currentCh
7a80 61 72 49 6e 66 6f 2e 69 73 56 69 73 69 62 6c 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 arInfo.isVisible;...............
7aa0 20 20 20 20 20 20 20 20 20 2f 2f 20 54 72 61 63 6b 20 6d 61 78 69 6d 75 6d 20 41 73 63 65 6e 64 .........//.Track.maximum.Ascend
7ac0 65 72 20 61 6e 64 20 6d 69 6e 69 6d 75 6d 20 44 65 73 63 65 6e 64 65 72 20 66 6f 72 20 65 61 63 er.and.minimum.Descender.for.eac
7ae0 68 20 77 6f 72 64 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 61 78 h.word.......................max
7b00 41 73 63 65 6e 64 65 72 20 3d 20 4d 61 74 68 66 2e 4d 61 78 28 6d 61 78 41 73 63 65 6e 64 65 72 Ascender.=.Mathf.Max(maxAscender
7b20 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 61 73 63 65 6e 64 65 72 29 3b 0d 0a 20 20 ,.currentCharInfo.ascender);....
7b40 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 69 6e 44 65 73 63 65 6e 64 65 72 20 3d ..................minDescender.=
7b60 20 4d 61 74 68 66 2e 4d 69 6e 28 6d 69 6e 44 65 73 63 65 6e 64 65 72 2c 20 63 75 72 72 65 6e 74 .Mathf.Min(minDescender,.current
7b80 43 68 61 72 49 6e 66 6f 2e 64 65 73 63 65 6e 64 65 72 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 CharInfo.descender);............
7ba0 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 3d 3d ............if.(isBeginRegion.==
7bc0 20 66 61 6c 73 65 20 26 26 20 69 73 43 68 61 72 61 63 74 65 72 56 69 73 69 62 6c 65 29 0d 0a 20 .false.&&.isCharacterVisible)...
7be0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 ...................{............
7c00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 3d 20 74 72 ..............isBeginRegion.=.tr
7c20 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 ue;............................b
7c40 6c 20 3d 20 6e 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e l.=.new.Vector3(currentCharInfo.
7c60 62 6f 74 74 6f 6d 4c 65 66 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 64 65 bottomLeft.x,.currentCharInfo.de
7c80 73 63 65 6e 64 65 72 2c 20 30 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 scender,.0);....................
7ca0 20 20 20 20 20 20 74 6c 20 3d 20 6e 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 ......tl.=.new.Vector3(currentCh
7cc0 61 72 49 6e 66 6f 2e 62 6f 74 74 6f 6d 4c 65 66 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 72 arInfo.bottomLeft.x,.currentChar
7ce0 49 6e 66 6f 2e 61 73 63 65 6e 64 65 72 2c 20 30 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 Info.ascender,.0);..............
7d00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 44 65 62 75 67 2e 4c 6f 67 28 22 53 74 61 72 74 ..............//Debug.Log("Start
7d20 20 57 6f 72 64 20 52 65 67 69 6f 6e 20 61 74 20 5b 22 20 2b 20 63 75 72 72 65 6e 74 43 68 61 72 .Word.Region.at.[".+.currentChar
7d40 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 20 2b 20 22 5d 22 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 Info.character.+."]");..........
7d60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 66 20 57 6f 72 64 20 69 73 20 ..................//.If.Word.is.
7d80 6f 6e 65 20 63 68 61 72 61 63 74 65 72 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 one.character...................
7da0 20 20 20 20 20 20 20 69 66 20 28 77 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 43 6f 75 6e 74 20 .......if.(wInfo.characterCount.
7dc0 3d 3d 20 31 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b ==.1)..........................{
7de0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 73 ..............................is
7e00 42 65 67 69 6e 52 65 67 69 6f 6e 20 3d 20 66 61 6c 73 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 BeginRegion.=.false;............
7e20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 72 20 3d 20 6e 65 77 20 56 65 63 ....................br.=.new.Vec
7e40 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 2e 78 2c tor3(currentCharInfo.topRight.x,
7e60 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 64 65 73 63 65 6e 64 65 72 2c 20 30 29 3b 0d .currentCharInfo.descender,.0);.
7e80 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 72 20 .............................tr.
7ea0 3d 20 6e 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 74 6f =.new.Vector3(currentCharInfo.to
7ec0 70 52 69 67 68 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 61 73 63 65 6e 64 pRight.x,.currentCharInfo.ascend
7ee0 65 72 2c 20 30 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 er,.0);.........................
7f00 20 20 20 20 20 20 20 2f 2f 20 54 72 61 6e 73 66 6f 72 6d 20 63 6f 6f 72 64 69 6e 61 74 65 73 20 .......//.Transform.coordinates.
7f20 74 6f 20 62 65 20 72 65 6c 61 74 69 76 65 20 74 6f 20 74 72 61 6e 73 66 6f 72 6d 20 61 6e 64 20 to.be.relative.to.transform.and.
7f40 61 63 63 6f 75 6e 74 20 6d 69 6e 20 64 65 73 63 65 6e 64 65 72 20 61 6e 64 20 6d 61 78 20 61 73 account.min.descender.and.max.as
7f60 63 65 6e 64 65 72 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 cender..........................
7f80 20 20 20 20 20 62 6c 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 .....bl.=.rectTransform.Transfor
7fa0 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 62 6c 2e 78 2c 20 6d 69 6e 44 65 73 63 mPoint(new.Vector3(bl.x,.minDesc
7fc0 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ender,.0));.....................
7fe0 20 20 20 20 20 20 20 20 20 74 6c 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e .........tl.=.rectTransform.Tran
8000 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 74 6c 2e 78 2c 20 6d 61 78 sformPoint(new.Vector3(tl.x,.max
8020 41 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 Ascender,.0));..................
8040 20 20 20 20 20 20 20 20 20 20 20 20 74 72 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 ............tr.=.rectTransform.T
8060 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 74 72 2e 78 2c 20 ransformPoint(new.Vector3(tr.x,.
8080 6d 61 78 41 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 maxAscender,.0));...............
80a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 72 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 ...............br.=.rectTransfor
80c0 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 62 72 2e m.TransformPoint(new.Vector3(br.
80e0 78 2c 20 6d 69 6e 44 65 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 x,.minDescender,.0));...........
8100 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 68 65 63 6b 20 66 6f .....................//.Check.fo
8120 72 20 49 6e 74 65 72 73 65 63 74 69 6f 6e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 r.Intersection..................
8140 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 50 6f 69 6e 74 49 6e 74 65 72 73 65 63 74 52 65 ............if.(PointIntersectRe
8160 63 74 61 6e 67 6c 65 28 70 6f 73 69 74 69 6f 6e 2c 20 62 6c 2c 20 74 6c 2c 20 74 72 2c 20 62 72 ctangle(position,.bl,.tl,.tr,.br
8180 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ))..............................
81a0 20 20 20 20 72 65 74 75 72 6e 20 69 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ....return.i;...................
81c0 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 44 65 62 75 67 2e 4c 6f 67 28 22 45 6e 64 20 57 6f .............//Debug.Log("End.Wo
81e0 72 64 20 52 65 67 69 6f 6e 20 61 74 20 5b 22 20 2b 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 rd.Region.at.[".+.currentCharInf
8200 6f 2e 63 68 61 72 61 63 74 65 72 20 2b 20 22 5d 22 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 o.character.+."]");.............
8220 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .............}..................
8240 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 ....}........................//.
8260 4c 61 73 74 20 43 68 61 72 61 63 74 65 72 20 6f 66 20 57 6f 72 64 0d 0a 20 20 20 20 20 20 20 20 Last.Character.of.Word..........
8280 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 26 26 ............if.(isBeginRegion.&&
82a0 20 6a 20 3d 3d 20 77 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 43 6f 75 6e 74 20 2d 20 31 29 0d .j.==.wInfo.characterCount.-.1).
82c0 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 .....................{..........
82e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 3d 20 ................isBeginRegion.=.
8300 66 61 6c 73 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 false;..........................
8320 20 20 62 72 20 3d 20 6e 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 49 6e ..br.=.new.Vector3(currentCharIn
8340 66 6f 2e 74 6f 70 52 69 67 68 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 64 fo.topRight.x,.currentCharInfo.d
8360 65 73 63 65 6e 64 65 72 2c 20 30 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 escender,.0);...................
8380 20 20 20 20 20 20 20 74 72 20 3d 20 6e 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 .......tr.=.new.Vector3(currentC
83a0 68 61 72 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 harInfo.topRight.x,.currentCharI
83c0 6e 66 6f 2e 61 73 63 65 6e 64 65 72 2c 20 30 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 nfo.ascender,.0);...............
83e0 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 54 72 61 6e 73 66 6f 72 6d 20 63 6f 6f 72 64 69 .............//.Transform.coordi
8400 6e 61 74 65 73 20 74 6f 20 62 65 20 72 65 6c 61 74 69 76 65 20 74 6f 20 74 72 61 6e 73 66 6f 72 nates.to.be.relative.to.transfor
8420 6d 20 61 6e 64 20 61 63 63 6f 75 6e 74 20 6d 69 6e 20 64 65 73 63 65 6e 64 65 72 20 61 6e 64 20 m.and.account.min.descender.and.
8440 6d 61 78 20 61 73 63 65 6e 64 65 72 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 max.ascender....................
8460 20 20 20 20 20 20 20 62 6c 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 .......bl.=.rectTransform.Transf
8480 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 62 6c 2e 78 2c 20 6d 69 6e 44 65 ormPoint(new.Vector3(bl.x,.minDe
84a0 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 scender,.0));...................
84c0 20 20 20 20 20 20 20 74 6c 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 .......tl.=.rectTransform.Transf
84e0 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 74 6c 2e 78 2c 20 6d 61 78 41 73 ormPoint(new.Vector3(tl.x,.maxAs
8500 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 cender,.0));....................
8520 20 20 20 20 20 20 74 72 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f ......tr.=.rectTransform.Transfo
8540 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 74 72 2e 78 2c 20 6d 61 78 41 73 63 rmPoint(new.Vector3(tr.x,.maxAsc
8560 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ender,.0));.....................
8580 20 20 20 20 20 62 72 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 .....br.=.rectTransform.Transfor
85a0 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 62 72 2e 78 2c 20 6d 69 6e 44 65 73 63 mPoint(new.Vector3(br.x,.minDesc
85c0 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ender,.0));.....................
85e0 20 20 20 20 20 20 20 2f 2f 20 43 68 65 63 6b 20 66 6f 72 20 49 6e 74 65 72 73 65 63 74 69 6f 6e .......//.Check.for.Intersection
8600 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 50 6f ..........................if.(Po
8620 69 6e 74 49 6e 74 65 72 73 65 63 74 52 65 63 74 61 6e 67 6c 65 28 70 6f 73 69 74 69 6f 6e 2c 20 intIntersectRectangle(position,.
8640 62 6c 2c 20 74 6c 2c 20 74 72 2c 20 62 72 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 bl,.tl,.tr,.br))................
8660 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 69 3b 0d 0a 0d 0a 20 20 20 20 20 ..............return.i;.........
8680 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 44 65 62 75 67 2e 4c 6f 67 28 22 ...................//Debug.Log("
86a0 45 6e 64 20 57 6f 72 64 20 52 65 67 69 6f 6e 20 61 74 20 5b 22 20 2b 20 63 75 72 72 65 6e 74 43 End.Word.Region.at.[".+.currentC
86c0 68 61 72 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 20 2b 20 22 5d 22 29 3b 0d 0a 20 20 20 20 20 harInfo.character.+."]");.......
86e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ...............}................
8700 20 20 20 20 20 20 2f 2f 20 49 66 20 57 6f 72 64 20 69 73 20 73 70 6c 69 74 20 6f 6e 20 6d 6f 72 ......//.If.Word.is.split.on.mor
8720 65 20 74 68 61 6e 20 6f 6e 65 20 6c 69 6e 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 e.than.one.line.................
8740 20 20 20 20 20 20 65 6c 73 65 20 69 66 20 28 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 26 26 20 ......else.if.(isBeginRegion.&&.
8760 63 75 72 72 65 6e 74 4c 69 6e 65 20 21 3d 20 74 65 78 74 2e 74 65 78 74 49 6e 66 6f 2e 63 68 61 currentLine.!=.text.textInfo.cha
8780 72 61 63 74 65 72 49 6e 66 6f 5b 63 68 61 72 61 63 74 65 72 49 6e 64 65 78 20 2b 20 31 5d 2e 6c racterInfo[characterIndex.+.1].l
87a0 69 6e 65 4e 75 6d 62 65 72 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ineNumber)......................
87c0 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 73 42 65 67 {..........................isBeg
87e0 69 6e 52 65 67 69 6f 6e 20 3d 20 66 61 6c 73 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 inRegion.=.false;...............
8800 20 20 20 20 20 20 20 20 20 20 20 20 20 62 72 20 3d 20 6e 65 77 20 56 65 63 74 6f 72 33 28 63 75 .............br.=.new.Vector3(cu
8820 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 2e 78 2c 20 63 75 72 72 65 6e rrentCharInfo.topRight.x,.curren
8840 74 43 68 61 72 49 6e 66 6f 2e 64 65 73 63 65 6e 64 65 72 2c 20 30 29 3b 0d 0a 20 20 20 20 20 20 tCharInfo.descender,.0);........
8860 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 72 20 3d 20 6e 65 77 20 56 65 63 74 6f ..................tr.=.new.Vecto
8880 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 2e 78 2c 20 63 r3(currentCharInfo.topRight.x,.c
88a0 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 61 73 63 65 6e 64 65 72 2c 20 30 29 3b 0d 0a 0d 0a urrentCharInfo.ascender,.0);....
88c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 54 72 61 6e 73 ........................//.Trans
88e0 66 6f 72 6d 20 63 6f 6f 72 64 69 6e 61 74 65 73 20 74 6f 20 62 65 20 72 65 6c 61 74 69 76 65 20 form.coordinates.to.be.relative.
8900 74 6f 20 74 72 61 6e 73 66 6f 72 6d 20 61 6e 64 20 61 63 63 6f 75 6e 74 20 6d 69 6e 20 64 65 73 to.transform.and.account.min.des
8920 63 65 6e 64 65 72 20 61 6e 64 20 6d 61 78 20 61 73 63 65 6e 64 65 72 2e 0d 0a 20 20 20 20 20 20 cender.and.max.ascender.........
8940 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 6c 20 3d 20 72 65 63 74 54 72 61 6e 73 ..................bl.=.rectTrans
8960 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 form.TransformPoint(new.Vector3(
8980 62 6c 2e 78 2c 20 6d 69 6e 44 65 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 20 20 20 20 20 20 bl.x,.minDescender,.0));........
89a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 6c 20 3d 20 72 65 63 74 54 72 61 6e 73 ..................tl.=.rectTrans
89c0 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 form.TransformPoint(new.Vector3(
89e0 74 6c 2e 78 2c 20 6d 61 78 41 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 20 20 20 20 20 20 20 tl.x,.maxAscender,.0));.........
8a00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 72 20 3d 20 72 65 63 74 54 72 61 6e 73 66 .................tr.=.rectTransf
8a20 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 74 orm.TransformPoint(new.Vector3(t
8a40 72 2e 78 2c 20 6d 61 78 41 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 r.x,.maxAscender,.0));..........
8a60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 72 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f ................br.=.rectTransfo
8a80 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 62 72 rm.TransformPoint(new.Vector3(br
8aa0 2e 78 2c 20 6d 69 6e 44 65 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 .x,.minDescender,.0));..........
8ac0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 61 78 41 73 63 65 6e 64 65 72 20 3d 20 ..................maxAscender.=.
8ae0 2d 4d 61 74 68 66 2e 49 6e 66 69 6e 69 74 79 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 -Mathf.Infinity;................
8b00 20 20 20 20 20 20 20 20 20 20 6d 69 6e 44 65 73 63 65 6e 64 65 72 20 3d 20 4d 61 74 68 66 2e 49 ..........minDescender.=.Mathf.I
8b20 6e 66 69 6e 69 74 79 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 nfinity;........................
8b40 20 20 20 20 2f 2f 20 43 68 65 63 6b 20 66 6f 72 20 49 6e 74 65 72 73 65 63 74 69 6f 6e 0d 0a 20 ....//.Check.for.Intersection...
8b60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 50 6f 69 6e 74 .......................if.(Point
8b80 49 6e 74 65 72 73 65 63 74 52 65 63 74 61 6e 67 6c 65 28 70 6f 73 69 74 69 6f 6e 2c 20 62 6c 2c IntersectRectangle(position,.bl,
8ba0 20 74 6c 2c 20 74 72 2c 20 62 72 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .tl,.tr,.br))...................
8bc0 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 69 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 ...........return.i;............
8be0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 44 65 62 75 67 2e 4c 6f 67 28 22 45 6e 64 ................//Debug.Log("End
8c00 20 57 6f 72 64 20 52 65 67 69 6f 6e 20 61 74 20 5b 22 20 2b 20 63 75 72 72 65 6e 74 43 68 61 72 .Word.Region.at.[".+.currentChar
8c20 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 20 2b 20 22 5d 22 29 3b 0d 0a 20 20 20 20 20 20 20 20 Info.character.+."]");..........
8c40 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d ............}..................}
8c60 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 44 65 62 75 67 2e 4c 6f 67 28 ....................//Debug.Log(
8c80 22 57 6f 72 64 20 61 74 20 49 6e 64 65 78 3a 20 22 20 2b 20 69 20 2b 20 22 20 69 73 20 6c 6f 63 "Word.at.Index:.".+.i.+.".is.loc
8ca0 61 74 65 64 20 61 74 20 28 22 20 2b 20 62 6c 20 2b 20 22 2c 20 22 20 2b 20 74 6c 20 2b 20 22 2c ated.at.(".+.bl.+.",.".+.tl.+.",
8cc0 20 22 20 2b 20 74 72 20 2b 20 22 2c 20 22 20 2b 20 62 72 20 2b 20 22 29 2e 22 29 3b 0d 0a 0d 0a .".+.tr.+.",.".+.br.+.").");....
8ce0 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 ............}................ret
8d00 75 72 6e 20 2d 31 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 0d 0a 20 20 20 20 20 20 20 20 urn.-1;..........}..............
8d20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 46 75 6e 63 74 ///.<summary>..........///.Funct
8d40 69 6f 6e 20 72 65 74 75 72 6e 69 6e 67 20 74 68 65 20 69 6e 64 65 78 20 6f 66 20 74 68 65 20 77 ion.returning.the.index.of.the.w
8d60 6f 72 64 20 61 74 20 74 68 65 20 67 69 76 65 6e 20 70 6f 73 69 74 69 6f 6e 20 28 69 66 20 61 6e ord.at.the.given.position.(if.an
8d80 79 29 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 y)...........///.</summary>.....
8da0 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 74 65 78 74 22 3e 41 20 72 65 .....///.<param.name="text">A.re
8dc0 66 65 72 65 6e 63 65 20 74 6f 20 74 68 65 20 54 65 78 74 4d 65 73 68 50 72 6f 20 55 47 55 49 20 ference.to.the.TextMeshPro.UGUI.
8de0 63 6f 6d 70 6f 6e 65 6e 74 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 component.</param>..........///.
8e00 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 70 6f 73 69 74 69 6f 6e 22 3e 50 6f 73 69 74 69 6f 6e 20 <param.name="position">Position.
8e20 74 6f 20 63 68 65 63 6b 20 66 6f 72 20 69 6e 74 65 72 73 65 63 74 69 6f 6e 2e 3c 2f 70 61 72 61 to.check.for.intersection.</para
8e40 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 63 61 6d m>..........///.<param.name="cam
8e60 65 72 61 22 3e 54 68 65 20 73 63 65 6e 65 20 63 61 6d 65 72 61 20 77 68 69 63 68 20 6d 61 79 20 era">The.scene.camera.which.may.
8e80 62 65 20 61 73 73 69 67 6e 65 64 20 74 6f 20 61 20 43 61 6e 76 61 73 20 75 73 69 6e 67 20 53 63 be.assigned.to.a.Canvas.using.Sc
8ea0 72 65 65 6e 53 70 61 63 65 20 43 61 6d 65 72 61 20 6f 72 20 57 6f 72 6c 64 53 70 61 63 65 20 72 reenSpace.Camera.or.WorldSpace.r
8ec0 65 6e 64 65 72 20 6d 6f 64 65 2e 20 53 65 74 20 74 6f 20 6e 75 6c 6c 20 69 73 20 75 73 69 6e 67 ender.mode..Set.to.null.is.using
8ee0 20 53 63 72 65 65 6e 53 70 61 63 65 20 4f 76 65 72 6c 61 79 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 .ScreenSpace.Overlay.</param>...
8f00 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a .......///.<returns></returns>..
8f20 20 20 20 20 20 20 20 20 2f 2f 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 69 6e 74 20 46 69 6e 64 ........//public.static.int.Find
8f40 49 6e 74 65 72 73 65 63 74 69 6e 67 57 6f 72 64 28 54 65 78 74 4d 65 73 68 50 72 6f 55 47 55 49 IntersectingWord(TextMeshProUGUI
8f60 20 74 65 78 74 2c 20 56 65 63 74 6f 72 33 20 70 6f 73 69 74 69 6f 6e 2c 20 43 61 6d 65 72 61 20 .text,.Vector3.position,.Camera.
8f80 63 61 6d 65 72 61 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f camera)..........//{..........//
8fa0 20 20 20 20 52 65 63 74 54 72 61 6e 73 66 6f 72 6d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 20 ....RectTransform.rectTransform.
8fc0 3d 20 74 65 78 74 2e 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 =.text.rectTransform;...........
8fe0 20 2f 2f 20 20 20 20 2f 2f 20 43 6f 6e 76 65 72 74 20 70 6f 73 69 74 69 6f 6e 20 69 6e 74 6f 20 .//....//.Convert.position.into.
9000 57 6f 72 6c 64 73 70 61 63 65 20 63 6f 6f 72 64 69 6e 61 74 65 73 0d 0a 20 20 20 20 20 20 20 20 Worldspace.coordinates..........
9020 2f 2f 20 20 20 20 53 63 72 65 65 6e 50 6f 69 6e 74 54 6f 57 6f 72 6c 64 50 6f 69 6e 74 49 6e 52 //....ScreenPointToWorldPointInR
9040 65 63 74 61 6e 67 6c 65 28 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2c 20 70 6f 73 69 74 69 6f 6e ectangle(rectTransform,.position
9060 2c 20 63 61 6d 65 72 61 2c 20 6f 75 74 20 70 6f 73 69 74 69 6f 6e 29 3b 0d 0a 0d 0a 20 20 20 20 ,.camera,.out.position);........
9080 20 20 20 20 2f 2f 20 20 20 20 66 6f 72 20 28 69 6e 74 20 69 20 3d 20 30 3b 20 69 20 3c 20 74 65 ....//....for.(int.i.=.0;.i.<.te
90a0 78 74 2e 74 65 78 74 49 6e 66 6f 2e 77 6f 72 64 43 6f 75 6e 74 3b 20 69 2b 2b 29 0d 0a 20 20 20 xt.textInfo.wordCount;.i++).....
90c0 20 20 20 20 20 2f 2f 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 .....//....{..........//........
90e0 54 4d 50 5f 57 6f 72 64 49 6e 66 6f 20 77 49 6e 66 6f 20 3d 20 74 65 78 74 2e 74 65 78 74 49 6e TMP_WordInfo.wInfo.=.text.textIn
9100 66 6f 2e 77 6f 72 64 49 6e 66 6f 5b 69 5d 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 fo.wordInfo[i];............//...
9120 20 20 20 20 20 62 6f 6f 6c 20 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 3d 20 66 61 6c 73 65 3b .....bool.isBeginRegion.=.false;
9140 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 56 65 63 74 6f 72 33 20 62 6c ............//........Vector3.bl
9160 20 3d 20 56 65 63 74 6f 72 33 2e 7a 65 72 6f 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 .=.Vector3.zero;..........//....
9180 20 20 20 20 56 65 63 74 6f 72 33 20 74 6c 20 3d 20 56 65 63 74 6f 72 33 2e 7a 65 72 6f 3b 0d 0a ....Vector3.tl.=.Vector3.zero;..
91a0 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 56 65 63 74 6f 72 33 20 62 72 20 3d 20 56 ........//........Vector3.br.=.V
91c0 65 63 74 6f 72 33 2e 7a 65 72 6f 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 ector3.zero;..........//........
91e0 56 65 63 74 6f 72 33 20 74 72 20 3d 20 56 65 63 74 6f 72 33 2e 7a 65 72 6f 3b 0d 0a 0d 0a 20 20 Vector3.tr.=.Vector3.zero;......
9200 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 6d 61 78 41 73 63 65 6e 64 65 ......//........float.maxAscende
9220 72 20 3d 20 2d 4d 61 74 68 66 2e 49 6e 66 69 6e 69 74 79 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f r.=.-Mathf.Infinity;..........//
9240 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 6d 69 6e 44 65 73 63 65 6e 64 65 72 20 3d 20 4d 61 74 ........float.minDescender.=.Mat
9260 68 66 2e 49 6e 66 69 6e 69 74 79 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 hf.Infinity;............//......
9280 20 20 2f 2f 20 49 74 65 72 61 74 65 20 74 68 72 6f 75 67 68 20 65 61 63 68 20 63 68 61 72 61 63 ..//.Iterate.through.each.charac
92a0 74 65 72 20 6f 66 20 74 68 65 20 77 6f 72 64 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 ter.of.the.word..........//.....
92c0 20 20 20 66 6f 72 20 28 69 6e 74 20 6a 20 3d 20 30 3b 20 6a 20 3c 20 77 49 6e 66 6f 2e 63 68 61 ...for.(int.j.=.0;.j.<.wInfo.cha
92e0 72 61 63 74 65 72 43 6f 75 6e 74 3b 20 6a 2b 2b 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 racterCount;.j++)..........//...
9300 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 69 6e .....{..........//............in
9320 74 20 63 68 61 72 61 63 74 65 72 49 6e 64 65 78 20 3d 20 77 49 6e 66 6f 2e 66 69 72 73 74 43 68 t.characterIndex.=.wInfo.firstCh
9340 61 72 61 63 74 65 72 49 6e 64 65 78 20 2b 20 6a 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 aracterIndex.+.j;..........//...
9360 20 20 20 20 20 20 20 20 20 54 4d 50 5f 43 68 61 72 61 63 74 65 72 49 6e 66 6f 20 63 75 72 72 65 .........TMP_CharacterInfo.curre
9380 6e 74 43 68 61 72 49 6e 66 6f 20 3d 20 74 65 78 74 2e 74 65 78 74 49 6e 66 6f 2e 63 68 61 72 61 ntCharInfo.=.text.textInfo.chara
93a0 63 74 65 72 49 6e 66 6f 5b 63 68 61 72 61 63 74 65 72 49 6e 64 65 78 5d 3b 0d 0a 20 20 20 20 20 cterInfo[characterIndex];.......
93c0 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 20 63 75 72 72 65 6e 74 4c 69 6e 65 ...//............int.currentLine
93e0 20 3d 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 6c 69 6e 65 4e 75 6d 62 65 72 3b 0d 0a .=.currentCharInfo.lineNumber;..
9400 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 62 6f 6f 6c 20 69 73 43 ..........//............bool.isC
9420 68 61 72 61 63 74 65 72 56 69 73 69 62 6c 65 20 3d 20 63 68 61 72 61 63 74 65 72 49 6e 64 65 78 haracterVisible.=.characterIndex
9440 20 3e 20 74 65 78 74 2e 6d 61 78 56 69 73 69 62 6c 65 43 68 61 72 61 63 74 65 72 73 20 7c 7c 0d .>.text.maxVisibleCharacters.||.
9460 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .........//.....................
9480 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f .................currentCharInfo
94a0 2e 6c 69 6e 65 4e 75 6d 62 65 72 20 3e 20 74 65 78 74 2e 6d 61 78 56 69 73 69 62 6c 65 4c 69 6e .lineNumber.>.text.maxVisibleLin
94c0 65 73 20 7c 7c 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 es.||..........//...............
94e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 28 74 65 78 74 2e 4f 76 65 72 ......................(text.Over
9500 66 6c 6f 77 4d 6f 64 65 20 3d 3d 20 54 65 78 74 4f 76 65 72 66 6c 6f 77 4d 6f 64 65 73 2e 50 61 flowMode.==.TextOverflowModes.Pa
9520 67 65 20 26 26 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 70 61 67 65 4e 75 6d 62 65 72 ge.&&.currentCharInfo.pageNumber
9540 20 2b 20 31 20 21 3d 20 74 65 78 74 2e 70 61 67 65 54 6f 44 69 73 70 6c 61 79 29 20 3f 20 66 61 .+.1.!=.text.pageToDisplay).?.fa
9560 6c 73 65 20 3a 20 74 72 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 lse.:.true;............//.......
9580 20 20 20 20 20 2f 2f 20 54 72 61 63 6b 20 6d 61 78 69 6d 75 6d 20 41 73 63 65 6e 64 65 72 20 61 .....//.Track.maximum.Ascender.a
95a0 6e 64 20 6d 69 6e 69 6d 75 6d 20 44 65 73 63 65 6e 64 65 72 20 66 6f 72 20 65 61 63 68 20 77 6f nd.minimum.Descender.for.each.wo
95c0 72 64 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 6d 61 78 41 73 rd...........//............maxAs
95e0 63 65 6e 64 65 72 20 3d 20 4d 61 74 68 66 2e 4d 61 78 28 6d 61 78 41 73 63 65 6e 64 65 72 2c 20 cender.=.Mathf.Max(maxAscender,.
9600 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 61 73 63 65 6e 64 65 72 29 3b 0d 0a 20 20 20 20 currentCharInfo.ascender);......
9620 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 6d 69 6e 44 65 73 63 65 6e 64 65 72 20 3d ....//............minDescender.=
9640 20 4d 61 74 68 66 2e 4d 69 6e 28 6d 69 6e 44 65 73 63 65 6e 64 65 72 2c 20 63 75 72 72 65 6e 74 .Mathf.Min(minDescender,.current
9660 43 68 61 72 49 6e 66 6f 2e 64 65 73 63 65 6e 64 65 72 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 CharInfo.descender);............
9680 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 //............if.(isBeginRegion.
96a0 3d 3d 20 66 61 6c 73 65 20 26 26 20 69 73 43 68 61 72 61 63 74 65 72 56 69 73 69 62 6c 65 29 0d ==.false.&&.isCharacterVisible).
96c0 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 .........//............{........
96e0 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 73 42 65 67 69 6e 52 65 67 69 6f ..//................isBeginRegio
9700 6e 20 3d 20 74 72 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 n.=.true;............//.........
9720 20 20 20 20 20 20 20 62 6c 20 3d 20 6e 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 .......bl.=.new.Vector3(currentC
9740 68 61 72 49 6e 66 6f 2e 62 6f 74 74 6f 6d 4c 65 66 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 harInfo.bottomLeft.x,.currentCha
9760 72 49 6e 66 6f 2e 64 65 73 63 65 6e 64 65 72 2c 20 30 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f rInfo.descender,.0);..........//
9780 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 6c 20 3d 20 6e 65 77 20 56 65 63 74 6f 72 33 ................tl.=.new.Vector3
97a0 28 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 62 6f 74 74 6f 6d 4c 65 66 74 2e 78 2c 20 63 (currentCharInfo.bottomLeft.x,.c
97c0 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 61 73 63 65 6e 64 65 72 2c 20 30 29 3b 0d 0a 0d 0a urrentCharInfo.ascender,.0);....
97e0 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 44 65 62 75 ........//................//Debu
9800 67 2e 4c 6f 67 28 22 53 74 61 72 74 20 57 6f 72 64 20 52 65 67 69 6f 6e 20 61 74 20 5b 22 20 2b g.Log("Start.Word.Region.at.[".+
9820 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 20 2b 20 22 5d 22 .currentCharInfo.character.+."]"
9840 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 );............//................
9860 2f 2f 20 49 66 20 57 6f 72 64 20 69 73 20 6f 6e 65 20 63 68 61 72 61 63 74 65 72 0d 0a 20 20 20 //.If.Word.is.one.character.....
9880 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 77 49 6e 66 6f .....//................if.(wInfo
98a0 2e 63 68 61 72 61 63 74 65 72 43 6f 75 6e 74 20 3d 3d 20 31 29 0d 0a 20 20 20 20 20 20 20 20 2f .characterCount.==.1)........../
98c0 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 /................{..........//..
98e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 ..................isBeginRegion.
9900 3d 20 66 61 6c 73 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 =.false;............//..........
9920 20 20 20 20 20 20 20 20 20 20 62 72 20 3d 20 6e 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 65 ..........br.=.new.Vector3(curre
9940 6e 74 43 68 61 72 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 ntCharInfo.topRight.x,.currentCh
9960 61 72 49 6e 66 6f 2e 64 65 73 63 65 6e 64 65 72 2c 20 30 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f arInfo.descender,.0);........../
9980 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 72 20 3d 20 6e 65 77 20 56 65 /....................tr.=.new.Ve
99a0 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 2e 78 ctor3(currentCharInfo.topRight.x
99c0 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 61 73 63 65 6e 64 65 72 2c 20 30 29 3b 0d ,.currentCharInfo.ascender,.0);.
99e0 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ...........//...................
9a00 20 2f 2f 20 54 72 61 6e 73 66 6f 72 6d 20 63 6f 6f 72 64 69 6e 61 74 65 73 20 74 6f 20 62 65 20 .//.Transform.coordinates.to.be.
9a20 72 65 6c 61 74 69 76 65 20 74 6f 20 74 72 61 6e 73 66 6f 72 6d 20 61 6e 64 20 61 63 63 6f 75 6e relative.to.transform.and.accoun
9a40 74 20 6d 69 6e 20 64 65 73 63 65 6e 64 65 72 20 61 6e 64 20 6d 61 78 20 61 73 63 65 6e 64 65 72 t.min.descender.and.max.ascender
9a60 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ...........//...................
9a80 20 62 6c 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 .bl.=.rectTransform.TransformPoi
9aa0 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 62 6c 2e 78 2c 20 6d 69 6e 44 65 73 63 65 6e 64 65 nt(new.Vector3(bl.x,.minDescende
9ac0 72 2c 20 30 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 r,.0));..........//.............
9ae0 20 20 20 20 20 20 20 74 6c 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 .......tl.=.rectTransform.Transf
9b00 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 74 6c 2e 78 2c 20 6d 61 78 41 73 ormPoint(new.Vector3(tl.x,.maxAs
9b20 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 cender,.0));..........//........
9b40 20 20 20 20 20 20 20 20 20 20 20 20 74 72 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 ............tr.=.rectTransform.T
9b60 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 74 72 2e 78 2c 20 ransformPoint(new.Vector3(tr.x,.
9b80 6d 61 78 41 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 maxAscender,.0));..........//...
9ba0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 72 20 3d 20 72 65 63 74 54 72 61 6e 73 66 .................br.=.rectTransf
9bc0 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 62 orm.TransformPoint(new.Vector3(b
9be0 72 2e 78 2c 20 6d 69 6e 44 65 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 r.x,.minDescender,.0));.........
9c00 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 68 65 63 ...//....................//.Chec
9c20 6b 20 66 6f 72 20 49 6e 74 65 72 73 65 63 74 69 6f 6e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 k.for.Intersection..........//..
9c40 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 50 6f 69 6e 74 49 6e 74 65 72 ..................if.(PointInter
9c60 73 65 63 74 52 65 63 74 61 6e 67 6c 65 28 70 6f 73 69 74 69 6f 6e 2c 20 62 6c 2c 20 74 6c 2c 20 sectRectangle(position,.bl,.tl,.
9c80 74 72 2c 20 62 72 29 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 tr,.br))..........//............
9ca0 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 69 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 ............return.i;...........
9cc0 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 44 65 62 75 67 2e 4c .//....................//Debug.L
9ce0 6f 67 28 22 45 6e 64 20 57 6f 72 64 20 52 65 67 69 6f 6e 20 61 74 20 5b 22 20 2b 20 63 75 72 72 og("End.Word.Region.at.[".+.curr
9d00 65 6e 74 43 68 61 72 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 20 2b 20 22 5d 22 29 3b 0d 0a 20 entCharInfo.character.+."]");...
9d20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 .......//................}......
9d40 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f ....//............}............/
9d60 2f 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4c 61 73 74 20 43 68 61 72 61 63 74 65 72 20 6f /............//.Last.Character.o
9d80 66 20 57 6f 72 64 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 69 66 f.Word..........//............if
9da0 20 28 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 26 26 20 6a 20 3d 3d 20 77 49 6e 66 6f 2e 63 68 .(isBeginRegion.&&.j.==.wInfo.ch
9dc0 61 72 61 63 74 65 72 43 6f 75 6e 74 20 2d 20 31 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 aracterCount.-.1)..........//...
9de0 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 .........{..........//..........
9e00 20 20 20 20 20 20 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 3d 20 66 61 6c 73 65 3b 0d 0a 0d 0a ......isBeginRegion.=.false;....
9e20 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 72 20 3d 20 6e ........//................br.=.n
9e40 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 74 6f 70 52 69 ew.Vector3(currentCharInfo.topRi
9e60 67 68 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 64 65 73 63 65 6e 64 65 72 ght.x,.currentCharInfo.descender
9e80 2c 20 30 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ,.0);..........//...............
9ea0 20 74 72 20 3d 20 6e 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 .tr.=.new.Vector3(currentCharInf
9ec0 6f 2e 74 6f 70 52 69 67 68 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 61 73 o.topRight.x,.currentCharInfo.as
9ee0 63 65 6e 64 65 72 2c 20 30 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 cender,.0);............//.......
9f00 20 20 20 20 20 20 20 20 20 2f 2f 20 54 72 61 6e 73 66 6f 72 6d 20 63 6f 6f 72 64 69 6e 61 74 65 .........//.Transform.coordinate
9f20 73 20 74 6f 20 62 65 20 72 65 6c 61 74 69 76 65 20 74 6f 20 74 72 61 6e 73 66 6f 72 6d 20 61 6e s.to.be.relative.to.transform.an
9f40 64 20 61 63 63 6f 75 6e 74 20 6d 69 6e 20 64 65 73 63 65 6e 64 65 72 20 61 6e 64 20 6d 61 78 20 d.account.min.descender.and.max.
9f60 61 73 63 65 6e 64 65 72 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 ascender...........//...........
9f80 20 20 20 20 20 62 6c 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 .....bl.=.rectTransform.Transfor
9fa0 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 62 6c 2e 78 2c 20 6d 69 6e 44 65 73 63 mPoint(new.Vector3(bl.x,.minDesc
9fc0 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 ender,.0));..........//.........
9fe0 20 20 20 20 20 20 20 74 6c 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 .......tl.=.rectTransform.Transf
a000 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 74 6c 2e 78 2c 20 6d 61 78 41 73 ormPoint(new.Vector3(tl.x,.maxAs
a020 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 cender,.0));..........//........
a040 20 20 20 20 20 20 20 20 74 72 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 ........tr.=.rectTransform.Trans
a060 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 74 72 2e 78 2c 20 6d 61 78 41 formPoint(new.Vector3(tr.x,.maxA
a080 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 scender,.0));..........//.......
a0a0 20 20 20 20 20 20 20 20 20 62 72 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e .........br.=.rectTransform.Tran
a0c0 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 62 72 2e 78 2c 20 6d 69 6e sformPoint(new.Vector3(br.x,.min
a0e0 44 65 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 Descender,.0));............//...
a100 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 68 65 63 6b 20 66 6f 72 20 49 6e 74 65 72 73 .............//.Check.for.Inters
a120 65 63 74 69 6f 6e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ection..........//..............
a140 20 20 69 66 20 28 50 6f 69 6e 74 49 6e 74 65 72 73 65 63 74 52 65 63 74 61 6e 67 6c 65 28 70 6f ..if.(PointIntersectRectangle(po
a160 73 69 74 69 6f 6e 2c 20 62 6c 2c 20 74 6c 2c 20 74 72 2c 20 62 72 29 29 0d 0a 20 20 20 20 20 20 sition,.bl,.tl,.tr,.br))........
a180 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 69 ..//....................return.i
a1a0 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f ;............//................/
a1c0 2f 44 65 62 75 67 2e 4c 6f 67 28 22 45 6e 64 20 57 6f 72 64 20 52 65 67 69 6f 6e 20 61 74 20 5b /Debug.Log("End.Word.Region.at.[
a1e0 22 20 2b 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 20 2b 20 ".+.currentCharInfo.character.+.
a200 22 5d 22 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a "]");..........//............}..
a220 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 66 20 57 6f 72 64 ........//............//.If.Word
a240 20 69 73 20 73 70 6c 69 74 20 6f 6e 20 6d 6f 72 65 20 74 68 61 6e 20 6f 6e 65 20 6c 69 6e 65 2e .is.split.on.more.than.one.line.
a260 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 20 69 66 20 ..........//............else.if.
a280 28 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 26 26 20 63 75 72 72 65 6e 74 4c 69 6e 65 20 21 3d (isBeginRegion.&&.currentLine.!=
a2a0 20 74 65 78 74 2e 74 65 78 74 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 49 6e 66 6f 5b 63 68 61 .text.textInfo.characterInfo[cha
a2c0 72 61 63 74 65 72 49 6e 64 65 78 20 2b 20 31 5d 2e 6c 69 6e 65 4e 75 6d 62 65 72 29 0d 0a 20 20 racterIndex.+.1].lineNumber)....
a2e0 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f ......//............{........../
a300 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 3d /................isBeginRegion.=
a320 20 66 61 6c 73 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 .false;............//...........
a340 20 20 20 20 20 62 72 20 3d 20 6e 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 .....br.=.new.Vector3(currentCha
a360 72 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 rInfo.topRight.x,.currentCharInf
a380 6f 2e 64 65 73 63 65 6e 64 65 72 2c 20 30 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 o.descender,.0);..........//....
a3a0 20 20 20 20 20 20 20 20 20 20 20 20 74 72 20 3d 20 6e 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 ............tr.=.new.Vector3(cur
a3c0 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 2e 78 2c 20 63 75 72 72 65 6e 74 rentCharInfo.topRight.x,.current
a3e0 43 68 61 72 49 6e 66 6f 2e 61 73 63 65 6e 64 65 72 2c 20 30 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 CharInfo.ascender,.0);..........
a400 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 54 72 61 6e 73 66 6f 72 6d ..//................//.Transform
a420 20 63 6f 6f 72 64 69 6e 61 74 65 73 20 74 6f 20 62 65 20 72 65 6c 61 74 69 76 65 20 74 6f 20 74 .coordinates.to.be.relative.to.t
a440 72 61 6e 73 66 6f 72 6d 20 61 6e 64 20 61 63 63 6f 75 6e 74 20 6d 69 6e 20 64 65 73 63 65 6e 64 ransform.and.account.min.descend
a460 65 72 20 61 6e 64 20 6d 61 78 20 61 73 63 65 6e 64 65 72 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f er.and.max.ascender...........//
a480 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 6c 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f ................bl.=.rectTransfo
a4a0 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 62 6c rm.TransformPoint(new.Vector3(bl
a4c0 2e 78 2c 20 6d 69 6e 44 65 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 .x,.minDescender,.0));..........
a4e0 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 6c 20 3d 20 72 65 63 74 54 72 61 6e 73 //................tl.=.rectTrans
a500 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 form.TransformPoint(new.Vector3(
a520 74 6c 2e 78 2c 20 6d 61 78 41 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 20 20 20 20 20 20 20 tl.x,.maxAscender,.0));.........
a540 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 72 20 3d 20 72 65 63 74 54 72 61 6e .//................tr.=.rectTran
a560 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 sform.TransformPoint(new.Vector3
a580 28 74 72 2e 78 2c 20 6d 61 78 41 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 20 20 20 20 20 20 (tr.x,.maxAscender,.0));........
a5a0 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 72 20 3d 20 72 65 63 74 54 72 61 ..//................br.=.rectTra
a5c0 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 nsform.TransformPoint(new.Vector
a5e0 33 28 62 72 2e 78 2c 20 6d 69 6e 44 65 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 0d 0a 20 20 3(br.x,.minDescender,.0));......
a600 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 61 78 41 73 63 65 6e ......//................maxAscen
a620 64 65 72 20 3d 20 2d 4d 61 74 68 66 2e 49 6e 66 69 6e 69 74 79 3b 0d 0a 20 20 20 20 20 20 20 20 der.=.-Mathf.Infinity;..........
a640 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 69 6e 44 65 73 63 65 6e 64 65 72 20 3d //................minDescender.=
a660 20 4d 61 74 68 66 2e 49 6e 66 69 6e 69 74 79 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 .Mathf.Infinity;............//..
a680 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 68 65 63 6b 20 66 6f 72 20 49 6e 74 65 72 ..............//.Check.for.Inter
a6a0 73 65 63 74 69 6f 6e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 section..........//.............
a6c0 20 20 20 69 66 20 28 50 6f 69 6e 74 49 6e 74 65 72 73 65 63 74 52 65 63 74 61 6e 67 6c 65 28 70 ...if.(PointIntersectRectangle(p
a6e0 6f 73 69 74 69 6f 6e 2c 20 62 6c 2c 20 74 6c 2c 20 74 72 2c 20 62 72 29 29 0d 0a 20 20 20 20 20 osition,.bl,.tl,.tr,.br)).......
a700 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 ...//....................return.
a720 69 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 i;............//................
a740 2f 2f 44 65 62 75 67 2e 4c 6f 67 28 22 45 6e 64 20 57 6f 72 64 20 52 65 67 69 6f 6e 20 61 74 20 //Debug.Log("End.Word.Region.at.
a760 5b 22 20 2b 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 20 2b [".+.currentCharInfo.character.+
a780 20 22 5d 22 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d ."]");..........//............}.
a7a0 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 .........//........}............
a7c0 2f 2f 20 20 20 20 20 20 20 20 2f 2f 44 65 62 75 67 2e 4c 6f 67 28 22 57 6f 72 64 20 61 74 20 49 //........//Debug.Log("Word.at.I
a7e0 6e 64 65 78 3a 20 22 20 2b 20 69 20 2b 20 22 20 69 73 20 6c 6f 63 61 74 65 64 20 61 74 20 28 22 ndex:.".+.i.+.".is.located.at.("
a800 20 2b 20 62 6c 20 2b 20 22 2c 20 22 20 2b 20 74 6c 20 2b 20 22 2c 20 22 20 2b 20 74 72 20 2b 20 .+.bl.+.",.".+.tl.+.",.".+.tr.+.
a820 22 2c 20 22 20 2b 20 62 72 20 2b 20 22 29 2e 22 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f ",.".+.br.+.").");............//
a840 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 72 65 74 75 72 6e 20 2d 31 ....}............//....return.-1
a860 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 7d 0d 0a 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 ;..........//}..............///.
a880 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 46 75 6e 63 74 69 6f 6e 20 <summary>..........///.Function.
a8a0 72 65 74 75 72 6e 69 6e 67 20 74 68 65 20 69 6e 64 65 78 20 6f 66 20 74 68 65 20 77 6f 72 64 20 returning.the.index.of.the.word.
a8c0 61 74 20 74 68 65 20 67 69 76 65 6e 20 70 6f 73 69 74 69 6f 6e 20 28 69 66 20 61 6e 79 29 2e 0d at.the.given.position.(if.any)..
a8e0 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 .........///.</summary>.........
a900 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 74 65 78 74 22 3e 41 20 72 65 66 65 72 65 .///.<param.name="text">A.refere
a920 6e 63 65 20 74 6f 20 74 68 65 20 54 65 78 74 4d 65 73 68 50 72 6f 20 63 6f 6d 70 6f 6e 65 6e 74 nce.to.the.TextMeshPro.component
a940 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 .</param>..........///.<param.na
a960 6d 65 3d 22 70 6f 73 69 74 69 6f 6e 22 3e 50 6f 73 69 74 69 6f 6e 20 74 6f 20 63 68 65 63 6b 20 me="position">Position.to.check.
a980 66 6f 72 20 69 6e 74 65 72 73 65 63 74 69 6f 6e 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 for.intersection.</param>.......
a9a0 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 63 61 6d 65 72 61 22 3e 54 68 65 20 ...///.<param.name="camera">The.
a9c0 63 61 6d 65 72 61 20 77 68 69 63 68 20 69 73 20 72 65 6e 64 65 72 69 6e 67 20 74 68 65 20 74 65 camera.which.is.rendering.the.te
a9e0 78 74 20 6f 62 6a 65 63 74 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 xt.object.</param>..........///.
aa00 3c 72 65 74 75 72 6e 73 3e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 70 <returns></returns>..........//p
aa20 75 62 6c 69 63 20 73 74 61 74 69 63 20 69 6e 74 20 46 69 6e 64 49 6e 74 65 72 73 65 63 74 69 6e ublic.static.int.FindIntersectin
aa40 67 57 6f 72 64 28 54 65 78 74 4d 65 73 68 50 72 6f 20 74 65 78 74 2c 20 56 65 63 74 6f 72 33 20 gWord(TextMeshPro.text,.Vector3.
aa60 70 6f 73 69 74 69 6f 6e 2c 20 43 61 6d 65 72 61 20 63 61 6d 65 72 61 29 0d 0a 20 20 20 20 20 20 position,.Camera.camera)........
aa80 20 20 2f 2f 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 54 72 61 6e 73 66 6f 72 6d 20 74 ..//{..........//....Transform.t
aaa0 65 78 74 54 72 61 6e 73 66 6f 72 6d 20 3d 20 74 65 78 74 2e 74 72 61 6e 73 66 6f 72 6d 3b 0d 0a extTransform.=.text.transform;..
aac0 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 2f 2f 20 43 6f 6e 76 65 72 74 20 70 6f 73 69 74 ..........//....//.Convert.posit
aae0 69 6f 6e 20 69 6e 74 6f 20 57 6f 72 6c 64 73 70 61 63 65 20 63 6f 6f 72 64 69 6e 61 74 65 73 0d ion.into.Worldspace.coordinates.
ab00 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 53 63 72 65 65 6e 50 6f 69 6e 74 54 6f 57 6f 72 6c .........//....ScreenPointToWorl
ab20 64 50 6f 69 6e 74 49 6e 52 65 63 74 61 6e 67 6c 65 28 74 65 78 74 54 72 61 6e 73 66 6f 72 6d 2c dPointInRectangle(textTransform,
ab40 20 70 6f 73 69 74 69 6f 6e 2c 20 63 61 6d 65 72 61 2c 20 6f 75 74 20 70 6f 73 69 74 69 6f 6e 29 .position,.camera,.out.position)
ab60 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 66 6f 72 20 28 69 6e 74 20 69 20 3d 20 ;............//....for.(int.i.=.
ab80 30 3b 20 69 20 3c 20 74 65 78 74 2e 74 65 78 74 49 6e 66 6f 2e 77 6f 72 64 43 6f 75 6e 74 3b 20 0;.i.<.text.textInfo.wordCount;.
aba0 69 2b 2b 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f i++)..........//....{........../
abc0 2f 20 20 20 20 20 20 20 20 54 4d 50 5f 57 6f 72 64 49 6e 66 6f 20 77 49 6e 66 6f 20 3d 20 74 65 /........TMP_WordInfo.wInfo.=.te
abe0 78 74 2e 74 65 78 74 49 6e 66 6f 2e 77 6f 72 64 49 6e 66 6f 5b 69 5d 3b 0d 0a 0d 0a 20 20 20 20 xt.textInfo.wordInfo[i];........
ac00 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 62 6f 6f 6c 20 69 73 42 65 67 69 6e 52 65 67 69 6f 6e ....//........bool.isBeginRegion
ac20 20 3d 20 66 61 6c 73 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 56 .=.false;............//........V
ac40 65 63 74 6f 72 33 20 62 6c 20 3d 20 56 65 63 74 6f 72 33 2e 7a 65 72 6f 3b 0d 0a 20 20 20 20 20 ector3.bl.=.Vector3.zero;.......
ac60 20 20 20 2f 2f 20 20 20 20 20 20 20 20 56 65 63 74 6f 72 33 20 74 6c 20 3d 20 56 65 63 74 6f 72 ...//........Vector3.tl.=.Vector
ac80 33 2e 7a 65 72 6f 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 56 65 63 74 6f 3.zero;..........//........Vecto
aca0 72 33 20 62 72 20 3d 20 56 65 63 74 6f 72 33 2e 7a 65 72 6f 3b 0d 0a 20 20 20 20 20 20 20 20 2f r3.br.=.Vector3.zero;........../
acc0 2f 20 20 20 20 20 20 20 20 56 65 63 74 6f 72 33 20 74 72 20 3d 20 56 65 63 74 6f 72 33 2e 7a 65 /........Vector3.tr.=.Vector3.ze
ace0 72 6f 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 6d ro;............//........float.m
ad00 61 78 41 73 63 65 6e 64 65 72 20 3d 20 2d 4d 61 74 68 66 2e 49 6e 66 69 6e 69 74 79 3b 0d 0a 20 axAscender.=.-Mathf.Infinity;...
ad20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 6d 69 6e 44 65 73 63 65 6e .......//........float.minDescen
ad40 64 65 72 20 3d 20 4d 61 74 68 66 2e 49 6e 66 69 6e 69 74 79 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 der.=.Mathf.Infinity;...........
ad60 20 2f 2f 20 20 20 20 20 20 20 20 2f 2f 20 49 74 65 72 61 74 65 20 74 68 72 6f 75 67 68 20 65 61 .//........//.Iterate.through.ea
ad80 63 68 20 63 68 61 72 61 63 74 65 72 20 6f 66 20 74 68 65 20 77 6f 72 64 0d 0a 20 20 20 20 20 20 ch.character.of.the.word........
ada0 20 20 2f 2f 20 20 20 20 20 20 20 20 66 6f 72 20 28 69 6e 74 20 6a 20 3d 20 30 3b 20 6a 20 3c 20 ..//........for.(int.j.=.0;.j.<.
adc0 77 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 43 6f 75 6e 74 3b 20 6a 2b 2b 29 0d 0a 20 20 20 20 wInfo.characterCount;.j++)......
ade0 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 ....//........{..........//.....
ae00 20 20 20 20 20 20 20 69 6e 74 20 63 68 61 72 61 63 74 65 72 49 6e 64 65 78 20 3d 20 77 49 6e 66 .......int.characterIndex.=.wInf
ae20 6f 2e 66 69 72 73 74 43 68 61 72 61 63 74 65 72 49 6e 64 65 78 20 2b 20 6a 3b 0d 0a 20 20 20 20 o.firstCharacterIndex.+.j;......
ae40 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 54 4d 50 5f 43 68 61 72 61 63 74 65 72 49 ....//............TMP_CharacterI
ae60 6e 66 6f 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 20 3d 20 74 65 78 74 2e 74 65 78 74 49 nfo.currentCharInfo.=.text.textI
ae80 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 49 6e 66 6f 5b 63 68 61 72 61 63 74 65 72 49 6e 64 65 78 nfo.characterInfo[characterIndex
aea0 5d 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 20 63 75 ];..........//............int.cu
aec0 72 72 65 6e 74 4c 69 6e 65 20 3d 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 6c 69 6e 65 rrentLine.=.currentCharInfo.line
aee0 4e 75 6d 62 65 72 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 Number;............//...........
af00 20 62 6f 6f 6c 20 69 73 43 68 61 72 61 63 74 65 72 56 69 73 69 62 6c 65 20 3d 20 63 68 61 72 61 .bool.isCharacterVisible.=.chara
af20 63 74 65 72 49 6e 64 65 78 20 3e 20 74 65 78 74 2e 6d 61 78 56 69 73 69 62 6c 65 43 68 61 72 61 cterIndex.>.text.maxVisibleChara
af40 63 74 65 72 73 20 7c 7c 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 cters.||..........//............
af60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 75 72 72 65 6e ..........................curren
af80 74 43 68 61 72 49 6e 66 6f 2e 6c 69 6e 65 4e 75 6d 62 65 72 20 3e 20 74 65 78 74 2e 6d 61 78 56 tCharInfo.lineNumber.>.text.maxV
afa0 69 73 69 62 6c 65 4c 69 6e 65 73 20 7c 7c 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 isibleLines.||..........//......
afc0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 28 ...............................(
afe0 74 65 78 74 2e 4f 76 65 72 66 6c 6f 77 4d 6f 64 65 20 3d 3d 20 54 65 78 74 4f 76 65 72 66 6c 6f text.OverflowMode.==.TextOverflo
b000 77 4d 6f 64 65 73 2e 50 61 67 65 20 26 26 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 70 wModes.Page.&&.currentCharInfo.p
b020 61 67 65 4e 75 6d 62 65 72 20 2b 20 31 20 21 3d 20 74 65 78 74 2e 70 61 67 65 54 6f 44 69 73 70 ageNumber.+.1.!=.text.pageToDisp
b040 6c 61 79 29 20 3f 20 66 61 6c 73 65 20 3a 20 74 72 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 lay).?.false.:.true;............
b060 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 54 72 61 63 6b 20 6d 61 78 69 6d 75 6d 20 41 //............//.Track.maximum.A
b080 73 63 65 6e 64 65 72 20 61 6e 64 20 6d 69 6e 69 6d 75 6d 20 44 65 73 63 65 6e 64 65 72 20 66 6f scender.and.minimum.Descender.fo
b0a0 72 20 65 61 63 68 20 77 6f 72 64 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 r.each.word...........//........
b0c0 20 20 20 20 6d 61 78 41 73 63 65 6e 64 65 72 20 3d 20 4d 61 74 68 66 2e 4d 61 78 28 6d 61 78 41 ....maxAscender.=.Mathf.Max(maxA
b0e0 73 63 65 6e 64 65 72 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 61 73 63 65 6e 64 65 scender,.currentCharInfo.ascende
b100 72 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 6d 69 6e 44 65 r);..........//............minDe
b120 73 63 65 6e 64 65 72 20 3d 20 4d 61 74 68 66 2e 4d 69 6e 28 6d 69 6e 44 65 73 63 65 6e 64 65 72 scender.=.Mathf.Min(minDescender
b140 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 64 65 73 63 65 6e 64 65 72 29 3b 0d 0a 0d ,.currentCharInfo.descender);...
b160 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 69 73 42 65 67 .........//............if.(isBeg
b180 69 6e 52 65 67 69 6f 6e 20 3d 3d 20 66 61 6c 73 65 20 26 26 20 69 73 43 68 61 72 61 63 74 65 72 inRegion.==.false.&&.isCharacter
b1a0 56 69 73 69 62 6c 65 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 Visible)..........//............
b1c0 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 73 42 {..........//................isB
b1e0 65 67 69 6e 52 65 67 69 6f 6e 20 3d 20 74 72 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f eginRegion.=.true;............//
b200 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 6c 20 3d 20 6e 65 77 20 56 65 63 74 6f 72 33 ................bl.=.new.Vector3
b220 28 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 62 6f 74 74 6f 6d 4c 65 66 74 2e 78 2c 20 63 (currentCharInfo.bottomLeft.x,.c
b240 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 64 65 73 63 65 6e 64 65 72 2c 20 30 29 3b 0d 0a 20 urrentCharInfo.descender,.0);...
b260 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 6c 20 3d 20 6e 65 .......//................tl.=.ne
b280 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 62 6f 74 74 6f 6d w.Vector3(currentCharInfo.bottom
b2a0 4c 65 66 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 61 73 63 65 6e 64 65 72 Left.x,.currentCharInfo.ascender
b2c0 2c 20 30 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 ,.0);............//.............
b2e0 20 20 20 2f 2f 44 65 62 75 67 2e 4c 6f 67 28 22 53 74 61 72 74 20 57 6f 72 64 20 52 65 67 69 6f ...//Debug.Log("Start.Word.Regio
b300 6e 20 61 74 20 5b 22 20 2b 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 63 68 61 72 61 63 n.at.[".+.currentCharInfo.charac
b320 74 65 72 20 2b 20 22 5d 22 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 ter.+."]");............//.......
b340 20 20 20 20 20 20 20 20 20 2f 2f 20 49 66 20 57 6f 72 64 20 69 73 20 6f 6e 65 20 63 68 61 72 61 .........//.If.Word.is.one.chara
b360 63 74 65 72 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 cter..........//................
b380 69 66 20 28 77 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 43 6f 75 6e 74 20 3d 3d 20 31 29 0d 0a if.(wInfo.characterCount.==.1)..
b3a0 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 ........//................{.....
b3c0 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 73 42 65 67 .....//....................isBeg
b3e0 69 6e 52 65 67 69 6f 6e 20 3d 20 66 61 6c 73 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 inRegion.=.false;............//.
b400 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 72 20 3d 20 6e 65 77 20 56 65 63 74 ...................br.=.new.Vect
b420 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 2e 78 2c 20 or3(currentCharInfo.topRight.x,.
b440 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 64 65 73 63 65 6e 64 65 72 2c 20 30 29 3b 0d 0a currentCharInfo.descender,.0);..
b460 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 72 ........//....................tr
b480 20 3d 20 6e 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 74 .=.new.Vector3(currentCharInfo.t
b4a0 6f 70 52 69 67 68 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 61 73 63 65 6e opRight.x,.currentCharInfo.ascen
b4c0 64 65 72 2c 20 30 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 der,.0);............//..........
b4e0 20 20 20 20 20 20 20 20 20 20 2f 2f 20 54 72 61 6e 73 66 6f 72 6d 20 63 6f 6f 72 64 69 6e 61 74 ..........//.Transform.coordinat
b500 65 73 20 74 6f 20 62 65 20 72 65 6c 61 74 69 76 65 20 74 6f 20 74 72 61 6e 73 66 6f 72 6d 20 61 es.to.be.relative.to.transform.a
b520 6e 64 20 61 63 63 6f 75 6e 74 20 6d 69 6e 20 64 65 73 63 65 6e 64 65 72 20 61 6e 64 20 6d 61 78 nd.account.min.descender.and.max
b540 20 61 73 63 65 6e 64 65 72 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 .ascender...........//..........
b560 20 20 20 20 20 20 20 20 20 20 62 6c 20 3d 20 74 65 78 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 ..........bl.=.textTransform.Tra
b580 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 62 6c 2e 78 2c 20 6d 69 nsformPoint(new.Vector3(bl.x,.mi
b5a0 6e 44 65 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 nDescender,.0));..........//....
b5c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 6c 20 3d 20 74 65 78 74 54 72 61 6e 73 66 6f ................tl.=.textTransfo
b5e0 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 74 6c rm.TransformPoint(new.Vector3(tl
b600 2e 78 2c 20 6d 61 78 41 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f .x,.maxAscender,.0));........../
b620 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 72 20 3d 20 74 65 78 74 54 72 /....................tr.=.textTr
b640 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f ansform.TransformPoint(new.Vecto
b660 72 33 28 74 72 2e 78 2c 20 6d 61 78 41 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 20 20 20 20 r3(tr.x,.maxAscender,.0));......
b680 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 72 20 3d 20 74 ....//....................br.=.t
b6a0 65 78 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 extTransform.TransformPoint(new.
b6c0 56 65 63 74 6f 72 33 28 62 72 2e 78 2c 20 6d 69 6e 44 65 73 63 65 6e 64 65 72 2c 20 30 29 29 3b Vector3(br.x,.minDescender,.0));
b6e0 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ............//..................
b700 20 20 2f 2f 20 43 68 65 63 6b 20 66 6f 72 20 49 6e 74 65 72 73 65 63 74 69 6f 6e 0d 0a 20 20 20 ..//.Check.for.Intersection.....
b720 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 50 .....//....................if.(P
b740 6f 69 6e 74 49 6e 74 65 72 73 65 63 74 52 65 63 74 61 6e 67 6c 65 28 70 6f 73 69 74 69 6f 6e 2c ointIntersectRectangle(position,
b760 20 62 6c 2c 20 74 6c 2c 20 74 72 2c 20 62 72 29 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 .bl,.tl,.tr,.br))..........//...
b780 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 69 3b 0d 0a .....................return.i;..
b7a0 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ..........//....................
b7c0 2f 2f 44 65 62 75 67 2e 4c 6f 67 28 22 45 6e 64 20 57 6f 72 64 20 52 65 67 69 6f 6e 20 61 74 20 //Debug.Log("End.Word.Region.at.
b7e0 5b 22 20 2b 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 20 2b [".+.currentCharInfo.character.+
b800 20 22 5d 22 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ."]");..........//..............
b820 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a ..}..........//............}....
b840 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4c 61 73 74 20 43 68 ........//............//.Last.Ch
b860 61 72 61 63 74 65 72 20 6f 66 20 57 6f 72 64 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 aracter.of.Word..........//.....
b880 20 20 20 20 20 20 20 69 66 20 28 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 26 26 20 6a 20 3d 3d .......if.(isBeginRegion.&&.j.==
b8a0 20 77 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 43 6f 75 6e 74 20 2d 20 31 29 0d 0a 20 20 20 20 .wInfo.characterCount.-.1)......
b8c0 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 ....//............{..........//.
b8e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 3d 20 66 ...............isBeginRegion.=.f
b900 61 6c 73 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 alse;............//.............
b920 20 20 20 62 72 20 3d 20 6e 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 49 ...br.=.new.Vector3(currentCharI
b940 6e 66 6f 2e 74 6f 70 52 69 67 68 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e nfo.topRight.x,.currentCharInfo.
b960 64 65 73 63 65 6e 64 65 72 2c 20 30 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 descender,.0);..........//......
b980 20 20 20 20 20 20 20 20 20 20 74 72 20 3d 20 6e 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 65 ..........tr.=.new.Vector3(curre
b9a0 6e 74 43 68 61 72 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 ntCharInfo.topRight.x,.currentCh
b9c0 61 72 49 6e 66 6f 2e 61 73 63 65 6e 64 65 72 2c 20 30 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 arInfo.ascender,.0);............
b9e0 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 54 72 61 6e 73 66 6f 72 6d 20 63 //................//.Transform.c
ba00 6f 6f 72 64 69 6e 61 74 65 73 20 74 6f 20 62 65 20 72 65 6c 61 74 69 76 65 20 74 6f 20 74 72 61 oordinates.to.be.relative.to.tra
ba20 6e 73 66 6f 72 6d 20 61 6e 64 20 61 63 63 6f 75 6e 74 20 6d 69 6e 20 64 65 73 63 65 6e 64 65 72 nsform.and.account.min.descender
ba40 20 61 6e 64 20 6d 61 78 20 61 73 63 65 6e 64 65 72 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 .and.max.ascender...........//..
ba60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 6c 20 3d 20 74 65 78 74 54 72 61 6e 73 66 6f 72 6d ..............bl.=.textTransform
ba80 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 62 6c 2e 78 .TransformPoint(new.Vector3(bl.x
baa0 2c 20 6d 69 6e 44 65 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f ,.minDescender,.0));..........//
bac0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 6c 20 3d 20 74 65 78 74 54 72 61 6e 73 66 6f ................tl.=.textTransfo
bae0 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 74 6c rm.TransformPoint(new.Vector3(tl
bb00 2e 78 2c 20 6d 61 78 41 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f .x,.maxAscender,.0));........../
bb20 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 72 20 3d 20 74 65 78 74 54 72 61 6e 73 66 /................tr.=.textTransf
bb40 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 74 orm.TransformPoint(new.Vector3(t
bb60 72 2e 78 2c 20 6d 61 78 41 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 r.x,.maxAscender,.0));..........
bb80 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 72 20 3d 20 74 65 78 74 54 72 61 6e 73 //................br.=.textTrans
bba0 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 form.TransformPoint(new.Vector3(
bbc0 62 72 2e 78 2c 20 6d 69 6e 44 65 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 0d 0a 20 20 20 20 br.x,.minDescender,.0));........
bbe0 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 68 65 63 6b 20 66 ....//................//.Check.f
bc00 6f 72 20 49 6e 74 65 72 73 65 63 74 69 6f 6e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 or.Intersection..........//.....
bc20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 50 6f 69 6e 74 49 6e 74 65 72 73 65 63 74 52 65 63 ...........if.(PointIntersectRec
bc40 74 61 6e 67 6c 65 28 70 6f 73 69 74 69 6f 6e 2c 20 62 6c 2c 20 74 6c 2c 20 74 72 2c 20 62 72 29 tangle(position,.bl,.tl,.tr,.br)
bc60 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 )..........//...................
bc80 20 72 65 74 75 72 6e 20 69 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 .return.i;............//........
bca0 20 20 20 20 20 20 20 20 2f 2f 44 65 62 75 67 2e 4c 6f 67 28 22 45 6e 64 20 57 6f 72 64 20 52 65 ........//Debug.Log("End.Word.Re
bcc0 67 69 6f 6e 20 61 74 20 5b 22 20 2b 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 63 68 61 gion.at.[".+.currentCharInfo.cha
bce0 72 61 63 74 65 72 20 2b 20 22 5d 22 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 racter.+."]");..........//......
bd00 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 2f ......}..........//............/
bd20 2f 20 49 66 20 57 6f 72 64 20 69 73 20 73 70 6c 69 74 20 6f 6e 20 6d 6f 72 65 20 74 68 61 6e 20 /.If.Word.is.split.on.more.than.
bd40 6f 6e 65 20 6c 69 6e 65 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 one.line...........//...........
bd60 20 65 6c 73 65 20 69 66 20 28 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 26 26 20 63 75 72 72 65 .else.if.(isBeginRegion.&&.curre
bd80 6e 74 4c 69 6e 65 20 21 3d 20 74 65 78 74 2e 74 65 78 74 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 ntLine.!=.text.textInfo.characte
bda0 72 49 6e 66 6f 5b 63 68 61 72 61 63 74 65 72 49 6e 64 65 78 20 2b 20 31 5d 2e 6c 69 6e 65 4e 75 rInfo[characterIndex.+.1].lineNu
bdc0 6d 62 65 72 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a mber)..........//............{..
bde0 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 73 42 65 67 69 ........//................isBegi
be00 6e 52 65 67 69 6f 6e 20 3d 20 66 61 6c 73 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 nRegion.=.false;............//..
be20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 72 20 3d 20 6e 65 77 20 56 65 63 74 6f 72 33 28 63 ..............br.=.new.Vector3(c
be40 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 2e 78 2c 20 63 75 72 72 65 urrentCharInfo.topRight.x,.curre
be60 6e 74 43 68 61 72 49 6e 66 6f 2e 64 65 73 63 65 6e 64 65 72 2c 20 30 29 3b 0d 0a 20 20 20 20 20 ntCharInfo.descender,.0);.......
be80 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 72 20 3d 20 6e 65 77 20 56 65 ...//................tr.=.new.Ve
bea0 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 2e 78 ctor3(currentCharInfo.topRight.x
bec0 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 61 73 63 65 6e 64 65 72 2c 20 30 29 3b 0d ,.currentCharInfo.ascender,.0);.
bee0 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 ...........//................//.
bf00 54 72 61 6e 73 66 6f 72 6d 20 63 6f 6f 72 64 69 6e 61 74 65 73 20 74 6f 20 62 65 20 72 65 6c 61 Transform.coordinates.to.be.rela
bf20 74 69 76 65 20 74 6f 20 74 72 61 6e 73 66 6f 72 6d 20 61 6e 64 20 61 63 63 6f 75 6e 74 20 6d 69 tive.to.transform.and.account.mi
bf40 6e 20 64 65 73 63 65 6e 64 65 72 20 61 6e 64 20 6d 61 78 20 61 73 63 65 6e 64 65 72 2e 0d 0a 20 n.descender.and.max.ascender....
bf60 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 6c 20 3d 20 74 65 .......//................bl.=.te
bf80 78 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 xtTransform.TransformPoint(new.V
bfa0 65 63 74 6f 72 33 28 62 6c 2e 78 2c 20 6d 69 6e 44 65 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d ector3(bl.x,.minDescender,.0));.
bfc0 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 6c 20 3d 20 .........//................tl.=.
bfe0 74 65 78 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 textTransform.TransformPoint(new
c000 20 56 65 63 74 6f 72 33 28 74 6c 2e 78 2c 20 6d 61 78 41 73 63 65 6e 64 65 72 2c 20 30 29 29 3b .Vector3(tl.x,.maxAscender,.0));
c020 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 72 20 3d ..........//................tr.=
c040 20 74 65 78 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 .textTransform.TransformPoint(ne
c060 77 20 56 65 63 74 6f 72 33 28 74 72 2e 78 2c 20 6d 61 78 41 73 63 65 6e 64 65 72 2c 20 30 29 29 w.Vector3(tr.x,.maxAscender,.0))
c080 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 72 20 ;..........//................br.
c0a0 3d 20 74 65 78 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e =.textTransform.TransformPoint(n
c0c0 65 77 20 56 65 63 74 6f 72 33 28 62 72 2e 78 2c 20 6d 69 6e 44 65 73 63 65 6e 64 65 72 2c 20 30 ew.Vector3(br.x,.minDescender,.0
c0e0 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ));............//...............
c100 20 2f 2f 20 52 65 73 65 74 20 6d 61 78 41 73 63 65 6e 64 65 72 20 61 6e 64 20 6d 69 6e 44 65 73 .//.Reset.maxAscender.and.minDes
c120 63 65 6e 64 65 72 20 66 6f 72 20 6e 65 78 74 20 77 6f 72 64 20 73 65 67 6d 65 6e 74 2e 0d 0a 20 cender.for.next.word.segment....
c140 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 61 78 41 73 63 65 .......//................maxAsce
c160 6e 64 65 72 20 3d 20 2d 4d 61 74 68 66 2e 49 6e 66 69 6e 69 74 79 3b 0d 0a 20 20 20 20 20 20 20 nder.=.-Mathf.Infinity;.........
c180 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 69 6e 44 65 73 63 65 6e 64 65 72 20 .//................minDescender.
c1a0 3d 20 4d 61 74 68 66 2e 49 6e 66 69 6e 69 74 79 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 =.Mathf.Infinity;............//.
c1c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 68 65 63 6b 20 66 6f 72 20 49 6e 74 65 ...............//.Check.for.Inte
c1e0 72 73 65 63 74 69 6f 6e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 rsection..........//............
c200 20 20 20 20 69 66 20 28 50 6f 69 6e 74 49 6e 74 65 72 73 65 63 74 52 65 63 74 61 6e 67 6c 65 28 ....if.(PointIntersectRectangle(
c220 70 6f 73 69 74 69 6f 6e 2c 20 62 6c 2c 20 74 6c 2c 20 74 72 2c 20 62 72 29 29 0d 0a 20 20 20 20 position,.bl,.tl,.tr,.br))......
c240 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e ....//....................return
c260 20 69 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .i;............//...............
c280 20 2f 2f 44 65 62 75 67 2e 4c 6f 67 28 22 45 6e 64 20 57 6f 72 64 20 52 65 67 69 6f 6e 20 61 74 .//Debug.Log("End.Word.Region.at
c2a0 20 5b 22 20 2b 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 20 .[".+.currentCharInfo.character.
c2c0 2b 20 22 5d 22 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 7d +."]");..........//............}
c2e0 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 2f ..........//........}........../
c300 2f 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 72 65 74 75 72 6e 20 2d /....}............//....return.-
c320 31 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 7d 0d 0a 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 1;..........//}..............///
c340 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 46 75 6e 63 74 69 6f 6e .<summary>..........///.Function
c360 20 72 65 74 75 72 6e 69 6e 67 20 74 68 65 20 69 6e 64 65 78 20 6f 66 20 74 68 65 20 77 6f 72 64 .returning.the.index.of.the.word
c380 20 61 74 20 74 68 65 20 67 69 76 65 6e 20 70 6f 73 69 74 69 6f 6e 20 28 69 66 20 61 6e 79 29 2e .at.the.given.position.(if.any).
c3a0 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 ..........///.</summary>........
c3c0 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 74 65 78 74 22 3e 41 20 72 65 66 65 72 ..///.<param.name="text">A.refer
c3e0 65 6e 63 65 20 74 6f 20 74 68 65 20 54 4d 50 5f 54 65 78 74 20 63 6f 6d 70 6f 6e 65 6e 74 2e 3c ence.to.the.TMP_Text.component.<
c400 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 /param>..........///.<param.name
c420 3d 22 70 6f 73 69 74 69 6f 6e 22 3e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f ="position"></param>..........//
c440 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 63 61 6d 65 72 61 22 3e 54 68 65 20 73 63 65 6e 65 /.<param.name="camera">The.scene
c460 20 63 61 6d 65 72 61 20 77 68 69 63 68 20 6d 61 79 20 62 65 20 61 73 73 69 67 6e 65 64 20 74 6f .camera.which.may.be.assigned.to
c480 20 61 20 43 61 6e 76 61 73 20 75 73 69 6e 67 20 53 63 72 65 65 6e 53 70 61 63 65 20 43 61 6d 65 .a.Canvas.using.ScreenSpace.Came
c4a0 72 61 20 6f 72 20 57 6f 72 6c 64 53 70 61 63 65 20 72 65 6e 64 65 72 20 6d 6f 64 65 2e 20 53 65 ra.or.WorldSpace.render.mode..Se
c4c0 74 20 74 6f 20 6e 75 6c 6c 20 69 73 20 75 73 69 6e 67 20 53 63 72 65 65 6e 53 70 61 63 65 20 4f t.to.null.is.using.ScreenSpace.O
c4e0 76 65 72 6c 61 79 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 verlay.</param>..........///.<re
c500 74 75 72 6e 73 3e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 turns></returns>..........public
c520 20 73 74 61 74 69 63 20 69 6e 74 20 46 69 6e 64 4e 65 61 72 65 73 74 57 6f 72 64 28 54 4d 50 5f .static.int.FindNearestWord(TMP_
c540 54 65 78 74 20 74 65 78 74 2c 20 56 65 63 74 6f 72 33 20 70 6f 73 69 74 69 6f 6e 2c 20 43 61 6d Text.text,.Vector3.position,.Cam
c560 65 72 61 20 63 61 6d 65 72 61 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 era.camera)..........{..........
c580 20 20 20 20 52 65 63 74 54 72 61 6e 73 66 6f 72 6d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 20 ....RectTransform.rectTransform.
c5a0 3d 20 74 65 78 74 2e 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 =.text.rectTransform;...........
c5c0 20 20 20 20 20 66 6c 6f 61 74 20 64 69 73 74 61 6e 63 65 53 71 72 20 3d 20 4d 61 74 68 66 2e 49 .....float.distanceSqr.=.Mathf.I
c5e0 6e 66 69 6e 69 74 79 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 20 63 6c 6f 73 65 73 nfinity;..............int.closes
c600 74 20 3d 20 30 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 6f 6e 76 65 72 74 t.=.0;................//.Convert
c620 20 70 6f 73 69 74 69 6f 6e 20 69 6e 74 6f 20 57 6f 72 6c 64 73 70 61 63 65 20 63 6f 6f 72 64 69 .position.into.Worldspace.coordi
c640 6e 61 74 65 73 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 53 63 72 65 65 6e 50 6f 69 6e 74 54 6f nates..............ScreenPointTo
c660 57 6f 72 6c 64 50 6f 69 6e 74 49 6e 52 65 63 74 61 6e 67 6c 65 28 72 65 63 74 54 72 61 6e 73 66 WorldPointInRectangle(rectTransf
c680 6f 72 6d 2c 20 70 6f 73 69 74 69 6f 6e 2c 20 63 61 6d 65 72 61 2c 20 6f 75 74 20 70 6f 73 69 74 orm,.position,.camera,.out.posit
c6a0 69 6f 6e 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 20 28 69 6e 74 20 69 20 ion);................for.(int.i.
c6c0 3d 20 30 3b 20 69 20 3c 20 74 65 78 74 2e 74 65 78 74 49 6e 66 6f 2e 77 6f 72 64 43 6f 75 6e 74 =.0;.i.<.text.textInfo.wordCount
c6e0 3b 20 69 2b 2b 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 ;.i++)..............{...........
c700 20 20 20 20 20 20 20 54 4d 50 5f 57 6f 72 64 49 6e 66 6f 20 77 49 6e 66 6f 20 3d 20 74 65 78 74 .......TMP_WordInfo.wInfo.=.text
c720 2e 74 65 78 74 49 6e 66 6f 2e 77 6f 72 64 49 6e 66 6f 5b 69 5d 3b 0d 0a 0d 0a 20 20 20 20 20 20 .textInfo.wordInfo[i];..........
c740 20 20 20 20 20 20 20 20 20 20 62 6f 6f 6c 20 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 3d 20 66 ..........bool.isBeginRegion.=.f
c760 61 6c 73 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 56 65 63 74 6f 72 33 alse;....................Vector3
c780 20 62 6c 20 3d 20 56 65 63 74 6f 72 33 2e 7a 65 72 6f 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 .bl.=.Vector3.zero;.............
c7a0 20 20 20 20 20 56 65 63 74 6f 72 33 20 74 6c 20 3d 20 56 65 63 74 6f 72 33 2e 7a 65 72 6f 3b 0d .....Vector3.tl.=.Vector3.zero;.
c7c0 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 56 65 63 74 6f 72 33 20 62 72 20 3d 20 56 65 .................Vector3.br.=.Ve
c7e0 63 74 6f 72 33 2e 7a 65 72 6f 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 56 65 63 ctor3.zero;..................Vec
c800 74 6f 72 33 20 74 72 20 3d 20 56 65 63 74 6f 72 33 2e 7a 65 72 6f 3b 0d 0a 0d 0a 20 20 20 20 20 tor3.tr.=.Vector3.zero;.........
c820 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 74 65 72 61 74 65 20 74 68 72 6f 75 67 68 20 65 61 ...........//.Iterate.through.ea
c840 63 68 20 63 68 61 72 61 63 74 65 72 20 6f 66 20 74 68 65 20 77 6f 72 64 0d 0a 20 20 20 20 20 20 ch.character.of.the.word........
c860 20 20 20 20 20 20 20 20 20 20 66 6f 72 20 28 69 6e 74 20 6a 20 3d 20 30 3b 20 6a 20 3c 20 77 49 ..........for.(int.j.=.0;.j.<.wI
c880 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 43 6f 75 6e 74 3b 20 6a 2b 2b 29 0d 0a 20 20 20 20 20 20 nfo.characterCount;.j++)........
c8a0 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ..........{.....................
c8c0 20 69 6e 74 20 63 68 61 72 61 63 74 65 72 49 6e 64 65 78 20 3d 20 77 49 6e 66 6f 2e 66 69 72 73 .int.characterIndex.=.wInfo.firs
c8e0 74 43 68 61 72 61 63 74 65 72 49 6e 64 65 78 20 2b 20 6a 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 tCharacterIndex.+.j;............
c900 20 20 20 20 20 20 20 20 20 20 54 4d 50 5f 43 68 61 72 61 63 74 65 72 49 6e 66 6f 20 63 75 72 72 ..........TMP_CharacterInfo.curr
c920 65 6e 74 43 68 61 72 49 6e 66 6f 20 3d 20 74 65 78 74 2e 74 65 78 74 49 6e 66 6f 2e 63 68 61 72 entCharInfo.=.text.textInfo.char
c940 61 63 74 65 72 49 6e 66 6f 5b 63 68 61 72 61 63 74 65 72 49 6e 64 65 78 5d 3b 0d 0a 20 20 20 20 acterInfo[characterIndex];......
c960 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 20 63 75 72 72 65 6e 74 4c 69 6e 65 20 ................int.currentLine.
c980 3d 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 6c 69 6e 65 4e 75 6d 62 65 72 3b 0d 0a 0d =.currentCharInfo.lineNumber;...
c9a0 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 6f 6f 6c 20 69 73 43 68 61 72 .....................bool.isChar
c9c0 61 63 74 65 72 56 69 73 69 62 6c 65 20 3d 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 69 acterVisible.=.currentCharInfo.i
c9e0 73 56 69 73 69 62 6c 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 sVisible;.......................
ca00 20 69 66 20 28 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 3d 3d 20 66 61 6c 73 65 20 26 26 20 69 .if.(isBeginRegion.==.false.&&.i
ca20 73 43 68 61 72 61 63 74 65 72 56 69 73 69 62 6c 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 sCharacterVisible)..............
ca40 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ........{.......................
ca60 20 20 20 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 3d 20 74 72 75 65 3b 0d 0a 0d 0a 20 20 20 20 ...isBeginRegion.=.true;........
ca80 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 6c 20 3d 20 72 65 63 74 54 72 61 ....................bl.=.rectTra
caa0 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 nsform.TransformPoint(new.Vector
cac0 33 28 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 62 6f 74 74 6f 6d 4c 65 66 74 2e 78 2c 20 3(currentCharInfo.bottomLeft.x,.
cae0 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 64 65 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d currentCharInfo.descender,.0));.
cb00 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 6c 20 3d 20 72 65 .........................tl.=.re
cb20 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 ctTransform.TransformPoint(new.V
cb40 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 62 6f 74 74 6f 6d 4c 65 66 ector3(currentCharInfo.bottomLef
cb60 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 61 73 63 65 6e 64 65 72 2c 20 30 t.x,.currentCharInfo.ascender,.0
cb80 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f ));............................/
cba0 2f 44 65 62 75 67 2e 4c 6f 67 28 22 53 74 61 72 74 20 57 6f 72 64 20 52 65 67 69 6f 6e 20 61 74 /Debug.Log("Start.Word.Region.at
cbc0 20 5b 22 20 2b 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 20 .[".+.currentCharInfo.character.
cbe0 2b 20 22 5d 22 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 +."]");.........................
cc00 20 20 20 2f 2f 20 49 66 20 57 6f 72 64 20 69 73 20 6f 6e 65 20 63 68 61 72 61 63 74 65 72 0d 0a ...//.If.Word.is.one.character..
cc20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 77 49 6e 66 ........................if.(wInf
cc40 6f 2e 63 68 61 72 61 63 74 65 72 43 6f 75 6e 74 20 3d 3d 20 31 29 0d 0a 20 20 20 20 20 20 20 20 o.characterCount.==.1)..........
cc60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 ................{...............
cc80 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 3d 20 66 ...............isBeginRegion.=.f
cca0 61 6c 73 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 alse;...........................
ccc0 20 20 20 20 20 62 72 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 .....br.=.rectTransform.Transfor
cce0 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 49 6e mPoint(new.Vector3(currentCharIn
cd00 66 6f 2e 74 6f 70 52 69 67 68 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 64 fo.topRight.x,.currentCharInfo.d
cd20 65 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 escender,.0));..................
cd40 20 20 20 20 20 20 20 20 20 20 20 20 74 72 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 ............tr.=.rectTransform.T
cd60 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 65 6e ransformPoint(new.Vector3(curren
cd80 74 43 68 61 72 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 tCharInfo.topRight.x,.currentCha
cda0 72 49 6e 66 6f 2e 61 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 rInfo.ascender,.0));............
cdc0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 68 65 63 6b 20 66 6f 72 ....................//.Check.for
cde0 20 49 6e 74 65 72 73 65 63 74 69 6f 6e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .Intersection...................
ce00 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 50 6f 69 6e 74 49 6e 74 65 72 73 65 63 74 52 65 63 ...........if.(PointIntersectRec
ce20 74 61 6e 67 6c 65 28 70 6f 73 69 74 69 6f 6e 2c 20 62 6c 2c 20 74 6c 2c 20 74 72 2c 20 62 72 29 tangle(position,.bl,.tl,.tr,.br)
ce40 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 )...............................
ce60 20 20 20 72 65 74 75 72 6e 20 69 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ...return.i;....................
ce80 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 46 69 6e 64 20 74 68 65 20 63 6c 6f 73 65 73 74 20 ............//.Find.the.closest.
cea0 6c 69 6e 65 20 73 65 67 6d 65 6e 74 20 74 6f 20 70 6f 73 69 74 69 6f 6e 2e 0d 0a 20 20 20 20 20 line.segment.to.position........
cec0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 64 62 6c .......................float.dbl
cee0 20 3d 20 44 69 73 74 61 6e 63 65 54 6f 4c 69 6e 65 28 62 6c 2c 20 74 6c 2c 20 70 6f 73 69 74 69 .=.DistanceToLine(bl,.tl,.positi
cf00 6f 6e 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 on);............................
cf20 20 20 66 6c 6f 61 74 20 64 74 6c 20 3d 20 44 69 73 74 61 6e 63 65 54 6f 4c 69 6e 65 28 74 6c 2c ..float.dtl.=.DistanceToLine(tl,
cf40 20 74 72 2c 20 70 6f 73 69 74 69 6f 6e 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .tr,.position);.................
cf60 20 20 20 20 20 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 64 74 72 20 3d 20 44 69 73 74 61 6e 63 .............float.dtr.=.Distanc
cf80 65 54 6f 4c 69 6e 65 28 74 72 2c 20 62 72 2c 20 70 6f 73 69 74 69 6f 6e 29 3b 0d 0a 20 20 20 20 eToLine(tr,.br,.position);......
cfa0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 64 62 ........................float.db
cfc0 72 20 3d 20 44 69 73 74 61 6e 63 65 54 6f 4c 69 6e 65 28 62 72 2c 20 62 6c 2c 20 70 6f 73 69 74 r.=.DistanceToLine(br,.bl,.posit
cfe0 69 6f 6e 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ion);...........................
d000 20 20 20 20 20 66 6c 6f 61 74 20 64 20 3d 20 64 62 6c 20 3c 20 64 74 6c 20 3f 20 64 62 6c 20 3a .....float.d.=.dbl.<.dtl.?.dbl.:
d020 20 64 74 6c 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .dtl;...........................
d040 20 20 20 64 20 3d 20 64 20 3c 20 64 74 72 20 3f 20 64 20 3a 20 64 74 72 3b 0d 0a 20 20 20 20 20 ...d.=.d.<.dtr.?.d.:.dtr;.......
d060 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 64 20 3d 20 64 20 3c 20 64 .......................d.=.d.<.d
d080 62 72 20 3f 20 64 20 3a 20 64 62 72 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 br.?.d.:.dbr;...................
d0a0 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 64 69 73 74 61 6e 63 65 53 71 72 20 3e 20 64 .............if.(distanceSqr.>.d
d0c0 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b )..............................{
d0e0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ................................
d100 20 20 64 69 73 74 61 6e 63 65 53 71 72 20 3d 20 64 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 ..distanceSqr.=.d;..............
d120 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 6c 6f 73 65 73 74 20 3d 20 69 3b ....................closest.=.i;
d140 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d ..............................}.
d160 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 .........................}......
d180 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ................}...............
d1a0 20 20 20 20 20 20 20 20 20 2f 2f 20 4c 61 73 74 20 43 68 61 72 61 63 74 65 72 20 6f 66 20 57 6f .........//.Last.Character.of.Wo
d1c0 72 64 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 69 73 42 65 rd......................if.(isBe
d1e0 67 69 6e 52 65 67 69 6f 6e 20 26 26 20 6a 20 3d 3d 20 77 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 ginRegion.&&.j.==.wInfo.characte
d200 72 43 6f 75 6e 74 20 2d 20 31 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 rCount.-.1).....................
d220 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 73 42 65 .{..........................isBe
d240 67 69 6e 52 65 67 69 6f 6e 20 3d 20 66 61 6c 73 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 ginRegion.=.false;..............
d260 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 72 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d ..............br.=.rectTransform
d280 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 .TransformPoint(new.Vector3(curr
d2a0 65 6e 74 43 68 61 72 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 entCharInfo.topRight.x,.currentC
d2c0 68 61 72 49 6e 66 6f 2e 64 65 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 20 20 20 20 20 20 20 harInfo.descender,.0));.........
d2e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 72 20 3d 20 72 65 63 74 54 72 61 6e 73 66 .................tr.=.rectTransf
d300 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 63 orm.TransformPoint(new.Vector3(c
d320 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 2e 78 2c 20 63 75 72 72 65 urrentCharInfo.topRight.x,.curre
d340 6e 74 43 68 61 72 49 6e 66 6f 2e 61 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 0d 0a 20 20 20 ntCharInfo.ascender,.0));.......
d360 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 68 65 63 6b 20 66 6f .....................//.Check.fo
d380 72 20 49 6e 74 65 72 73 65 63 74 69 6f 6e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 r.Intersection..................
d3a0 20 20 20 20 20 20 20 20 69 66 20 28 50 6f 69 6e 74 49 6e 74 65 72 73 65 63 74 52 65 63 74 61 6e ........if.(PointIntersectRectan
d3c0 67 6c 65 28 70 6f 73 69 74 69 6f 6e 2c 20 62 6c 2c 20 74 6c 2c 20 74 72 2c 20 62 72 29 29 0d 0a gle(position,.bl,.tl,.tr,.br))..
d3e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 ............................retu
d400 72 6e 20 69 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 rn.i;...........................
d420 20 2f 2f 20 46 69 6e 64 20 74 68 65 20 63 6c 6f 73 65 73 74 20 6c 69 6e 65 20 73 65 67 6d 65 6e .//.Find.the.closest.line.segmen
d440 74 20 74 6f 20 70 6f 73 69 74 69 6f 6e 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 t.to.position...................
d460 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 64 62 6c 20 3d 20 44 69 73 74 61 6e 63 65 54 6f 4c 69 ........float.dbl.=.DistanceToLi
d480 6e 65 28 62 6c 2c 20 74 6c 2c 20 70 6f 73 69 74 69 6f 6e 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 ne(bl,.tl,.position);...........
d4a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 64 74 6c 20 3d 20 44 69 73 74 61 ...............float.dtl.=.Dista
d4c0 6e 63 65 54 6f 4c 69 6e 65 28 74 6c 2c 20 74 72 2c 20 70 6f 73 69 74 69 6f 6e 29 3b 0d 0a 20 20 nceToLine(tl,.tr,.position);....
d4e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 64 74 72 20 ......................float.dtr.
d500 3d 20 44 69 73 74 61 6e 63 65 54 6f 4c 69 6e 65 28 74 72 2c 20 62 72 2c 20 70 6f 73 69 74 69 6f =.DistanceToLine(tr,.br,.positio
d520 6e 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 6c 6f n);..........................flo
d540 61 74 20 64 62 72 20 3d 20 44 69 73 74 61 6e 63 65 54 6f 4c 69 6e 65 28 62 72 2c 20 62 6c 2c 20 at.dbr.=.DistanceToLine(br,.bl,.
d560 70 6f 73 69 74 69 6f 6e 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 position);......................
d580 20 20 20 20 20 20 66 6c 6f 61 74 20 64 20 3d 20 64 62 6c 20 3c 20 64 74 6c 20 3f 20 64 62 6c 20 ......float.d.=.dbl.<.dtl.?.dbl.
d5a0 3a 20 64 74 6c 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 :.dtl;..........................
d5c0 64 20 3d 20 64 20 3c 20 64 74 72 20 3f 20 64 20 3a 20 64 74 72 3b 0d 0a 20 20 20 20 20 20 20 20 d.=.d.<.dtr.?.d.:.dtr;..........
d5e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 64 20 3d 20 64 20 3c 20 64 62 72 20 3f 20 64 20 ................d.=.d.<.dbr.?.d.
d600 3a 20 64 62 72 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 :.dbr;..........................
d620 20 20 69 66 20 28 64 69 73 74 61 6e 63 65 53 71 72 20 3e 20 64 29 0d 0a 20 20 20 20 20 20 20 20 ..if.(distanceSqr.>.d)..........
d640 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 ................{...............
d660 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 64 69 73 74 61 6e 63 65 53 71 72 20 3d 20 64 3b 0d ...............distanceSqr.=.d;.
d680 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 6c 6f .............................clo
d6a0 73 65 73 74 20 3d 20 69 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 sest.=.i;.......................
d6c0 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 ...}......................}.....
d6e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 66 20 57 6f 72 64 20 69 73 20 73 .................//.If.Word.is.s
d700 70 6c 69 74 20 6f 6e 20 6d 6f 72 65 20 74 68 61 6e 20 6f 6e 65 20 6c 69 6e 65 2e 0d 0a 20 20 20 plit.on.more.than.one.line......
d720 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 20 69 66 20 28 69 73 42 65 67 69 .................else.if.(isBegi
d740 6e 52 65 67 69 6f 6e 20 26 26 20 63 75 72 72 65 6e 74 4c 69 6e 65 20 21 3d 20 74 65 78 74 2e 74 nRegion.&&.currentLine.!=.text.t
d760 65 78 74 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 49 6e 66 6f 5b 63 68 61 72 61 63 74 65 72 49 extInfo.characterInfo[characterI
d780 6e 64 65 78 20 2b 20 31 5d 2e 6c 69 6e 65 4e 75 6d 62 65 72 29 0d 0a 20 20 20 20 20 20 20 20 20 ndex.+.1].lineNumber)...........
d7a0 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ...........{....................
d7c0 20 20 20 20 20 20 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 3d 20 66 61 6c 73 65 3b 0d 0a 0d 0a ......isBeginRegion.=.false;....
d7e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 72 20 3d 20 72 65 63 ........................br.=.rec
d800 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 tTransform.TransformPoint(new.Ve
d820 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 2e 78 ctor3(currentCharInfo.topRight.x
d840 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 64 65 73 63 65 6e 64 65 72 2c 20 30 29 29 ,.currentCharInfo.descender,.0))
d860 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 72 20 3d 20 ;..........................tr.=.
d880 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 rectTransform.TransformPoint(new
d8a0 20 56 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 74 6f 70 52 69 67 68 .Vector3(currentCharInfo.topRigh
d8c0 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 61 73 63 65 6e 64 65 72 2c 20 30 t.x,.currentCharInfo.ascender,.0
d8e0 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f ));............................/
d900 2f 20 43 68 65 63 6b 20 66 6f 72 20 49 6e 74 65 72 73 65 63 74 69 6f 6e 0d 0a 20 20 20 20 20 20 /.Check.for.Intersection........
d920 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 50 6f 69 6e 74 49 6e 74 65 72 ..................if.(PointInter
d940 73 65 63 74 52 65 63 74 61 6e 67 6c 65 28 70 6f 73 69 74 69 6f 6e 2c 20 62 6c 2c 20 74 6c 2c 20 sectRectangle(position,.bl,.tl,.
d960 74 72 2c 20 62 72 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 tr,.br))........................
d980 20 20 20 20 20 20 72 65 74 75 72 6e 20 69 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 ......return.i;.................
d9a0 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 46 69 6e 64 20 74 68 65 20 63 6c 6f 73 65 73 74 20 6c ...........//.Find.the.closest.l
d9c0 69 6e 65 20 73 65 67 6d 65 6e 74 20 74 6f 20 70 6f 73 69 74 69 6f 6e 2e 0d 0a 20 20 20 20 20 20 ine.segment.to.position.........
d9e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 64 62 6c 20 3d 20 44 69 ..................float.dbl.=.Di
da00 73 74 61 6e 63 65 54 6f 4c 69 6e 65 28 62 6c 2c 20 74 6c 2c 20 70 6f 73 69 74 69 6f 6e 29 3b 0d stanceToLine(bl,.tl,.position);.
da20 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 64 .........................float.d
da40 74 6c 20 3d 20 44 69 73 74 61 6e 63 65 54 6f 4c 69 6e 65 28 74 6c 2c 20 74 72 2c 20 70 6f 73 69 tl.=.DistanceToLine(tl,.tr,.posi
da60 74 69 6f 6e 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 tion);..........................
da80 66 6c 6f 61 74 20 64 74 72 20 3d 20 44 69 73 74 61 6e 63 65 54 6f 4c 69 6e 65 28 74 72 2c 20 62 float.dtr.=.DistanceToLine(tr,.b
daa0 72 2c 20 70 6f 73 69 74 69 6f 6e 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 r,.position);...................
dac0 20 20 20 20 20 20 20 66 6c 6f 61 74 20 64 62 72 20 3d 20 44 69 73 74 61 6e 63 65 54 6f 4c 69 6e .......float.dbr.=.DistanceToLin
dae0 65 28 62 72 2c 20 62 6c 2c 20 70 6f 73 69 74 69 6f 6e 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 e(br,.bl,.position);............
db00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 64 20 3d 20 64 62 6c 20 3c 20 ................float.d.=.dbl.<.
db20 64 74 6c 20 3f 20 64 62 6c 20 3a 20 64 74 6c 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 dtl.?.dbl.:.dtl;................
db40 20 20 20 20 20 20 20 20 20 20 64 20 3d 20 64 20 3c 20 64 74 72 20 3f 20 64 20 3a 20 64 74 72 3b ..........d.=.d.<.dtr.?.d.:.dtr;
db60 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 64 20 3d 20 64 20 ..........................d.=.d.
db80 3c 20 64 62 72 20 3f 20 64 20 3a 20 64 62 72 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 <.dbr.?.d.:.dbr;................
dba0 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 64 69 73 74 61 6e 63 65 53 71 72 20 3e 20 64 29 ............if.(distanceSqr.>.d)
dbc0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 ..........................{.....
dbe0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 64 69 73 74 61 6e 63 .........................distanc
dc00 65 53 71 72 20 3d 20 64 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 eSqr.=.d;.......................
dc20 20 20 20 20 20 20 20 63 6c 6f 73 65 73 74 20 3d 20 69 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 .......closest.=.i;.............
dc40 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .............}..................
dc60 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 ....}..................}........
dc80 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 44 65 62 75 67 2e 4c 6f 67 28 22 57 6f 72 64 20 61 74 ............//Debug.Log("Word.at
dca0 20 49 6e 64 65 78 3a 20 22 20 2b 20 69 20 2b 20 22 20 69 73 20 6c 6f 63 61 74 65 64 20 61 74 20 .Index:.".+.i.+.".is.located.at.
dcc0 28 22 20 2b 20 62 6c 20 2b 20 22 2c 20 22 20 2b 20 74 6c 20 2b 20 22 2c 20 22 20 2b 20 74 72 20 (".+.bl.+.",.".+.tl.+.",.".+.tr.
dce0 2b 20 22 2c 20 22 20 2b 20 62 72 20 2b 20 22 29 2e 22 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 +.",.".+.br.+.").");............
dd00 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 63 6c 6f 73 65 73 ..}................return.closes
dd20 74 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 t;..........}............///.<su
dd40 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 46 75 6e 63 74 69 6f 6e 20 72 65 74 mmary>..........///.Function.ret
dd60 75 72 6e 69 6e 67 20 74 68 65 20 69 6e 64 65 78 20 6f 66 20 74 68 65 20 77 6f 72 64 20 61 74 20 urning.the.index.of.the.word.at.
dd80 74 68 65 20 67 69 76 65 6e 20 70 6f 73 69 74 69 6f 6e 20 28 69 66 20 61 6e 79 29 2e 0d 0a 20 20 the.given.position.(if.any).....
dda0 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f ......///.</summary>..........//
ddc0 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 74 65 78 74 22 3e 41 20 72 65 66 65 72 65 6e 63 65 /.<param.name="text">A.reference
dde0 20 74 6f 20 74 68 65 20 54 65 78 74 4d 65 73 68 50 72 6f 20 55 47 55 49 20 63 6f 6d 70 6f 6e 65 .to.the.TextMeshPro.UGUI.compone
de00 6e 74 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 nt.</param>..........///.<param.
de20 6e 61 6d 65 3d 22 70 6f 73 69 74 69 6f 6e 22 3e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 name="position"></param>........
de40 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 63 61 6d 65 72 61 22 3e 54 68 65 20 73 ..///.<param.name="camera">The.s
de60 63 65 6e 65 20 63 61 6d 65 72 61 20 77 68 69 63 68 20 6d 61 79 20 62 65 20 61 73 73 69 67 6e 65 cene.camera.which.may.be.assigne
de80 64 20 74 6f 20 61 20 43 61 6e 76 61 73 20 75 73 69 6e 67 20 53 63 72 65 65 6e 53 70 61 63 65 20 d.to.a.Canvas.using.ScreenSpace.
dea0 43 61 6d 65 72 61 20 6f 72 20 57 6f 72 6c 64 53 70 61 63 65 20 72 65 6e 64 65 72 20 6d 6f 64 65 Camera.or.WorldSpace.render.mode
dec0 2e 20 53 65 74 20 74 6f 20 6e 75 6c 6c 20 69 73 20 75 73 69 6e 67 20 53 63 72 65 65 6e 53 70 61 ..Set.to.null.is.using.ScreenSpa
dee0 63 65 20 4f 76 65 72 6c 61 79 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f ce.Overlay.</param>..........///
df00 20 3c 72 65 74 75 72 6e 73 3e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f .<returns></returns>..........//
df20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 69 6e 74 20 46 69 6e 64 4e 65 61 72 65 73 74 57 6f 72 public.static.int.FindNearestWor
df40 64 28 54 65 78 74 4d 65 73 68 50 72 6f 55 47 55 49 20 74 65 78 74 2c 20 56 65 63 74 6f 72 33 20 d(TextMeshProUGUI.text,.Vector3.
df60 70 6f 73 69 74 69 6f 6e 2c 20 43 61 6d 65 72 61 20 63 61 6d 65 72 61 29 0d 0a 20 20 20 20 20 20 position,.Camera.camera)........
df80 20 20 2f 2f 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 52 65 63 74 54 72 61 6e 73 66 6f ..//{..........//....RectTransfo
dfa0 72 6d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 20 3d 20 74 65 78 74 2e 72 65 63 74 54 72 61 6e rm.rectTransform.=.text.rectTran
dfc0 73 66 6f 72 6d 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 66 6c 6f 61 74 20 64 69 sform;............//....float.di
dfe0 73 74 61 6e 63 65 53 71 72 20 3d 20 4d 61 74 68 66 2e 49 6e 66 69 6e 69 74 79 3b 0d 0a 20 20 20 stanceSqr.=.Mathf.Infinity;.....
e000 20 20 20 20 20 2f 2f 20 20 20 20 69 6e 74 20 63 6c 6f 73 65 73 74 20 3d 20 30 3b 0d 0a 0d 0a 20 .....//....int.closest.=.0;.....
e020 20 20 20 20 20 20 20 2f 2f 20 20 20 20 2f 2f 20 43 6f 6e 76 65 72 74 20 70 6f 73 69 74 69 6f 6e .......//....//.Convert.position
e040 20 69 6e 74 6f 20 57 6f 72 6c 64 73 70 61 63 65 20 63 6f 6f 72 64 69 6e 61 74 65 73 0d 0a 20 20 .into.Worldspace.coordinates....
e060 20 20 20 20 20 20 2f 2f 20 20 20 20 53 63 72 65 65 6e 50 6f 69 6e 74 54 6f 57 6f 72 6c 64 50 6f ......//....ScreenPointToWorldPo
e080 69 6e 74 49 6e 52 65 63 74 61 6e 67 6c 65 28 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2c 20 70 6f intInRectangle(rectTransform,.po
e0a0 73 69 74 69 6f 6e 2c 20 63 61 6d 65 72 61 2c 20 6f 75 74 20 70 6f 73 69 74 69 6f 6e 29 3b 0d 0a sition,.camera,.out.position);..
e0c0 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 66 6f 72 20 28 69 6e 74 20 69 20 3d 20 30 3b 20 ..........//....for.(int.i.=.0;.
e0e0 69 20 3c 20 74 65 78 74 2e 74 65 78 74 49 6e 66 6f 2e 77 6f 72 64 43 6f 75 6e 74 3b 20 69 2b 2b i.<.text.textInfo.wordCount;.i++
e100 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 )..........//....{..........//..
e120 20 20 20 20 20 20 54 4d 50 5f 57 6f 72 64 49 6e 66 6f 20 77 49 6e 66 6f 20 3d 20 74 65 78 74 2e ......TMP_WordInfo.wInfo.=.text.
e140 74 65 78 74 49 6e 66 6f 2e 77 6f 72 64 49 6e 66 6f 5b 69 5d 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 textInfo.wordInfo[i];...........
e160 20 2f 2f 20 20 20 20 20 20 20 20 62 6f 6f 6c 20 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 3d 20 .//........bool.isBeginRegion.=.
e180 66 61 6c 73 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 56 65 63 74 false;............//........Vect
e1a0 6f 72 33 20 62 6c 20 3d 20 56 65 63 74 6f 72 33 2e 7a 65 72 6f 3b 0d 0a 20 20 20 20 20 20 20 20 or3.bl.=.Vector3.zero;..........
e1c0 2f 2f 20 20 20 20 20 20 20 20 56 65 63 74 6f 72 33 20 74 6c 20 3d 20 56 65 63 74 6f 72 33 2e 7a //........Vector3.tl.=.Vector3.z
e1e0 65 72 6f 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 56 65 63 74 6f 72 33 20 ero;..........//........Vector3.
e200 62 72 20 3d 20 56 65 63 74 6f 72 33 2e 7a 65 72 6f 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 br.=.Vector3.zero;..........//..
e220 20 20 20 20 20 20 56 65 63 74 6f 72 33 20 74 72 20 3d 20 56 65 63 74 6f 72 33 2e 7a 65 72 6f 3b ......Vector3.tr.=.Vector3.zero;
e240 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 2f 2f 20 49 74 65 72 61 74 65 ............//........//.Iterate
e260 20 74 68 72 6f 75 67 68 20 65 61 63 68 20 63 68 61 72 61 63 74 65 72 20 6f 66 20 74 68 65 20 77 .through.each.character.of.the.w
e280 6f 72 64 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 66 6f 72 20 28 69 6e 74 20 ord..........//........for.(int.
e2a0 6a 20 3d 20 30 3b 20 6a 20 3c 20 77 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 43 6f 75 6e 74 3b j.=.0;.j.<.wInfo.characterCount;
e2c0 20 6a 2b 2b 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 .j++)..........//........{......
e2e0 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 20 63 68 61 72 61 63 74 65 72 49 ....//............int.characterI
e300 6e 64 65 78 20 3d 20 77 49 6e 66 6f 2e 66 69 72 73 74 43 68 61 72 61 63 74 65 72 49 6e 64 65 78 ndex.=.wInfo.firstCharacterIndex
e320 20 2b 20 6a 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 54 4d 50 .+.j;..........//............TMP
e340 5f 43 68 61 72 61 63 74 65 72 49 6e 66 6f 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 20 3d _CharacterInfo.currentCharInfo.=
e360 20 74 65 78 74 2e 74 65 78 74 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 49 6e 66 6f 5b 63 68 61 .text.textInfo.characterInfo[cha
e380 72 61 63 74 65 72 49 6e 64 65 78 5d 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 racterIndex];..........//.......
e3a0 20 20 20 20 20 69 6e 74 20 63 75 72 72 65 6e 74 4c 69 6e 65 20 3d 20 63 75 72 72 65 6e 74 43 68 .....int.currentLine.=.currentCh
e3c0 61 72 49 6e 66 6f 2e 6c 69 6e 65 4e 75 6d 62 65 72 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f arInfo.lineNumber;............//
e3e0 20 20 20 20 20 20 20 20 20 20 20 20 62 6f 6f 6c 20 69 73 43 68 61 72 61 63 74 65 72 56 69 73 69 ............bool.isCharacterVisi
e400 62 6c 65 20 3d 20 63 68 61 72 61 63 74 65 72 49 6e 64 65 78 20 3e 20 74 65 78 74 2e 6d 61 78 56 ble.=.characterIndex.>.text.maxV
e420 69 73 69 62 6c 65 43 68 61 72 61 63 74 65 72 73 20 7c 7c 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 isibleCharacters.||..........//.
e440 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ................................
e460 20 20 20 20 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 6c 69 6e 65 4e 75 6d 62 65 72 20 .....currentCharInfo.lineNumber.
e480 3e 20 74 65 78 74 2e 6d 61 78 56 69 73 69 62 6c 65 4c 69 6e 65 73 20 7c 7c 0d 0a 20 20 20 20 20 >.text.maxVisibleLines.||.......
e4a0 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ...//...........................
e4c0 20 20 20 20 20 20 20 20 20 20 28 74 65 78 74 2e 4f 76 65 72 66 6c 6f 77 4d 6f 64 65 20 3d 3d 20 ..........(text.OverflowMode.==.
e4e0 54 65 78 74 4f 76 65 72 66 6c 6f 77 4d 6f 64 65 73 2e 50 61 67 65 20 26 26 20 63 75 72 72 65 6e TextOverflowModes.Page.&&.curren
e500 74 43 68 61 72 49 6e 66 6f 2e 70 61 67 65 4e 75 6d 62 65 72 20 2b 20 31 20 21 3d 20 74 65 78 74 tCharInfo.pageNumber.+.1.!=.text
e520 2e 70 61 67 65 54 6f 44 69 73 70 6c 61 79 29 20 3f 20 66 61 6c 73 65 20 3a 20 74 72 75 65 3b 0d .pageToDisplay).?.false.:.true;.
e540 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 69 73 42 ...........//............if.(isB
e560 65 67 69 6e 52 65 67 69 6f 6e 20 3d 3d 20 66 61 6c 73 65 20 26 26 20 69 73 43 68 61 72 61 63 74 eginRegion.==.false.&&.isCharact
e580 65 72 56 69 73 69 62 6c 65 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 erVisible)..........//..........
e5a0 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 ..{..........//................i
e5c0 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 3d 20 74 72 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 sBeginRegion.=.true;............
e5e0 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 6c 20 3d 20 72 65 63 74 54 72 61 6e 73 //................bl.=.rectTrans
e600 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 form.TransformPoint(new.Vector3(
e620 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 62 6f 74 74 6f 6d 4c 65 66 74 2e 78 2c 20 63 75 currentCharInfo.bottomLeft.x,.cu
e640 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 64 65 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 20 rrentCharInfo.descender,.0));...
e660 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 6c 20 3d 20 72 65 .......//................tl.=.re
e680 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 ctTransform.TransformPoint(new.V
e6a0 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 62 6f 74 74 6f 6d 4c 65 66 ector3(currentCharInfo.bottomLef
e6c0 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 61 73 63 65 6e 64 65 72 2c 20 30 t.x,.currentCharInfo.ascender,.0
e6e0 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ));............//...............
e700 20 2f 2f 44 65 62 75 67 2e 4c 6f 67 28 22 53 74 61 72 74 20 57 6f 72 64 20 52 65 67 69 6f 6e 20 .//Debug.Log("Start.Word.Region.
e720 61 74 20 5b 22 20 2b 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 at.[".+.currentCharInfo.characte
e740 72 20 2b 20 22 5d 22 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 r.+."]");............//.........
e760 20 20 20 20 20 20 20 2f 2f 20 49 66 20 57 6f 72 64 20 69 73 20 6f 6e 65 20 63 68 61 72 61 63 74 .......//.If.Word.is.one.charact
e780 65 72 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 er..........//................if
e7a0 20 28 77 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 43 6f 75 6e 74 20 3d 3d 20 31 29 0d 0a 20 20 .(wInfo.characterCount.==.1)....
e7c0 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 ......//................{.......
e7e0 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 73 42 65 67 69 6e ...//....................isBegin
e800 52 65 67 69 6f 6e 20 3d 20 66 61 6c 73 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 Region.=.false;............//...
e820 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 72 20 3d 20 72 65 63 74 54 72 61 6e 73 66 .................br.=.rectTransf
e840 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 63 orm.TransformPoint(new.Vector3(c
e860 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 2e 78 2c 20 63 75 72 72 65 urrentCharInfo.topRight.x,.curre
e880 6e 74 43 68 61 72 49 6e 66 6f 2e 64 65 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 20 20 20 20 ntCharInfo.descender,.0));......
e8a0 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 72 20 3d 20 72 ....//....................tr.=.r
e8c0 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 ectTransform.TransformPoint(new.
e8e0 56 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 Vector3(currentCharInfo.topRight
e900 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 61 73 63 65 6e 64 65 72 2c 20 30 29 .x,.currentCharInfo.ascender,.0)
e920 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 );............//................
e940 20 20 20 20 2f 2f 20 43 68 65 63 6b 20 66 6f 72 20 49 6e 74 65 72 73 65 63 74 69 6f 6e 0d 0a 20 ....//.Check.for.Intersection...
e960 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 .......//....................if.
e980 28 50 6f 69 6e 74 49 6e 74 65 72 73 65 63 74 52 65 63 74 61 6e 67 6c 65 28 70 6f 73 69 74 69 6f (PointIntersectRectangle(positio
e9a0 6e 2c 20 62 6c 2c 20 74 6c 2c 20 74 72 2c 20 62 72 29 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 n,.bl,.tl,.tr,.br))..........//.
e9c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 69 3b .......................return.i;
e9e0 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ............//..................
ea00 20 20 2f 2f 44 65 62 75 67 2e 4c 6f 67 28 22 45 6e 64 20 57 6f 72 64 20 52 65 67 69 6f 6e 20 61 ..//Debug.Log("End.Word.Region.a
ea20 74 20 5b 22 20 2b 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 t.[".+.currentCharInfo.character
ea40 20 2b 20 22 5d 22 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 .+."]");..........//............
ea60 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a ....}..........//............}..
ea80 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4c 61 73 74 20 ..........//............//.Last.
eaa0 43 68 61 72 61 63 74 65 72 20 6f 66 20 57 6f 72 64 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 Character.of.Word..........//...
eac0 20 20 20 20 20 20 20 20 20 69 66 20 28 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 26 26 20 6a 20 .........if.(isBeginRegion.&&.j.
eae0 3d 3d 20 77 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 43 6f 75 6e 74 20 2d 20 31 29 0d 0a 20 20 ==.wInfo.characterCount.-.1)....
eb00 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f ......//............{........../
eb20 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 3d /................isBeginRegion.=
eb40 20 66 61 6c 73 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 .false;............//...........
eb60 20 20 20 20 20 62 72 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 .....br.=.rectTransform.Transfor
eb80 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 49 6e mPoint(new.Vector3(currentCharIn
eba0 66 6f 2e 74 6f 70 52 69 67 68 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 64 fo.topRight.x,.currentCharInfo.d
ebc0 65 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 escender,.0));..........//......
ebe0 20 20 20 20 20 20 20 20 20 20 74 72 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 ..........tr.=.rectTransform.Tra
ec00 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 nsformPoint(new.Vector3(currentC
ec20 68 61 72 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 harInfo.topRight.x,.currentCharI
ec40 6e 66 6f 2e 61 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f nfo.ascender,.0));............//
ec60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 68 65 63 6b 20 66 6f 72 20 49 6e 74 ................//.Check.for.Int
ec80 65 72 73 65 63 74 69 6f 6e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 ersection..........//...........
eca0 20 20 20 20 20 69 66 20 28 50 6f 69 6e 74 49 6e 74 65 72 73 65 63 74 52 65 63 74 61 6e 67 6c 65 .....if.(PointIntersectRectangle
ecc0 28 70 6f 73 69 74 69 6f 6e 2c 20 62 6c 2c 20 74 6c 2c 20 74 72 2c 20 62 72 29 29 0d 0a 20 20 20 (position,.bl,.tl,.tr,.br)).....
ece0 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 .....//....................retur
ed00 6e 20 69 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 n.i;............//..............
ed20 20 20 2f 2f 44 65 62 75 67 2e 4c 6f 67 28 22 45 6e 64 20 57 6f 72 64 20 52 65 67 69 6f 6e 20 61 ..//Debug.Log("End.Word.Region.a
ed40 74 20 5b 22 20 2b 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 t.[".+.currentCharInfo.character
ed60 20 2b 20 22 5d 22 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 .+."]");..........//............
ed80 7d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 66 20 57 }..........//............//.If.W
eda0 6f 72 64 20 69 73 20 73 70 6c 69 74 20 6f 6e 20 6d 6f 72 65 20 74 68 61 6e 20 6f 6e 65 20 6c 69 ord.is.split.on.more.than.one.li
edc0 6e 65 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 20 ne...........//............else.
ede0 69 66 20 28 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 26 26 20 63 75 72 72 65 6e 74 4c 69 6e 65 if.(isBeginRegion.&&.currentLine
ee00 20 21 3d 20 74 65 78 74 2e 74 65 78 74 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 49 6e 66 6f 5b .!=.text.textInfo.characterInfo[
ee20 63 68 61 72 61 63 74 65 72 49 6e 64 65 78 20 2b 20 31 5d 2e 6c 69 6e 65 4e 75 6d 62 65 72 29 0d characterIndex.+.1].lineNumber).
ee40 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 .........//............{........
ee60 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 73 42 65 67 69 6e 52 65 67 69 6f ..//................isBeginRegio
ee80 6e 20 3d 20 66 61 6c 73 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 n.=.false;............//........
eea0 20 20 20 20 20 20 20 20 62 72 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 ........br.=.rectTransform.Trans
eec0 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 formPoint(new.Vector3(currentCha
eee0 72 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 rInfo.topRight.x,.currentCharInf
ef00 6f 2e 64 65 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 o.descender,.0));..........//...
ef20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 72 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e .............tr.=.rectTransform.
ef40 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 65 TransformPoint(new.Vector3(curre
ef60 6e 74 43 68 61 72 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 ntCharInfo.topRight.x,.currentCh
ef80 61 72 49 6e 66 6f 2e 61 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 arInfo.ascender,.0));...........
efa0 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 68 65 63 6b 20 66 6f 72 20 .//................//.Check.for.
efc0 49 6e 74 65 72 73 65 63 74 69 6f 6e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 Intersection..........//........
efe0 20 20 20 20 20 20 20 20 69 66 20 28 50 6f 69 6e 74 49 6e 74 65 72 73 65 63 74 52 65 63 74 61 6e ........if.(PointIntersectRectan
f000 67 6c 65 28 70 6f 73 69 74 69 6f 6e 2c 20 62 6c 2c 20 74 6c 2c 20 74 72 2c 20 62 72 29 29 0d 0a gle(position,.bl,.tl,.tr,.br))..
f020 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 ........//....................re
f040 74 75 72 6e 20 69 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 turn.i;............//...........
f060 20 20 20 20 20 2f 2f 44 65 62 75 67 2e 4c 6f 67 28 22 45 6e 64 20 57 6f 72 64 20 52 65 67 69 6f .....//Debug.Log("End.Word.Regio
f080 6e 20 61 74 20 5b 22 20 2b 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 63 68 61 72 61 63 n.at.[".+.currentCharInfo.charac
f0a0 74 65 72 20 2b 20 22 5d 22 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 ter.+."]");..........//.........
f0c0 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 ...}..........//........}.......
f0e0 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 2f 2f 20 46 69 6e 64 20 74 68 65 20 63 6c 6f 73 65 .....//........//.Find.the.close
f100 73 74 20 6c 69 6e 65 20 73 65 67 6d 65 6e 74 20 74 6f 20 70 6f 73 69 74 69 6f 6e 2e 0d 0a 20 20 st.line.segment.to.position.....
f120 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 64 62 6c 20 3d 20 44 69 73 74 ......//........float.dbl.=.Dist
f140 61 6e 63 65 54 6f 4c 69 6e 65 28 62 6c 2c 20 74 6c 2c 20 70 6f 73 69 74 69 6f 6e 29 3b 20 2f 2f anceToLine(bl,.tl,.position);.//
f160 20 28 70 6f 73 69 74 69 6f 6e 20 2d 20 62 6c 29 2e 73 71 72 4d 61 67 6e 69 74 75 64 65 3b 0d 0a .(position.-.bl).sqrMagnitude;..
f180 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 64 74 6c 20 3d 20 44 69 ........//........float.dtl.=.Di
f1a0 73 74 61 6e 63 65 54 6f 4c 69 6e 65 28 74 6c 2c 20 74 72 2c 20 70 6f 73 69 74 69 6f 6e 29 3b 20 stanceToLine(tl,.tr,.position);.
f1c0 2f 2f 20 28 70 6f 73 69 74 69 6f 6e 20 2d 20 74 6c 29 2e 73 71 72 4d 61 67 6e 69 74 75 64 65 3b //.(position.-.tl).sqrMagnitude;
f1e0 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 64 74 72 20 3d 20 ..........//........float.dtr.=.
f200 44 69 73 74 61 6e 63 65 54 6f 4c 69 6e 65 28 74 72 2c 20 62 72 2c 20 70 6f 73 69 74 69 6f 6e 29 DistanceToLine(tr,.br,.position)
f220 3b 20 2f 2f 20 28 70 6f 73 69 74 69 6f 6e 20 2d 20 74 72 29 2e 73 71 72 4d 61 67 6e 69 74 75 64 ;.//.(position.-.tr).sqrMagnitud
f240 65 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 64 62 72 20 e;..........//........float.dbr.
f260 3d 20 44 69 73 74 61 6e 63 65 54 6f 4c 69 6e 65 28 62 72 2c 20 62 6c 2c 20 70 6f 73 69 74 69 6f =.DistanceToLine(br,.bl,.positio
f280 6e 29 3b 20 2f 2f 20 28 70 6f 73 69 74 69 6f 6e 20 2d 20 62 72 29 2e 73 71 72 4d 61 67 6e 69 74 n);.//.(position.-.br).sqrMagnit
f2a0 75 64 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 ude;............//........float.
f2c0 64 20 3d 20 64 62 6c 20 3c 20 64 74 6c 20 3f 20 64 62 6c 20 3a 20 64 74 6c 3b 0d 0a 20 20 20 20 d.=.dbl.<.dtl.?.dbl.:.dtl;......
f2e0 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 64 20 3d 20 64 20 3c 20 64 74 72 20 3f 20 64 20 3a 20 ....//........d.=.d.<.dtr.?.d.:.
f300 64 74 72 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 64 20 3d 20 64 20 3c 20 dtr;..........//........d.=.d.<.
f320 64 62 72 20 3f 20 64 20 3a 20 64 62 72 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 dbr.?.d.:.dbr;............//....
f340 20 20 20 20 69 66 20 28 64 69 73 74 61 6e 63 65 53 71 72 20 3e 20 64 29 0d 0a 20 20 20 20 20 20 ....if.(distanceSqr.>.d)........
f360 20 20 2f 2f 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 ..//........{..........//.......
f380 20 20 20 20 20 64 69 73 74 61 6e 63 65 53 71 72 20 3d 20 64 3b 0d 0a 20 20 20 20 20 20 20 20 2f .....distanceSqr.=.d;........../
f3a0 2f 20 20 20 20 20 20 20 20 20 20 20 20 63 6c 6f 73 65 73 74 20 3d 20 69 3b 0d 0a 20 20 20 20 20 /............closest.=.i;.......
f3c0 20 20 20 2f 2f 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 ...//........}..........//......
f3e0 20 20 2f 2f 44 65 62 75 67 2e 4c 6f 67 28 22 57 6f 72 64 20 61 74 20 49 6e 64 65 78 3a 20 22 20 ..//Debug.Log("Word.at.Index:.".
f400 2b 20 69 20 2b 20 22 20 69 73 20 6c 6f 63 61 74 65 64 20 61 74 20 28 22 20 2b 20 62 6c 20 2b 20 +.i.+.".is.located.at.(".+.bl.+.
f420 22 2c 20 22 20 2b 20 74 6c 20 2b 20 22 2c 20 22 20 2b 20 74 72 20 2b 20 22 2c 20 22 20 2b 20 62 ",.".+.tl.+.",.".+.tr.+.",.".+.b
f440 72 20 2b 20 22 29 2e 22 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 7d 0d 0a 0d r.+.").");............//....}...
f460 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 72 65 74 75 72 6e 20 63 6c 6f 73 65 73 74 3b 0d 0a .........//....return.closest;..
f480 20 20 20 20 20 20 20 20 2f 2f 7d 0d 0a 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 ........//}..............///.<su
f4a0 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 46 75 6e 63 74 69 6f 6e 20 72 65 74 mmary>..........///.Function.ret
f4c0 75 72 6e 69 6e 67 20 74 68 65 20 69 6e 64 65 78 20 6f 66 20 74 68 65 20 77 6f 72 64 20 61 74 20 urning.the.index.of.the.word.at.
f4e0 74 68 65 20 67 69 76 65 6e 20 70 6f 73 69 74 69 6f 6e 20 28 69 66 20 61 6e 79 29 2e 0d 0a 20 20 the.given.position.(if.any).....
f500 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f ......///.</summary>..........//
f520 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 74 65 78 74 22 3e 41 20 72 65 66 65 72 65 6e 63 65 /.<param.name="text">A.reference
f540 20 74 6f 20 74 68 65 20 54 65 78 74 4d 65 73 68 50 72 6f 20 55 47 55 49 20 63 6f 6d 70 6f 6e 65 .to.the.TextMeshPro.UGUI.compone
f560 6e 74 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 nt.</param>..........///.<param.
f580 6e 61 6d 65 3d 22 70 6f 73 69 74 69 6f 6e 22 3e 50 6f 73 69 74 69 6f 6e 20 74 6f 20 63 68 65 63 name="position">Position.to.chec
f5a0 6b 20 66 6f 72 20 69 6e 74 65 72 73 65 63 74 69 6f 6e 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 k.for.intersection.</param>.....
f5c0 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 63 61 6d 65 72 61 22 3e 54 68 .....///.<param.name="camera">Th
f5e0 65 20 63 61 6d 65 72 61 20 77 68 69 63 68 20 69 73 20 72 65 6e 64 65 72 69 6e 67 20 74 68 65 20 e.camera.which.is.rendering.the.
f600 74 65 78 74 20 6f 62 6a 65 63 74 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f text.object.</param>..........//
f620 2f 20 3c 72 65 74 75 72 6e 73 3e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f /.<returns></returns>........../
f640 2f 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 69 6e 74 20 46 69 6e 64 4e 65 61 72 65 73 74 57 6f /public.static.int.FindNearestWo
f660 72 64 28 54 65 78 74 4d 65 73 68 50 72 6f 20 74 65 78 74 2c 20 56 65 63 74 6f 72 33 20 70 6f 73 rd(TextMeshPro.text,.Vector3.pos
f680 69 74 69 6f 6e 2c 20 43 61 6d 65 72 61 20 63 61 6d 65 72 61 29 0d 0a 20 20 20 20 20 20 20 20 2f ition,.Camera.camera)........../
f6a0 2f 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 54 72 61 6e 73 66 6f 72 6d 20 74 65 78 74 /{..........//....Transform.text
f6c0 54 72 61 6e 73 66 6f 72 6d 20 3d 20 74 65 78 74 2e 74 72 61 6e 73 66 6f 72 6d 3b 0d 0a 0d 0a 20 Transform.=.text.transform;.....
f6e0 20 20 20 20 20 20 20 2f 2f 20 20 20 20 66 6c 6f 61 74 20 64 69 73 74 61 6e 63 65 53 71 72 20 3d .......//....float.distanceSqr.=
f700 20 4d 61 74 68 66 2e 49 6e 66 69 6e 69 74 79 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 .Mathf.Infinity;..........//....
f720 69 6e 74 20 63 6c 6f 73 65 73 74 20 3d 20 30 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 int.closest.=.0;............//..
f740 20 20 2f 2f 20 43 6f 6e 76 65 72 74 20 70 6f 73 69 74 69 6f 6e 20 69 6e 74 6f 20 57 6f 72 6c 64 ..//.Convert.position.into.World
f760 73 70 61 63 65 20 63 6f 6f 72 64 69 6e 61 74 65 73 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 space.coordinates..........//...
f780 20 53 63 72 65 65 6e 50 6f 69 6e 74 54 6f 57 6f 72 6c 64 50 6f 69 6e 74 49 6e 52 65 63 74 61 6e .ScreenPointToWorldPointInRectan
f7a0 67 6c 65 28 74 65 78 74 54 72 61 6e 73 66 6f 72 6d 2c 20 70 6f 73 69 74 69 6f 6e 2c 20 63 61 6d gle(textTransform,.position,.cam
f7c0 65 72 61 2c 20 6f 75 74 20 70 6f 73 69 74 69 6f 6e 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f era,.out.position);............/
f7e0 2f 20 20 20 20 66 6f 72 20 28 69 6e 74 20 69 20 3d 20 30 3b 20 69 20 3c 20 74 65 78 74 2e 74 65 /....for.(int.i.=.0;.i.<.text.te
f800 78 74 49 6e 66 6f 2e 77 6f 72 64 43 6f 75 6e 74 3b 20 69 2b 2b 29 0d 0a 20 20 20 20 20 20 20 20 xtInfo.wordCount;.i++)..........
f820 2f 2f 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 54 4d 50 5f 57 //....{..........//........TMP_W
f840 6f 72 64 49 6e 66 6f 20 77 49 6e 66 6f 20 3d 20 74 65 78 74 2e 74 65 78 74 49 6e 66 6f 2e 77 6f ordInfo.wInfo.=.text.textInfo.wo
f860 72 64 49 6e 66 6f 5b 69 5d 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 rdInfo[i];............//........
f880 62 6f 6f 6c 20 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 3d 20 66 61 6c 73 65 3b 0d 0a 0d 0a 20 bool.isBeginRegion.=.false;.....
f8a0 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 56 65 63 74 6f 72 33 20 62 6c 20 3d 20 56 65 .......//........Vector3.bl.=.Ve
f8c0 63 74 6f 72 33 2e 7a 65 72 6f 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 56 ctor3.zero;..........//........V
f8e0 65 63 74 6f 72 33 20 74 6c 20 3d 20 56 65 63 74 6f 72 33 2e 7a 65 72 6f 3b 0d 0a 20 20 20 20 20 ector3.tl.=.Vector3.zero;.......
f900 20 20 20 2f 2f 20 20 20 20 20 20 20 20 56 65 63 74 6f 72 33 20 62 72 20 3d 20 56 65 63 74 6f 72 ...//........Vector3.br.=.Vector
f920 33 2e 7a 65 72 6f 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 56 65 63 74 6f 3.zero;..........//........Vecto
f940 72 33 20 74 72 20 3d 20 56 65 63 74 6f 72 33 2e 7a 65 72 6f 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 r3.tr.=.Vector3.zero;...........
f960 20 2f 2f 20 20 20 20 20 20 20 20 2f 2f 20 49 74 65 72 61 74 65 20 74 68 72 6f 75 67 68 20 65 61 .//........//.Iterate.through.ea
f980 63 68 20 63 68 61 72 61 63 74 65 72 20 6f 66 20 74 68 65 20 77 6f 72 64 0d 0a 20 20 20 20 20 20 ch.character.of.the.word........
f9a0 20 20 2f 2f 20 20 20 20 20 20 20 20 66 6f 72 20 28 69 6e 74 20 6a 20 3d 20 30 3b 20 6a 20 3c 20 ..//........for.(int.j.=.0;.j.<.
f9c0 77 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 43 6f 75 6e 74 3b 20 6a 2b 2b 29 0d 0a 20 20 20 20 wInfo.characterCount;.j++)......
f9e0 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 ....//........{..........//.....
fa00 20 20 20 20 20 20 20 69 6e 74 20 63 68 61 72 61 63 74 65 72 49 6e 64 65 78 20 3d 20 77 49 6e 66 .......int.characterIndex.=.wInf
fa20 6f 2e 66 69 72 73 74 43 68 61 72 61 63 74 65 72 49 6e 64 65 78 20 2b 20 6a 3b 0d 0a 20 20 20 20 o.firstCharacterIndex.+.j;......
fa40 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 54 4d 50 5f 43 68 61 72 61 63 74 65 72 49 ....//............TMP_CharacterI
fa60 6e 66 6f 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 20 3d 20 74 65 78 74 2e 74 65 78 74 49 nfo.currentCharInfo.=.text.textI
fa80 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 49 6e 66 6f 5b 63 68 61 72 61 63 74 65 72 49 6e 64 65 78 nfo.characterInfo[characterIndex
faa0 5d 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 20 63 75 ];..........//............int.cu
fac0 72 72 65 6e 74 4c 69 6e 65 20 3d 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 6c 69 6e 65 rrentLine.=.currentCharInfo.line
fae0 4e 75 6d 62 65 72 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 Number;............//...........
fb00 20 62 6f 6f 6c 20 69 73 43 68 61 72 61 63 74 65 72 56 69 73 69 62 6c 65 20 3d 20 63 68 61 72 61 .bool.isCharacterVisible.=.chara
fb20 63 74 65 72 49 6e 64 65 78 20 3e 20 74 65 78 74 2e 6d 61 78 56 69 73 69 62 6c 65 43 68 61 72 61 cterIndex.>.text.maxVisibleChara
fb40 63 74 65 72 73 20 7c 7c 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 cters.||..........//............
fb60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 75 72 72 65 6e ..........................curren
fb80 74 43 68 61 72 49 6e 66 6f 2e 6c 69 6e 65 4e 75 6d 62 65 72 20 3e 20 74 65 78 74 2e 6d 61 78 56 tCharInfo.lineNumber.>.text.maxV
fba0 69 73 69 62 6c 65 4c 69 6e 65 73 20 7c 7c 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 isibleLines.||..........//......
fbc0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 28 ...............................(
fbe0 74 65 78 74 2e 4f 76 65 72 66 6c 6f 77 4d 6f 64 65 20 3d 3d 20 54 65 78 74 4f 76 65 72 66 6c 6f text.OverflowMode.==.TextOverflo
fc00 77 4d 6f 64 65 73 2e 50 61 67 65 20 26 26 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 70 wModes.Page.&&.currentCharInfo.p
fc20 61 67 65 4e 75 6d 62 65 72 20 2b 20 31 20 21 3d 20 74 65 78 74 2e 70 61 67 65 54 6f 44 69 73 70 ageNumber.+.1.!=.text.pageToDisp
fc40 6c 61 79 29 20 3f 20 66 61 6c 73 65 20 3a 20 74 72 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 lay).?.false.:.true;............
fc60 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 //............if.(isBeginRegion.
fc80 3d 3d 20 66 61 6c 73 65 20 26 26 20 69 73 43 68 61 72 61 63 74 65 72 56 69 73 69 62 6c 65 29 0d ==.false.&&.isCharacterVisible).
fca0 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 .........//............{........
fcc0 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 73 42 65 67 69 6e 52 65 67 69 6f ..//................isBeginRegio
fce0 6e 20 3d 20 74 72 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 n.=.true;............//.........
fd00 20 20 20 20 20 20 20 62 6c 20 3d 20 74 65 78 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 .......bl.=.textTransform.Transf
fd20 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 ormPoint(new.Vector3(currentChar
fd40 49 6e 66 6f 2e 62 6f 74 74 6f 6d 4c 65 66 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e Info.bottomLeft.x,.currentCharIn
fd60 66 6f 2e 64 65 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 fo.descender,.0));..........//..
fd80 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 6c 20 3d 20 74 65 78 74 54 72 61 6e 73 66 6f 72 6d ..............tl.=.textTransform
fda0 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 .TransformPoint(new.Vector3(curr
fdc0 65 6e 74 43 68 61 72 49 6e 66 6f 2e 62 6f 74 74 6f 6d 4c 65 66 74 2e 78 2c 20 63 75 72 72 65 6e entCharInfo.bottomLeft.x,.curren
fde0 74 43 68 61 72 49 6e 66 6f 2e 61 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 0d 0a 20 20 20 20 tCharInfo.ascender,.0));........
fe00 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 44 65 62 75 67 2e 4c 6f ....//................//Debug.Lo
fe20 67 28 22 53 74 61 72 74 20 57 6f 72 64 20 52 65 67 69 6f 6e 20 61 74 20 5b 22 20 2b 20 63 75 72 g("Start.Word.Region.at.[".+.cur
fe40 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 20 2b 20 22 5d 22 29 3b 0d 0a rentCharInfo.character.+."]");..
fe60 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 ..........//................//.I
fe80 66 20 57 6f 72 64 20 69 73 20 6f 6e 65 20 63 68 61 72 61 63 74 65 72 0d 0a 20 20 20 20 20 20 20 f.Word.is.one.character.........
fea0 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 77 49 6e 66 6f 2e 63 68 61 .//................if.(wInfo.cha
fec0 72 61 63 74 65 72 43 6f 75 6e 74 20 3d 3d 20 31 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 racterCount.==.1)..........//...
fee0 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 .............{..........//......
ff00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 3d 20 66 61 ..............isBeginRegion.=.fa
ff20 6c 73 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 lse;............//..............
ff40 20 20 20 20 20 20 62 72 20 3d 20 74 65 78 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f ......br.=.textTransform.Transfo
ff60 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 49 rmPoint(new.Vector3(currentCharI
ff80 6e 66 6f 2e 74 6f 70 52 69 67 68 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e nfo.topRight.x,.currentCharInfo.
ffa0 64 65 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 descender,.0));..........//.....
ffc0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 72 20 3d 20 74 65 78 74 54 72 61 6e 73 66 6f 72 ...............tr.=.textTransfor
ffe0 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 m.TransformPoint(new.Vector3(cur
10000 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 2e 78 2c 20 63 75 72 72 65 6e 74 rentCharInfo.topRight.x,.current
10020 43 68 61 72 49 6e 66 6f 2e 61 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 CharInfo.ascender,.0));.........
10040 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 68 65 63 ...//....................//.Chec
10060 6b 20 66 6f 72 20 49 6e 74 65 72 73 65 63 74 69 6f 6e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 k.for.Intersection..........//..
10080 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 50 6f 69 6e 74 49 6e 74 65 72 ..................if.(PointInter
100a0 73 65 63 74 52 65 63 74 61 6e 67 6c 65 28 70 6f 73 69 74 69 6f 6e 2c 20 62 6c 2c 20 74 6c 2c 20 sectRectangle(position,.bl,.tl,.
100c0 74 72 2c 20 62 72 29 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 tr,.br))..........//............
100e0 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 69 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 ............return.i;...........
10100 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 44 65 62 75 67 2e 4c .//....................//Debug.L
10120 6f 67 28 22 45 6e 64 20 57 6f 72 64 20 52 65 67 69 6f 6e 20 61 74 20 5b 22 20 2b 20 63 75 72 72 og("End.Word.Region.at.[".+.curr
10140 65 6e 74 43 68 61 72 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 20 2b 20 22 5d 22 29 3b 0d 0a 20 entCharInfo.character.+."]");...
10160 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 .......//................}......
10180 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f ....//............}............/
101a0 2f 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4c 61 73 74 20 43 68 61 72 61 63 74 65 72 20 6f /............//.Last.Character.o
101c0 66 20 57 6f 72 64 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 69 66 f.Word..........//............if
101e0 20 28 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 26 26 20 6a 20 3d 3d 20 77 49 6e 66 6f 2e 63 68 .(isBeginRegion.&&.j.==.wInfo.ch
10200 61 72 61 63 74 65 72 43 6f 75 6e 74 20 2d 20 31 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 aracterCount.-.1)..........//...
10220 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 .........{..........//..........
10240 20 20 20 20 20 20 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 3d 20 66 61 6c 73 65 3b 0d 0a 0d 0a ......isBeginRegion.=.false;....
10260 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 72 20 3d 20 74 ........//................br.=.t
10280 65 78 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 extTransform.TransformPoint(new.
102a0 56 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 Vector3(currentCharInfo.topRight
102c0 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 64 65 73 63 65 6e 64 65 72 2c 20 30 .x,.currentCharInfo.descender,.0
102e0 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 ));..........//................t
10300 72 20 3d 20 74 65 78 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 r.=.textTransform.TransformPoint
10320 28 6e 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 74 6f 70 (new.Vector3(currentCharInfo.top
10340 52 69 67 68 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 61 73 63 65 6e 64 65 Right.x,.currentCharInfo.ascende
10360 72 2c 20 30 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 r,.0));............//...........
10380 20 20 20 20 20 2f 2f 20 43 68 65 63 6b 20 66 6f 72 20 49 6e 74 65 72 73 65 63 74 69 6f 6e 0d 0a .....//.Check.for.Intersection..
103a0 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 50 6f ........//................if.(Po
103c0 69 6e 74 49 6e 74 65 72 73 65 63 74 52 65 63 74 61 6e 67 6c 65 28 70 6f 73 69 74 69 6f 6e 2c 20 intIntersectRectangle(position,.
103e0 62 6c 2c 20 74 6c 2c 20 74 72 2c 20 62 72 29 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 bl,.tl,.tr,.br))..........//....
10400 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 69 3b 0d 0a 0d 0a 20 20 20 ................return.i;.......
10420 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 44 65 62 75 67 2e 4c .....//................//Debug.L
10440 6f 67 28 22 45 6e 64 20 57 6f 72 64 20 52 65 67 69 6f 6e 20 61 74 20 5b 22 20 2b 20 63 75 72 72 og("End.Word.Region.at.[".+.curr
10460 65 6e 74 43 68 61 72 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 20 2b 20 22 5d 22 29 3b 0d 0a 20 entCharInfo.character.+."]");...
10480 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 .......//............}..........
104a0 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 66 20 57 6f 72 64 20 69 73 20 73 70 6c 69 //............//.If.Word.is.spli
104c0 74 20 6f 6e 20 6d 6f 72 65 20 74 68 61 6e 20 6f 6e 65 20 6c 69 6e 65 2e 0d 0a 20 20 20 20 20 20 t.on.more.than.one.line.........
104e0 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 20 69 66 20 28 69 73 42 65 67 69 6e ..//............else.if.(isBegin
10500 52 65 67 69 6f 6e 20 26 26 20 63 75 72 72 65 6e 74 4c 69 6e 65 20 21 3d 20 74 65 78 74 2e 74 65 Region.&&.currentLine.!=.text.te
10520 78 74 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 49 6e 66 6f 5b 63 68 61 72 61 63 74 65 72 49 6e xtInfo.characterInfo[characterIn
10540 64 65 78 20 2b 20 31 5d 2e 6c 69 6e 65 4e 75 6d 62 65 72 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f dex.+.1].lineNumber)..........//
10560 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 ............{..........//.......
10580 20 20 20 20 20 20 20 20 20 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 3d 20 66 61 6c 73 65 3b 0d .........isBeginRegion.=.false;.
105a0 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 72 20 ...........//................br.
105c0 3d 20 74 65 78 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e =.textTransform.TransformPoint(n
105e0 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 74 6f 70 52 69 ew.Vector3(currentCharInfo.topRi
10600 67 68 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 64 65 73 63 65 6e 64 65 72 ght.x,.currentCharInfo.descender
10620 2c 20 30 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ,.0));..........//..............
10640 20 20 74 72 20 3d 20 74 65 78 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f ..tr.=.textTransform.TransformPo
10660 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e int(new.Vector3(currentCharInfo.
10680 74 6f 70 52 69 67 68 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 61 73 63 65 topRight.x,.currentCharInfo.asce
106a0 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 nder,.0));............//........
106c0 20 20 20 20 20 20 20 20 2f 2f 20 43 68 65 63 6b 20 66 6f 72 20 49 6e 74 65 72 73 65 63 74 69 6f ........//.Check.for.Intersectio
106e0 6e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 n..........//................if.
10700 28 50 6f 69 6e 74 49 6e 74 65 72 73 65 63 74 52 65 63 74 61 6e 67 6c 65 28 70 6f 73 69 74 69 6f (PointIntersectRectangle(positio
10720 6e 2c 20 62 6c 2c 20 74 6c 2c 20 74 72 2c 20 62 72 29 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 n,.bl,.tl,.tr,.br))..........//.
10740 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 69 3b 0d 0a 0d 0a ...................return.i;....
10760 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 44 65 62 75 ........//................//Debu
10780 67 2e 4c 6f 67 28 22 45 6e 64 20 57 6f 72 64 20 52 65 67 69 6f 6e 20 61 74 20 5b 22 20 2b 20 63 g.Log("End.Word.Region.at.[".+.c
107a0 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 20 2b 20 22 5d 22 29 3b urrentCharInfo.character.+."]");
107c0 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 ..........//............}.......
107e0 20 20 20 2f 2f 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 ...//........}............//....
10800 20 20 20 20 20 2f 2f 20 46 69 6e 64 20 74 68 65 20 63 6c 6f 73 65 73 74 20 6c 69 6e 65 20 73 65 .....//.Find.the.closest.line.se
10820 67 6d 65 6e 74 20 74 6f 20 70 6f 73 69 74 69 6f 6e 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 gment.to.position...........//..
10840 20 20 20 20 20 20 66 6c 6f 61 74 20 64 62 6c 20 3d 20 44 69 73 74 61 6e 63 65 54 6f 4c 69 6e 65 ......float.dbl.=.DistanceToLine
10860 28 62 6c 2c 20 74 6c 2c 20 70 6f 73 69 74 69 6f 6e 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 (bl,.tl,.position);..........//.
10880 20 20 20 20 20 20 20 66 6c 6f 61 74 20 64 74 6c 20 3d 20 44 69 73 74 61 6e 63 65 54 6f 4c 69 6e .......float.dtl.=.DistanceToLin
108a0 65 28 74 6c 2c 20 74 72 2c 20 70 6f 73 69 74 69 6f 6e 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f e(tl,.tr,.position);..........//
108c0 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 64 74 72 20 3d 20 44 69 73 74 61 6e 63 65 54 6f 4c 69 ........float.dtr.=.DistanceToLi
108e0 6e 65 28 74 72 2c 20 62 72 2c 20 70 6f 73 69 74 69 6f 6e 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f ne(tr,.br,.position);........../
10900 2f 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 64 62 72 20 3d 20 44 69 73 74 61 6e 63 65 54 6f 4c /........float.dbr.=.DistanceToL
10920 69 6e 65 28 62 72 2c 20 62 6c 2c 20 70 6f 73 69 74 69 6f 6e 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 ine(br,.bl,.position);..........
10940 20 20 2f 2f 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 64 20 3d 20 64 62 6c 20 3c 20 64 74 6c 20 ..//........float.d.=.dbl.<.dtl.
10960 3f 20 64 62 6c 20 3a 20 64 74 6c 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 ?.dbl.:.dtl;..........//........
10980 64 20 3d 20 64 20 3c 20 64 74 72 20 3f 20 64 20 3a 20 64 74 72 3b 0d 0a 20 20 20 20 20 20 20 20 d.=.d.<.dtr.?.d.:.dtr;..........
109a0 2f 2f 20 20 20 20 20 20 20 20 64 20 3d 20 64 20 3c 20 64 62 72 20 3f 20 64 20 3a 20 64 62 72 3b //........d.=.d.<.dbr.?.d.:.dbr;
109c0 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 69 66 20 28 64 69 73 74 61 6e ............//........if.(distan
109e0 63 65 53 71 72 20 3e 20 64 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 7b 0d ceSqr.>.d)..........//........{.
10a00 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 64 69 73 74 61 6e 63 65 53 .........//............distanceS
10a20 71 72 20 3d 20 64 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 63 qr.=.d;..........//............c
10a40 6c 6f 73 65 73 74 20 3d 20 69 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 7d losest.=.i;..........//........}
10a60 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 2f 2f 44 65 62 75 67 2e 4c 6f 67 28 ..........//........//Debug.Log(
10a80 22 57 6f 72 64 20 61 74 20 49 6e 64 65 78 3a 20 22 20 2b 20 69 20 2b 20 22 20 69 73 20 6c 6f 63 "Word.at.Index:.".+.i.+.".is.loc
10aa0 61 74 65 64 20 61 74 20 28 22 20 2b 20 62 6c 20 2b 20 22 2c 20 22 20 2b 20 74 6c 20 2b 20 22 2c ated.at.(".+.bl.+.",.".+.tl.+.",
10ac0 20 22 20 2b 20 74 72 20 2b 20 22 2c 20 22 20 2b 20 62 72 20 2b 20 22 29 2e 22 29 3b 0d 0a 0d 0a .".+.tr.+.",.".+.br.+.").");....
10ae0 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 ........//....}............//...
10b00 20 72 65 74 75 72 6e 20 63 6c 6f 73 65 73 74 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 7d 0d .return.closest;............//}.
10b20 0a 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 .............///.<summary>......
10b40 20 20 20 20 2f 2f 2f 20 46 75 6e 63 74 69 6f 6e 20 72 65 74 75 72 6e 69 6e 67 20 74 68 65 20 6c ....///.Function.returning.the.l
10b60 69 6e 65 20 69 6e 74 65 72 73 65 63 74 69 6e 67 20 74 68 65 20 70 6f 73 69 74 69 6f 6e 2e 0d 0a ine.intersecting.the.position...
10b80 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 ........///.</summary>..........
10ba0 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 74 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 22 3e ///.<param.name="textComponent">
10bc0 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d </param>..........///.<param.nam
10be0 65 3d 22 70 6f 73 69 74 69 6f 6e 22 3e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f e="position"></param>........../
10c00 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 63 61 6d 65 72 61 22 3e 3c 2f 70 61 72 61 6d 3e //.<param.name="camera"></param>
10c20 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 3c 2f 72 65 74 75 72 6e 73 ..........///.<returns></returns
10c40 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 69 6e 74 20 46 69 6e >..........public.static.int.Fin
10c60 64 49 6e 74 65 72 73 65 63 74 69 6e 67 4c 69 6e 65 28 54 4d 50 5f 54 65 78 74 20 74 65 78 74 2c dIntersectingLine(TMP_Text.text,
10c80 20 56 65 63 74 6f 72 33 20 70 6f 73 69 74 69 6f 6e 2c 20 43 61 6d 65 72 61 20 63 61 6d 65 72 61 .Vector3.position,.Camera.camera
10ca0 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 52 65 63 74 54 72 )..........{..............RectTr
10cc0 61 6e 73 66 6f 72 6d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 20 3d 20 74 65 78 74 2e 72 65 63 ansform.rectTransform.=.text.rec
10ce0 74 54 72 61 6e 73 66 6f 72 6d 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 20 63 tTransform;................int.c
10d00 6c 6f 73 65 73 74 20 3d 20 2d 31 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 losest.=.-1;................//.C
10d20 6f 6e 76 65 72 74 20 70 6f 73 69 74 69 6f 6e 20 69 6e 74 6f 20 57 6f 72 6c 64 73 70 61 63 65 20 onvert.position.into.Worldspace.
10d40 63 6f 6f 72 64 69 6e 61 74 65 73 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 53 63 72 65 65 6e 50 coordinates..............ScreenP
10d60 6f 69 6e 74 54 6f 57 6f 72 6c 64 50 6f 69 6e 74 49 6e 52 65 63 74 61 6e 67 6c 65 28 72 65 63 74 ointToWorldPointInRectangle(rect
10d80 54 72 61 6e 73 66 6f 72 6d 2c 20 70 6f 73 69 74 69 6f 6e 2c 20 63 61 6d 65 72 61 2c 20 6f 75 74 Transform,.position,.camera,.out
10da0 20 70 6f 73 69 74 69 6f 6e 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 20 28 .position);................for.(
10dc0 69 6e 74 20 69 20 3d 20 30 3b 20 69 20 3c 20 74 65 78 74 2e 74 65 78 74 49 6e 66 6f 2e 6c 69 6e int.i.=.0;.i.<.text.textInfo.lin
10de0 65 43 6f 75 6e 74 3b 20 69 2b 2b 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 eCount;.i++)..............{.....
10e00 20 20 20 20 20 20 20 20 20 20 20 20 20 54 4d 50 5f 4c 69 6e 65 49 6e 66 6f 20 6c 69 6e 65 49 6e .............TMP_LineInfo.lineIn
10e20 66 6f 20 3d 20 74 65 78 74 2e 74 65 78 74 49 6e 66 6f 2e 6c 69 6e 65 49 6e 66 6f 5b 69 5d 3b 0d fo.=.text.textInfo.lineInfo[i];.
10e40 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 61 73 63 65 6e 64 65 ...................float.ascende
10e60 72 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 r.=.rectTransform.TransformPoint
10e80 28 6e 65 77 20 56 65 63 74 6f 72 33 28 30 2c 20 6c 69 6e 65 49 6e 66 6f 2e 61 73 63 65 6e 64 65 (new.Vector3(0,.lineInfo.ascende
10ea0 72 2c 20 30 29 29 2e 79 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 6c 6f 61 74 r,.0)).y;..................float
10ec0 20 64 65 73 63 65 6e 64 65 72 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 .descender.=.rectTransform.Trans
10ee0 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 30 2c 20 6c 69 6e 65 49 6e 66 formPoint(new.Vector3(0,.lineInf
10f00 6f 2e 64 65 73 63 65 6e 64 65 72 2c 20 30 29 29 2e 79 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 o.descender,.0)).y;.............
10f20 20 20 20 20 20 20 20 69 66 20 28 61 73 63 65 6e 64 65 72 20 3e 20 70 6f 73 69 74 69 6f 6e 2e 79 .......if.(ascender.>.position.y
10f40 20 26 26 20 64 65 73 63 65 6e 64 65 72 20 3c 20 70 6f 73 69 74 69 6f 6e 2e 79 29 0d 0a 20 20 20 .&&.descender.<.position.y).....
10f60 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .............{..................
10f80 20 20 20 20 2f 2f 44 65 62 75 67 2e 4c 6f 67 28 22 50 6f 73 69 74 69 6f 6e 20 69 73 20 6f 6e 20 ....//Debug.Log("Position.is.on.
10fa0 6c 69 6e 65 20 22 20 2b 20 69 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 line.".+.i);....................
10fc0 20 20 72 65 74 75 72 6e 20 69 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a ..return.i;..................}..
10fe0 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 44 ............}................//D
11000 65 62 75 67 2e 4c 6f 67 28 22 43 6c 6f 73 65 73 74 20 6c 69 6e 65 20 74 6f 20 70 6f 73 69 74 69 ebug.Log("Closest.line.to.positi
11020 6f 6e 20 69 73 20 22 20 2b 20 63 6c 6f 73 65 73 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 on.is.".+.closest);.............
11040 20 72 65 74 75 72 6e 20 63 6c 6f 73 65 73 74 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 0d .return.closest;..........}.....
11060 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 .........///.<summary>..........
11080 2f 2f 2f 20 46 75 6e 63 74 69 6f 6e 20 72 65 74 75 72 6e 69 6e 67 20 74 68 65 20 69 6e 64 65 78 ///.Function.returning.the.index
110a0 20 6f 66 20 74 68 65 20 4c 69 6e 6b 20 61 74 20 74 68 65 20 67 69 76 65 6e 20 70 6f 73 69 74 69 .of.the.Link.at.the.given.positi
110c0 6f 6e 20 28 69 66 20 61 6e 79 29 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d on.(if.any)...........///.</summ
110e0 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 74 ary>..........///.<param.name="t
11100 65 78 74 22 3e 41 20 72 65 66 65 72 65 6e 63 65 20 74 6f 20 74 68 65 20 54 4d 50 5f 54 65 78 74 ext">A.reference.to.the.TMP_Text
11120 20 63 6f 6d 70 6f 6e 65 6e 74 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f .component.</param>..........///
11140 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 70 6f 73 69 74 69 6f 6e 22 3e 50 6f 73 69 74 69 6f 6e .<param.name="position">Position
11160 20 74 6f 20 63 68 65 63 6b 20 66 6f 72 20 69 6e 74 65 72 73 65 63 74 69 6f 6e 2e 3c 2f 70 61 72 .to.check.for.intersection.</par
11180 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 63 61 am>..........///.<param.name="ca
111a0 6d 65 72 61 22 3e 54 68 65 20 73 63 65 6e 65 20 63 61 6d 65 72 61 20 77 68 69 63 68 20 6d 61 79 mera">The.scene.camera.which.may
111c0 20 62 65 20 61 73 73 69 67 6e 65 64 20 74 6f 20 61 20 43 61 6e 76 61 73 20 75 73 69 6e 67 20 53 .be.assigned.to.a.Canvas.using.S
111e0 63 72 65 65 6e 53 70 61 63 65 20 43 61 6d 65 72 61 20 6f 72 20 57 6f 72 6c 64 53 70 61 63 65 20 creenSpace.Camera.or.WorldSpace.
11200 72 65 6e 64 65 72 20 6d 6f 64 65 2e 20 53 65 74 20 74 6f 20 6e 75 6c 6c 20 69 73 20 75 73 69 6e render.mode..Set.to.null.is.usin
11220 67 20 53 63 72 65 65 6e 53 70 61 63 65 20 4f 76 65 72 6c 61 79 2e 3c 2f 70 61 72 61 6d 3e 0d 0a g.ScreenSpace.Overlay.</param>..
11240 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 3c 2f 72 65 74 75 72 6e 73 3e 0d ........///.<returns></returns>.
11260 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 69 6e 74 20 46 69 6e 64 49 .........public.static.int.FindI
11280 6e 74 65 72 73 65 63 74 69 6e 67 4c 69 6e 6b 28 54 4d 50 5f 54 65 78 74 20 74 65 78 74 2c 20 56 ntersectingLink(TMP_Text.text,.V
112a0 65 63 74 6f 72 33 20 70 6f 73 69 74 69 6f 6e 2c 20 43 61 6d 65 72 61 20 63 61 6d 65 72 61 29 0d ector3.position,.Camera.camera).
112c0 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 54 72 61 6e 73 66 6f 72 .........{..............Transfor
112e0 6d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 20 3d 20 74 65 78 74 2e 74 72 61 6e 73 66 6f 72 6d m.rectTransform.=.text.transform
11300 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 6f 6e 76 65 72 74 20 70 6f 73 69 ;................//.Convert.posi
11320 74 69 6f 6e 20 69 6e 74 6f 20 57 6f 72 6c 64 73 70 61 63 65 20 63 6f 6f 72 64 69 6e 61 74 65 73 tion.into.Worldspace.coordinates
11340 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 53 63 72 65 65 6e 50 6f 69 6e 74 54 6f 57 6f 72 6c 64 ..............ScreenPointToWorld
11360 50 6f 69 6e 74 49 6e 52 65 63 74 61 6e 67 6c 65 28 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2c 20 PointInRectangle(rectTransform,.
11380 70 6f 73 69 74 69 6f 6e 2c 20 63 61 6d 65 72 61 2c 20 6f 75 74 20 70 6f 73 69 74 69 6f 6e 29 3b position,.camera,.out.position);
113a0 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 20 28 69 6e 74 20 69 20 3d 20 30 3b 20 ................for.(int.i.=.0;.
113c0 69 20 3c 20 74 65 78 74 2e 74 65 78 74 49 6e 66 6f 2e 6c 69 6e 6b 43 6f 75 6e 74 3b 20 69 2b 2b i.<.text.textInfo.linkCount;.i++
113e0 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 )..............{................
11400 20 20 54 4d 50 5f 4c 69 6e 6b 49 6e 66 6f 20 6c 69 6e 6b 49 6e 66 6f 20 3d 20 74 65 78 74 2e 74 ..TMP_LinkInfo.linkInfo.=.text.t
11420 65 78 74 49 6e 66 6f 2e 6c 69 6e 6b 49 6e 66 6f 5b 69 5d 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 extInfo.linkInfo[i];............
11440 20 20 20 20 20 20 20 20 62 6f 6f 6c 20 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 3d 20 66 61 6c ........bool.isBeginRegion.=.fal
11460 73 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 56 65 63 74 6f 72 33 20 62 se;....................Vector3.b
11480 6c 20 3d 20 56 65 63 74 6f 72 33 2e 7a 65 72 6f 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 l.=.Vector3.zero;...............
114a0 20 20 20 56 65 63 74 6f 72 33 20 74 6c 20 3d 20 56 65 63 74 6f 72 33 2e 7a 65 72 6f 3b 0d 0a 20 ...Vector3.tl.=.Vector3.zero;...
114c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 56 65 63 74 6f 72 33 20 62 72 20 3d 20 56 65 63 74 ...............Vector3.br.=.Vect
114e0 6f 72 33 2e 7a 65 72 6f 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 56 65 63 74 6f or3.zero;..................Vecto
11500 72 33 20 74 72 20 3d 20 56 65 63 74 6f 72 33 2e 7a 65 72 6f 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 r3.tr.=.Vector3.zero;...........
11520 20 20 20 20 20 20 20 20 20 2f 2f 20 49 74 65 72 61 74 65 20 74 68 72 6f 75 67 68 20 65 61 63 68 .........//.Iterate.through.each
11540 20 63 68 61 72 61 63 74 65 72 20 6f 66 20 74 68 65 20 77 6f 72 64 0d 0a 20 20 20 20 20 20 20 20 .character.of.the.word..........
11560 20 20 20 20 20 20 20 20 66 6f 72 20 28 69 6e 74 20 6a 20 3d 20 30 3b 20 6a 20 3c 20 6c 69 6e 6b ........for.(int.j.=.0;.j.<.link
11580 49 6e 66 6f 2e 6c 69 6e 6b 54 65 78 74 4c 65 6e 67 74 68 3b 20 6a 2b 2b 29 0d 0a 20 20 20 20 20 Info.linkTextLength;.j++).......
115a0 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ...........{....................
115c0 20 20 69 6e 74 20 63 68 61 72 61 63 74 65 72 49 6e 64 65 78 20 3d 20 6c 69 6e 6b 49 6e 66 6f 2e ..int.characterIndex.=.linkInfo.
115e0 6c 69 6e 6b 54 65 78 74 66 69 72 73 74 43 68 61 72 61 63 74 65 72 49 6e 64 65 78 20 2b 20 6a 3b linkTextfirstCharacterIndex.+.j;
11600 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 54 4d 50 5f 43 68 61 72 61 63 ......................TMP_Charac
11620 74 65 72 49 6e 66 6f 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 20 3d 20 74 65 78 74 2e 74 terInfo.currentCharInfo.=.text.t
11640 65 78 74 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 49 6e 66 6f 5b 63 68 61 72 61 63 74 65 72 49 extInfo.characterInfo[characterI
11660 6e 64 65 78 5d 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 20 ndex];......................int.
11680 63 75 72 72 65 6e 74 4c 69 6e 65 20 3d 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 6c 69 currentLine.=.currentCharInfo.li
116a0 6e 65 4e 75 6d 62 65 72 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 neNumber;.......................
116c0 20 2f 2f 20 43 68 65 63 6b 20 69 66 20 4c 69 6e 6b 20 63 68 61 72 61 63 74 65 72 73 20 61 72 65 .//.Check.if.Link.characters.are
116e0 20 6f 6e 20 74 68 65 20 63 75 72 72 65 6e 74 20 70 61 67 65 0d 0a 20 20 20 20 20 20 20 20 20 20 .on.the.current.page............
11700 20 20 20 20 20 20 20 20 20 20 69 66 20 28 74 65 78 74 2e 6f 76 65 72 66 6c 6f 77 4d 6f 64 65 20 ..........if.(text.overflowMode.
11720 3d 3d 20 54 65 78 74 4f 76 65 72 66 6c 6f 77 4d 6f 64 65 73 2e 50 61 67 65 20 26 26 20 63 75 72 ==.TextOverflowModes.Page.&&.cur
11740 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 70 61 67 65 4e 75 6d 62 65 72 20 2b 20 31 20 21 3d 20 74 rentCharInfo.pageNumber.+.1.!=.t
11760 65 78 74 2e 70 61 67 65 54 6f 44 69 73 70 6c 61 79 29 20 63 6f 6e 74 69 6e 75 65 3b 0d 0a 0d 0a ext.pageToDisplay).continue;....
11780 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 69 73 42 65 67 69 6e 52 ....................if.(isBeginR
117a0 65 67 69 6f 6e 20 3d 3d 20 66 61 6c 73 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 egion.==.false).................
117c0 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .....{..........................
117e0 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 3d 20 74 72 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 isBeginRegion.=.true;...........
11800 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 6c 20 3d 20 72 65 63 74 54 72 61 6e 73 66 .................bl.=.rectTransf
11820 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 63 orm.TransformPoint(new.Vector3(c
11840 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 62 6f 74 74 6f 6d 4c 65 66 74 2e 78 2c 20 63 75 72 urrentCharInfo.bottomLeft.x,.cur
11860 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 64 65 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 20 20 rentCharInfo.descender,.0));....
11880 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 6c 20 3d 20 72 65 63 74 54 ......................tl.=.rectT
118a0 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 ransform.TransformPoint(new.Vect
118c0 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 62 6f 74 74 6f 6d 4c 65 66 74 2e 78 or3(currentCharInfo.bottomLeft.x
118e0 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 61 73 63 65 6e 64 65 72 2c 20 30 29 29 3b ,.currentCharInfo.ascender,.0));
11900 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 44 65 ............................//De
11920 62 75 67 2e 4c 6f 67 28 22 53 74 61 72 74 20 57 6f 72 64 20 52 65 67 69 6f 6e 20 61 74 20 5b 22 bug.Log("Start.Word.Region.at.["
11940 20 2b 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 20 2b 20 22 .+.currentCharInfo.character.+."
11960 5d 22 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ]");............................
11980 2f 2f 20 49 66 20 57 6f 72 64 20 69 73 20 6f 6e 65 20 63 68 61 72 61 63 74 65 72 0d 0a 20 20 20 //.If.Word.is.one.character.....
119a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6c 69 6e 6b 49 6e 66 .....................if.(linkInf
119c0 6f 2e 6c 69 6e 6b 54 65 78 74 4c 65 6e 67 74 68 20 3d 3d 20 31 29 0d 0a 20 20 20 20 20 20 20 20 o.linkTextLength.==.1)..........
119e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 ................{...............
11a00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 3d 20 66 ...............isBeginRegion.=.f
11a20 61 6c 73 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 alse;...........................
11a40 20 20 20 20 20 62 72 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 .....br.=.rectTransform.Transfor
11a60 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 49 6e mPoint(new.Vector3(currentCharIn
11a80 66 6f 2e 74 6f 70 52 69 67 68 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 64 fo.topRight.x,.currentCharInfo.d
11aa0 65 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 escender,.0));..................
11ac0 20 20 20 20 20 20 20 20 20 20 20 20 74 72 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 ............tr.=.rectTransform.T
11ae0 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 65 6e ransformPoint(new.Vector3(curren
11b00 74 43 68 61 72 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 tCharInfo.topRight.x,.currentCha
11b20 72 49 6e 66 6f 2e 61 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 rInfo.ascender,.0));............
11b40 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 68 65 63 6b 20 66 6f 72 ....................//.Check.for
11b60 20 49 6e 74 65 72 73 65 63 74 69 6f 6e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .Intersection...................
11b80 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 50 6f 69 6e 74 49 6e 74 65 72 73 65 63 74 52 65 63 ...........if.(PointIntersectRec
11ba0 74 61 6e 67 6c 65 28 70 6f 73 69 74 69 6f 6e 2c 20 62 6c 2c 20 74 6c 2c 20 74 72 2c 20 62 72 29 tangle(position,.bl,.tl,.tr,.br)
11bc0 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 )...............................
11be0 20 20 20 72 65 74 75 72 6e 20 69 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ...return.i;....................
11c00 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 44 65 62 75 67 2e 4c 6f 67 28 22 45 6e 64 20 57 6f 72 ............//Debug.Log("End.Wor
11c20 64 20 52 65 67 69 6f 6e 20 61 74 20 5b 22 20 2b 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f d.Region.at.[".+.currentCharInfo
11c40 2e 63 68 61 72 61 63 74 65 72 20 2b 20 22 5d 22 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 .character.+."]");..............
11c60 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ............}...................
11c80 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4c ...}........................//.L
11ca0 61 73 74 20 43 68 61 72 61 63 74 65 72 20 6f 66 20 57 6f 72 64 0d 0a 20 20 20 20 20 20 20 20 20 ast.Character.of.Word...........
11cc0 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 26 26 20 ...........if.(isBeginRegion.&&.
11ce0 6a 20 3d 3d 20 6c 69 6e 6b 49 6e 66 6f 2e 6c 69 6e 6b 54 65 78 74 4c 65 6e 67 74 68 20 2d 20 31 j.==.linkInfo.linkTextLength.-.1
11d00 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 )......................{........
11d20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 ..................isBeginRegion.
11d40 3d 20 66 61 6c 73 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 =.false;........................
11d60 20 20 20 20 62 72 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d ....br.=.rectTransform.Transform
11d80 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 Point(new.Vector3(currentCharInf
11da0 6f 2e 74 6f 70 52 69 67 68 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 64 65 o.topRight.x,.currentCharInfo.de
11dc0 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 scender,.0));...................
11de0 20 20 20 20 20 20 20 74 72 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 .......tr.=.rectTransform.Transf
11e00 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 ormPoint(new.Vector3(currentChar
11e20 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f Info.topRight.x,.currentCharInfo
11e40 2e 61 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 .ascender,.0));.................
11e60 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 68 65 63 6b 20 66 6f 72 20 49 6e 74 65 72 73 65 63 ...........//.Check.for.Intersec
11e80 74 69 6f 6e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 tion..........................if
11ea0 20 28 50 6f 69 6e 74 49 6e 74 65 72 73 65 63 74 52 65 63 74 61 6e 67 6c 65 28 70 6f 73 69 74 69 .(PointIntersectRectangle(positi
11ec0 6f 6e 2c 20 62 6c 2c 20 74 6c 2c 20 74 72 2c 20 62 72 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 on,.bl,.tl,.tr,.br))............
11ee0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 69 3b 0d 0a 0d 0a 20 ..................return.i;.....
11f00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 44 65 62 75 67 2e 4c .......................//Debug.L
11f20 6f 67 28 22 45 6e 64 20 57 6f 72 64 20 52 65 67 69 6f 6e 20 61 74 20 5b 22 20 2b 20 63 75 72 72 og("End.Word.Region.at.[".+.curr
11f40 65 6e 74 43 68 61 72 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 20 2b 20 22 5d 22 29 3b 0d 0a 20 entCharInfo.character.+."]");...
11f60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 ...................}............
11f80 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 66 20 57 6f 72 64 20 69 73 20 73 70 6c 69 74 20 6f 6e ..........//.If.Word.is.split.on
11fa0 20 6d 6f 72 65 20 74 68 61 6e 20 6f 6e 65 20 6c 69 6e 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 .more.than.one.line.............
11fc0 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 20 69 66 20 28 69 73 42 65 67 69 6e 52 65 67 69 6f 6e ..........else.if.(isBeginRegion
11fe0 20 26 26 20 63 75 72 72 65 6e 74 4c 69 6e 65 20 21 3d 20 74 65 78 74 2e 74 65 78 74 49 6e 66 6f .&&.currentLine.!=.text.textInfo
12000 2e 63 68 61 72 61 63 74 65 72 49 6e 66 6f 5b 63 68 61 72 61 63 74 65 72 49 6e 64 65 78 20 2b 20 .characterInfo[characterIndex.+.
12020 31 5d 2e 6c 69 6e 65 4e 75 6d 62 65 72 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 1].lineNumber)..................
12040 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 ....{..........................i
12060 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 3d 20 66 61 6c 73 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 sBeginRegion.=.false;...........
12080 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 72 20 3d 20 72 65 63 74 54 72 61 6e 73 66 .................br.=.rectTransf
120a0 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 63 orm.TransformPoint(new.Vector3(c
120c0 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 2e 78 2c 20 63 75 72 72 65 urrentCharInfo.topRight.x,.curre
120e0 6e 74 43 68 61 72 49 6e 66 6f 2e 64 65 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 20 20 20 20 ntCharInfo.descender,.0));......
12100 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 72 20 3d 20 72 65 63 74 54 72 61 ....................tr.=.rectTra
12120 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 nsform.TransformPoint(new.Vector
12140 33 28 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 2e 78 2c 20 63 75 3(currentCharInfo.topRight.x,.cu
12160 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 61 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 0d 0a rrentCharInfo.ascender,.0));....
12180 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 68 65 63 6b ........................//.Check
121a0 20 66 6f 72 20 49 6e 74 65 72 73 65 63 74 69 6f 6e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 .for.Intersection...............
121c0 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 50 6f 69 6e 74 49 6e 74 65 72 73 65 63 74 52 65 63 ...........if.(PointIntersectRec
121e0 74 61 6e 67 6c 65 28 70 6f 73 69 74 69 6f 6e 2c 20 62 6c 2c 20 74 6c 2c 20 74 72 2c 20 62 72 29 tangle(position,.bl,.tl,.tr,.br)
12200 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 )..............................r
12220 65 74 75 72 6e 20 69 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 eturn.i;........................
12240 20 20 20 20 2f 2f 44 65 62 75 67 2e 4c 6f 67 28 22 45 6e 64 20 57 6f 72 64 20 52 65 67 69 6f 6e ....//Debug.Log("End.Word.Region
12260 20 61 74 20 5b 22 20 2b 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 63 68 61 72 61 63 74 .at.[".+.currentCharInfo.charact
12280 65 72 20 2b 20 22 5d 22 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 er.+."]");......................
122a0 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 }..................}............
122c0 20 20 20 20 20 20 20 20 2f 2f 44 65 62 75 67 2e 4c 6f 67 28 22 57 6f 72 64 20 61 74 20 49 6e 64 ........//Debug.Log("Word.at.Ind
122e0 65 78 3a 20 22 20 2b 20 69 20 2b 20 22 20 69 73 20 6c 6f 63 61 74 65 64 20 61 74 20 28 22 20 2b ex:.".+.i.+.".is.located.at.(".+
12300 20 62 6c 20 2b 20 22 2c 20 22 20 2b 20 74 6c 20 2b 20 22 2c 20 22 20 2b 20 74 72 20 2b 20 22 2c .bl.+.",.".+.tl.+.",.".+.tr.+.",
12320 20 22 20 2b 20 62 72 20 2b 20 22 29 2e 22 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 .".+.br.+.").");................
12340 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 2d 31 3b 0d 0a 20 20 20 }................return.-1;.....
12360 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d .....}............///.<summary>.
12380 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 46 75 6e 63 74 69 6f 6e 20 72 65 74 75 72 6e 69 6e 67 20 .........///.Function.returning.
123a0 74 68 65 20 69 6e 64 65 78 20 6f 66 20 74 68 65 20 4c 69 6e 6b 20 61 74 20 74 68 65 20 67 69 76 the.index.of.the.Link.at.the.giv
123c0 65 6e 20 70 6f 73 69 74 69 6f 6e 20 28 69 66 20 61 6e 79 29 2e 0d 0a 20 20 20 20 20 20 20 20 2f en.position.(if.any).........../
123e0 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 //.</summary>..........///.<para
12400 6d 20 6e 61 6d 65 3d 22 74 65 78 74 22 3e 41 20 72 65 66 65 72 65 6e 63 65 20 74 6f 20 74 68 65 m.name="text">A.reference.to.the
12420 20 54 65 78 74 4d 65 73 68 50 72 6f 20 55 47 55 49 20 63 6f 6d 70 6f 6e 65 6e 74 2e 3c 2f 70 61 .TextMeshPro.UGUI.component.</pa
12440 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 70 ram>..........///.<param.name="p
12460 6f 73 69 74 69 6f 6e 22 3e 50 6f 73 69 74 69 6f 6e 20 74 6f 20 63 68 65 63 6b 20 66 6f 72 20 69 osition">Position.to.check.for.i
12480 6e 74 65 72 73 65 63 74 69 6f 6e 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f ntersection.</param>..........//
124a0 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 63 61 6d 65 72 61 22 3e 54 68 65 20 73 63 65 6e 65 /.<param.name="camera">The.scene
124c0 20 63 61 6d 65 72 61 20 77 68 69 63 68 20 6d 61 79 20 62 65 20 61 73 73 69 67 6e 65 64 20 74 6f .camera.which.may.be.assigned.to
124e0 20 61 20 43 61 6e 76 61 73 20 75 73 69 6e 67 20 53 63 72 65 65 6e 53 70 61 63 65 20 43 61 6d 65 .a.Canvas.using.ScreenSpace.Came
12500 72 61 20 6f 72 20 57 6f 72 6c 64 53 70 61 63 65 20 72 65 6e 64 65 72 20 6d 6f 64 65 2e 20 53 65 ra.or.WorldSpace.render.mode..Se
12520 74 20 74 6f 20 6e 75 6c 6c 20 69 73 20 75 73 69 6e 67 20 53 63 72 65 65 6e 53 70 61 63 65 20 4f t.to.null.is.using.ScreenSpace.O
12540 76 65 72 6c 61 79 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 verlay.</param>..........///.<re
12560 74 75 72 6e 73 3e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 70 75 62 6c turns></returns>..........//publ
12580 69 63 20 73 74 61 74 69 63 20 69 6e 74 20 46 69 6e 64 49 6e 74 65 72 73 65 63 74 69 6e 67 4c 69 ic.static.int.FindIntersectingLi
125a0 6e 6b 28 54 65 78 74 4d 65 73 68 50 72 6f 55 47 55 49 20 74 65 78 74 2c 20 56 65 63 74 6f 72 33 nk(TextMeshProUGUI.text,.Vector3
125c0 20 70 6f 73 69 74 69 6f 6e 2c 20 43 61 6d 65 72 61 20 63 61 6d 65 72 61 29 0d 0a 20 20 20 20 20 .position,.Camera.camera).......
125e0 20 20 20 2f 2f 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 54 72 61 6e 73 66 6f 72 6d 20 ...//{..........//....Transform.
12600 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 20 3d 20 74 65 78 74 2e 74 72 61 6e 73 66 6f 72 6d 3b 0d rectTransform.=.text.transform;.
12620 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 2f 2f 20 43 6f 6e 76 65 72 74 20 70 6f 73 69 ...........//....//.Convert.posi
12640 74 69 6f 6e 20 69 6e 74 6f 20 57 6f 72 6c 64 73 70 61 63 65 20 63 6f 6f 72 64 69 6e 61 74 65 73 tion.into.Worldspace.coordinates
12660 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 53 63 72 65 65 6e 50 6f 69 6e 74 54 6f 57 6f 72 ..........//....ScreenPointToWor
12680 6c 64 50 6f 69 6e 74 49 6e 52 65 63 74 61 6e 67 6c 65 28 72 65 63 74 54 72 61 6e 73 66 6f 72 6d ldPointInRectangle(rectTransform
126a0 2c 20 70 6f 73 69 74 69 6f 6e 2c 20 63 61 6d 65 72 61 2c 20 6f 75 74 20 70 6f 73 69 74 69 6f 6e ,.position,.camera,.out.position
126c0 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 66 6f 72 20 28 69 6e 74 20 69 20 3d );............//....for.(int.i.=
126e0 20 30 3b 20 69 20 3c 20 74 65 78 74 2e 74 65 78 74 49 6e 66 6f 2e 6c 69 6e 6b 43 6f 75 6e 74 3b .0;.i.<.text.textInfo.linkCount;
12700 20 69 2b 2b 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 .i++)..........//....{..........
12720 2f 2f 20 20 20 20 20 20 20 20 54 4d 50 5f 4c 69 6e 6b 49 6e 66 6f 20 6c 69 6e 6b 49 6e 66 6f 20 //........TMP_LinkInfo.linkInfo.
12740 3d 20 74 65 78 74 2e 74 65 78 74 49 6e 66 6f 2e 6c 69 6e 6b 49 6e 66 6f 5b 69 5d 3b 0d 0a 0d 0a =.text.textInfo.linkInfo[i];....
12760 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 62 6f 6f 6c 20 69 73 42 65 67 69 6e 52 65 ........//........bool.isBeginRe
12780 67 69 6f 6e 20 3d 20 66 61 6c 73 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 gion.=.false;............//.....
127a0 20 20 20 56 65 63 74 6f 72 33 20 62 6c 20 3d 20 56 65 63 74 6f 72 33 2e 7a 65 72 6f 3b 0d 0a 20 ...Vector3.bl.=.Vector3.zero;...
127c0 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 56 65 63 74 6f 72 33 20 74 6c 20 3d 20 56 65 .......//........Vector3.tl.=.Ve
127e0 63 74 6f 72 33 2e 7a 65 72 6f 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 56 ctor3.zero;..........//........V
12800 65 63 74 6f 72 33 20 62 72 20 3d 20 56 65 63 74 6f 72 33 2e 7a 65 72 6f 3b 0d 0a 20 20 20 20 20 ector3.br.=.Vector3.zero;.......
12820 20 20 20 2f 2f 20 20 20 20 20 20 20 20 56 65 63 74 6f 72 33 20 74 72 20 3d 20 56 65 63 74 6f 72 ...//........Vector3.tr.=.Vector
12840 33 2e 7a 65 72 6f 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 2f 2f 20 3.zero;............//........//.
12860 49 74 65 72 61 74 65 20 74 68 72 6f 75 67 68 20 65 61 63 68 20 63 68 61 72 61 63 74 65 72 20 6f Iterate.through.each.character.o
12880 66 20 74 68 65 20 77 6f 72 64 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 66 6f f.the.word..........//........fo
128a0 72 20 28 69 6e 74 20 6a 20 3d 20 30 3b 20 6a 20 3c 20 6c 69 6e 6b 49 6e 66 6f 2e 6c 69 6e 6b 54 r.(int.j.=.0;.j.<.linkInfo.linkT
128c0 65 78 74 4c 65 6e 67 74 68 3b 20 6a 2b 2b 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 extLength;.j++)..........//.....
128e0 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 20 ...{..........//............int.
12900 63 68 61 72 61 63 74 65 72 49 6e 64 65 78 20 3d 20 6c 69 6e 6b 49 6e 66 6f 2e 6c 69 6e 6b 54 65 characterIndex.=.linkInfo.linkTe
12920 78 74 66 69 72 73 74 43 68 61 72 61 63 74 65 72 49 6e 64 65 78 20 2b 20 6a 3b 0d 0a 20 20 20 20 xtfirstCharacterIndex.+.j;......
12940 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 54 4d 50 5f 43 68 61 72 61 63 74 65 72 49 ....//............TMP_CharacterI
12960 6e 66 6f 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 20 3d 20 74 65 78 74 2e 74 65 78 74 49 nfo.currentCharInfo.=.text.textI
12980 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 49 6e 66 6f 5b 63 68 61 72 61 63 74 65 72 49 6e 64 65 78 nfo.characterInfo[characterIndex
129a0 5d 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 20 63 75 ];..........//............int.cu
129c0 72 72 65 6e 74 4c 69 6e 65 20 3d 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 6c 69 6e 65 rrentLine.=.currentCharInfo.line
129e0 4e 75 6d 62 65 72 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 Number;............//...........
12a00 20 2f 2f 20 43 68 65 63 6b 20 69 66 20 4c 69 6e 6b 20 63 68 61 72 61 63 74 65 72 73 20 61 72 65 .//.Check.if.Link.characters.are
12a20 20 6f 6e 20 74 68 65 20 63 75 72 72 65 6e 74 20 70 61 67 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f .on.the.current.page..........//
12a40 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 74 65 78 74 2e 4f 76 65 72 66 6c 6f 77 4d 6f 64 ............if.(text.OverflowMod
12a60 65 20 3d 3d 20 54 65 78 74 4f 76 65 72 66 6c 6f 77 4d 6f 64 65 73 2e 50 61 67 65 20 26 26 20 63 e.==.TextOverflowModes.Page.&&.c
12a80 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 70 61 67 65 4e 75 6d 62 65 72 20 2b 20 31 20 21 3d urrentCharInfo.pageNumber.+.1.!=
12aa0 20 74 65 78 74 2e 70 61 67 65 54 6f 44 69 73 70 6c 61 79 29 20 63 6f 6e 74 69 6e 75 65 3b 0d 0a .text.pageToDisplay).continue;..
12ac0 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 69 73 42 65 ..........//............if.(isBe
12ae0 67 69 6e 52 65 67 69 6f 6e 20 3d 3d 20 66 61 6c 73 65 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 ginRegion.==.false)..........//.
12b00 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 ...........{..........//........
12b20 20 20 20 20 20 20 20 20 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 3d 20 74 72 75 65 3b 0d 0a 0d ........isBeginRegion.=.true;...
12b40 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 6c 20 3d 20 .........//................bl.=.
12b60 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 rectTransform.TransformPoint(new
12b80 20 56 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 62 6f 74 74 6f 6d 4c .Vector3(currentCharInfo.bottomL
12ba0 65 66 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 64 65 73 63 65 6e 64 65 72 eft.x,.currentCharInfo.descender
12bc0 2c 20 30 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ,.0));..........//..............
12be0 20 20 74 6c 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f ..tl.=.rectTransform.TransformPo
12c00 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e int(new.Vector3(currentCharInfo.
12c20 62 6f 74 74 6f 6d 4c 65 66 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 61 73 bottomLeft.x,.currentCharInfo.as
12c40 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 cender,.0));............//......
12c60 20 20 20 20 20 20 20 20 20 20 2f 2f 44 65 62 75 67 2e 4c 6f 67 28 22 53 74 61 72 74 20 57 6f 72 ..........//Debug.Log("Start.Wor
12c80 64 20 52 65 67 69 6f 6e 20 61 74 20 5b 22 20 2b 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f d.Region.at.[".+.currentCharInfo
12ca0 2e 63 68 61 72 61 63 74 65 72 20 2b 20 22 5d 22 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f .character.+."]");............//
12cc0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 66 20 57 6f 72 64 20 69 73 20 6f 6e ................//.If.Word.is.on
12ce0 65 20 63 68 61 72 61 63 74 65 72 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 e.character..........//.........
12d00 20 20 20 20 20 20 20 69 66 20 28 6c 69 6e 6b 49 6e 66 6f 2e 6c 69 6e 6b 54 65 78 74 4c 65 6e 67 .......if.(linkInfo.linkTextLeng
12d20 74 68 20 3d 3d 20 31 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 th.==.1)..........//............
12d40 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ....{..........//...............
12d60 20 20 20 20 20 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 3d 20 66 61 6c 73 65 3b 0d 0a 0d 0a 20 .....isBeginRegion.=.false;.....
12d80 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 72 20 .......//....................br.
12da0 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e =.rectTransform.TransformPoint(n
12dc0 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 74 6f 70 52 69 ew.Vector3(currentCharInfo.topRi
12de0 67 68 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 64 65 73 63 65 6e 64 65 72 ght.x,.currentCharInfo.descender
12e00 2c 20 30 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ,.0));..........//..............
12e20 20 20 20 20 20 20 74 72 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f ......tr.=.rectTransform.Transfo
12e40 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 49 rmPoint(new.Vector3(currentCharI
12e60 6e 66 6f 2e 74 6f 70 52 69 67 68 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e nfo.topRight.x,.currentCharInfo.
12e80 61 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 ascender,.0));............//....
12ea0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 68 65 63 6b 20 66 6f 72 20 49 6e 74 ................//.Check.for.Int
12ec0 65 72 73 65 63 74 69 6f 6e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 ersection..........//...........
12ee0 20 20 20 20 20 20 20 20 20 69 66 20 28 50 6f 69 6e 74 49 6e 74 65 72 73 65 63 74 52 65 63 74 61 .........if.(PointIntersectRecta
12f00 6e 67 6c 65 28 70 6f 73 69 74 69 6f 6e 2c 20 62 6c 2c 20 74 6c 2c 20 74 72 2c 20 62 72 29 29 0d ngle(position,.bl,.tl,.tr,.br)).
12f20 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .........//.....................
12f40 20 20 20 72 65 74 75 72 6e 20 69 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 ...return.i;............//......
12f60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 44 65 62 75 67 2e 4c 6f 67 28 22 45 6e 64 20 57 ..............//Debug.Log("End.W
12f80 6f 72 64 20 52 65 67 69 6f 6e 20 61 74 20 5b 22 20 2b 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e ord.Region.at.[".+.currentCharIn
12fa0 66 6f 2e 63 68 61 72 61 63 74 65 72 20 2b 20 22 5d 22 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f fo.character.+."]");..........//
12fc0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 ................}..........//...
12fe0 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 .........}............//........
13000 20 20 20 20 2f 2f 20 4c 61 73 74 20 43 68 61 72 61 63 74 65 72 20 6f 66 20 57 6f 72 64 0d 0a 20 ....//.Last.Character.of.Word...
13020 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 69 73 42 65 67 69 6e .......//............if.(isBegin
13040 52 65 67 69 6f 6e 20 26 26 20 6a 20 3d 3d 20 6c 69 6e 6b 49 6e 66 6f 2e 6c 69 6e 6b 54 65 78 74 Region.&&.j.==.linkInfo.linkText
13060 4c 65 6e 67 74 68 20 2d 20 31 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 Length.-.1)..........//.........
13080 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ...{..........//................
130a0 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 3d 20 66 61 6c 73 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 isBeginRegion.=.false;..........
130c0 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 72 20 3d 20 72 65 63 74 54 72 61 ..//................br.=.rectTra
130e0 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 nsform.TransformPoint(new.Vector
13100 33 28 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 2e 78 2c 20 63 75 3(currentCharInfo.topRight.x,.cu
13120 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 64 65 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 20 rrentCharInfo.descender,.0));...
13140 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 72 20 3d 20 72 65 .......//................tr.=.re
13160 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 ctTransform.TransformPoint(new.V
13180 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 2e ector3(currentCharInfo.topRight.
131a0 78 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 61 73 63 65 6e 64 65 72 2c 20 30 29 29 x,.currentCharInfo.ascender,.0))
131c0 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f ;............//................/
131e0 2f 20 43 68 65 63 6b 20 66 6f 72 20 49 6e 74 65 72 73 65 63 74 69 6f 6e 0d 0a 20 20 20 20 20 20 /.Check.for.Intersection........
13200 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 50 6f 69 6e 74 49 6e 74 ..//................if.(PointInt
13220 65 72 73 65 63 74 52 65 63 74 61 6e 67 6c 65 28 70 6f 73 69 74 69 6f 6e 2c 20 62 6c 2c 20 74 6c ersectRectangle(position,.bl,.tl
13240 2c 20 74 72 2c 20 62 72 29 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 ,.tr,.br))..........//..........
13260 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 69 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f ..........return.i;............/
13280 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 44 65 62 75 67 2e 4c 6f 67 28 22 45 6e /................//Debug.Log("En
132a0 64 20 57 6f 72 64 20 52 65 67 69 6f 6e 20 61 74 20 5b 22 20 2b 20 63 75 72 72 65 6e 74 43 68 61 d.Word.Region.at.[".+.currentCha
132c0 72 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 20 2b 20 22 5d 22 29 3b 0d 0a 20 20 20 20 20 20 20 rInfo.character.+."]");.........
132e0 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 .//............}..........//....
13300 20 20 20 20 20 20 20 20 2f 2f 20 49 66 20 57 6f 72 64 20 69 73 20 73 70 6c 69 74 20 6f 6e 20 6d ........//.If.Word.is.split.on.m
13320 6f 72 65 20 74 68 61 6e 20 6f 6e 65 20 6c 69 6e 65 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 ore.than.one.line...........//..
13340 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 20 69 66 20 28 69 73 42 65 67 69 6e 52 65 67 69 6f 6e ..........else.if.(isBeginRegion
13360 20 26 26 20 63 75 72 72 65 6e 74 4c 69 6e 65 20 21 3d 20 74 65 78 74 2e 74 65 78 74 49 6e 66 6f .&&.currentLine.!=.text.textInfo
13380 2e 63 68 61 72 61 63 74 65 72 49 6e 66 6f 5b 63 68 61 72 61 63 74 65 72 49 6e 64 65 78 20 2b 20 .characterInfo[characterIndex.+.
133a0 31 5d 2e 6c 69 6e 65 4e 75 6d 62 65 72 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 1].lineNumber)..........//......
133c0 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 ......{..........//.............
133e0 20 20 20 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 3d 20 66 61 6c 73 65 3b 0d 0a 0d 0a 20 20 20 ...isBeginRegion.=.false;.......
13400 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 72 20 3d 20 72 65 63 74 .....//................br.=.rect
13420 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 Transform.TransformPoint(new.Vec
13440 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 2e 78 2c tor3(currentCharInfo.topRight.x,
13460 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 64 65 73 63 65 6e 64 65 72 2c 20 30 29 29 3b .currentCharInfo.descender,.0));
13480 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 72 20 3d ..........//................tr.=
134a0 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 .rectTransform.TransformPoint(ne
134c0 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 74 6f 70 52 69 67 w.Vector3(currentCharInfo.topRig
134e0 68 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 61 73 63 65 6e 64 65 72 2c 20 ht.x,.currentCharInfo.ascender,.
13500 30 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 0));............//..............
13520 20 20 2f 2f 20 43 68 65 63 6b 20 66 6f 72 20 49 6e 74 65 72 73 65 63 74 69 6f 6e 0d 0a 20 20 20 ..//.Check.for.Intersection.....
13540 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 50 6f 69 6e 74 .....//................if.(Point
13560 49 6e 74 65 72 73 65 63 74 52 65 63 74 61 6e 67 6c 65 28 70 6f 73 69 74 69 6f 6e 2c 20 62 6c 2c IntersectRectangle(position,.bl,
13580 20 74 6c 2c 20 74 72 2c 20 62 72 29 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 .tl,.tr,.br))..........//.......
135a0 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 69 3b 0d 0a 0d 0a 20 20 20 20 20 20 .............return.i;..........
135c0 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 44 65 62 75 67 2e 4c 6f 67 28 ..//................//Debug.Log(
135e0 22 45 6e 64 20 57 6f 72 64 20 52 65 67 69 6f 6e 20 61 74 20 5b 22 20 2b 20 63 75 72 72 65 6e 74 "End.Word.Region.at.[".+.current
13600 43 68 61 72 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 20 2b 20 22 5d 22 29 3b 0d 0a 20 20 20 20 CharInfo.character.+."]");......
13620 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 ....//............}..........//.
13640 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 2f 2f .......}............//........//
13660 44 65 62 75 67 2e 4c 6f 67 28 22 57 6f 72 64 20 61 74 20 49 6e 64 65 78 3a 20 22 20 2b 20 69 20 Debug.Log("Word.at.Index:.".+.i.
13680 2b 20 22 20 69 73 20 6c 6f 63 61 74 65 64 20 61 74 20 28 22 20 2b 20 62 6c 20 2b 20 22 2c 20 22 +.".is.located.at.(".+.bl.+.",."
136a0 20 2b 20 74 6c 20 2b 20 22 2c 20 22 20 2b 20 74 72 20 2b 20 22 2c 20 22 20 2b 20 62 72 20 2b 20 .+.tl.+.",.".+.tr.+.",.".+.br.+.
136c0 22 29 2e 22 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 ").");............//....}.......
136e0 20 20 20 20 20 2f 2f 20 20 20 20 72 65 74 75 72 6e 20 2d 31 3b 0d 0a 20 20 20 20 20 20 20 20 2f .....//....return.-1;........../
13700 2f 7d 0d 0a 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 /}..............///.<summary>...
13720 20 20 20 20 20 20 20 2f 2f 2f 20 46 75 6e 63 74 69 6f 6e 20 72 65 74 75 72 6e 69 6e 67 20 74 68 .......///.Function.returning.th
13740 65 20 69 6e 64 65 78 20 6f 66 20 74 68 65 20 4c 69 6e 6b 20 61 74 20 74 68 65 20 67 69 76 65 6e e.index.of.the.Link.at.the.given
13760 20 70 6f 73 69 74 69 6f 6e 20 28 69 66 20 61 6e 79 29 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f .position.(if.any)...........///
13780 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 .</summary>..........///.<param.
137a0 6e 61 6d 65 3d 22 74 65 78 74 22 3e 41 20 72 65 66 65 72 65 6e 63 65 20 74 6f 20 74 68 65 20 54 name="text">A.reference.to.the.T
137c0 65 78 74 4d 65 73 68 50 72 6f 20 63 6f 6d 70 6f 6e 65 6e 74 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 extMeshPro.component.</param>...
137e0 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 70 6f 73 69 74 69 6f 6e .......///.<param.name="position
13800 22 3e 50 6f 73 69 74 69 6f 6e 20 74 6f 20 63 68 65 63 6b 20 66 6f 72 20 69 6e 74 65 72 73 65 63 ">Position.to.check.for.intersec
13820 74 69 6f 6e 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 tion.</param>..........///.<para
13840 6d 20 6e 61 6d 65 3d 22 63 61 6d 65 72 61 22 3e 54 68 65 20 63 61 6d 65 72 61 20 77 68 69 63 68 m.name="camera">The.camera.which
13860 20 69 73 20 72 65 6e 64 65 72 69 6e 67 20 74 68 65 20 74 65 78 74 20 6f 62 6a 65 63 74 2e 3c 2f .is.rendering.the.text.object.</
13880 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 3c 2f 72 param>..........///.<returns></r
138a0 65 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 70 75 62 6c 69 63 20 73 74 61 74 69 63 eturns>..........//public.static
138c0 20 69 6e 74 20 46 69 6e 64 49 6e 74 65 72 73 65 63 74 69 6e 67 4c 69 6e 6b 28 54 65 78 74 4d 65 .int.FindIntersectingLink(TextMe
138e0 73 68 50 72 6f 20 74 65 78 74 2c 20 56 65 63 74 6f 72 33 20 70 6f 73 69 74 69 6f 6e 2c 20 43 61 shPro.text,.Vector3.position,.Ca
13900 6d 65 72 61 20 63 61 6d 65 72 61 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 7b 0d 0a 20 20 20 20 20 mera.camera)..........//{.......
13920 20 20 20 2f 2f 20 20 20 20 54 72 61 6e 73 66 6f 72 6d 20 74 65 78 74 54 72 61 6e 73 66 6f 72 6d ...//....Transform.textTransform
13940 20 3d 20 74 65 78 74 2e 74 72 61 6e 73 66 6f 72 6d 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f .=.text.transform;............//
13960 20 20 20 20 2f 2f 20 43 6f 6e 76 65 72 74 20 70 6f 73 69 74 69 6f 6e 20 69 6e 74 6f 20 57 6f 72 ....//.Convert.position.into.Wor
13980 6c 64 73 70 61 63 65 20 63 6f 6f 72 64 69 6e 61 74 65 73 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 ldspace.coordinates..........//.
139a0 20 20 20 53 63 72 65 65 6e 50 6f 69 6e 74 54 6f 57 6f 72 6c 64 50 6f 69 6e 74 49 6e 52 65 63 74 ...ScreenPointToWorldPointInRect
139c0 61 6e 67 6c 65 28 74 65 78 74 54 72 61 6e 73 66 6f 72 6d 2c 20 70 6f 73 69 74 69 6f 6e 2c 20 63 angle(textTransform,.position,.c
139e0 61 6d 65 72 61 2c 20 6f 75 74 20 70 6f 73 69 74 69 6f 6e 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 amera,.out.position);...........
13a00 20 2f 2f 20 20 20 20 66 6f 72 20 28 69 6e 74 20 69 20 3d 20 30 3b 20 69 20 3c 20 74 65 78 74 2e .//....for.(int.i.=.0;.i.<.text.
13a20 74 65 78 74 49 6e 66 6f 2e 6c 69 6e 6b 43 6f 75 6e 74 3b 20 69 2b 2b 29 0d 0a 20 20 20 20 20 20 textInfo.linkCount;.i++)........
13a40 20 20 2f 2f 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 54 4d 50 ..//....{..........//........TMP
13a60 5f 4c 69 6e 6b 49 6e 66 6f 20 6c 69 6e 6b 49 6e 66 6f 20 3d 20 74 65 78 74 2e 74 65 78 74 49 6e _LinkInfo.linkInfo.=.text.textIn
13a80 66 6f 2e 6c 69 6e 6b 49 6e 66 6f 5b 69 5d 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 fo.linkInfo[i];............//...
13aa0 20 20 20 20 20 62 6f 6f 6c 20 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 3d 20 66 61 6c 73 65 3b .....bool.isBeginRegion.=.false;
13ac0 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 56 65 63 74 6f 72 33 20 62 6c ............//........Vector3.bl
13ae0 20 3d 20 56 65 63 74 6f 72 33 2e 7a 65 72 6f 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 .=.Vector3.zero;..........//....
13b00 20 20 20 20 56 65 63 74 6f 72 33 20 74 6c 20 3d 20 56 65 63 74 6f 72 33 2e 7a 65 72 6f 3b 0d 0a ....Vector3.tl.=.Vector3.zero;..
13b20 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 56 65 63 74 6f 72 33 20 62 72 20 3d 20 56 ........//........Vector3.br.=.V
13b40 65 63 74 6f 72 33 2e 7a 65 72 6f 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 ector3.zero;..........//........
13b60 56 65 63 74 6f 72 33 20 74 72 20 3d 20 56 65 63 74 6f 72 33 2e 7a 65 72 6f 3b 0d 0a 0d 0a 20 20 Vector3.tr.=.Vector3.zero;......
13b80 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 2f 2f 20 49 74 65 72 61 74 65 20 74 68 72 6f 75 ......//........//.Iterate.throu
13ba0 67 68 20 65 61 63 68 20 63 68 61 72 61 63 74 65 72 20 6f 66 20 74 68 65 20 77 6f 72 64 0d 0a 20 gh.each.character.of.the.word...
13bc0 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 66 6f 72 20 28 69 6e 74 20 6a 20 3d 20 30 3b .......//........for.(int.j.=.0;
13be0 20 6a 20 3c 20 6c 69 6e 6b 49 6e 66 6f 2e 6c 69 6e 6b 54 65 78 74 4c 65 6e 67 74 68 3b 20 6a 2b .j.<.linkInfo.linkTextLength;.j+
13c00 2b 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 +)..........//........{.........
13c20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 20 63 68 61 72 61 63 74 65 72 49 6e 64 65 .//............int.characterInde
13c40 78 20 3d 20 6c 69 6e 6b 49 6e 66 6f 2e 6c 69 6e 6b 54 65 78 74 66 69 72 73 74 43 68 61 72 61 63 x.=.linkInfo.linkTextfirstCharac
13c60 74 65 72 49 6e 64 65 78 20 2b 20 6a 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 terIndex.+.j;..........//.......
13c80 20 20 20 20 20 54 4d 50 5f 43 68 61 72 61 63 74 65 72 49 6e 66 6f 20 63 75 72 72 65 6e 74 43 68 .....TMP_CharacterInfo.currentCh
13ca0 61 72 49 6e 66 6f 20 3d 20 74 65 78 74 2e 74 65 78 74 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 arInfo.=.text.textInfo.character
13cc0 49 6e 66 6f 5b 63 68 61 72 61 63 74 65 72 49 6e 64 65 78 5d 3b 0d 0a 20 20 20 20 20 20 20 20 2f Info[characterIndex];........../
13ce0 2f 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 20 63 75 72 72 65 6e 74 4c 69 6e 65 20 3d 20 63 /............int.currentLine.=.c
13d00 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 6c 69 6e 65 4e 75 6d 62 65 72 3b 0d 0a 0d 0a 20 20 urrentCharInfo.lineNumber;......
13d20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 68 65 63 6b 20 69 66 20 ......//............//.Check.if.
13d40 4c 69 6e 6b 20 63 68 61 72 61 63 74 65 72 73 20 61 72 65 20 6f 6e 20 74 68 65 20 63 75 72 72 65 Link.characters.are.on.the.curre
13d60 6e 74 20 70 61 67 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 69 nt.page..........//............i
13d80 66 20 28 74 65 78 74 2e 4f 76 65 72 66 6c 6f 77 4d 6f 64 65 20 3d 3d 20 54 65 78 74 4f 76 65 72 f.(text.OverflowMode.==.TextOver
13da0 66 6c 6f 77 4d 6f 64 65 73 2e 50 61 67 65 20 26 26 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 flowModes.Page.&&.currentCharInf
13dc0 6f 2e 70 61 67 65 4e 75 6d 62 65 72 20 2b 20 31 20 21 3d 20 74 65 78 74 2e 70 61 67 65 54 6f 44 o.pageNumber.+.1.!=.text.pageToD
13de0 69 73 70 6c 61 79 29 20 63 6f 6e 74 69 6e 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 isplay).continue;............//.
13e00 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 3d 3d 20 ...........if.(isBeginRegion.==.
13e20 66 61 6c 73 65 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d false)..........//............{.
13e40 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 73 42 65 67 .........//................isBeg
13e60 69 6e 52 65 67 69 6f 6e 20 3d 20 74 72 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 inRegion.=.true;............//..
13e80 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 6c 20 3d 20 74 65 78 74 54 72 61 6e 73 66 6f 72 6d ..............bl.=.textTransform
13ea0 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 .TransformPoint(new.Vector3(curr
13ec0 65 6e 74 43 68 61 72 49 6e 66 6f 2e 62 6f 74 74 6f 6d 4c 65 66 74 2e 78 2c 20 63 75 72 72 65 6e entCharInfo.bottomLeft.x,.curren
13ee0 74 43 68 61 72 49 6e 66 6f 2e 64 65 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 20 20 20 20 20 tCharInfo.descender,.0));.......
13f00 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 6c 20 3d 20 74 65 78 74 54 72 ...//................tl.=.textTr
13f20 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f ansform.TransformPoint(new.Vecto
13f40 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 62 6f 74 74 6f 6d 4c 65 66 74 2e 78 2c r3(currentCharInfo.bottomLeft.x,
13f60 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 61 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d .currentCharInfo.ascender,.0));.
13f80 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 44 ...........//................//D
13fa0 65 62 75 67 2e 4c 6f 67 28 22 53 74 61 72 74 20 57 6f 72 64 20 52 65 67 69 6f 6e 20 61 74 20 5b ebug.Log("Start.Word.Region.at.[
13fc0 22 20 2b 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 20 2b 20 ".+.currentCharInfo.character.+.
13fe0 22 5d 22 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 "]");............//.............
14000 20 20 20 2f 2f 20 49 66 20 57 6f 72 64 20 69 73 20 6f 6e 65 20 63 68 61 72 61 63 74 65 72 0d 0a ...//.If.Word.is.one.character..
14020 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6c 69 ........//................if.(li
14040 6e 6b 49 6e 66 6f 2e 6c 69 6e 6b 54 65 78 74 4c 65 6e 67 74 68 20 3d 3d 20 31 29 0d 0a 20 20 20 nkInfo.linkTextLength.==.1).....
14060 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 .....//................{........
14080 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 73 42 65 67 69 6e 52 ..//....................isBeginR
140a0 65 67 69 6f 6e 20 3d 20 66 61 6c 73 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 egion.=.false;............//....
140c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 72 20 3d 20 74 65 78 74 54 72 61 6e 73 66 6f ................br.=.textTransfo
140e0 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 63 75 rm.TransformPoint(new.Vector3(cu
14100 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 2e 78 2c 20 63 75 72 72 65 6e rrentCharInfo.topRight.x,.curren
14120 74 43 68 61 72 49 6e 66 6f 2e 64 65 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 20 20 20 20 20 tCharInfo.descender,.0));.......
14140 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 72 20 3d 20 74 65 ...//....................tr.=.te
14160 78 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 xtTransform.TransformPoint(new.V
14180 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 2e ector3(currentCharInfo.topRight.
141a0 78 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 61 73 63 65 6e 64 65 72 2c 20 30 29 29 x,.currentCharInfo.ascender,.0))
141c0 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ;............//.................
141e0 20 20 20 2f 2f 20 43 68 65 63 6b 20 66 6f 72 20 49 6e 74 65 72 73 65 63 74 69 6f 6e 0d 0a 20 20 ...//.Check.for.Intersection....
14200 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 ......//....................if.(
14220 50 6f 69 6e 74 49 6e 74 65 72 73 65 63 74 52 65 63 74 61 6e 67 6c 65 28 70 6f 73 69 74 69 6f 6e PointIntersectRectangle(position
14240 2c 20 62 6c 2c 20 74 6c 2c 20 74 72 2c 20 62 72 29 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 ,.bl,.tl,.tr,.br))..........//..
14260 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 69 3b 0d ......................return.i;.
14280 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ...........//...................
142a0 20 2f 2f 44 65 62 75 67 2e 4c 6f 67 28 22 45 6e 64 20 57 6f 72 64 20 52 65 67 69 6f 6e 20 61 74 .//Debug.Log("End.Word.Region.at
142c0 20 5b 22 20 2b 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 20 .[".+.currentCharInfo.character.
142e0 2b 20 22 5d 22 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 +."]");..........//.............
14300 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d ...}..........//............}...
14320 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4c 61 73 74 20 43 .........//............//.Last.C
14340 68 61 72 61 63 74 65 72 20 6f 66 20 57 6f 72 64 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 haracter.of.Word..........//....
14360 20 20 20 20 20 20 20 20 69 66 20 28 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 26 26 20 6a 20 3d ........if.(isBeginRegion.&&.j.=
14380 3d 20 6c 69 6e 6b 49 6e 66 6f 2e 6c 69 6e 6b 54 65 78 74 4c 65 6e 67 74 68 20 2d 20 31 29 0d 0a =.linkInfo.linkTextLength.-.1)..
143a0 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 ........//............{.........
143c0 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 73 42 65 67 69 6e 52 65 67 69 6f 6e .//................isBeginRegion
143e0 20 3d 20 66 61 6c 73 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 .=.false;............//.........
14400 20 20 20 20 20 20 20 62 72 20 3d 20 74 65 78 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 .......br.=.textTransform.Transf
14420 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 ormPoint(new.Vector3(currentChar
14440 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f Info.topRight.x,.currentCharInfo
14460 2e 64 65 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 .descender,.0));..........//....
14480 20 20 20 20 20 20 20 20 20 20 20 20 74 72 20 3d 20 74 65 78 74 54 72 61 6e 73 66 6f 72 6d 2e 54 ............tr.=.textTransform.T
144a0 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 65 6e ransformPoint(new.Vector3(curren
144c0 74 43 68 61 72 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 tCharInfo.topRight.x,.currentCha
144e0 72 49 6e 66 6f 2e 61 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 rInfo.ascender,.0));............
14500 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 68 65 63 6b 20 66 6f 72 20 49 //................//.Check.for.I
14520 6e 74 65 72 73 65 63 74 69 6f 6e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 ntersection..........//.........
14540 20 20 20 20 20 20 20 69 66 20 28 50 6f 69 6e 74 49 6e 74 65 72 73 65 63 74 52 65 63 74 61 6e 67 .......if.(PointIntersectRectang
14560 6c 65 28 70 6f 73 69 74 69 6f 6e 2c 20 62 6c 2c 20 74 6c 2c 20 74 72 2c 20 62 72 29 29 0d 0a 20 le(position,.bl,.tl,.tr,.br))...
14580 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 .......//....................ret
145a0 75 72 6e 20 69 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 urn.i;............//............
145c0 20 20 20 20 2f 2f 44 65 62 75 67 2e 4c 6f 67 28 22 45 6e 64 20 57 6f 72 64 20 52 65 67 69 6f 6e ....//Debug.Log("End.Word.Region
145e0 20 61 74 20 5b 22 20 2b 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 63 68 61 72 61 63 74 .at.[".+.currentCharInfo.charact
14600 65 72 20 2b 20 22 5d 22 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 er.+."]");..........//..........
14620 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 66 ..}..........//............//.If
14640 20 57 6f 72 64 20 69 73 20 73 70 6c 69 74 20 6f 6e 20 6d 6f 72 65 20 74 68 61 6e 20 6f 6e 65 20 .Word.is.split.on.more.than.one.
14660 6c 69 6e 65 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 65 6c 73 line...........//............els
14680 65 20 69 66 20 28 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 26 26 20 63 75 72 72 65 6e 74 4c 69 e.if.(isBeginRegion.&&.currentLi
146a0 6e 65 20 21 3d 20 74 65 78 74 2e 74 65 78 74 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 49 6e 66 ne.!=.text.textInfo.characterInf
146c0 6f 5b 63 68 61 72 61 63 74 65 72 49 6e 64 65 78 20 2b 20 31 5d 2e 6c 69 6e 65 4e 75 6d 62 65 72 o[characterIndex.+.1].lineNumber
146e0 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 )..........//............{......
14700 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 73 42 65 67 69 6e 52 65 67 ....//................isBeginReg
14720 69 6f 6e 20 3d 20 66 61 6c 73 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 ion.=.false;............//......
14740 20 20 20 20 20 20 20 20 20 20 62 72 20 3d 20 74 65 78 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 ..........br.=.textTransform.Tra
14760 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 nsformPoint(new.Vector3(currentC
14780 68 61 72 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 harInfo.topRight.x,.currentCharI
147a0 6e 66 6f 2e 64 65 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 nfo.descender,.0));..........//.
147c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 72 20 3d 20 74 65 78 74 54 72 61 6e 73 66 6f 72 ...............tr.=.textTransfor
147e0 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 m.TransformPoint(new.Vector3(cur
14800 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 2e 78 2c 20 63 75 72 72 65 6e 74 rentCharInfo.topRight.x,.current
14820 43 68 61 72 49 6e 66 6f 2e 61 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 CharInfo.ascender,.0));.........
14840 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 68 65 63 6b 20 66 6f ...//................//.Check.fo
14860 72 20 49 6e 74 65 72 73 65 63 74 69 6f 6e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 r.Intersection..........//......
14880 20 20 20 20 20 20 20 20 20 20 69 66 20 28 50 6f 69 6e 74 49 6e 74 65 72 73 65 63 74 52 65 63 74 ..........if.(PointIntersectRect
148a0 61 6e 67 6c 65 28 70 6f 73 69 74 69 6f 6e 2c 20 62 6c 2c 20 74 6c 2c 20 74 72 2c 20 62 72 29 29 angle(position,.bl,.tl,.tr,.br))
148c0 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ..........//....................
148e0 72 65 74 75 72 6e 20 69 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 return.i;............//.........
14900 20 20 20 20 20 20 20 2f 2f 44 65 62 75 67 2e 4c 6f 67 28 22 45 6e 64 20 57 6f 72 64 20 52 65 67 .......//Debug.Log("End.Word.Reg
14920 69 6f 6e 20 61 74 20 5b 22 20 2b 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 63 68 61 72 ion.at.[".+.currentCharInfo.char
14940 61 63 74 65 72 20 2b 20 22 5d 22 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 acter.+."]");..........//.......
14960 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 .....}..........//........}.....
14980 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 2f 2f 44 65 62 75 67 2e 4c 6f 67 28 22 57 6f .......//........//Debug.Log("Wo
149a0 72 64 20 61 74 20 49 6e 64 65 78 3a 20 22 20 2b 20 69 20 2b 20 22 20 69 73 20 6c 6f 63 61 74 65 rd.at.Index:.".+.i.+.".is.locate
149c0 64 20 61 74 20 28 22 20 2b 20 62 6c 20 2b 20 22 2c 20 22 20 2b 20 74 6c 20 2b 20 22 2c 20 22 20 d.at.(".+.bl.+.",.".+.tl.+.",.".
149e0 2b 20 74 72 20 2b 20 22 2c 20 22 20 2b 20 62 72 20 2b 20 22 29 2e 22 29 3b 0d 0a 0d 0a 20 20 20 +.tr.+.",.".+.br.+.").");.......
14a00 20 20 20 20 20 2f 2f 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 72 65 .....//....}............//....re
14a20 74 75 72 6e 20 2d 31 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 7d 0d 0a 0d 0a 0d 0a 20 20 20 20 20 turn.-1;..........//}...........
14a40 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 46 75 ...///.<summary>..........///.Fu
14a60 6e 63 74 69 6f 6e 20 72 65 74 75 72 6e 69 6e 67 20 74 68 65 20 69 6e 64 65 78 20 6f 66 20 74 68 nction.returning.the.index.of.th
14a80 65 20 77 6f 72 64 20 61 74 20 74 68 65 20 67 69 76 65 6e 20 70 6f 73 69 74 69 6f 6e 20 28 69 66 e.word.at.the.given.position.(if
14aa0 20 61 6e 79 29 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a .any)...........///.</summary>..
14ac0 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 74 65 78 74 22 3e 41 ........///.<param.name="text">A
14ae0 20 72 65 66 65 72 65 6e 63 65 20 74 6f 20 74 68 65 20 54 4d 50 5f 54 65 78 74 20 63 6f 6d 70 6f .reference.to.the.TMP_Text.compo
14b00 6e 65 6e 74 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 nent.</param>..........///.<para
14b20 6d 20 6e 61 6d 65 3d 22 70 6f 73 69 74 69 6f 6e 22 3e 50 6f 73 69 74 69 6f 6e 20 74 6f 20 63 68 m.name="position">Position.to.ch
14b40 65 63 6b 20 66 6f 72 20 69 6e 74 65 72 73 65 63 74 69 6f 6e 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 eck.for.intersection.</param>...
14b60 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 63 61 6d 65 72 61 22 3e .......///.<param.name="camera">
14b80 54 68 65 20 73 63 65 6e 65 20 63 61 6d 65 72 61 20 77 68 69 63 68 20 6d 61 79 20 62 65 20 61 73 The.scene.camera.which.may.be.as
14ba0 73 69 67 6e 65 64 20 74 6f 20 61 20 43 61 6e 76 61 73 20 75 73 69 6e 67 20 53 63 72 65 65 6e 53 signed.to.a.Canvas.using.ScreenS
14bc0 70 61 63 65 20 43 61 6d 65 72 61 20 6f 72 20 57 6f 72 6c 64 53 70 61 63 65 20 72 65 6e 64 65 72 pace.Camera.or.WorldSpace.render
14be0 20 6d 6f 64 65 2e 20 53 65 74 20 74 6f 20 6e 75 6c 6c 20 69 73 20 75 73 69 6e 67 20 53 63 72 65 .mode..Set.to.null.is.using.Scre
14c00 65 6e 53 70 61 63 65 20 4f 76 65 72 6c 61 79 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 enSpace.Overlay.</param>........
14c20 20 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 ..///.<returns></returns>.......
14c40 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 69 6e 74 20 46 69 6e 64 4e 65 61 72 65 73 74 ...public.static.int.FindNearest
14c60 4c 69 6e 6b 28 54 4d 50 5f 54 65 78 74 20 74 65 78 74 2c 20 56 65 63 74 6f 72 33 20 70 6f 73 69 Link(TMP_Text.text,.Vector3.posi
14c80 74 69 6f 6e 2c 20 43 61 6d 65 72 61 20 63 61 6d 65 72 61 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d tion,.Camera.camera)..........{.
14ca0 0a 20 20 20 20 20 20 20 20 20 20 20 20 52 65 63 74 54 72 61 6e 73 66 6f 72 6d 20 72 65 63 74 54 .............RectTransform.rectT
14cc0 72 61 6e 73 66 6f 72 6d 20 3d 20 74 65 78 74 2e 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 3b 0d 0a ransform.=.text.rectTransform;..
14ce0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 6f 6e 76 65 72 74 20 70 6f 73 69 74 69 6f ..............//.Convert.positio
14d00 6e 20 69 6e 74 6f 20 57 6f 72 6c 64 73 70 61 63 65 20 63 6f 6f 72 64 69 6e 61 74 65 73 0d 0a 20 n.into.Worldspace.coordinates...
14d20 20 20 20 20 20 20 20 20 20 20 20 53 63 72 65 65 6e 50 6f 69 6e 74 54 6f 57 6f 72 6c 64 50 6f 69 ...........ScreenPointToWorldPoi
14d40 6e 74 49 6e 52 65 63 74 61 6e 67 6c 65 28 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2c 20 70 6f 73 ntInRectangle(rectTransform,.pos
14d60 69 74 69 6f 6e 2c 20 63 61 6d 65 72 61 2c 20 6f 75 74 20 70 6f 73 69 74 69 6f 6e 29 3b 0d 0a 0d ition,.camera,.out.position);...
14d80 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 64 69 73 74 61 6e 63 65 53 71 72 20 3d .............float.distanceSqr.=
14da0 20 4d 61 74 68 66 2e 49 6e 66 69 6e 69 74 79 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 6e .Mathf.Infinity;..............in
14dc0 74 20 63 6c 6f 73 65 73 74 20 3d 20 30 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 6f t.closest.=.0;................fo
14de0 72 20 28 69 6e 74 20 69 20 3d 20 30 3b 20 69 20 3c 20 74 65 78 74 2e 74 65 78 74 49 6e 66 6f 2e r.(int.i.=.0;.i.<.text.textInfo.
14e00 6c 69 6e 6b 43 6f 75 6e 74 3b 20 69 2b 2b 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a linkCount;.i++)..............{..
14e20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 54 4d 50 5f 4c 69 6e 6b 49 6e 66 6f 20 6c 69 6e ................TMP_LinkInfo.lin
14e40 6b 49 6e 66 6f 20 3d 20 74 65 78 74 2e 74 65 78 74 49 6e 66 6f 2e 6c 69 6e 6b 49 6e 66 6f 5b 69 kInfo.=.text.textInfo.linkInfo[i
14e60 5d 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 6f 6f 6c 20 69 73 42 65 67 ];....................bool.isBeg
14e80 69 6e 52 65 67 69 6f 6e 20 3d 20 66 61 6c 73 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 inRegion.=.false;...............
14ea0 20 20 20 20 20 56 65 63 74 6f 72 33 20 62 6c 20 3d 20 56 65 63 74 6f 72 33 2e 7a 65 72 6f 3b 0d .....Vector3.bl.=.Vector3.zero;.
14ec0 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 56 65 63 74 6f 72 33 20 74 6c 20 3d 20 56 65 .................Vector3.tl.=.Ve
14ee0 63 74 6f 72 33 2e 7a 65 72 6f 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 56 65 63 ctor3.zero;..................Vec
14f00 74 6f 72 33 20 62 72 20 3d 20 56 65 63 74 6f 72 33 2e 7a 65 72 6f 3b 0d 0a 20 20 20 20 20 20 20 tor3.br.=.Vector3.zero;.........
14f20 20 20 20 20 20 20 20 20 20 56 65 63 74 6f 72 33 20 74 72 20 3d 20 56 65 63 74 6f 72 33 2e 7a 65 .........Vector3.tr.=.Vector3.ze
14f40 72 6f 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 74 65 72 61 74 ro;....................//.Iterat
14f60 65 20 74 68 72 6f 75 67 68 20 65 61 63 68 20 63 68 61 72 61 63 74 65 72 20 6f 66 20 74 68 65 20 e.through.each.character.of.the.
14f80 6c 69 6e 6b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 20 28 69 6e 74 20 6a link..................for.(int.j
14fa0 20 3d 20 30 3b 20 6a 20 3c 20 6c 69 6e 6b 49 6e 66 6f 2e 6c 69 6e 6b 54 65 78 74 4c 65 6e 67 74 .=.0;.j.<.linkInfo.linkTextLengt
14fc0 68 3b 20 6a 2b 2b 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 h;.j++)..................{......
14fe0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 20 63 68 61 72 61 63 74 65 72 49 6e 64 ................int.characterInd
15000 65 78 20 3d 20 6c 69 6e 6b 49 6e 66 6f 2e 6c 69 6e 6b 54 65 78 74 66 69 72 73 74 43 68 61 72 61 ex.=.linkInfo.linkTextfirstChara
15020 63 74 65 72 49 6e 64 65 78 20 2b 20 6a 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 cterIndex.+.j;..................
15040 20 20 20 20 54 4d 50 5f 43 68 61 72 61 63 74 65 72 49 6e 66 6f 20 63 75 72 72 65 6e 74 43 68 61 ....TMP_CharacterInfo.currentCha
15060 72 49 6e 66 6f 20 3d 20 74 65 78 74 2e 74 65 78 74 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 49 rInfo.=.text.textInfo.characterI
15080 6e 66 6f 5b 63 68 61 72 61 63 74 65 72 49 6e 64 65 78 5d 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 nfo[characterIndex];............
150a0 20 20 20 20 20 20 20 20 20 20 69 6e 74 20 63 75 72 72 65 6e 74 4c 69 6e 65 20 3d 20 63 75 72 72 ..........int.currentLine.=.curr
150c0 65 6e 74 43 68 61 72 49 6e 66 6f 2e 6c 69 6e 65 4e 75 6d 62 65 72 3b 0d 0a 0d 0a 20 20 20 20 20 entCharInfo.lineNumber;.........
150e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 68 65 63 6b 20 69 66 20 4c 69 6e 6b 20 ...............//.Check.if.Link.
15100 63 68 61 72 61 63 74 65 72 73 20 61 72 65 20 6f 6e 20 74 68 65 20 63 75 72 72 65 6e 74 20 70 61 characters.are.on.the.current.pa
15120 67 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 74 65 78 74 ge......................if.(text
15140 2e 6f 76 65 72 66 6c 6f 77 4d 6f 64 65 20 3d 3d 20 54 65 78 74 4f 76 65 72 66 6c 6f 77 4d 6f 64 .overflowMode.==.TextOverflowMod
15160 65 73 2e 50 61 67 65 20 26 26 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 70 61 67 65 4e es.Page.&&.currentCharInfo.pageN
15180 75 6d 62 65 72 20 2b 20 31 20 21 3d 20 74 65 78 74 2e 70 61 67 65 54 6f 44 69 73 70 6c 61 79 29 umber.+.1.!=.text.pageToDisplay)
151a0 20 63 6f 6e 74 69 6e 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .continue;......................
151c0 20 20 69 66 20 28 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 3d 3d 20 66 61 6c 73 65 29 0d 0a 20 ..if.(isBeginRegion.==.false)...
151e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 ...................{............
15200 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 3d 20 74 72 ..............isBeginRegion.=.tr
15220 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f ue;............................/
15240 2f 44 65 62 75 67 2e 4c 6f 67 28 22 53 74 61 72 74 20 57 6f 72 64 20 52 65 67 69 6f 6e 20 61 74 /Debug.Log("Start.Word.Region.at
15260 20 5b 22 20 2b 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 20 .[".+.currentCharInfo.character.
15280 2b 20 22 5d 22 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 +."]");.........................
152a0 20 20 20 62 6c 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 ...bl.=.rectTransform.TransformP
152c0 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f oint(new.Vector3(currentCharInfo
152e0 2e 62 6f 74 74 6f 6d 4c 65 66 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 64 .bottomLeft.x,.currentCharInfo.d
15300 65 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 escender,.0));..................
15320 20 20 20 20 20 20 20 20 74 6c 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 ........tl.=.rectTransform.Trans
15340 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 formPoint(new.Vector3(currentCha
15360 72 49 6e 66 6f 2e 62 6f 74 74 6f 6d 4c 65 66 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 rInfo.bottomLeft.x,.currentCharI
15380 6e 66 6f 2e 61 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 nfo.ascender,.0));..............
153a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 66 20 4c 69 6e 6b 20 69 73 20 6f 6e 65 20 ..............//.If.Link.is.one.
153c0 63 68 61 72 61 63 74 65 72 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 character.......................
153e0 20 20 20 69 66 20 28 6c 69 6e 6b 49 6e 66 6f 2e 6c 69 6e 6b 54 65 78 74 4c 65 6e 67 74 68 20 3d ...if.(linkInfo.linkTextLength.=
15400 3d 20 31 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d =.1)..........................{.
15420 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 73 42 .............................isB
15440 65 67 69 6e 52 65 67 69 6f 6e 20 3d 20 66 61 6c 73 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 eginRegion.=.false;.............
15460 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 72 20 3d 20 72 65 63 74 54 72 61 6e ...................br.=.rectTran
15480 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 sform.TransformPoint(new.Vector3
154a0 28 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 2e 78 2c 20 63 75 72 (currentCharInfo.topRight.x,.cur
154c0 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 64 65 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 20 20 rentCharInfo.descender,.0));....
154e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 72 20 3d 20 72 ..........................tr.=.r
15500 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 ectTransform.TransformPoint(new.
15520 56 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 Vector3(currentCharInfo.topRight
15540 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 61 73 63 65 6e 64 65 72 2c 20 30 29 .x,.currentCharInfo.ascender,.0)
15560 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 );..............................
15580 20 20 2f 2f 20 43 68 65 63 6b 20 66 6f 72 20 49 6e 74 65 72 73 65 63 74 69 6f 6e 0d 0a 20 20 20 ..//.Check.for.Intersection.....
155a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 50 6f 69 .........................if.(Poi
155c0 6e 74 49 6e 74 65 72 73 65 63 74 52 65 63 74 61 6e 67 6c 65 28 70 6f 73 69 74 69 6f 6e 2c 20 62 ntIntersectRectangle(position,.b
155e0 6c 2c 20 74 6c 2c 20 74 72 2c 20 62 72 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 l,.tl,.tr,.br)).................
15600 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 69 3b 0d 0a 0d 0a 20 20 .................return.i;......
15620 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 46 69 6e ..........................//.Fin
15640 64 20 74 68 65 20 63 6c 6f 73 65 73 74 20 6c 69 6e 65 20 73 65 67 6d 65 6e 74 20 74 6f 20 70 6f d.the.closest.line.segment.to.po
15660 73 69 74 69 6f 6e 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 sition..........................
15680 20 20 20 20 20 66 6c 6f 61 74 20 64 62 6c 20 3d 20 44 69 73 74 61 6e 63 65 54 6f 4c 69 6e 65 28 .....float.dbl.=.DistanceToLine(
156a0 62 6c 2c 20 74 6c 2c 20 70 6f 73 69 74 69 6f 6e 29 3b 20 0d 0a 20 20 20 20 20 20 20 20 20 20 20 bl,.tl,.position);..............
156c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 64 74 6c 20 3d 20 44 69 73 .................float.dtl.=.Dis
156e0 74 61 6e 63 65 54 6f 4c 69 6e 65 28 74 6c 2c 20 74 72 2c 20 70 6f 73 69 74 69 6f 6e 29 3b 20 0d tanceToLine(tl,.tr,.position);..
15700 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 6c 6f .............................flo
15720 61 74 20 64 74 72 20 3d 20 44 69 73 74 61 6e 63 65 54 6f 4c 69 6e 65 28 74 72 2c 20 62 72 2c 20 at.dtr.=.DistanceToLine(tr,.br,.
15740 70 6f 73 69 74 69 6f 6e 29 3b 20 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 position);......................
15760 20 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 64 62 72 20 3d 20 44 69 73 74 61 6e 63 65 54 6f 4c .........float.dbr.=.DistanceToL
15780 69 6e 65 28 62 72 2c 20 62 6c 2c 20 70 6f 73 69 74 69 6f 6e 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 ine(br,.bl,.position);..........
157a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 64 20 3d 20 ......................float.d.=.
157c0 64 62 6c 20 3c 20 64 74 6c 20 3f 20 64 62 6c 20 3a 20 64 74 6c 3b 0d 0a 20 20 20 20 20 20 20 20 dbl.<.dtl.?.dbl.:.dtl;..........
157e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 64 20 3d 20 64 20 3c 20 64 74 72 20 ....................d.=.d.<.dtr.
15800 3f 20 64 20 3a 20 64 74 72 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ?.d.:.dtr;......................
15820 20 20 20 20 20 20 20 20 64 20 3d 20 64 20 3c 20 64 62 72 20 3f 20 64 20 3a 20 64 62 72 3b 0d 0a ........d.=.d.<.dbr.?.d.:.dbr;..
15840 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 ..............................if
15860 20 28 64 69 73 74 61 6e 63 65 53 71 72 20 3e 20 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 .(distanceSqr.>.d)..............
15880 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 ................{...............
158a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 64 69 73 74 61 6e 63 65 53 71 72 20 3d ...................distanceSqr.=
158c0 20 64 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .d;.............................
158e0 20 20 20 20 20 63 6c 6f 73 65 73 74 20 3d 20 69 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 .....closest.=.i;...............
15900 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 ...............}................
15920 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ............}...................
15940 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4c ...}........................//.L
15960 61 73 74 20 43 68 61 72 61 63 74 65 72 20 6f 66 20 57 6f 72 64 0d 0a 20 20 20 20 20 20 20 20 20 ast.Character.of.Word...........
15980 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 26 26 20 ...........if.(isBeginRegion.&&.
159a0 6a 20 3d 3d 20 6c 69 6e 6b 49 6e 66 6f 2e 6c 69 6e 6b 54 65 78 74 4c 65 6e 67 74 68 20 2d 20 31 j.==.linkInfo.linkTextLength.-.1
159c0 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 )......................{........
159e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 ..................isBeginRegion.
15a00 3d 20 66 61 6c 73 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 =.false;........................
15a20 20 20 20 20 62 72 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d ....br.=.rectTransform.Transform
15a40 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 Point(new.Vector3(currentCharInf
15a60 6f 2e 74 6f 70 52 69 67 68 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 64 65 o.topRight.x,.currentCharInfo.de
15a80 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 scender,.0));...................
15aa0 20 20 20 20 20 20 20 74 72 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 .......tr.=.rectTransform.Transf
15ac0 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 ormPoint(new.Vector3(currentChar
15ae0 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f Info.topRight.x,.currentCharInfo
15b00 2e 61 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 .ascender,.0));.................
15b20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 68 65 63 6b 20 66 6f 72 20 49 6e 74 65 72 73 65 63 ...........//.Check.for.Intersec
15b40 74 69 6f 6e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 tion..........................if
15b60 20 28 50 6f 69 6e 74 49 6e 74 65 72 73 65 63 74 52 65 63 74 61 6e 67 6c 65 28 70 6f 73 69 74 69 .(PointIntersectRectangle(positi
15b80 6f 6e 2c 20 62 6c 2c 20 74 6c 2c 20 74 72 2c 20 62 72 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 on,.bl,.tl,.tr,.br))............
15ba0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 69 3b 0d 0a 0d 0a 20 ..................return.i;.....
15bc0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 46 69 6e 64 20 74 .......................//.Find.t
15be0 68 65 20 63 6c 6f 73 65 73 74 20 6c 69 6e 65 20 73 65 67 6d 65 6e 74 20 74 6f 20 70 6f 73 69 74 he.closest.line.segment.to.posit
15c00 69 6f 6e 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 6c ion...........................fl
15c20 6f 61 74 20 64 62 6c 20 3d 20 44 69 73 74 61 6e 63 65 54 6f 4c 69 6e 65 28 62 6c 2c 20 74 6c 2c oat.dbl.=.DistanceToLine(bl,.tl,
15c40 20 70 6f 73 69 74 69 6f 6e 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .position);.....................
15c60 20 20 20 20 20 66 6c 6f 61 74 20 64 74 6c 20 3d 20 44 69 73 74 61 6e 63 65 54 6f 4c 69 6e 65 28 .....float.dtl.=.DistanceToLine(
15c80 74 6c 2c 20 74 72 2c 20 70 6f 73 69 74 69 6f 6e 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 tl,.tr,.position);..............
15ca0 20 20 20 20 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 64 74 72 20 3d 20 44 69 73 74 61 6e 63 65 ............float.dtr.=.Distance
15cc0 54 6f 4c 69 6e 65 28 74 72 2c 20 62 72 2c 20 70 6f 73 69 74 69 6f 6e 29 3b 0d 0a 20 20 20 20 20 ToLine(tr,.br,.position);.......
15ce0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 64 62 72 20 3d 20 44 ...................float.dbr.=.D
15d00 69 73 74 61 6e 63 65 54 6f 4c 69 6e 65 28 62 72 2c 20 62 6c 2c 20 70 6f 73 69 74 69 6f 6e 29 3b istanceToLine(br,.bl,.position);
15d20 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 6c 6f 61 ............................floa
15d40 74 20 64 20 3d 20 64 62 6c 20 3c 20 64 74 6c 20 3f 20 64 62 6c 20 3a 20 64 74 6c 3b 0d 0a 20 20 t.d.=.dbl.<.dtl.?.dbl.:.dtl;....
15d60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 64 20 3d 20 64 20 3c 20 64 74 ......................d.=.d.<.dt
15d80 72 20 3f 20 64 20 3a 20 64 74 72 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 r.?.d.:.dtr;....................
15da0 20 20 20 20 20 20 64 20 3d 20 64 20 3c 20 64 62 72 20 3f 20 64 20 3a 20 64 62 72 3b 0d 0a 0d 0a ......d.=.d.<.dbr.?.d.:.dbr;....
15dc0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 64 69 73 74 ........................if.(dist
15de0 61 6e 63 65 53 71 72 20 3e 20 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 anceSqr.>.d)....................
15e00 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ......{.........................
15e20 20 20 20 20 20 64 69 73 74 61 6e 63 65 53 71 72 20 3d 20 64 3b 0d 0a 20 20 20 20 20 20 20 20 20 .....distanceSqr.=.d;...........
15e40 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 6c 6f 73 65 73 74 20 3d 20 69 3b 0d ...................closest.=.i;.
15e60 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 .........................}......
15e80 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ..................}.............
15ea0 20 20 20 20 20 20 20 20 20 2f 2f 20 49 66 20 4c 69 6e 6b 20 69 73 20 73 70 6c 69 74 20 6f 6e 20 .........//.If.Link.is.split.on.
15ec0 6d 6f 72 65 20 74 68 61 6e 20 6f 6e 65 20 6c 69 6e 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 more.than.one.line..............
15ee0 20 20 20 20 20 20 20 20 20 65 6c 73 65 20 69 66 20 28 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 .........else.if.(isBeginRegion.
15f00 26 26 20 63 75 72 72 65 6e 74 4c 69 6e 65 20 21 3d 20 74 65 78 74 2e 74 65 78 74 49 6e 66 6f 2e &&.currentLine.!=.text.textInfo.
15f20 63 68 61 72 61 63 74 65 72 49 6e 66 6f 5b 63 68 61 72 61 63 74 65 72 49 6e 64 65 78 20 2b 20 31 characterInfo[characterIndex.+.1
15f40 5d 2e 6c 69 6e 65 4e 75 6d 62 65 72 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ].lineNumber)...................
15f60 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 73 ...{..........................is
15f80 42 65 67 69 6e 52 65 67 69 6f 6e 20 3d 20 66 61 6c 73 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 BeginRegion.=.false;............
15fa0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 72 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f ................br.=.rectTransfo
15fc0 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 63 75 rm.TransformPoint(new.Vector3(cu
15fe0 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 2e 78 2c 20 63 75 72 72 65 6e rrentCharInfo.topRight.x,.curren
16000 74 43 68 61 72 49 6e 66 6f 2e 64 65 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 20 20 20 20 20 tCharInfo.descender,.0));.......
16020 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 72 20 3d 20 72 65 63 74 54 72 61 6e ...................tr.=.rectTran
16040 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 sform.TransformPoint(new.Vector3
16060 28 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 2e 78 2c 20 63 75 72 (currentCharInfo.topRight.x,.cur
16080 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 61 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 0d 0a 20 rentCharInfo.ascender,.0));.....
160a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 68 65 63 6b 20 .......................//.Check.
160c0 66 6f 72 20 49 6e 74 65 72 73 65 63 74 69 6f 6e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 for.Intersection................
160e0 20 20 20 20 20 20 20 20 20 20 69 66 20 28 50 6f 69 6e 74 49 6e 74 65 72 73 65 63 74 52 65 63 74 ..........if.(PointIntersectRect
16100 61 6e 67 6c 65 28 70 6f 73 69 74 69 6f 6e 2c 20 62 6c 2c 20 74 6c 2c 20 74 72 2c 20 62 72 29 29 angle(position,.bl,.tl,.tr,.br))
16120 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 ..............................re
16140 74 75 72 6e 20 69 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 turn.i;.........................
16160 20 20 20 2f 2f 20 46 69 6e 64 20 74 68 65 20 63 6c 6f 73 65 73 74 20 6c 69 6e 65 20 73 65 67 6d ...//.Find.the.closest.line.segm
16180 65 6e 74 20 74 6f 20 70 6f 73 69 74 69 6f 6e 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ent.to.position.................
161a0 20 20 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 64 62 6c 20 3d 20 44 69 73 74 61 6e 63 65 54 6f ..........float.dbl.=.DistanceTo
161c0 4c 69 6e 65 28 62 6c 2c 20 74 6c 2c 20 70 6f 73 69 74 69 6f 6e 29 3b 0d 0a 20 20 20 20 20 20 20 Line(bl,.tl,.position);.........
161e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 64 74 6c 20 3d 20 44 69 73 .................float.dtl.=.Dis
16200 74 61 6e 63 65 54 6f 4c 69 6e 65 28 74 6c 2c 20 74 72 2c 20 70 6f 73 69 74 69 6f 6e 29 3b 0d 0a tanceToLine(tl,.tr,.position);..
16220 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 64 74 ........................float.dt
16240 72 20 3d 20 44 69 73 74 61 6e 63 65 54 6f 4c 69 6e 65 28 74 72 2c 20 62 72 2c 20 70 6f 73 69 74 r.=.DistanceToLine(tr,.br,.posit
16260 69 6f 6e 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 ion);..........................f
16280 6c 6f 61 74 20 64 62 72 20 3d 20 44 69 73 74 61 6e 63 65 54 6f 4c 69 6e 65 28 62 72 2c 20 62 6c loat.dbr.=.DistanceToLine(br,.bl
162a0 2c 20 70 6f 73 69 74 69 6f 6e 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ,.position);....................
162c0 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 64 20 3d 20 64 62 6c 20 3c 20 64 74 6c 20 3f 20 64 62 ........float.d.=.dbl.<.dtl.?.db
162e0 6c 20 3a 20 64 74 6c 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 l.:.dtl;........................
16300 20 20 64 20 3d 20 64 20 3c 20 64 74 72 20 3f 20 64 20 3a 20 64 74 72 3b 0d 0a 20 20 20 20 20 20 ..d.=.d.<.dtr.?.d.:.dtr;........
16320 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 64 20 3d 20 64 20 3c 20 64 62 72 20 3f 20 ..................d.=.d.<.dbr.?.
16340 64 20 3a 20 64 62 72 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 d.:.dbr;........................
16360 20 20 20 20 69 66 20 28 64 69 73 74 61 6e 63 65 53 71 72 20 3e 20 64 29 0d 0a 20 20 20 20 20 20 ....if.(distanceSqr.>.d)........
16380 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ..................{.............
163a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 64 69 73 74 61 6e 63 65 53 71 72 20 3d 20 64 .................distanceSqr.=.d
163c0 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 ;..............................c
163e0 6c 6f 73 65 73 74 20 3d 20 69 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 losest.=.i;.....................
16400 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 .....}......................}...
16420 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 ...............}................
16440 20 20 20 20 2f 2f 44 65 62 75 67 2e 4c 6f 67 28 22 57 6f 72 64 20 61 74 20 49 6e 64 65 78 3a 20 ....//Debug.Log("Word.at.Index:.
16460 22 20 2b 20 69 20 2b 20 22 20 69 73 20 6c 6f 63 61 74 65 64 20 61 74 20 28 22 20 2b 20 62 6c 20 ".+.i.+.".is.located.at.(".+.bl.
16480 2b 20 22 2c 20 22 20 2b 20 74 6c 20 2b 20 22 2c 20 22 20 2b 20 74 72 20 2b 20 22 2c 20 22 20 2b +.",.".+.tl.+.",.".+.tr.+.",.".+
164a0 20 62 72 20 2b 20 22 29 2e 22 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d .br.+.").");................}...
164c0 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 63 6c 6f 73 65 73 74 3b 0d 0a 20 20 .............return.closest;....
164e0 20 20 20 20 20 20 7d 0d 0a 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 ......}..............///.<summar
16500 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 46 75 6e 63 74 69 6f 6e 20 72 65 74 75 72 6e 69 y>..........///.Function.returni
16520 6e 67 20 74 68 65 20 69 6e 64 65 78 20 6f 66 20 74 68 65 20 77 6f 72 64 20 61 74 20 74 68 65 20 ng.the.index.of.the.word.at.the.
16540 67 69 76 65 6e 20 70 6f 73 69 74 69 6f 6e 20 28 69 66 20 61 6e 79 29 2e 0d 0a 20 20 20 20 20 20 given.position.(if.any).........
16560 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 ..///.</summary>..........///.<p
16580 61 72 61 6d 20 6e 61 6d 65 3d 22 74 65 78 74 22 3e 41 20 72 65 66 65 72 65 6e 63 65 20 74 6f 20 aram.name="text">A.reference.to.
165a0 74 68 65 20 54 65 78 74 4d 65 73 68 50 72 6f 20 55 47 55 49 20 63 6f 6d 70 6f 6e 65 6e 74 2e 3c the.TextMeshPro.UGUI.component.<
165c0 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 /param>..........///.<param.name
165e0 3d 22 70 6f 73 69 74 69 6f 6e 22 3e 50 6f 73 69 74 69 6f 6e 20 74 6f 20 63 68 65 63 6b 20 66 6f ="position">Position.to.check.fo
16600 72 20 69 6e 74 65 72 73 65 63 74 69 6f 6e 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 r.intersection.</param>.........
16620 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 63 61 6d 65 72 61 22 3e 54 68 65 20 73 63 .///.<param.name="camera">The.sc
16640 65 6e 65 20 63 61 6d 65 72 61 20 77 68 69 63 68 20 6d 61 79 20 62 65 20 61 73 73 69 67 6e 65 64 ene.camera.which.may.be.assigned
16660 20 74 6f 20 61 20 43 61 6e 76 61 73 20 75 73 69 6e 67 20 53 63 72 65 65 6e 53 70 61 63 65 20 43 .to.a.Canvas.using.ScreenSpace.C
16680 61 6d 65 72 61 20 6f 72 20 57 6f 72 6c 64 53 70 61 63 65 20 72 65 6e 64 65 72 20 6d 6f 64 65 2e amera.or.WorldSpace.render.mode.
166a0 20 53 65 74 20 74 6f 20 6e 75 6c 6c 20 69 73 20 75 73 69 6e 67 20 53 63 72 65 65 6e 53 70 61 63 .Set.to.null.is.using.ScreenSpac
166c0 65 20 4f 76 65 72 6c 61 79 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 e.Overlay.</param>..........///.
166e0 3c 72 65 74 75 72 6e 73 3e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 70 <returns></returns>..........//p
16700 75 62 6c 69 63 20 73 74 61 74 69 63 20 69 6e 74 20 46 69 6e 64 4e 65 61 72 65 73 74 4c 69 6e 6b ublic.static.int.FindNearestLink
16720 28 54 65 78 74 4d 65 73 68 50 72 6f 55 47 55 49 20 74 65 78 74 2c 20 56 65 63 74 6f 72 33 20 70 (TextMeshProUGUI.text,.Vector3.p
16740 6f 73 69 74 69 6f 6e 2c 20 43 61 6d 65 72 61 20 63 61 6d 65 72 61 29 0d 0a 20 20 20 20 20 20 20 osition,.Camera.camera).........
16760 20 2f 2f 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 52 65 63 74 54 72 61 6e 73 66 6f 72 .//{..........//....RectTransfor
16780 6d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 20 3d 20 74 65 78 74 2e 72 65 63 74 54 72 61 6e 73 m.rectTransform.=.text.rectTrans
167a0 66 6f 72 6d 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 2f 2f 20 43 6f 6e 76 65 72 form;............//....//.Conver
167c0 74 20 70 6f 73 69 74 69 6f 6e 20 69 6e 74 6f 20 57 6f 72 6c 64 73 70 61 63 65 20 63 6f 6f 72 64 t.position.into.Worldspace.coord
167e0 69 6e 61 74 65 73 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 53 63 72 65 65 6e 50 6f 69 6e inates..........//....ScreenPoin
16800 74 54 6f 57 6f 72 6c 64 50 6f 69 6e 74 49 6e 52 65 63 74 61 6e 67 6c 65 28 72 65 63 74 54 72 61 tToWorldPointInRectangle(rectTra
16820 6e 73 66 6f 72 6d 2c 20 70 6f 73 69 74 69 6f 6e 2c 20 63 61 6d 65 72 61 2c 20 6f 75 74 20 70 6f nsform,.position,.camera,.out.po
16840 73 69 74 69 6f 6e 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 66 6c 6f 61 74 20 sition);............//....float.
16860 64 69 73 74 61 6e 63 65 53 71 72 20 3d 20 4d 61 74 68 66 2e 49 6e 66 69 6e 69 74 79 3b 0d 0a 20 distanceSqr.=.Mathf.Infinity;...
16880 20 20 20 20 20 20 20 2f 2f 20 20 20 20 69 6e 74 20 63 6c 6f 73 65 73 74 20 3d 20 30 3b 0d 0a 0d .......//....int.closest.=.0;...
168a0 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 66 6f 72 20 28 69 6e 74 20 69 20 3d 20 30 3b 20 69 .........//....for.(int.i.=.0;.i
168c0 20 3c 20 74 65 78 74 2e 74 65 78 74 49 6e 66 6f 2e 6c 69 6e 6b 43 6f 75 6e 74 3b 20 69 2b 2b 29 .<.text.textInfo.linkCount;.i++)
168e0 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 ..........//....{..........//...
16900 20 20 20 20 20 54 4d 50 5f 4c 69 6e 6b 49 6e 66 6f 20 6c 69 6e 6b 49 6e 66 6f 20 3d 20 74 65 78 .....TMP_LinkInfo.linkInfo.=.tex
16920 74 2e 74 65 78 74 49 6e 66 6f 2e 6c 69 6e 6b 49 6e 66 6f 5b 69 5d 3b 0d 0a 0d 0a 20 20 20 20 20 t.textInfo.linkInfo[i];.........
16940 20 20 20 2f 2f 20 20 20 20 20 20 20 20 62 6f 6f 6c 20 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 ...//........bool.isBeginRegion.
16960 3d 20 66 61 6c 73 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 56 65 =.false;............//........Ve
16980 63 74 6f 72 33 20 62 6c 20 3d 20 56 65 63 74 6f 72 33 2e 7a 65 72 6f 3b 0d 0a 20 20 20 20 20 20 ctor3.bl.=.Vector3.zero;........
169a0 20 20 2f 2f 20 20 20 20 20 20 20 20 56 65 63 74 6f 72 33 20 74 6c 20 3d 20 56 65 63 74 6f 72 33 ..//........Vector3.tl.=.Vector3
169c0 2e 7a 65 72 6f 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 56 65 63 74 6f 72 .zero;..........//........Vector
169e0 33 20 62 72 20 3d 20 56 65 63 74 6f 72 33 2e 7a 65 72 6f 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 3.br.=.Vector3.zero;..........//
16a00 20 20 20 20 20 20 20 20 56 65 63 74 6f 72 33 20 74 72 20 3d 20 56 65 63 74 6f 72 33 2e 7a 65 72 ........Vector3.tr.=.Vector3.zer
16a20 6f 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 2f 2f 20 49 74 65 72 61 o;............//........//.Itera
16a40 74 65 20 74 68 72 6f 75 67 68 20 65 61 63 68 20 63 68 61 72 61 63 74 65 72 20 6f 66 20 74 68 65 te.through.each.character.of.the
16a60 20 77 6f 72 64 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 66 6f 72 20 28 69 6e .word..........//........for.(in
16a80 74 20 6a 20 3d 20 30 3b 20 6a 20 3c 20 6c 69 6e 6b 49 6e 66 6f 2e 6c 69 6e 6b 54 65 78 74 4c 65 t.j.=.0;.j.<.linkInfo.linkTextLe
16aa0 6e 67 74 68 3b 20 6a 2b 2b 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 7b 0d ngth;.j++)..........//........{.
16ac0 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 20 63 68 61 72 61 .........//............int.chara
16ae0 63 74 65 72 49 6e 64 65 78 20 3d 20 6c 69 6e 6b 49 6e 66 6f 2e 6c 69 6e 6b 54 65 78 74 66 69 72 cterIndex.=.linkInfo.linkTextfir
16b00 73 74 43 68 61 72 61 63 74 65 72 49 6e 64 65 78 20 2b 20 6a 3b 0d 0a 20 20 20 20 20 20 20 20 2f stCharacterIndex.+.j;........../
16b20 2f 20 20 20 20 20 20 20 20 20 20 20 20 54 4d 50 5f 43 68 61 72 61 63 74 65 72 49 6e 66 6f 20 63 /............TMP_CharacterInfo.c
16b40 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 20 3d 20 74 65 78 74 2e 74 65 78 74 49 6e 66 6f 2e 63 urrentCharInfo.=.text.textInfo.c
16b60 68 61 72 61 63 74 65 72 49 6e 66 6f 5b 63 68 61 72 61 63 74 65 72 49 6e 64 65 78 5d 3b 0d 0a 20 haracterInfo[characterIndex];...
16b80 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 20 63 75 72 72 65 6e 74 .......//............int.current
16ba0 4c 69 6e 65 20 3d 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 6c 69 6e 65 4e 75 6d 62 65 Line.=.currentCharInfo.lineNumbe
16bc0 72 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 r;............//............if.(
16be0 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 3d 3d 20 66 61 6c 73 65 29 0d 0a 20 20 20 20 20 20 20 isBeginRegion.==.false).........
16c00 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 .//............{..........//....
16c20 20 20 20 20 20 20 20 20 20 20 20 20 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 3d 20 74 72 75 65 ............isBeginRegion.=.true
16c40 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 ;............//................b
16c60 6c 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 l.=.rectTransform.TransformPoint
16c80 28 6e 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 62 6f 74 (new.Vector3(currentCharInfo.bot
16ca0 74 6f 6d 4c 65 66 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 64 65 73 63 65 tomLeft.x,.currentCharInfo.desce
16cc0 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 nder,.0));..........//..........
16ce0 20 20 20 20 20 20 74 6c 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f ......tl.=.rectTransform.Transfo
16d00 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 49 rmPoint(new.Vector3(currentCharI
16d20 6e 66 6f 2e 62 6f 74 74 6f 6d 4c 65 66 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 nfo.bottomLeft.x,.currentCharInf
16d40 6f 2e 61 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 o.ascender,.0));............//..
16d60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 44 65 62 75 67 2e 4c 6f 67 28 22 53 74 61 72 74 ..............//Debug.Log("Start
16d80 20 57 6f 72 64 20 52 65 67 69 6f 6e 20 61 74 20 5b 22 20 2b 20 63 75 72 72 65 6e 74 43 68 61 72 .Word.Region.at.[".+.currentChar
16da0 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 20 2b 20 22 5d 22 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 Info.character.+."]");..........
16dc0 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 66 20 57 6f 72 64 20 69 ..//................//.If.Word.i
16de0 73 20 6f 6e 65 20 63 68 61 72 61 63 74 65 72 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 s.one.character..........//.....
16e00 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6c 69 6e 6b 49 6e 66 6f 2e 6c 69 6e 6b 54 65 78 74 ...........if.(linkInfo.linkText
16e20 4c 65 6e 67 74 68 20 3d 3d 20 31 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 Length.==.1)..........//........
16e40 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 ........{..........//...........
16e60 20 20 20 20 20 20 20 20 20 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 3d 20 66 61 6c 73 65 3b 0d .........isBeginRegion.=.false;.
16e80 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ...........//...................
16ea0 20 62 72 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 .br.=.rectTransform.TransformPoi
16ec0 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 74 nt(new.Vector3(currentCharInfo.t
16ee0 6f 70 52 69 67 68 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 64 65 73 63 65 opRight.x,.currentCharInfo.desce
16f00 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 nder,.0));..........//..........
16f20 20 20 20 20 20 20 20 20 20 20 74 72 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 ..........tr.=.rectTransform.Tra
16f40 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 nsformPoint(new.Vector3(currentC
16f60 68 61 72 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 harInfo.topRight.x,.currentCharI
16f80 6e 66 6f 2e 61 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f nfo.ascender,.0));............//
16fa0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 68 65 63 6b 20 66 6f 72 ....................//.Check.for
16fc0 20 49 6e 74 65 72 73 65 63 74 69 6f 6e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 .Intersection..........//.......
16fe0 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 50 6f 69 6e 74 49 6e 74 65 72 73 65 63 74 52 .............if.(PointIntersectR
17000 65 63 74 61 6e 67 6c 65 28 70 6f 73 69 74 69 6f 6e 2c 20 62 6c 2c 20 74 6c 2c 20 74 72 2c 20 62 ectangle(position,.bl,.tl,.tr,.b
17020 72 29 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 r))..........//.................
17040 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 69 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 .......return.i;............//..
17060 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 44 65 62 75 67 2e 4c 6f 67 28 22 45 ..................//Debug.Log("E
17080 6e 64 20 57 6f 72 64 20 52 65 67 69 6f 6e 20 61 74 20 5b 22 20 2b 20 63 75 72 72 65 6e 74 43 68 nd.Word.Region.at.[".+.currentCh
170a0 61 72 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 20 2b 20 22 5d 22 29 3b 0d 0a 20 20 20 20 20 20 arInfo.character.+."]");........
170c0 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 2f ..//................}........../
170e0 2f 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 /............}............//....
17100 20 20 20 20 20 20 20 20 2f 2f 20 4c 61 73 74 20 43 68 61 72 61 63 74 65 72 20 6f 66 20 57 6f 72 ........//.Last.Character.of.Wor
17120 64 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 69 73 42 d..........//............if.(isB
17140 65 67 69 6e 52 65 67 69 6f 6e 20 26 26 20 6a 20 3d 3d 20 6c 69 6e 6b 49 6e 66 6f 2e 6c 69 6e 6b eginRegion.&&.j.==.linkInfo.link
17160 54 65 78 74 4c 65 6e 67 74 68 20 2d 20 31 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 TextLength.-.1)..........//.....
17180 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 .......{..........//............
171a0 20 20 20 20 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 3d 20 66 61 6c 73 65 3b 0d 0a 0d 0a 20 20 ....isBeginRegion.=.false;......
171c0 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 72 20 3d 20 72 65 63 ......//................br.=.rec
171e0 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 tTransform.TransformPoint(new.Ve
17200 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 2e 78 ctor3(currentCharInfo.topRight.x
17220 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 64 65 73 63 65 6e 64 65 72 2c 20 30 29 29 ,.currentCharInfo.descender,.0))
17240 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 72 20 ;..........//................tr.
17260 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e =.rectTransform.TransformPoint(n
17280 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 74 6f 70 52 69 ew.Vector3(currentCharInfo.topRi
172a0 67 68 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 61 73 63 65 6e 64 65 72 2c ght.x,.currentCharInfo.ascender,
172c0 20 30 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 .0));............//.............
172e0 20 20 20 2f 2f 20 43 68 65 63 6b 20 66 6f 72 20 49 6e 74 65 72 73 65 63 74 69 6f 6e 0d 0a 20 20 ...//.Check.for.Intersection....
17300 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 50 6f 69 6e ......//................if.(Poin
17320 74 49 6e 74 65 72 73 65 63 74 52 65 63 74 61 6e 67 6c 65 28 70 6f 73 69 74 69 6f 6e 2c 20 62 6c tIntersectRectangle(position,.bl
17340 2c 20 74 6c 2c 20 74 72 2c 20 62 72 29 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 ,.tl,.tr,.br))..........//......
17360 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 69 3b 0d 0a 0d 0a 20 20 20 20 20 ..............return.i;.........
17380 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 44 65 62 75 67 2e 4c 6f 67 ...//................//Debug.Log
173a0 28 22 45 6e 64 20 57 6f 72 64 20 52 65 67 69 6f 6e 20 61 74 20 5b 22 20 2b 20 63 75 72 72 65 6e ("End.Word.Region.at.[".+.curren
173c0 74 43 68 61 72 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 20 2b 20 22 5d 22 29 3b 0d 0a 20 20 20 tCharInfo.character.+."]");.....
173e0 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 2f 2f .....//............}..........//
17400 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 66 20 57 6f 72 64 20 69 73 20 73 70 6c 69 74 20 ............//.If.Word.is.split.
17420 6f 6e 20 6d 6f 72 65 20 74 68 61 6e 20 6f 6e 65 20 6c 69 6e 65 2e 0d 0a 20 20 20 20 20 20 20 20 on.more.than.one.line...........
17440 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 20 69 66 20 28 69 73 42 65 67 69 6e 52 65 //............else.if.(isBeginRe
17460 67 69 6f 6e 20 26 26 20 63 75 72 72 65 6e 74 4c 69 6e 65 20 21 3d 20 74 65 78 74 2e 74 65 78 74 gion.&&.currentLine.!=.text.text
17480 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 49 6e 66 6f 5b 63 68 61 72 61 63 74 65 72 49 6e 64 65 Info.characterInfo[characterInde
174a0 78 20 2b 20 31 5d 2e 6c 69 6e 65 4e 75 6d 62 65 72 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 x.+.1].lineNumber)..........//..
174c0 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 ..........{..........//.........
174e0 20 20 20 20 20 20 20 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 3d 20 66 61 6c 73 65 3b 0d 0a 0d .......isBeginRegion.=.false;...
17500 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 72 20 3d 20 .........//................br.=.
17520 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 rectTransform.TransformPoint(new
17540 20 56 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 74 6f 70 52 69 67 68 .Vector3(currentCharInfo.topRigh
17560 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 64 65 73 63 65 6e 64 65 72 2c 20 t.x,.currentCharInfo.descender,.
17580 30 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 0));..........//................
175a0 74 72 20 3d 20 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e tr.=.rectTransform.TransformPoin
175c0 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 74 6f t(new.Vector3(currentCharInfo.to
175e0 70 52 69 67 68 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 61 73 63 65 6e 64 pRight.x,.currentCharInfo.ascend
17600 65 72 2c 20 30 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 er,.0));............//..........
17620 20 20 20 20 20 20 2f 2f 20 43 68 65 63 6b 20 66 6f 72 20 49 6e 74 65 72 73 65 63 74 69 6f 6e 0d ......//.Check.for.Intersection.
17640 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 50 .........//................if.(P
17660 6f 69 6e 74 49 6e 74 65 72 73 65 63 74 52 65 63 74 61 6e 67 6c 65 28 70 6f 73 69 74 69 6f 6e 2c ointIntersectRectangle(position,
17680 20 62 6c 2c 20 74 6c 2c 20 74 72 2c 20 62 72 29 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 .bl,.tl,.tr,.br))..........//...
176a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 69 3b 0d 0a 0d 0a 20 20 .................return.i;......
176c0 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 44 65 62 75 67 2e ......//................//Debug.
176e0 4c 6f 67 28 22 45 6e 64 20 57 6f 72 64 20 52 65 67 69 6f 6e 20 61 74 20 5b 22 20 2b 20 63 75 72 Log("End.Word.Region.at.[".+.cur
17700 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 20 2b 20 22 5d 22 29 3b 0d 0a rentCharInfo.character.+."]");..
17720 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 ........//............}.........
17740 20 2f 2f 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 .//........}............//......
17760 20 20 2f 2f 20 46 69 6e 64 20 74 68 65 20 63 6c 6f 73 65 73 74 20 6c 69 6e 65 20 73 65 67 6d 65 ..//.Find.the.closest.line.segme
17780 6e 74 20 74 6f 20 70 6f 73 69 74 69 6f 6e 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 nt.to.position...........//.....
177a0 20 20 20 66 6c 6f 61 74 20 64 62 6c 20 3d 20 44 69 73 74 61 6e 63 65 54 6f 4c 69 6e 65 28 62 6c ...float.dbl.=.DistanceToLine(bl
177c0 2c 20 74 6c 2c 20 70 6f 73 69 74 69 6f 6e 29 3b 20 2f 2f 20 28 70 6f 73 69 74 69 6f 6e 20 2d 20 ,.tl,.position);.//.(position.-.
177e0 62 6c 29 2e 73 71 72 4d 61 67 6e 69 74 75 64 65 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 bl).sqrMagnitude;..........//...
17800 20 20 20 20 20 66 6c 6f 61 74 20 64 74 6c 20 3d 20 44 69 73 74 61 6e 63 65 54 6f 4c 69 6e 65 28 .....float.dtl.=.DistanceToLine(
17820 74 6c 2c 20 74 72 2c 20 70 6f 73 69 74 69 6f 6e 29 3b 20 2f 2f 20 28 70 6f 73 69 74 69 6f 6e 20 tl,.tr,.position);.//.(position.
17840 2d 20 74 6c 29 2e 73 71 72 4d 61 67 6e 69 74 75 64 65 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 -.tl).sqrMagnitude;..........//.
17860 20 20 20 20 20 20 20 66 6c 6f 61 74 20 64 74 72 20 3d 20 44 69 73 74 61 6e 63 65 54 6f 4c 69 6e .......float.dtr.=.DistanceToLin
17880 65 28 74 72 2c 20 62 72 2c 20 70 6f 73 69 74 69 6f 6e 29 3b 20 2f 2f 20 28 70 6f 73 69 74 69 6f e(tr,.br,.position);.//.(positio
178a0 6e 20 2d 20 74 72 29 2e 73 71 72 4d 61 67 6e 69 74 75 64 65 3b 0d 0a 20 20 20 20 20 20 20 20 2f n.-.tr).sqrMagnitude;........../
178c0 2f 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 64 62 72 20 3d 20 44 69 73 74 61 6e 63 65 54 6f 4c /........float.dbr.=.DistanceToL
178e0 69 6e 65 28 62 72 2c 20 62 6c 2c 20 70 6f 73 69 74 69 6f 6e 29 3b 20 2f 2f 20 28 70 6f 73 69 74 ine(br,.bl,.position);.//.(posit
17900 69 6f 6e 20 2d 20 62 72 29 2e 73 71 72 4d 61 67 6e 69 74 75 64 65 3b 0d 0a 0d 0a 20 20 20 20 20 ion.-.br).sqrMagnitude;.........
17920 20 20 20 2f 2f 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 64 20 3d 20 64 62 6c 20 3c 20 64 74 6c ...//........float.d.=.dbl.<.dtl
17940 20 3f 20 64 62 6c 20 3a 20 64 74 6c 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 .?.dbl.:.dtl;..........//.......
17960 20 64 20 3d 20 64 20 3c 20 64 74 72 20 3f 20 64 20 3a 20 64 74 72 3b 0d 0a 20 20 20 20 20 20 20 .d.=.d.<.dtr.?.d.:.dtr;.........
17980 20 2f 2f 20 20 20 20 20 20 20 20 64 20 3d 20 64 20 3c 20 64 62 72 20 3f 20 64 20 3a 20 64 62 72 .//........d.=.d.<.dbr.?.d.:.dbr
179a0 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 69 66 20 28 64 69 73 74 61 ;............//........if.(dista
179c0 6e 63 65 53 71 72 20 3e 20 64 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 7b nceSqr.>.d)..........//........{
179e0 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 64 69 73 74 61 6e 63 65 ..........//............distance
17a00 53 71 72 20 3d 20 64 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 Sqr.=.d;..........//............
17a20 63 6c 6f 73 65 73 74 20 3d 20 69 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 closest.=.i;..........//........
17a40 7d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 2f 2f 44 65 62 75 67 2e 4c 6f 67 }..........//........//Debug.Log
17a60 28 22 57 6f 72 64 20 61 74 20 49 6e 64 65 78 3a 20 22 20 2b 20 69 20 2b 20 22 20 69 73 20 6c 6f ("Word.at.Index:.".+.i.+.".is.lo
17a80 63 61 74 65 64 20 61 74 20 28 22 20 2b 20 62 6c 20 2b 20 22 2c 20 22 20 2b 20 74 6c 20 2b 20 22 cated.at.(".+.bl.+.",.".+.tl.+."
17aa0 2c 20 22 20 2b 20 74 72 20 2b 20 22 2c 20 22 20 2b 20 62 72 20 2b 20 22 29 2e 22 29 3b 0d 0a 0d ,.".+.tr.+.",.".+.br.+.").");...
17ac0 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 .........//....}............//..
17ae0 20 20 72 65 74 75 72 6e 20 63 6c 6f 73 65 73 74 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 7d 0d 0a ..return.closest;..........//}..
17b00 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 ............///.<summary>.......
17b20 20 20 20 2f 2f 2f 20 46 75 6e 63 74 69 6f 6e 20 72 65 74 75 72 6e 69 6e 67 20 74 68 65 20 69 6e ...///.Function.returning.the.in
17b40 64 65 78 20 6f 66 20 74 68 65 20 77 6f 72 64 20 61 74 20 74 68 65 20 67 69 76 65 6e 20 70 6f 73 dex.of.the.word.at.the.given.pos
17b60 69 74 69 6f 6e 20 28 69 66 20 61 6e 79 29 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 ition.(if.any)...........///.</s
17b80 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 ummary>..........///.<param.name
17ba0 3d 22 74 65 78 74 22 3e 41 20 72 65 66 65 72 65 6e 63 65 20 74 6f 20 74 68 65 20 54 65 78 74 4d ="text">A.reference.to.the.TextM
17bc0 65 73 68 50 72 6f 20 63 6f 6d 70 6f 6e 65 6e 74 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 eshPro.component.</param>.......
17be0 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 70 6f 73 69 74 69 6f 6e 22 3e 50 6f ...///.<param.name="position">Po
17c00 73 69 74 69 6f 6e 20 74 6f 20 63 68 65 63 6b 20 66 6f 72 20 69 6e 74 65 72 73 65 63 74 69 6f 6e sition.to.check.for.intersection
17c20 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 .</param>..........///.<param.na
17c40 6d 65 3d 22 63 61 6d 65 72 61 22 3e 54 68 65 20 63 61 6d 65 72 61 20 77 68 69 63 68 20 69 73 20 me="camera">The.camera.which.is.
17c60 72 65 6e 64 65 72 69 6e 67 20 74 68 65 20 74 65 78 74 20 6f 62 6a 65 63 74 2e 3c 2f 70 61 72 61 rendering.the.text.object.</para
17c80 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 3c 2f 72 65 74 75 72 m>..........///.<returns></retur
17ca0 6e 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 69 6e 74 ns>..........//public.static.int
17cc0 20 46 69 6e 64 4e 65 61 72 65 73 74 4c 69 6e 6b 28 54 65 78 74 4d 65 73 68 50 72 6f 20 74 65 78 .FindNearestLink(TextMeshPro.tex
17ce0 74 2c 20 56 65 63 74 6f 72 33 20 70 6f 73 69 74 69 6f 6e 2c 20 43 61 6d 65 72 61 20 63 61 6d 65 t,.Vector3.position,.Camera.came
17d00 72 61 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 ra)..........//{..........//....
17d20 54 72 61 6e 73 66 6f 72 6d 20 74 65 78 74 54 72 61 6e 73 66 6f 72 6d 20 3d 20 74 65 78 74 2e 74 Transform.textTransform.=.text.t
17d40 72 61 6e 73 66 6f 72 6d 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 2f 2f 20 43 6f ransform;............//....//.Co
17d60 6e 76 65 72 74 20 70 6f 73 69 74 69 6f 6e 20 69 6e 74 6f 20 57 6f 72 6c 64 73 70 61 63 65 20 63 nvert.position.into.Worldspace.c
17d80 6f 6f 72 64 69 6e 61 74 65 73 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 53 63 72 65 65 6e oordinates..........//....Screen
17da0 50 6f 69 6e 74 54 6f 57 6f 72 6c 64 50 6f 69 6e 74 49 6e 52 65 63 74 61 6e 67 6c 65 28 74 65 78 PointToWorldPointInRectangle(tex
17dc0 74 54 72 61 6e 73 66 6f 72 6d 2c 20 70 6f 73 69 74 69 6f 6e 2c 20 63 61 6d 65 72 61 2c 20 6f 75 tTransform,.position,.camera,.ou
17de0 74 20 70 6f 73 69 74 69 6f 6e 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 66 6c t.position);............//....fl
17e00 6f 61 74 20 64 69 73 74 61 6e 63 65 53 71 72 20 3d 20 4d 61 74 68 66 2e 49 6e 66 69 6e 69 74 79 oat.distanceSqr.=.Mathf.Infinity
17e20 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 69 6e 74 20 63 6c 6f 73 65 73 74 20 3d 20 30 ;..........//....int.closest.=.0
17e40 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 66 6f 72 20 28 69 6e 74 20 69 20 3d 20 ;............//....for.(int.i.=.
17e60 30 3b 20 69 20 3c 20 74 65 78 74 2e 74 65 78 74 49 6e 66 6f 2e 6c 69 6e 6b 43 6f 75 6e 74 3b 20 0;.i.<.text.textInfo.linkCount;.
17e80 69 2b 2b 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f i++)..........//....{........../
17ea0 2f 20 20 20 20 20 20 20 20 54 4d 50 5f 4c 69 6e 6b 49 6e 66 6f 20 6c 69 6e 6b 49 6e 66 6f 20 3d /........TMP_LinkInfo.linkInfo.=
17ec0 20 74 65 78 74 2e 74 65 78 74 49 6e 66 6f 2e 6c 69 6e 6b 49 6e 66 6f 5b 69 5d 3b 0d 0a 0d 0a 20 .text.textInfo.linkInfo[i];.....
17ee0 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 62 6f 6f 6c 20 69 73 42 65 67 69 6e 52 65 67 .......//........bool.isBeginReg
17f00 69 6f 6e 20 3d 20 66 61 6c 73 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 ion.=.false;............//......
17f20 20 20 56 65 63 74 6f 72 33 20 62 6c 20 3d 20 56 65 63 74 6f 72 33 2e 7a 65 72 6f 3b 0d 0a 20 20 ..Vector3.bl.=.Vector3.zero;....
17f40 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 56 65 63 74 6f 72 33 20 74 6c 20 3d 20 56 65 63 ......//........Vector3.tl.=.Vec
17f60 74 6f 72 33 2e 7a 65 72 6f 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 56 65 tor3.zero;..........//........Ve
17f80 63 74 6f 72 33 20 62 72 20 3d 20 56 65 63 74 6f 72 33 2e 7a 65 72 6f 3b 0d 0a 20 20 20 20 20 20 ctor3.br.=.Vector3.zero;........
17fa0 20 20 2f 2f 20 20 20 20 20 20 20 20 56 65 63 74 6f 72 33 20 74 72 20 3d 20 56 65 63 74 6f 72 33 ..//........Vector3.tr.=.Vector3
17fc0 2e 7a 65 72 6f 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 2f 2f 20 49 .zero;............//........//.I
17fe0 74 65 72 61 74 65 20 74 68 72 6f 75 67 68 20 65 61 63 68 20 63 68 61 72 61 63 74 65 72 20 6f 66 terate.through.each.character.of
18000 20 74 68 65 20 77 6f 72 64 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 66 6f 72 .the.word..........//........for
18020 20 28 69 6e 74 20 6a 20 3d 20 30 3b 20 6a 20 3c 20 6c 69 6e 6b 49 6e 66 6f 2e 6c 69 6e 6b 54 65 .(int.j.=.0;.j.<.linkInfo.linkTe
18040 78 74 4c 65 6e 67 74 68 3b 20 6a 2b 2b 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 xtLength;.j++)..........//......
18060 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 20 63 ..{..........//............int.c
18080 68 61 72 61 63 74 65 72 49 6e 64 65 78 20 3d 20 6c 69 6e 6b 49 6e 66 6f 2e 6c 69 6e 6b 54 65 78 haracterIndex.=.linkInfo.linkTex
180a0 74 66 69 72 73 74 43 68 61 72 61 63 74 65 72 49 6e 64 65 78 20 2b 20 6a 3b 0d 0a 20 20 20 20 20 tfirstCharacterIndex.+.j;.......
180c0 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 54 4d 50 5f 43 68 61 72 61 63 74 65 72 49 6e ...//............TMP_CharacterIn
180e0 66 6f 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 20 3d 20 74 65 78 74 2e 74 65 78 74 49 6e fo.currentCharInfo.=.text.textIn
18100 66 6f 2e 63 68 61 72 61 63 74 65 72 49 6e 66 6f 5b 63 68 61 72 61 63 74 65 72 49 6e 64 65 78 5d fo.characterInfo[characterIndex]
18120 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 20 63 75 72 ;..........//............int.cur
18140 72 65 6e 74 4c 69 6e 65 20 3d 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 6c 69 6e 65 4e rentLine.=.currentCharInfo.lineN
18160 75 6d 62 65 72 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 umber;............//............
18180 69 66 20 28 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 3d 3d 20 66 61 6c 73 65 29 0d 0a 20 20 20 if.(isBeginRegion.==.false).....
181a0 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f .....//............{..........//
181c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 3d 20 ................isBeginRegion.=.
181e0 74 72 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 true;............//.............
18200 20 20 20 62 6c 20 3d 20 74 65 78 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 ...bl.=.textTransform.TransformP
18220 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f oint(new.Vector3(currentCharInfo
18240 2e 62 6f 74 74 6f 6d 4c 65 66 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 64 .bottomLeft.x,.currentCharInfo.d
18260 65 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 escender,.0));..........//......
18280 20 20 20 20 20 20 20 20 20 20 74 6c 20 3d 20 74 65 78 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 ..........tl.=.textTransform.Tra
182a0 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 nsformPoint(new.Vector3(currentC
182c0 68 61 72 49 6e 66 6f 2e 62 6f 74 74 6f 6d 4c 65 66 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 harInfo.bottomLeft.x,.currentCha
182e0 72 49 6e 66 6f 2e 61 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 rInfo.ascender,.0));............
18300 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 44 65 62 75 67 2e 4c 6f 67 28 22 53 //................//Debug.Log("S
18320 74 61 72 74 20 57 6f 72 64 20 52 65 67 69 6f 6e 20 61 74 20 5b 22 20 2b 20 63 75 72 72 65 6e 74 tart.Word.Region.at.[".+.current
18340 43 68 61 72 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 20 2b 20 22 5d 22 29 3b 0d 0a 0d 0a 20 20 CharInfo.character.+."]");......
18360 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 66 20 57 6f ......//................//.If.Wo
18380 72 64 20 69 73 20 6f 6e 65 20 63 68 61 72 61 63 74 65 72 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 rd.is.one.character..........//.
183a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6c 69 6e 6b 49 6e 66 6f 2e 6c 69 6e 6b ...............if.(linkInfo.link
183c0 54 65 78 74 4c 65 6e 67 74 68 20 3d 3d 20 31 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 TextLength.==.1)..........//....
183e0 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 ............{..........//.......
18400 20 20 20 20 20 20 20 20 20 20 20 20 20 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 3d 20 66 61 6c .............isBeginRegion.=.fal
18420 73 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 se;............//...............
18440 20 20 20 20 20 62 72 20 3d 20 74 65 78 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 .....br.=.textTransform.Transfor
18460 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 49 6e mPoint(new.Vector3(currentCharIn
18480 66 6f 2e 74 6f 70 52 69 67 68 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 64 fo.topRight.x,.currentCharInfo.d
184a0 65 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 escender,.0));..........//......
184c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 72 20 3d 20 74 65 78 74 54 72 61 6e 73 66 6f 72 6d ..............tr.=.textTransform
184e0 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 .TransformPoint(new.Vector3(curr
18500 65 6e 74 43 68 61 72 49 6e 66 6f 2e 74 6f 70 52 69 67 68 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 entCharInfo.topRight.x,.currentC
18520 68 61 72 49 6e 66 6f 2e 61 73 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 harInfo.ascender,.0));..........
18540 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 68 65 63 6b ..//....................//.Check
18560 20 66 6f 72 20 49 6e 74 65 72 73 65 63 74 69 6f 6e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 .for.Intersection..........//...
18580 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 50 6f 69 6e 74 49 6e 74 65 72 73 .................if.(PointInters
185a0 65 63 74 52 65 63 74 61 6e 67 6c 65 28 70 6f 73 69 74 69 6f 6e 2c 20 62 6c 2c 20 74 6c 2c 20 74 ectRectangle(position,.bl,.tl,.t
185c0 72 2c 20 62 72 29 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 r,.br))..........//.............
185e0 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 69 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 ...........return.i;............
18600 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 44 65 62 75 67 2e 4c 6f //....................//Debug.Lo
18620 67 28 22 45 6e 64 20 57 6f 72 64 20 52 65 67 69 6f 6e 20 61 74 20 5b 22 20 2b 20 63 75 72 72 65 g("End.Word.Region.at.[".+.curre
18640 6e 74 43 68 61 72 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 20 2b 20 22 5d 22 29 3b 0d 0a 20 20 ntCharInfo.character.+."]");....
18660 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 ......//................}.......
18680 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f ...//............}............//
186a0 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4c 61 73 74 20 43 68 61 72 61 63 74 65 72 20 6f 66 ............//.Last.Character.of
186c0 20 57 6f 72 64 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 .Word..........//............if.
186e0 28 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 26 26 20 6a 20 3d 3d 20 6c 69 6e 6b 49 6e 66 6f 2e (isBeginRegion.&&.j.==.linkInfo.
18700 6c 69 6e 6b 54 65 78 74 4c 65 6e 67 74 68 20 2d 20 31 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 linkTextLength.-.1)..........//.
18720 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 ...........{..........//........
18740 20 20 20 20 20 20 20 20 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 3d 20 66 61 6c 73 65 3b 0d 0a ........isBeginRegion.=.false;..
18760 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 72 20 3d ..........//................br.=
18780 20 74 65 78 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 28 6e 65 .textTransform.TransformPoint(ne
187a0 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 74 6f 70 52 69 67 w.Vector3(currentCharInfo.topRig
187c0 68 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 64 65 73 63 65 6e 64 65 72 2c ht.x,.currentCharInfo.descender,
187e0 20 30 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .0));..........//...............
18800 20 74 72 20 3d 20 74 65 78 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 .tr.=.textTransform.TransformPoi
18820 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 74 nt(new.Vector3(currentCharInfo.t
18840 6f 70 52 69 67 68 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 61 73 63 65 6e opRight.x,.currentCharInfo.ascen
18860 64 65 72 2c 20 30 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 der,.0));............//.........
18880 20 20 20 20 20 20 20 2f 2f 20 43 68 65 63 6b 20 66 6f 72 20 49 6e 74 65 72 73 65 63 74 69 6f 6e .......//.Check.for.Intersection
188a0 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 ..........//................if.(
188c0 50 6f 69 6e 74 49 6e 74 65 72 73 65 63 74 52 65 63 74 61 6e 67 6c 65 28 70 6f 73 69 74 69 6f 6e PointIntersectRectangle(position
188e0 2c 20 62 6c 2c 20 74 6c 2c 20 74 72 2c 20 62 72 29 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 ,.bl,.tl,.tr,.br))..........//..
18900 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 69 3b 0d 0a 0d 0a 20 ..................return.i;.....
18920 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 44 65 62 75 67 .......//................//Debug
18940 2e 4c 6f 67 28 22 45 6e 64 20 57 6f 72 64 20 52 65 67 69 6f 6e 20 61 74 20 5b 22 20 2b 20 63 75 .Log("End.Word.Region.at.[".+.cu
18960 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 20 2b 20 22 5d 22 29 3b 0d rrentCharInfo.character.+."]");.
18980 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 .........//............}........
189a0 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 66 20 57 6f 72 64 20 69 73 20 73 70 ..//............//.If.Word.is.sp
189c0 6c 69 74 20 6f 6e 20 6d 6f 72 65 20 74 68 61 6e 20 6f 6e 65 20 6c 69 6e 65 2e 0d 0a 20 20 20 20 lit.on.more.than.one.line.......
189e0 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 20 69 66 20 28 69 73 42 65 67 ....//............else.if.(isBeg
18a00 69 6e 52 65 67 69 6f 6e 20 26 26 20 63 75 72 72 65 6e 74 4c 69 6e 65 20 21 3d 20 74 65 78 74 2e inRegion.&&.currentLine.!=.text.
18a20 74 65 78 74 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 49 6e 66 6f 5b 63 68 61 72 61 63 74 65 72 textInfo.characterInfo[character
18a40 49 6e 64 65 78 20 2b 20 31 5d 2e 6c 69 6e 65 4e 75 6d 62 65 72 29 0d 0a 20 20 20 20 20 20 20 20 Index.+.1].lineNumber)..........
18a60 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 //............{..........//.....
18a80 20 20 20 20 20 20 20 20 20 20 20 69 73 42 65 67 69 6e 52 65 67 69 6f 6e 20 3d 20 66 61 6c 73 65 ...........isBeginRegion.=.false
18aa0 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 ;............//................b
18ac0 72 20 3d 20 74 65 78 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d 50 6f 69 6e 74 r.=.textTransform.TransformPoint
18ae0 28 6e 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 74 6f 70 (new.Vector3(currentCharInfo.top
18b00 52 69 67 68 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 64 65 73 63 65 6e 64 Right.x,.currentCharInfo.descend
18b20 65 72 2c 20 30 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 er,.0));..........//............
18b40 20 20 20 20 74 72 20 3d 20 74 65 78 74 54 72 61 6e 73 66 6f 72 6d 2e 54 72 61 6e 73 66 6f 72 6d ....tr.=.textTransform.Transform
18b60 50 6f 69 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 33 28 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 Point(new.Vector3(currentCharInf
18b80 6f 2e 74 6f 70 52 69 67 68 74 2e 78 2c 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 61 73 o.topRight.x,.currentCharInfo.as
18ba0 63 65 6e 64 65 72 2c 20 30 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 cender,.0));............//......
18bc0 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 68 65 63 6b 20 66 6f 72 20 49 6e 74 65 72 73 65 63 74 ..........//.Check.for.Intersect
18be0 69 6f 6e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 ion..........//................i
18c00 66 20 28 50 6f 69 6e 74 49 6e 74 65 72 73 65 63 74 52 65 63 74 61 6e 67 6c 65 28 70 6f 73 69 74 f.(PointIntersectRectangle(posit
18c20 69 6f 6e 2c 20 62 6c 2c 20 74 6c 2c 20 74 72 2c 20 62 72 29 29 0d 0a 20 20 20 20 20 20 20 20 2f ion,.bl,.tl,.tr,.br))........../
18c40 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 69 3b 0d 0a /....................return.i;..
18c60 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 44 65 ..........//................//De
18c80 62 75 67 2e 4c 6f 67 28 22 45 6e 64 20 57 6f 72 64 20 52 65 67 69 6f 6e 20 61 74 20 5b 22 20 2b bug.Log("End.Word.Region.at.[".+
18ca0 20 63 75 72 72 65 6e 74 43 68 61 72 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 20 2b 20 22 5d 22 .currentCharInfo.character.+."]"
18cc0 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 );..........//............}.....
18ce0 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 .....//........}............//..
18d00 20 20 20 20 20 20 2f 2f 20 46 69 6e 64 20 74 68 65 20 63 6c 6f 73 65 73 74 20 6c 69 6e 65 20 73 ......//.Find.the.closest.line.s
18d20 65 67 6d 65 6e 74 20 74 6f 20 70 6f 73 69 74 69 6f 6e 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 egment.to.position...........//.
18d40 20 20 20 20 20 20 20 66 6c 6f 61 74 20 64 62 6c 20 3d 20 44 69 73 74 61 6e 63 65 54 6f 4c 69 6e .......float.dbl.=.DistanceToLin
18d60 65 28 62 6c 2c 20 74 6c 2c 20 70 6f 73 69 74 69 6f 6e 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f e(bl,.tl,.position);..........//
18d80 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 64 74 6c 20 3d 20 44 69 73 74 61 6e 63 65 54 6f 4c 69 ........float.dtl.=.DistanceToLi
18da0 6e 65 28 74 6c 2c 20 74 72 2c 20 70 6f 73 69 74 69 6f 6e 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f ne(tl,.tr,.position);........../
18dc0 2f 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 64 74 72 20 3d 20 44 69 73 74 61 6e 63 65 54 6f 4c /........float.dtr.=.DistanceToL
18de0 69 6e 65 28 74 72 2c 20 62 72 2c 20 70 6f 73 69 74 69 6f 6e 29 3b 0d 0a 20 20 20 20 20 20 20 20 ine(tr,.br,.position);..........
18e00 2f 2f 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 64 62 72 20 3d 20 44 69 73 74 61 6e 63 65 54 6f //........float.dbr.=.DistanceTo
18e20 4c 69 6e 65 28 62 72 2c 20 62 6c 2c 20 70 6f 73 69 74 69 6f 6e 29 3b 0d 0a 0d 0a 20 20 20 20 20 Line(br,.bl,.position);.........
18e40 20 20 20 2f 2f 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 64 20 3d 20 64 62 6c 20 3c 20 64 74 6c ...//........float.d.=.dbl.<.dtl
18e60 20 3f 20 64 62 6c 20 3a 20 64 74 6c 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 .?.dbl.:.dtl;..........//.......
18e80 20 64 20 3d 20 64 20 3c 20 64 74 72 20 3f 20 64 20 3a 20 64 74 72 3b 0d 0a 20 20 20 20 20 20 20 .d.=.d.<.dtr.?.d.:.dtr;.........
18ea0 20 2f 2f 20 20 20 20 20 20 20 20 64 20 3d 20 64 20 3c 20 64 62 72 20 3f 20 64 20 3a 20 64 62 72 .//........d.=.d.<.dbr.?.d.:.dbr
18ec0 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 69 66 20 28 64 69 73 74 61 ;............//........if.(dista
18ee0 6e 63 65 53 71 72 20 3e 20 64 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 7b nceSqr.>.d)..........//........{
18f00 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 64 69 73 74 61 6e 63 65 ..........//............distance
18f20 53 71 72 20 3d 20 64 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 Sqr.=.d;..........//............
18f40 63 6c 6f 73 65 73 74 20 3d 20 69 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 closest.=.i;..........//........
18f60 7d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 2f 2f 44 65 62 75 67 2e 4c 6f 67 }..........//........//Debug.Log
18f80 28 22 57 6f 72 64 20 61 74 20 49 6e 64 65 78 3a 20 22 20 2b 20 69 20 2b 20 22 20 69 73 20 6c 6f ("Word.at.Index:.".+.i.+.".is.lo
18fa0 63 61 74 65 64 20 61 74 20 28 22 20 2b 20 62 6c 20 2b 20 22 2c 20 22 20 2b 20 74 6c 20 2b 20 22 cated.at.(".+.bl.+.",.".+.tl.+."
18fc0 2c 20 22 20 2b 20 74 72 20 2b 20 22 2c 20 22 20 2b 20 62 72 20 2b 20 22 29 2e 22 29 3b 0d 0a 0d ,.".+.tr.+.",.".+.br.+.").");...
18fe0 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 .........//....}..........//....
19000 72 65 74 75 72 6e 20 63 6c 6f 73 65 73 74 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 7d 0d 0a 0d 0a return.closest;..........//}....
19020 0d 0a 20 20 20 20 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 ................///.<summary>...
19040 20 20 20 20 20 20 20 2f 2f 2f 20 46 75 6e 63 74 69 6f 6e 20 74 6f 20 63 68 65 63 6b 20 69 66 20 .......///.Function.to.check.if.
19060 61 20 50 6f 69 6e 74 20 69 73 20 63 6f 6e 74 61 69 6e 65 64 20 77 69 74 68 69 6e 20 61 20 52 65 a.Point.is.contained.within.a.Re
19080 63 74 61 6e 67 6c 65 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e ctangle...........///.</summary>
190a0 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 6d 22 3e 3c 2f ..........///.<param.name="m"></
190c0 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d param>..........///.<param.name=
190e0 22 61 22 3e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d "a"></param>..........///.<param
19100 20 6e 61 6d 65 3d 22 62 22 3e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 .name="b"></param>..........///.
19120 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 63 22 3e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 <param.name="c"></param>........
19140 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 64 22 3e 3c 2f 70 61 72 61 6d 3e 0d 0a ..///.<param.name="d"></param>..
19160 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 3c 2f 72 65 74 75 72 6e 73 3e 0d ........///.<returns></returns>.
19180 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 73 74 61 74 69 63 20 62 6f 6f 6c 20 50 6f 69 .........private.static.bool.Poi
191a0 6e 74 49 6e 74 65 72 73 65 63 74 52 65 63 74 61 6e 67 6c 65 28 56 65 63 74 6f 72 33 20 6d 2c 20 ntIntersectRectangle(Vector3.m,.
191c0 56 65 63 74 6f 72 33 20 61 2c 20 56 65 63 74 6f 72 33 20 62 2c 20 56 65 63 74 6f 72 33 20 63 2c Vector3.a,.Vector3.b,.Vector3.c,
191e0 20 56 65 63 74 6f 72 33 20 64 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 .Vector3.d)..........{..........
19200 20 20 20 20 56 65 63 74 6f 72 33 20 61 62 20 3d 20 62 20 2d 20 61 3b 0d 0a 20 20 20 20 20 20 20 ....Vector3.ab.=.b.-.a;.........
19220 20 20 20 20 20 56 65 63 74 6f 72 33 20 61 6d 20 3d 20 6d 20 2d 20 61 3b 0d 0a 20 20 20 20 20 20 .....Vector3.am.=.m.-.a;........
19240 20 20 20 20 20 20 56 65 63 74 6f 72 33 20 62 63 20 3d 20 63 20 2d 20 62 3b 0d 0a 20 20 20 20 20 ......Vector3.bc.=.c.-.b;.......
19260 20 20 20 20 20 20 20 56 65 63 74 6f 72 33 20 62 6d 20 3d 20 6d 20 2d 20 62 3b 0d 0a 0d 0a 20 20 .......Vector3.bm.=.m.-.b;......
19280 20 20 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 61 62 61 6d 44 6f 74 20 3d 20 56 65 63 74 6f 72 ..........float.abamDot.=.Vector
192a0 33 2e 44 6f 74 28 61 62 2c 20 61 6d 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 6c 6f 61 3.Dot(ab,.am);..............floa
192c0 74 20 62 63 62 6d 44 6f 74 20 3d 20 56 65 63 74 6f 72 33 2e 44 6f 74 28 62 63 2c 20 62 6d 29 3b t.bcbmDot.=.Vector3.Dot(bc,.bm);
192e0 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 30 20 3c 3d 20 61 62 61 6d ................return.0.<=.abam
19300 44 6f 74 20 26 26 20 61 62 61 6d 44 6f 74 20 3c 3d 20 56 65 63 74 6f 72 33 2e 44 6f 74 28 61 62 Dot.&&.abamDot.<=.Vector3.Dot(ab
19320 2c 20 61 62 29 20 26 26 20 30 20 3c 3d 20 62 63 62 6d 44 6f 74 20 26 26 20 62 63 62 6d 44 6f 74 ,.ab).&&.0.<=.bcbmDot.&&.bcbmDot
19340 20 3c 3d 20 56 65 63 74 6f 72 33 2e 44 6f 74 28 62 63 2c 20 62 63 29 3b 0d 0a 20 20 20 20 20 20 .<=.Vector3.Dot(bc,.bc);........
19360 20 20 7d 0d 0a 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a ..}..............///.<summary>..
19380 20 20 20 20 20 20 20 20 2f 2f 2f 20 4d 65 74 68 6f 64 20 74 6f 20 63 6f 6e 76 65 72 74 20 53 63 ........///.Method.to.convert.Sc
193a0 72 65 65 6e 50 6f 69 6e 74 20 74 6f 20 57 6f 72 6c 64 50 6f 69 6e 74 20 61 6c 69 67 6e 65 64 20 reenPoint.to.WorldPoint.aligned.
193c0 77 69 74 68 20 52 65 63 74 61 6e 67 6c 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 with.Rectangle..........///.</su
193e0 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d mmary>..........///.<param.name=
19400 22 74 72 61 6e 73 66 6f 72 6d 22 3e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f "transform"></param>..........//
19420 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 73 63 72 65 65 6e 50 6f 69 6e 74 22 3e 3c 2f 70 61 /.<param.name="screenPoint"></pa
19440 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 63 ram>..........///.<param.name="c
19460 61 6d 22 3e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d am"></param>..........///.<param
19480 20 6e 61 6d 65 3d 22 77 6f 72 6c 64 50 6f 69 6e 74 22 3e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 .name="worldPoint"></param>.....
194a0 20 20 20 20 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 20 .....///.<returns></returns>....
194c0 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 62 6f 6f 6c 20 53 63 72 65 65 6e 50 ......public.static.bool.ScreenP
194e0 6f 69 6e 74 54 6f 57 6f 72 6c 64 50 6f 69 6e 74 49 6e 52 65 63 74 61 6e 67 6c 65 28 54 72 61 6e ointToWorldPointInRectangle(Tran
19500 73 66 6f 72 6d 20 74 72 61 6e 73 66 6f 72 6d 2c 20 56 65 63 74 6f 72 32 20 73 63 72 65 65 6e 50 sform.transform,.Vector2.screenP
19520 6f 69 6e 74 2c 20 43 61 6d 65 72 61 20 63 61 6d 2c 20 6f 75 74 20 56 65 63 74 6f 72 33 20 77 6f oint,.Camera.cam,.out.Vector3.wo
19540 72 6c 64 50 6f 69 6e 74 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 rldPoint)..........{............
19560 20 20 77 6f 72 6c 64 50 6f 69 6e 74 20 3d 20 28 56 65 63 74 6f 72 33 29 56 65 63 74 6f 72 32 2e ..worldPoint.=.(Vector3)Vector2.
19580 7a 65 72 6f 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 52 61 79 20 72 61 79 20 3d 20 52 65 63 zero;..............Ray.ray.=.Rec
195a0 74 54 72 61 6e 73 66 6f 72 6d 55 74 69 6c 69 74 79 2e 53 63 72 65 65 6e 50 6f 69 6e 74 54 6f 52 tTransformUtility.ScreenPointToR
195c0 61 79 28 63 61 6d 2c 20 73 63 72 65 65 6e 50 6f 69 6e 74 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 ay(cam,.screenPoint);...........
195e0 20 20 20 20 20 69 66 20 28 21 6e 65 77 20 50 6c 61 6e 65 28 74 72 61 6e 73 66 6f 72 6d 2e 72 6f .....if.(!new.Plane(transform.ro
19600 74 61 74 69 6f 6e 20 2a 20 56 65 63 74 6f 72 33 2e 62 61 63 6b 2c 20 74 72 61 6e 73 66 6f 72 6d tation.*.Vector3.back,.transform
19620 2e 70 6f 73 69 74 69 6f 6e 29 2e 52 61 79 63 61 73 74 28 72 61 79 2c 20 6f 75 74 20 66 6c 6f 61 .position).Raycast(ray,.out.floa
19640 74 20 65 6e 74 65 72 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 t.enter))..................retur
19660 6e 20 66 61 6c 73 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 77 6f 72 6c 64 50 6f 69 n.false;................worldPoi
19680 6e 74 20 3d 20 72 61 79 2e 47 65 74 50 6f 69 6e 74 28 65 6e 74 65 72 29 3b 0d 0a 0d 0a 20 20 20 nt.=.ray.GetPoint(enter);.......
196a0 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 74 72 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 7d .........return.true;..........}
196c0 0d 0a 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 73 74 72 75 63 74 20 4c 69 6e ..............private.struct.Lin
196e0 65 53 65 67 6d 65 6e 74 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 eSegment..........{.............
19700 20 70 75 62 6c 69 63 20 56 65 63 74 6f 72 33 20 50 6f 69 6e 74 31 3b 0d 0a 20 20 20 20 20 20 20 .public.Vector3.Point1;.........
19720 20 20 20 20 20 70 75 62 6c 69 63 20 56 65 63 74 6f 72 33 20 50 6f 69 6e 74 32 3b 0d 0a 0d 0a 20 .....public.Vector3.Point2;.....
19740 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 4c 69 6e 65 53 65 67 6d 65 6e 74 28 56 65 ...........public.LineSegment(Ve
19760 63 74 6f 72 33 20 70 31 2c 20 56 65 63 74 6f 72 33 20 70 32 29 0d 0a 20 20 20 20 20 20 20 20 20 ctor3.p1,.Vector3.p2)...........
19780 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 50 6f 69 6e 74 31 20 3d 20 70 ...{..................Point1.=.p
197a0 31 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 50 6f 69 6e 74 32 20 3d 20 70 32 3b 1;..................Point2.=.p2;
197c0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 0d 0a ..............}..........}......
197e0 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f ........///.<summary>........../
19800 2f 2f 20 46 75 6e 63 74 69 6f 6e 20 72 65 74 75 72 6e 69 6e 67 20 74 68 65 20 70 6f 69 6e 74 20 //.Function.returning.the.point.
19820 6f 66 20 69 6e 74 65 72 73 65 63 74 69 6f 6e 20 62 65 74 77 65 65 6e 20 61 20 6c 69 6e 65 20 61 of.intersection.between.a.line.a
19840 6e 64 20 61 20 70 6c 61 6e 65 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 nd.a.plane...........///.</summa
19860 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 6c 69 ry>..........///.<param.name="li
19880 6e 65 22 3e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d ne"></param>..........///.<param
198a0 20 6e 61 6d 65 3d 22 70 6f 69 6e 74 22 3e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 .name="point"></param>..........
198c0 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 6e 6f 72 6d 61 6c 22 3e 3c 2f 70 61 72 61 6d ///.<param.name="normal"></param
198e0 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 69 6e 74 65 >..........///.<param.name="inte
19900 72 73 65 63 74 69 6e 67 50 6f 69 6e 74 22 3e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 rsectingPoint"></param>.........
19920 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 .///.<returns></returns>........
19940 20 20 70 72 69 76 61 74 65 20 73 74 61 74 69 63 20 62 6f 6f 6c 20 49 6e 74 65 72 73 65 63 74 4c ..private.static.bool.IntersectL
19960 69 6e 65 50 6c 61 6e 65 28 4c 69 6e 65 53 65 67 6d 65 6e 74 20 6c 69 6e 65 2c 20 56 65 63 74 6f inePlane(LineSegment.line,.Vecto
19980 72 33 20 70 6f 69 6e 74 2c 20 56 65 63 74 6f 72 33 20 6e 6f 72 6d 61 6c 2c 20 6f 75 74 20 56 65 r3.point,.Vector3.normal,.out.Ve
199a0 63 74 6f 72 33 20 69 6e 74 65 72 73 65 63 74 69 6e 67 50 6f 69 6e 74 29 0d 0a 20 20 20 20 20 20 ctor3.intersectingPoint)........
199c0 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 65 72 73 65 63 74 69 6e 67 50 6f 69 ..{..............intersectingPoi
199e0 6e 74 20 3d 20 56 65 63 74 6f 72 33 2e 7a 65 72 6f 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 nt.=.Vector3.zero;..............
19a00 56 65 63 74 6f 72 33 20 75 20 3d 20 6c 69 6e 65 2e 50 6f 69 6e 74 32 20 2d 20 6c 69 6e 65 2e 50 Vector3.u.=.line.Point2.-.line.P
19a20 6f 69 6e 74 31 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 56 65 63 74 6f 72 33 20 77 20 3d 20 oint1;..............Vector3.w.=.
19a40 6c 69 6e 65 2e 50 6f 69 6e 74 31 20 2d 20 70 6f 69 6e 74 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 line.Point1.-.point;............
19a60 20 20 20 20 66 6c 6f 61 74 20 44 20 3d 20 56 65 63 74 6f 72 33 2e 44 6f 74 28 6e 6f 72 6d 61 6c ....float.D.=.Vector3.Dot(normal
19a80 2c 20 75 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 4e 20 3d 20 2d 56 65 ,.u);..............float.N.=.-Ve
19aa0 63 74 6f 72 33 2e 44 6f 74 28 6e 6f 72 6d 61 6c 2c 20 77 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 ctor3.Dot(normal,.w);...........
19ac0 20 20 20 20 20 69 66 20 28 4d 61 74 68 66 2e 41 62 73 28 44 29 20 3c 20 4d 61 74 68 66 2e 45 70 .....if.(Mathf.Abs(D).<.Mathf.Ep
19ae0 73 69 6c 6f 6e 29 20 20 20 2f 2f 20 69 66 20 6c 69 6e 65 20 69 73 20 70 61 72 61 6c 6c 65 6c 20 silon)...//.if.line.is.parallel.
19b00 26 20 63 6f 2d 70 6c 61 6e 61 72 20 74 6f 20 70 6c 61 6e 65 0d 0a 20 20 20 20 20 20 20 20 20 20 &.co-planar.to.plane............
19b20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 4e 20 3d 3d 20 30 29 ..{..................if.(N.==.0)
19b40 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 74 72 75 ......................return.tru
19b60 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 0d 0a 20 20 20 20 20 20 e;..................else........
19b80 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 66 61 6c 73 65 3b 0d 0a 20 20 20 ..............return.false;.....
19ba0 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 .........}................float.
19bc0 73 49 20 3d 20 4e 20 2f 20 44 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 sI.=.N./.D;................if.(s
19be0 49 20 3c 20 30 20 7c 7c 20 73 49 20 3e 20 31 29 20 2f 2f 20 4c 69 6e 65 20 70 61 72 61 6c 6c 65 I.<.0.||.sI.>.1).//.Line.paralle
19c00 6c 20 74 6f 20 70 6c 61 6e 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 l.to.plane..................retu
19c20 72 6e 20 66 61 6c 73 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 65 72 73 65 rn.false;................interse
19c40 63 74 69 6e 67 50 6f 69 6e 74 20 3d 20 6c 69 6e 65 2e 50 6f 69 6e 74 31 20 2b 20 73 49 20 2a 20 ctingPoint.=.line.Point1.+.sI.*.
19c60 75 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 74 72 75 65 3b 0d 0a u;................return.true;..
19c80 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d ........}..............///.<summ
19ca0 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 46 75 6e 63 74 69 6f 6e 20 72 65 74 75 72 ary>..........///.Function.retur
19cc0 6e 69 6e 67 20 74 68 65 20 53 71 75 61 72 65 20 44 69 73 74 61 6e 63 65 20 66 72 6f 6d 20 61 20 ning.the.Square.Distance.from.a.
19ce0 50 6f 69 6e 74 20 74 6f 20 61 20 4c 69 6e 65 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f Point.to.a.Line...........///.</
19d00 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d summary>..........///.<param.nam
19d20 65 3d 22 61 22 3e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 e="a"></param>..........///.<par
19d40 61 6d 20 6e 61 6d 65 3d 22 62 22 3e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f am.name="b"></param>..........//
19d60 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 70 6f 69 6e 74 22 3e 3c 2f 70 61 72 61 6d 3e 0d 0a /.<param.name="point"></param>..
19d80 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 3c 2f 72 65 74 75 72 6e 73 3e 0d ........///.<returns></returns>.
19da0 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 66 6c 6f 61 74 20 44 69 73 .........public.static.float.Dis
19dc0 74 61 6e 63 65 54 6f 4c 69 6e 65 28 56 65 63 74 6f 72 33 20 61 2c 20 56 65 63 74 6f 72 33 20 62 tanceToLine(Vector3.a,.Vector3.b
19de0 2c 20 56 65 63 74 6f 72 33 20 70 6f 69 6e 74 29 0d 0a 20 20 20 20 20 20 20 20 7b 20 20 20 20 20 ,.Vector3.point)..........{.....
19e00 20 20 20 20 20 20 20 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 56 65 63 74 6f 72 33 20 6e 20 3d .....................Vector3.n.=
19e20 20 62 20 2d 20 61 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 56 65 63 74 6f 72 33 20 70 61 20 .b.-.a;..............Vector3.pa.
19e40 3d 20 61 20 2d 20 70 6f 69 6e 74 3b 0d 0a 20 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 6c 6f =.a.-.point;.................flo
19e60 61 74 20 63 20 3d 20 56 65 63 74 6f 72 33 2e 44 6f 74 28 20 6e 2c 20 70 61 20 29 3b 0d 0a 20 0d at.c.=.Vector3.Dot(.n,.pa.);....
19e80 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 6c 6f 73 65 73 74 20 70 6f 69 6e 74 20 69 73 .............//.Closest.point.is
19ea0 20 61 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 20 63 20 3e 20 30 2e 30 66 20 29 0d .a..............if.(.c.>.0.0f.).
19ec0 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 56 65 63 74 6f 72 33 2e .................return.Vector3.
19ee0 44 6f 74 28 20 70 61 2c 20 70 61 20 29 3b 0d 0a 20 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 56 Dot(.pa,.pa.);.................V
19f00 65 63 74 6f 72 33 20 62 70 20 3d 20 70 6f 69 6e 74 20 2d 20 62 3b 0d 0a 20 0d 0a 20 20 20 20 20 ector3.bp.=.point.-.b;..........
19f20 20 20 20 20 20 20 20 2f 2f 20 43 6c 6f 73 65 73 74 20 70 6f 69 6e 74 20 69 73 20 62 0d 0a 20 20 .......//.Closest.point.is.b....
19f40 20 20 20 20 20 20 20 20 20 20 69 66 20 28 56 65 63 74 6f 72 33 2e 44 6f 74 28 20 6e 2c 20 62 70 ..........if.(Vector3.Dot(.n,.bp
19f60 20 29 20 3e 20 30 2e 30 66 20 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 .).>.0.0f.)..................ret
19f80 75 72 6e 20 56 65 63 74 6f 72 33 2e 44 6f 74 28 20 62 70 2c 20 62 70 20 29 3b 0d 0a 20 0d 0a 20 urn.Vector3.Dot(.bp,.bp.);......
19fa0 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 6c 6f 73 65 73 74 20 70 6f 69 6e 74 20 69 73 20 62 ...........//.Closest.point.is.b
19fc0 65 74 77 65 65 6e 20 61 20 61 6e 64 20 62 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 56 65 63 74 etween.a.and.b..............Vect
19fe0 6f 72 33 20 65 20 3d 20 70 61 20 2d 20 6e 20 2a 20 28 63 20 2f 20 56 65 63 74 6f 72 33 2e 44 6f or3.e.=.pa.-.n.*.(c./.Vector3.Do
1a000 74 28 20 6e 2c 20 6e 20 29 29 3b 0d 0a 20 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 t(.n,.n.));.................retu
1a020 72 6e 20 56 65 63 74 6f 72 33 2e 44 6f 74 28 20 65 2c 20 65 20 29 3b 0d 0a 20 20 20 20 20 20 20 rn.Vector3.Dot(.e,.e.);.........
1a040 20 7d 0d 0a 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 .}..............///.<summary>...
1a060 20 20 20 20 20 20 20 2f 2f 2f 20 46 75 6e 63 74 69 6f 6e 20 72 65 74 75 72 6e 69 6e 67 20 74 68 .......///.Function.returning.th
1a080 65 20 53 71 75 61 72 65 20 44 69 73 74 61 6e 63 65 20 66 72 6f 6d 20 61 20 50 6f 69 6e 74 20 74 e.Square.Distance.from.a.Point.t
1a0a0 6f 20 61 20 4c 69 6e 65 20 61 6e 64 20 44 69 72 65 63 74 69 6f 6e 2e 0d 0a 20 20 20 20 20 20 20 o.a.Line.and.Direction..........
1a0c0 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 .///.</summary>..........///.<pa
1a0e0 72 61 6d 20 6e 61 6d 65 3d 22 61 22 3e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f ram.name="a"></param>........../
1a100 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 62 22 3e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 //.<param.name="b"></param>.....
1a120 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 70 6f 69 6e 74 22 3e 3c 2f 70 .....///.<param.name="point"></p
1a140 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 aram>..........///.<param.name="
1a160 64 69 72 65 63 74 69 6f 6e 22 3e 2d 31 20 6c 65 66 74 2c 20 30 20 69 6e 20 62 65 74 77 65 65 6e direction">-1.left,.0.in.between
1a180 2c 20 31 20 72 69 67 68 74 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c ,.1.right</param>..........///.<
1a1a0 72 65 74 75 72 6e 73 3e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 70 75 returns></returns>..........//pu
1a1c0 62 6c 69 63 20 73 74 61 74 69 63 20 66 6c 6f 61 74 20 44 69 73 74 61 6e 63 65 54 6f 4c 69 6e 65 blic.static.float.DistanceToLine
1a1e0 44 69 72 65 63 74 69 6f 6e 61 6c 28 56 65 63 74 6f 72 33 20 61 2c 20 56 65 63 74 6f 72 33 20 62 Directional(Vector3.a,.Vector3.b
1a200 2c 20 56 65 63 74 6f 72 33 20 70 6f 69 6e 74 2c 20 72 65 66 20 69 6e 74 20 64 69 72 65 63 74 69 ,.Vector3.point,.ref.int.directi
1a220 6f 6e 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 on)..........//{..........//....
1a240 56 65 63 74 6f 72 33 20 6e 20 3d 20 62 20 2d 20 61 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 Vector3.n.=.b.-.a;..........//..
1a260 20 20 56 65 63 74 6f 72 33 20 70 61 20 3d 20 61 20 2d 20 70 6f 69 6e 74 3b 0d 0a 0d 0a 20 20 20 ..Vector3.pa.=.a.-.point;.......
1a280 20 20 20 20 20 2f 2f 20 20 20 20 66 6c 6f 61 74 20 63 20 3d 20 56 65 63 74 6f 72 33 2e 44 6f 74 .....//....float.c.=.Vector3.Dot
1a2a0 28 6e 2c 20 70 61 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 64 69 72 65 63 74 69 6f (n,.pa);..........//....directio
1a2c0 6e 20 3d 20 2d 31 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 2f 2f 20 43 6c 6f 73 n.=.-1;............//....//.Clos
1a2e0 65 73 74 20 70 6f 69 6e 74 20 69 73 20 61 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 69 66 est.point.is.a..........//....if
1a300 20 28 63 20 3e 20 30 2e 30 66 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 72 .(c.>.0.0f)..........//........r
1a320 65 74 75 72 6e 20 56 65 63 74 6f 72 33 2e 44 6f 74 28 70 61 2c 20 70 61 29 3b 0d 0a 0d 0a 20 20 eturn.Vector3.Dot(pa,.pa);......
1a340 20 20 20 20 20 20 2f 2f 20 20 20 20 56 65 63 74 6f 72 33 20 62 70 20 3d 20 70 6f 69 6e 74 20 2d ......//....Vector3.bp.=.point.-
1a360 20 62 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 64 69 72 65 63 74 69 6f 6e 20 3d 20 31 .b;..........//....direction.=.1
1a380 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 2f 2f 20 43 6c 6f 73 65 73 74 20 70 6f ;............//....//.Closest.po
1a3a0 69 6e 74 20 69 73 20 62 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 69 66 20 28 56 65 63 74 int.is.b..........//....if.(Vect
1a3c0 6f 72 33 2e 44 6f 74 28 6e 2c 20 62 70 29 20 3e 20 30 2e 30 66 29 0d 0a 20 20 20 20 20 20 20 20 or3.Dot(n,.bp).>.0.0f)..........
1a3e0 2f 2f 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 56 65 63 74 6f 72 33 2e 44 6f 74 28 62 70 2c //........return.Vector3.Dot(bp,
1a400 20 62 70 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 2f 2f 20 43 6c 6f 73 65 73 .bp);............//....//.Closes
1a420 74 20 70 6f 69 6e 74 20 69 73 20 62 65 74 77 65 65 6e 20 61 20 61 6e 64 20 62 0d 0a 20 20 20 20 t.point.is.between.a.and.b......
1a440 20 20 20 20 2f 2f 20 20 20 20 56 65 63 74 6f 72 33 20 65 20 3d 20 70 61 20 2d 20 6e 20 2a 20 28 ....//....Vector3.e.=.pa.-.n.*.(
1a460 63 20 2f 20 56 65 63 74 6f 72 33 2e 44 6f 74 28 6e 2c 20 6e 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 c./.Vector3.Dot(n,.n));.........
1a480 20 20 20 2f 2f 20 20 20 20 64 69 72 65 63 74 69 6f 6e 20 3d 20 30 3b 0d 0a 20 20 20 20 20 20 20 ...//....direction.=.0;.........
1a4a0 20 2f 2f 20 20 20 20 72 65 74 75 72 6e 20 56 65 63 74 6f 72 33 2e 44 6f 74 28 65 2c 20 65 29 3b .//....return.Vector3.Dot(e,.e);
1a4c0 0d 0a 20 20 20 20 20 20 20 20 2f 2f 7d 0d 0a 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c ..........//}..............///.<
1a4e0 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 61 62 6c 65 20 75 73 65 64 summary>..........///.Table.used
1a500 20 74 6f 20 63 6f 6e 76 65 72 74 20 63 68 61 72 61 63 74 65 72 20 74 6f 20 6c 6f 77 65 72 63 61 .to.convert.character.to.lowerca
1a520 73 65 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 se...........///.</summary>.....
1a540 20 20 20 20 20 63 6f 6e 73 74 20 73 74 72 69 6e 67 20 6b 5f 6c 6f 6f 6b 75 70 53 74 72 69 6e 67 .....const.string.k_lookupString
1a560 4c 20 3d 20 22 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d L.=."---------------------------
1a580 2d 2d 2d 2d 2d 20 21 2d 23 24 25 26 2d 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a -----.!-#$%&-()*+,-./0123456789:
1a5a0 3b 3c 3d 3e 3f 40 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 71 72 73 74 75 76 77 78 79 7a ;<=>?@abcdefghijklmnopqrstuvwxyz
1a5c0 5b 2d 5d 5e 5f 60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 71 72 73 74 75 76 77 78 79 7a [-]^_`abcdefghijklmnopqrstuvwxyz
1a5e0 7b 7c 7d 7e 2d 22 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e {|}~-";............///.<summary>
1a600 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 61 62 6c 65 20 75 73 65 64 20 74 6f 20 63 6f 6e 76 ..........///.Table.used.to.conv
1a620 65 72 74 20 63 68 61 72 61 63 74 65 72 20 74 6f 20 75 70 70 65 72 63 61 73 65 2e 0d 0a 20 20 20 ert.character.to.uppercase......
1a640 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 63 6f 6e .....///.</summary>..........con
1a660 73 74 20 73 74 72 69 6e 67 20 6b 5f 6c 6f 6f 6b 75 70 53 74 72 69 6e 67 55 20 3d 20 22 2d 2d 2d st.string.k_lookupStringU.=."---
1a680 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 20 21 2d -----------------------------.!-
1a6a0 23 24 25 26 2d 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f 40 41 42 #$%&-()*+,-./0123456789:;<=>?@AB
1a6c0 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 51 52 53 54 55 56 57 58 59 5a 5b 2d 5d 5e 5f 60 41 42 CDEFGHIJKLMNOPQRSTUVWXYZ[-]^_`AB
1a6e0 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 51 52 53 54 55 56 57 58 59 5a 7b 7c 7d 7e 2d 22 3b 0d CDEFGHIJKLMNOPQRSTUVWXYZ{|}~-";.
1a700 0a 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 .............///.<summary>......
1a720 20 20 20 20 2f 2f 2f 20 47 65 74 20 6c 6f 77 65 72 63 61 73 65 20 76 65 72 73 69 6f 6e 20 6f 66 ....///.Get.lowercase.version.of
1a740 20 74 68 69 73 20 41 53 43 49 49 20 63 68 61 72 61 63 74 65 72 2e 0d 0a 20 20 20 20 20 20 20 20 .this.ASCII.character...........
1a760 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 ///.</summary>..........public.s
1a780 74 61 74 69 63 20 63 68 61 72 20 54 6f 4c 6f 77 65 72 46 61 73 74 28 63 68 61 72 20 63 29 0d 0a tatic.char.ToLowerFast(char.c)..
1a7a0 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 20 3e 20 6b ........{..............if.(c.>.k
1a7c0 5f 6c 6f 6f 6b 75 70 53 74 72 69 6e 67 4c 2e 4c 65 6e 67 74 68 20 2d 20 31 29 0d 0a 20 20 20 20 _lookupStringL.Length.-.1)......
1a7e0 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 63 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 ............return.c;...........
1a800 20 20 20 20 20 72 65 74 75 72 6e 20 6b 5f 6c 6f 6f 6b 75 70 53 74 72 69 6e 67 4c 5b 63 5d 3b 0d .....return.k_lookupStringL[c];.
1a820 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 .........}............///.<summa
1a840 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 47 65 74 20 75 70 70 65 72 63 61 73 65 20 76 ry>..........///.Get.uppercase.v
1a860 65 72 73 69 6f 6e 20 6f 66 20 74 68 69 73 20 41 53 43 49 49 20 63 68 61 72 61 63 74 65 72 2e 0d ersion.of.this.ASCII.character..
1a880 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 .........///.</summary>.........
1a8a0 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 63 68 61 72 20 54 6f 55 70 70 65 72 46 61 73 74 28 .public.static.char.ToUpperFast(
1a8c0 63 68 61 72 20 63 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 char.c)..........{..............
1a8e0 69 66 20 28 63 20 3e 20 6b 5f 6c 6f 6f 6b 75 70 53 74 72 69 6e 67 55 2e 4c 65 6e 67 74 68 20 2d if.(c.>.k_lookupStringU.Length.-
1a900 20 31 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 63 3b 0d 0a .1)..................return.c;..
1a920 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 6b 5f 6c 6f 6f 6b 75 70 53 74 72 ..............return.k_lookupStr
1a940 69 6e 67 55 5b 63 5d 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f ingU[c];..........}............/
1a960 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 46 75 6e 63 74 69 //.<summary>..........///.Functi
1a980 6f 6e 20 77 68 69 63 68 20 72 65 74 75 72 6e 73 20 61 20 73 69 6d 70 6c 65 20 68 61 73 68 63 6f on.which.returns.a.simple.hashco
1a9a0 64 65 20 66 72 6f 6d 20 61 20 73 74 72 69 6e 67 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c de.from.a.string...........///.<
1a9c0 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e /summary>..........///.<returns>
1a9e0 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 </returns>..........public.stati
1aa00 63 20 69 6e 74 20 47 65 74 53 69 6d 70 6c 65 48 61 73 68 43 6f 64 65 28 73 74 72 69 6e 67 20 73 c.int.GetSimpleHashCode(string.s
1aa20 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 20 68 61 )..........{..............int.ha
1aa40 73 68 43 6f 64 65 20 3d 20 30 3b 20 2f 2f 20 35 33 38 31 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 shCode.=.0;.//.5381;............
1aa60 20 20 20 20 66 6f 72 20 28 69 6e 74 20 69 20 3d 20 30 3b 20 69 20 3c 20 73 2e 4c 65 6e 67 74 68 ....for.(int.i.=.0;.i.<.s.Length
1aa80 3b 20 69 2b 2b 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 68 61 73 68 43 6f 64 65 ;.i++)..................hashCode
1aaa0 20 3d 20 28 68 61 73 68 43 6f 64 65 20 3c 3c 20 35 29 20 2b 20 68 61 73 68 43 6f 64 65 20 5e 20 .=.(hashCode.<<.5).+.hashCode.^.
1aac0 73 5b 69 5d 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 68 61 73 68 s[i];................return.hash
1aae0 43 6f 64 65 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 Code;..........}............///.
1ab00 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 46 75 6e 63 74 69 6f 6e 20 <summary>..........///.Function.
1ab20 77 68 69 63 68 20 72 65 74 75 72 6e 73 20 61 20 73 69 6d 70 6c 65 20 68 61 73 68 63 6f 64 65 20 which.returns.a.simple.hashcode.
1ab40 66 72 6f 6d 20 61 20 73 74 72 69 6e 67 20 63 6f 6e 76 65 72 74 65 64 20 74 6f 20 6c 6f 77 65 72 from.a.string.converted.to.lower
1ab60 63 61 73 65 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 case...........///.</summary>...
1ab80 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a .......///.<returns></returns>..
1aba0 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 75 69 6e 74 20 47 65 74 53 69 ........public.static.uint.GetSi
1abc0 6d 70 6c 65 48 61 73 68 43 6f 64 65 4c 6f 77 65 72 63 61 73 65 28 73 74 72 69 6e 67 20 73 29 0d mpleHashCodeLowercase(string.s).
1abe0 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 75 69 6e 74 20 68 61 73 .........{..............uint.has
1ac00 68 43 6f 64 65 20 3d 20 35 33 38 31 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 hCode.=.5381;................for
1ac20 20 28 69 6e 74 20 69 20 3d 20 30 3b 20 69 20 3c 20 73 2e 4c 65 6e 67 74 68 3b 20 69 2b 2b 29 0d .(int.i.=.0;.i.<.s.Length;.i++).
1ac40 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 68 61 73 68 43 6f 64 65 20 3d 20 28 68 61 73 .................hashCode.=.(has
1ac60 68 43 6f 64 65 20 3c 3c 20 35 29 20 2b 20 68 61 73 68 43 6f 64 65 20 5e 20 54 6f 4c 6f 77 65 72 hCode.<<.5).+.hashCode.^.ToLower
1ac80 46 61 73 74 28 73 5b 69 5d 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 Fast(s[i]);................retur
1aca0 6e 20 68 61 73 68 43 6f 64 65 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 0d 0a 20 20 20 20 n.hashCode;..........}..........
1acc0 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 46 ....///.<summary>..........///.F
1ace0 75 6e 63 74 69 6f 6e 20 74 6f 20 63 6f 6e 76 65 72 74 20 48 65 78 20 74 6f 20 49 6e 74 0d 0a 20 unction.to.convert.Hex.to.Int...
1ad00 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f .......///.</summary>........../
1ad20 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 68 65 78 22 3e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 //.<param.name="hex"></param>...
1ad40 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a .......///.<returns></returns>..
1ad60 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 69 6e 74 20 48 65 78 54 6f 49 ........public.static.int.HexToI
1ad80 6e 74 28 63 68 61 72 20 68 65 78 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 nt(char.hex)..........{.........
1ada0 20 20 20 20 20 73 77 69 74 63 68 20 28 68 65 78 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b .....switch.(hex)..............{
1adc0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 73 65 20 27 30 27 3a 20 72 65 74 75 ..................case.'0':.retu
1ade0 72 6e 20 30 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 73 65 20 27 31 27 3a rn.0;..................case.'1':
1ae00 20 72 65 74 75 72 6e 20 31 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 73 65 .return.1;..................case
1ae20 20 27 32 27 3a 20 72 65 74 75 72 6e 20 32 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .'2':.return.2;.................
1ae40 20 63 61 73 65 20 27 33 27 3a 20 72 65 74 75 72 6e 20 33 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 .case.'3':.return.3;............
1ae60 20 20 20 20 20 20 63 61 73 65 20 27 34 27 3a 20 72 65 74 75 72 6e 20 34 3b 0d 0a 20 20 20 20 20 ......case.'4':.return.4;.......
1ae80 20 20 20 20 20 20 20 20 20 20 20 63 61 73 65 20 27 35 27 3a 20 72 65 74 75 72 6e 20 35 3b 0d 0a ...........case.'5':.return.5;..
1aea0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 73 65 20 27 36 27 3a 20 72 65 74 75 72 6e ................case.'6':.return
1aec0 20 36 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 73 65 20 27 37 27 3a 20 72 .6;..................case.'7':.r
1aee0 65 74 75 72 6e 20 37 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 73 65 20 27 eturn.7;..................case.'
1af00 38 27 3a 20 72 65 74 75 72 6e 20 38 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 8':.return.8;..................c
1af20 61 73 65 20 27 39 27 3a 20 72 65 74 75 72 6e 20 39 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 ase.'9':.return.9;..............
1af40 20 20 20 20 63 61 73 65 20 27 41 27 3a 20 72 65 74 75 72 6e 20 31 30 3b 0d 0a 20 20 20 20 20 20 ....case.'A':.return.10;........
1af60 20 20 20 20 20 20 20 20 20 20 63 61 73 65 20 27 42 27 3a 20 72 65 74 75 72 6e 20 31 31 3b 0d 0a ..........case.'B':.return.11;..
1af80 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 73 65 20 27 43 27 3a 20 72 65 74 75 72 6e ................case.'C':.return
1afa0 20 31 32 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 73 65 20 27 44 27 3a 20 .12;..................case.'D':.
1afc0 72 65 74 75 72 6e 20 31 33 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 73 65 return.13;..................case
1afe0 20 27 45 27 3a 20 72 65 74 75 72 6e 20 31 34 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .'E':.return.14;................
1b000 20 20 63 61 73 65 20 27 46 27 3a 20 72 65 74 75 72 6e 20 31 35 3b 0d 0a 20 20 20 20 20 20 20 20 ..case.'F':.return.15;..........
1b020 20 20 20 20 20 20 20 20 63 61 73 65 20 27 61 27 3a 20 72 65 74 75 72 6e 20 31 30 3b 0d 0a 20 20 ........case.'a':.return.10;....
1b040 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 73 65 20 27 62 27 3a 20 72 65 74 75 72 6e 20 31 ..............case.'b':.return.1
1b060 31 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 73 65 20 27 63 27 3a 20 72 65 1;..................case.'c':.re
1b080 74 75 72 6e 20 31 32 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 73 65 20 27 turn.12;..................case.'
1b0a0 64 27 3a 20 72 65 74 75 72 6e 20 31 33 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 d':.return.13;..................
1b0c0 63 61 73 65 20 27 65 27 3a 20 72 65 74 75 72 6e 20 31 34 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 case.'e':.return.14;............
1b0e0 20 20 20 20 20 20 63 61 73 65 20 27 66 27 3a 20 72 65 74 75 72 6e 20 31 35 3b 0d 0a 20 20 20 20 ......case.'f':.return.15;......
1b100 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 31 35 ........}..............return.15
1b120 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 ;..........}..............///.<s
1b140 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 46 75 6e 63 74 69 6f 6e 20 74 6f ummary>..........///.Function.to
1b160 20 63 6f 6e 76 65 72 74 20 61 20 70 72 6f 70 65 72 6c 79 20 66 6f 72 6d 61 74 74 65 64 20 73 74 .convert.a.properly.formatted.st
1b180 72 69 6e 67 20 77 68 69 63 68 20 63 6f 6e 74 61 69 6e 73 20 61 6e 20 68 65 78 20 76 61 6c 75 65 ring.which.contains.an.hex.value
1b1a0 20 74 6f 20 69 74 73 20 64 65 63 69 6d 61 6c 20 76 61 6c 75 65 2e 20 0d 0a 20 20 20 20 20 20 20 .to.its.decimal.value...........
1b1c0 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 .///.</summary>..........///.<pa
1b1e0 72 61 6d 20 6e 61 6d 65 3d 22 73 22 3e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f ram.name="s"></param>........../
1b200 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 20 20 //.<returns></returns>..........
1b220 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 69 6e 74 20 53 74 72 69 6e 67 48 65 78 54 6f 49 6e 74 public.static.int.StringHexToInt
1b240 28 73 74 72 69 6e 67 20 73 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 (string.s)..........{...........
1b260 20 20 20 69 6e 74 20 76 61 6c 75 65 20 3d 20 30 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ...int.value.=.0;...............
1b280 20 66 6f 72 20 28 69 6e 74 20 69 20 3d 20 30 3b 20 69 20 3c 20 73 2e 4c 65 6e 67 74 68 3b 20 69 .for.(int.i.=.0;.i.<.s.Length;.i
1b2a0 2b 2b 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 ++)..............{..............
1b2c0 20 20 20 20 76 61 6c 75 65 20 2b 3d 20 48 65 78 54 6f 49 6e 74 28 73 5b 69 5d 29 20 2a 20 28 69 ....value.+=.HexToInt(s[i]).*.(i
1b2e0 6e 74 29 4d 61 74 68 66 2e 50 6f 77 28 31 36 2c 20 28 73 2e 4c 65 6e 67 74 68 20 2d 20 31 29 20 nt)Mathf.Pow(16,.(s.Length.-.1).
1b300 2d 20 69 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 -.i);..............}............
1b320 20 20 20 20 72 65 74 75 72 6e 20 76 61 6c 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a ....return.value;..........}....
1b340 20 20 20 20 7d 0d 0a 7d 0d 0a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ....}..}........................
1b360 11 00 00 00 54 4d 50 5f 54 65 78 74 55 74 69 6c 69 74 69 65 73 00 00 00 05 00 00 00 54 4d 50 72 ....TMP_TextUtilities.......TMPr
1b380 6f 00 00 00 o...