summaryrefslogtreecommitdiff
path: root/Library/Artifacts/b3/b32f90e5e9a12b0f1634dc12660970fd
blob: 7956b17abf99fb4694a788a6325651e1865e54ac (plain)
ofshex dumpascii
0000 00 00 0f 97 00 02 84 9c 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 3c 74 02 00 01 00 00 00 00 00 00 00 01 00 00 00 00 e3 4e a0 7a c9 2d 24 5a 5b b3 b0 c0 4a 1f f3 <t................N.z.-$Z[...J..
0fa0 f0 03 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 01 00 00 00 80 b9 2a 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 0e 00 00 00 54 4d 50 5f 49 6e 70 75 74 46 69 65 6c 64 00 00 c5 73 02 00 ............TMP_InputField...s..
10a0 2f 2f 23 64 65 66 69 6e 65 20 54 4d 50 5f 44 45 42 55 47 5f 4d 4f 44 45 0d 0a 0d 0a 75 73 69 6e //#define.TMP_DEBUG_MODE....usin
10c0 67 20 53 79 73 74 65 6d 3b 0d 0a 75 73 69 6e 67 20 53 79 73 74 65 6d 2e 43 6f 6c 6c 65 63 74 69 g.System;..using.System.Collecti
10e0 6f 6e 73 3b 0d 0a 75 73 69 6e 67 20 53 79 73 74 65 6d 2e 43 6f 6c 6c 65 63 74 69 6f 6e 73 2e 47 ons;..using.System.Collections.G
1100 65 6e 65 72 69 63 3b 0d 0a 75 73 69 6e 67 20 53 79 73 74 65 6d 2e 54 65 78 74 3b 0d 0a 75 73 69 eneric;..using.System.Text;..usi
1120 6e 67 20 53 79 73 74 65 6d 2e 54 65 78 74 2e 52 65 67 75 6c 61 72 45 78 70 72 65 73 73 69 6f 6e ng.System.Text.RegularExpression
1140 73 3b 0d 0a 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 55 6e s;..using.UnityEngine;..using.Un
1160 69 74 79 45 6e 67 69 6e 65 2e 55 49 3b 0d 0a 75 73 69 6e 67 20 55 6e 69 74 79 45 6e 67 69 6e 65 ityEngine.UI;..using.UnityEngine
1180 2e 45 76 65 6e 74 73 3b 0d 0a 75 73 69 6e 67 20 55 6e 69 74 79 45 6e 67 69 6e 65 2e 45 76 65 6e .Events;..using.UnityEngine.Even
11a0 74 53 79 73 74 65 6d 73 3b 0d 0a 75 73 69 6e 67 20 55 6e 69 74 79 45 6e 67 69 6e 65 2e 53 65 72 tSystems;..using.UnityEngine.Ser
11c0 69 61 6c 69 7a 61 74 69 6f 6e 3b 0d 0a 0d 0a 0d 0a 6e 61 6d 65 73 70 61 63 65 20 54 4d 50 72 6f ialization;......namespace.TMPro
11e0 0d 0a 7b 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 ..{......///.<summary>......///.
1200 45 64 69 74 61 62 6c 65 20 74 65 78 74 20 69 6e 70 75 74 20 66 69 65 6c 64 2e 0d 0a 20 20 20 20 Editable.text.input.field.......
1220 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 5b 41 64 64 43 6f 6d 70 6f 6e 65 6e ///.</summary>......[AddComponen
1240 74 4d 65 6e 75 28 22 55 49 2f 54 65 78 74 4d 65 73 68 50 72 6f 20 2d 20 49 6e 70 75 74 20 46 69 tMenu("UI/TextMeshPro.-.Input.Fi
1260 65 6c 64 22 2c 20 31 31 29 5d 0d 0a 20 20 20 20 70 75 62 6c 69 63 20 63 6c 61 73 73 20 54 4d 50 eld",.11)]......public.class.TMP
1280 5f 49 6e 70 75 74 46 69 65 6c 64 20 3a 20 53 65 6c 65 63 74 61 62 6c 65 2c 0d 0a 20 20 20 20 20 _InputField.:.Selectable,.......
12a0 20 20 20 49 55 70 64 61 74 65 53 65 6c 65 63 74 65 64 48 61 6e 64 6c 65 72 2c 0d 0a 20 20 20 20 ...IUpdateSelectedHandler,......
12c0 20 20 20 20 49 42 65 67 69 6e 44 72 61 67 48 61 6e 64 6c 65 72 2c 0d 0a 20 20 20 20 20 20 20 20 ....IBeginDragHandler,..........
12e0 49 44 72 61 67 48 61 6e 64 6c 65 72 2c 0d 0a 20 20 20 20 20 20 20 20 49 45 6e 64 44 72 61 67 48 IDragHandler,..........IEndDragH
1300 61 6e 64 6c 65 72 2c 0d 0a 20 20 20 20 20 20 20 20 49 50 6f 69 6e 74 65 72 43 6c 69 63 6b 48 61 andler,..........IPointerClickHa
1320 6e 64 6c 65 72 2c 0d 0a 20 20 20 20 20 20 20 20 49 53 75 62 6d 69 74 48 61 6e 64 6c 65 72 2c 0d ndler,..........ISubmitHandler,.
1340 0a 20 20 20 20 20 20 20 20 49 43 61 6e 76 61 73 45 6c 65 6d 65 6e 74 2c 0d 0a 20 20 20 20 20 20 .........ICanvasElement,........
1360 20 20 49 4c 61 79 6f 75 74 45 6c 65 6d 65 6e 74 2c 0d 0a 20 20 20 20 20 20 20 20 49 53 63 72 6f ..ILayoutElement,..........IScro
1380 6c 6c 48 61 6e 64 6c 65 72 0d 0a 20 20 20 20 7b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 53 llHandler......{............//.S
13a0 65 74 74 69 6e 67 20 74 68 65 20 63 6f 6e 74 65 6e 74 20 74 79 70 65 20 61 63 74 73 20 61 73 20 etting.the.content.type.acts.as.
13c0 61 20 73 68 6f 72 74 63 75 74 20 66 6f 72 20 73 65 74 74 69 6e 67 20 61 20 63 6f 6d 62 69 6e 61 a.shortcut.for.setting.a.combina
13e0 74 69 6f 6e 20 6f 66 20 49 6e 70 75 74 54 79 70 65 2c 20 43 68 61 72 61 63 74 65 72 56 61 6c 69 tion.of.InputType,.CharacterVali
1400 64 61 74 69 6f 6e 2c 20 4c 69 6e 65 54 79 70 65 2c 20 61 6e 64 20 54 6f 75 63 68 53 63 72 65 65 dation,.LineType,.and.TouchScree
1420 6e 4b 65 79 62 6f 61 72 64 54 79 70 65 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 65 6e nKeyboardType..........public.en
1440 75 6d 20 43 6f 6e 74 65 6e 74 54 79 70 65 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 um.ContentType..........{.......
1460 20 20 20 20 20 20 20 53 74 61 6e 64 61 72 64 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 41 75 .......Standard,..............Au
1480 74 6f 63 6f 72 72 65 63 74 65 64 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 49 6e 74 65 67 65 tocorrected,..............Intege
14a0 72 4e 75 6d 62 65 72 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 44 65 63 69 6d 61 6c 4e 75 6d rNumber,..............DecimalNum
14c0 62 65 72 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 41 6c 70 68 61 6e 75 6d 65 72 69 63 2c 0d ber,..............Alphanumeric,.
14e0 0a 20 20 20 20 20 20 20 20 20 20 20 20 4e 61 6d 65 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 .............Name,..............
1500 45 6d 61 69 6c 41 64 64 72 65 73 73 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 50 61 73 73 77 EmailAddress,..............Passw
1520 6f 72 64 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 50 69 6e 2c 0d 0a 20 20 20 20 20 20 20 20 ord,..............Pin,..........
1540 20 20 20 20 43 75 73 74 6f 6d 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 ....Custom..........}...........
1560 20 70 75 62 6c 69 63 20 65 6e 75 6d 20 49 6e 70 75 74 54 79 70 65 0d 0a 20 20 20 20 20 20 20 20 .public.enum.InputType..........
1580 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 53 74 61 6e 64 61 72 64 2c 0d 0a 20 20 20 20 20 20 {..............Standard,........
15a0 20 20 20 20 20 20 41 75 74 6f 43 6f 72 72 65 63 74 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 ......AutoCorrect,..............
15c0 50 61 73 73 77 6f 72 64 2c 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 Password,..........}............
15e0 70 75 62 6c 69 63 20 65 6e 75 6d 20 43 68 61 72 61 63 74 65 72 56 61 6c 69 64 61 74 69 6f 6e 0d public.enum.CharacterValidation.
1600 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 4e 6f 6e 65 2c 0d 0a 20 .........{..............None,...
1620 20 20 20 20 20 20 20 20 20 20 20 44 69 67 69 74 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 49 ...........Digit,..............I
1640 6e 74 65 67 65 72 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 44 65 63 69 6d 61 6c 2c 0d 0a 20 nteger,..............Decimal,...
1660 20 20 20 20 20 20 20 20 20 20 20 41 6c 70 68 61 6e 75 6d 65 72 69 63 2c 0d 0a 20 20 20 20 20 20 ...........Alphanumeric,........
1680 20 20 20 20 20 20 4e 61 6d 65 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 52 65 67 65 78 2c 0d ......Name,..............Regex,.
16a0 0a 20 20 20 20 20 20 20 20 20 20 20 20 45 6d 61 69 6c 41 64 64 72 65 73 73 2c 0d 0a 20 20 20 20 .............EmailAddress,......
16c0 20 20 20 20 20 20 20 20 43 75 73 74 6f 6d 56 61 6c 69 64 61 74 6f 72 0d 0a 20 20 20 20 20 20 20 ........CustomValidator.........
16e0 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 65 6e 75 6d 20 4c 69 6e 65 54 79 .}............public.enum.LineTy
1700 70 65 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 53 69 6e 67 6c pe..........{..............Singl
1720 65 4c 69 6e 65 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 4d 75 6c 74 69 4c 69 6e 65 53 75 62 eLine,..............MultiLineSub
1740 6d 69 74 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 4d 75 6c 74 69 4c 69 6e 65 4e 65 77 6c 69 mit,..............MultiLineNewli
1760 6e 65 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 ne..........}............public.
1780 64 65 6c 65 67 61 74 65 20 63 68 61 72 20 4f 6e 56 61 6c 69 64 61 74 65 49 6e 70 75 74 28 73 74 delegate.char.OnValidateInput(st
17a0 72 69 6e 67 20 74 65 78 74 2c 20 69 6e 74 20 63 68 61 72 49 6e 64 65 78 2c 20 63 68 61 72 20 61 ring.text,.int.charIndex,.char.a
17c0 64 64 65 64 43 68 61 72 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 5b 53 65 72 69 61 6c 69 7a 61 ddedChar);............[Serializa
17e0 62 6c 65 5d 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 63 6c 61 73 73 20 53 75 62 6d 69 ble]..........public.class.Submi
1800 74 45 76 65 6e 74 20 3a 20 55 6e 69 74 79 45 76 65 6e 74 3c 73 74 72 69 6e 67 3e 20 7b 20 7d 0d tEvent.:.UnityEvent<string>.{.}.
1820 0a 0d 0a 20 20 20 20 20 20 20 20 5b 53 65 72 69 61 6c 69 7a 61 62 6c 65 5d 0d 0a 20 20 20 20 20 ...........[Serializable].......
1840 20 20 20 70 75 62 6c 69 63 20 63 6c 61 73 73 20 4f 6e 43 68 61 6e 67 65 45 76 65 6e 74 20 3a 20 ...public.class.OnChangeEvent.:.
1860 55 6e 69 74 79 45 76 65 6e 74 3c 73 74 72 69 6e 67 3e 20 7b 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 UnityEvent<string>.{.}..........
1880 20 20 5b 53 65 72 69 61 6c 69 7a 61 62 6c 65 5d 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 ..[Serializable]..........public
18a0 20 63 6c 61 73 73 20 53 65 6c 65 63 74 69 6f 6e 45 76 65 6e 74 20 3a 20 55 6e 69 74 79 45 76 65 .class.SelectionEvent.:.UnityEve
18c0 6e 74 3c 73 74 72 69 6e 67 3e 20 7b 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 5b 53 65 72 69 61 nt<string>.{.}............[Seria
18e0 6c 69 7a 61 62 6c 65 5d 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 63 6c 61 73 73 20 54 lizable]..........public.class.T
1900 65 78 74 53 65 6c 65 63 74 69 6f 6e 45 76 65 6e 74 20 3a 20 55 6e 69 74 79 45 76 65 6e 74 3c 73 extSelectionEvent.:.UnityEvent<s
1920 74 72 69 6e 67 2c 20 69 6e 74 2c 20 69 6e 74 3e 20 7b 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 tring,.int,.int>.{.}............
1940 5b 53 65 72 69 61 6c 69 7a 61 62 6c 65 5d 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 63 [Serializable]..........public.c
1960 6c 61 73 73 20 54 6f 75 63 68 53 63 72 65 65 6e 4b 65 79 62 6f 61 72 64 45 76 65 6e 74 20 3a 20 lass.TouchScreenKeyboardEvent.:.
1980 55 6e 69 74 79 45 76 65 6e 74 3c 54 6f 75 63 68 53 63 72 65 65 6e 4b 65 79 62 6f 61 72 64 2e 53 UnityEvent<TouchScreenKeyboard.S
19a0 74 61 74 75 73 3e 20 7b 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 tatus>.{.}............protected.
19c0 54 6f 75 63 68 53 63 72 65 65 6e 4b 65 79 62 6f 61 72 64 20 6d 5f 53 6f 66 74 4b 65 79 62 6f 61 TouchScreenKeyboard.m_SoftKeyboa
19e0 72 64 3b 0d 0a 20 20 20 20 20 20 20 20 73 74 61 74 69 63 20 70 72 69 76 61 74 65 20 72 65 61 64 rd;..........static.private.read
1a00 6f 6e 6c 79 20 63 68 61 72 5b 5d 20 6b 53 65 70 61 72 61 74 6f 72 73 20 3d 20 7b 20 27 20 27 2c only.char[].kSeparators.=.{.'.',
1a20 20 27 2e 27 2c 20 27 2c 27 2c 20 27 5c 74 27 2c 20 27 5c 72 27 2c 20 27 5c 6e 27 20 7d 3b 0d 0a .'.',.',',.'\t',.'\r',.'\n'.};..
1a40 0d 0a 20 20 20 20 20 20 20 20 23 72 65 67 69 6f 6e 20 45 78 70 6f 73 65 64 20 70 72 6f 70 65 72 ..........#region.Exposed.proper
1a60 74 69 65 73 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 ties..........///.<summary>.....
1a80 20 20 20 20 20 2f 2f 2f 20 54 65 78 74 20 54 65 78 74 20 75 73 65 64 20 74 6f 20 64 69 73 70 6c .....///.Text.Text.used.to.displ
1aa0 61 79 20 74 68 65 20 69 6e 70 75 74 27 73 20 76 61 6c 75 65 2e 0d 0a 20 20 20 20 20 20 20 20 2f ay.the.input's.value.........../
1ac0 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 0d 0a 20 20 20 20 20 20 20 20 5b 53 65 72 69 61 6c //.</summary>............[Serial
1ae0 69 7a 65 46 69 65 6c 64 5d 0d 0a 20 20 20 20 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 52 65 63 izeField]..........protected.Rec
1b00 74 54 72 61 6e 73 66 6f 72 6d 20 6d 5f 54 65 78 74 56 69 65 77 70 6f 72 74 3b 0d 0a 0d 0a 20 20 tTransform.m_TextViewport;......
1b20 20 20 20 20 20 20 2f 2f 56 65 63 74 6f 72 33 5b 5d 20 6d 5f 56 69 65 77 70 6f 72 74 43 6f 72 6e ......//Vector3[].m_ViewportCorn
1b40 65 72 73 20 3d 20 6e 65 77 20 56 65 63 74 6f 72 33 5b 34 5d 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 ers.=.new.Vector3[4];...........
1b60 20 5b 53 65 72 69 61 6c 69 7a 65 46 69 65 6c 64 5d 0d 0a 20 20 20 20 20 20 20 20 70 72 6f 74 65 .[SerializeField]..........prote
1b80 63 74 65 64 20 54 4d 50 5f 54 65 78 74 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 3b 0d 0a cted.TMP_Text.m_TextComponent;..
1ba0 0d 0a 20 20 20 20 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 52 65 63 74 54 72 61 6e 73 66 6f 72 ..........protected.RectTransfor
1bc0 6d 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 52 65 63 74 54 72 61 6e 73 66 6f 72 6d 3b 0d m.m_TextComponentRectTransform;.
1be0 0a 0d 0a 20 20 20 20 20 20 20 20 5b 53 65 72 69 61 6c 69 7a 65 46 69 65 6c 64 5d 0d 0a 20 20 20 ...........[SerializeField].....
1c00 20 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 47 72 61 70 68 69 63 20 6d 5f 50 6c 61 63 65 68 6f .....protected.Graphic.m_Placeho
1c20 6c 64 65 72 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 5b 53 65 72 69 61 6c 69 7a 65 46 69 65 6c 64 lder;............[SerializeField
1c40 5d 0d 0a 20 20 20 20 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 53 63 72 6f 6c 6c 62 61 72 20 6d ]..........protected.Scrollbar.m
1c60 5f 56 65 72 74 69 63 61 6c 53 63 72 6f 6c 6c 62 61 72 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 5b _VerticalScrollbar;............[
1c80 53 65 72 69 61 6c 69 7a 65 46 69 65 6c 64 5d 0d 0a 20 20 20 20 20 20 20 20 70 72 6f 74 65 63 74 SerializeField]..........protect
1ca0 65 64 20 54 4d 50 5f 53 63 72 6f 6c 6c 62 61 72 45 76 65 6e 74 48 61 6e 64 6c 65 72 20 6d 5f 56 ed.TMP_ScrollbarEventHandler.m_V
1cc0 65 72 74 69 63 61 6c 53 63 72 6f 6c 6c 62 61 72 45 76 65 6e 74 48 61 6e 64 6c 65 72 3b 0d 0a 20 erticalScrollbarEventHandler;...
1ce0 20 20 20 20 20 20 20 2f 2f 70 72 69 76 61 74 65 20 62 6f 6f 6c 20 6d 5f 46 6f 72 63 65 44 65 61 .......//private.bool.m_ForceDea
1d00 63 74 69 76 61 74 69 6f 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 62 6f ctivation;............private.bo
1d20 6f 6c 20 6d 5f 49 73 44 72 69 76 65 6e 42 79 4c 61 79 6f 75 74 43 6f 6d 70 6f 6e 65 6e 74 73 20 ol.m_IsDrivenByLayoutComponents.
1d40 3d 20 66 61 6c 73 65 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 =.false;............///.<summary
1d60 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 55 73 65 64 20 74 6f 20 6b 65 65 70 20 74 72 61 63 >..........///.Used.to.keep.trac
1d80 6b 20 6f 66 20 73 63 72 6f 6c 6c 20 70 6f 73 69 74 69 6f 6e 0d 0a 20 20 20 20 20 20 20 20 2f 2f k.of.scroll.position..........//
1da0 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 66 6c /.</summary>..........private.fl
1dc0 6f 61 74 20 6d 5f 53 63 72 6f 6c 6c 50 6f 73 69 74 69 6f 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 oat.m_ScrollPosition;...........
1de0 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 0d 0a 20 20 .///.<summary>..........///.....
1e00 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 5b 53 ......///.</summary>..........[S
1e20 65 72 69 61 6c 69 7a 65 46 69 65 6c 64 5d 0d 0a 20 20 20 20 20 20 20 20 70 72 6f 74 65 63 74 65 erializeField]..........protecte
1e40 64 20 66 6c 6f 61 74 20 6d 5f 53 63 72 6f 6c 6c 53 65 6e 73 69 74 69 76 69 74 79 20 3d 20 31 2e d.float.m_ScrollSensitivity.=.1.
1e60 30 66 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 5b 53 65 72 69 61 6c 69 7a 65 46 69 65 6c 64 0f;............//[SerializeField
1e80 5d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 70 72 6f 74 65 63 74 65 64 20 54 4d 50 5f 54 65 78 74 20 ]..........//protected.TMP_Text.
1ea0 6d 5f 50 6c 61 63 65 68 6f 6c 64 65 72 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 3b 0d 0a 0d 0a 20 m_PlaceholderTextComponent;.....
1ec0 20 20 20 20 20 20 20 5b 53 65 72 69 61 6c 69 7a 65 46 69 65 6c 64 5d 0d 0a 20 20 20 20 20 20 20 .......[SerializeField].........
1ee0 20 70 72 69 76 61 74 65 20 43 6f 6e 74 65 6e 74 54 79 70 65 20 6d 5f 43 6f 6e 74 65 6e 74 54 79 .private.ContentType.m_ContentTy
1f00 70 65 20 3d 20 43 6f 6e 74 65 6e 74 54 79 70 65 2e 53 74 61 6e 64 61 72 64 3b 0d 0a 0d 0a 20 20 pe.=.ContentType.Standard;......
1f20 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 2f ......///.<summary>..........///
1f40 20 54 79 70 65 20 6f 66 20 64 61 74 61 20 65 78 70 65 63 74 65 64 20 62 79 20 74 68 65 20 69 6e .Type.of.data.expected.by.the.in
1f60 70 75 74 20 66 69 65 6c 64 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 put.field...........///.</summar
1f80 79 3e 0d 0a 20 20 20 20 20 20 20 20 5b 53 65 72 69 61 6c 69 7a 65 46 69 65 6c 64 5d 0d 0a 20 20 y>..........[SerializeField]....
1fa0 20 20 20 20 20 20 70 72 69 76 61 74 65 20 49 6e 70 75 74 54 79 70 65 20 6d 5f 49 6e 70 75 74 54 ......private.InputType.m_InputT
1fc0 79 70 65 20 3d 20 49 6e 70 75 74 54 79 70 65 2e 53 74 61 6e 64 61 72 64 3b 0d 0a 0d 0a 20 20 20 ype.=.InputType.Standard;.......
1fe0 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 2f 20 .....///.<summary>..........///.
2000 54 68 65 20 63 68 61 72 61 63 74 65 72 20 75 73 65 64 20 74 6f 20 68 69 64 65 20 74 65 78 74 20 The.character.used.to.hide.text.
2020 69 6e 20 70 61 73 73 77 6f 72 64 20 66 69 65 6c 64 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 in.password.field...........///.
2040 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 5b 53 65 72 69 61 6c 69 7a 65 46 69 </summary>..........[SerializeFi
2060 65 6c 64 5d 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 63 68 61 72 20 6d 5f 41 73 74 eld]..........private.char.m_Ast
2080 65 72 69 73 6b 43 68 61 72 20 3d 20 27 2a 27 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 eriskChar.=.'*';............///.
20a0 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 4b 65 79 62 6f 61 72 64 20 <summary>..........///.Keyboard.
20c0 74 79 70 65 20 61 70 70 6c 69 65 73 20 74 6f 20 6d 6f 62 69 6c 65 20 6b 65 79 62 6f 61 72 64 73 type.applies.to.mobile.keyboards
20e0 20 74 68 61 74 20 67 65 74 20 73 68 6f 77 6e 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f .that.get.shown...........///.</
2100 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 5b 53 65 72 69 61 6c 69 7a 65 46 69 65 6c summary>..........[SerializeFiel
2120 64 5d 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 54 6f 75 63 68 53 63 72 65 65 6e 4b d]..........private.TouchScreenK
2140 65 79 62 6f 61 72 64 54 79 70 65 20 6d 5f 4b 65 79 62 6f 61 72 64 54 79 70 65 20 3d 20 54 6f 75 eyboardType.m_KeyboardType.=.Tou
2160 63 68 53 63 72 65 65 6e 4b 65 79 62 6f 61 72 64 54 79 70 65 2e 44 65 66 61 75 6c 74 3b 0d 0a 0d chScreenKeyboardType.Default;...
2180 0a 20 20 20 20 20 20 20 20 5b 53 65 72 69 61 6c 69 7a 65 46 69 65 6c 64 5d 0d 0a 20 20 20 20 20 .........[SerializeField].......
21a0 20 20 20 70 72 69 76 61 74 65 20 4c 69 6e 65 54 79 70 65 20 6d 5f 4c 69 6e 65 54 79 70 65 20 3d ...private.LineType.m_LineType.=
21c0 20 4c 69 6e 65 54 79 70 65 2e 53 69 6e 67 6c 65 4c 69 6e 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 .LineType.SingleLine;...........
21e0 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 53 68 6f 75 .///.<summary>..........///.Shou
2200 6c 64 20 68 69 64 65 20 6d 6f 62 69 6c 65 20 69 6e 70 75 74 20 66 69 65 6c 64 20 70 61 72 74 20 ld.hide.mobile.input.field.part.
2220 6f 66 20 74 68 65 20 76 69 72 74 75 61 6c 20 6b 65 79 62 6f 61 72 64 2e 0d 0a 20 20 20 20 20 20 of.the.virtual.keyboard.........
2240 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 5b 53 65 72 69 61 ..///.</summary>..........[Seria
2260 6c 69 7a 65 46 69 65 6c 64 5d 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 62 6f 6f 6c lizeField]..........private.bool
2280 20 6d 5f 48 69 64 65 4d 6f 62 69 6c 65 49 6e 70 75 74 20 3d 20 66 61 6c 73 65 3b 0d 0a 0d 0a 20 .m_HideMobileInput.=.false;.....
22a0 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>..........//
22c0 2f 20 53 68 6f 75 6c 64 20 68 69 64 65 20 73 6f 66 74 20 2f 20 76 69 72 74 75 61 6c 20 6b 65 79 /.Should.hide.soft./.virtual.key
22e0 62 6f 61 72 64 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 board...........///.</summary>..
2300 20 20 20 20 20 20 20 20 5b 53 65 72 69 61 6c 69 7a 65 46 69 65 6c 64 5d 0d 0a 20 20 20 20 20 20 ........[SerializeField]........
2320 20 20 70 72 69 76 61 74 65 20 62 6f 6f 6c 20 6d 5f 48 69 64 65 53 6f 66 74 4b 65 79 62 6f 61 72 ..private.bool.m_HideSoftKeyboar
2340 64 20 3d 20 66 61 6c 73 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 d.=.false;............///.<summa
2360 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 57 68 61 74 20 6b 69 6e 64 20 6f 66 20 76 61 ry>..........///.What.kind.of.va
2380 6c 69 64 61 74 69 6f 6e 20 74 6f 20 75 73 65 20 77 69 74 68 20 74 68 65 20 69 6e 70 75 74 20 66 lidation.to.use.with.the.input.f
23a0 69 65 6c 64 27 73 20 64 61 74 61 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d ield's.data...........///.</summ
23c0 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 5b 53 65 72 69 61 6c 69 7a 65 46 69 65 6c 64 5d 0d 0a ary>..........[SerializeField]..
23e0 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 43 68 61 72 61 63 74 65 72 56 61 6c 69 64 61 74 ........private.CharacterValidat
2400 69 6f 6e 20 6d 5f 43 68 61 72 61 63 74 65 72 56 61 6c 69 64 61 74 69 6f 6e 20 3d 20 43 68 61 72 ion.m_CharacterValidation.=.Char
2420 61 63 74 65 72 56 61 6c 69 64 61 74 69 6f 6e 2e 4e 6f 6e 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 acterValidation.None;...........
2440 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 54 68 65 20 .///.<summary>..........///.The.
2460 52 65 67 65 78 20 65 78 70 72 65 73 73 69 6f 6e 20 75 73 65 64 20 66 6f 72 20 76 61 6c 69 64 61 Regex.expression.used.for.valida
2480 74 69 6e 67 20 74 68 65 20 74 65 78 74 20 69 6e 70 75 74 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f ting.the.text.input...........//
24a0 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 5b 53 65 72 69 61 6c 69 7a 65 /.</summary>..........[Serialize
24c0 46 69 65 6c 64 5d 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 73 74 72 69 6e 67 20 6d Field]..........private.string.m
24e0 5f 52 65 67 65 78 56 61 6c 75 65 20 3d 20 73 74 72 69 6e 67 2e 45 6d 70 74 79 3b 0d 0a 0d 0a 20 _RegexValue.=.string.Empty;.....
2500 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>..........//
2520 2f 20 54 68 65 20 70 6f 69 6e 74 20 73 69 7a 65 64 20 75 73 65 64 20 62 79 20 74 68 65 20 70 6c /.The.point.sized.used.by.the.pl
2540 61 63 65 68 6f 6c 64 65 72 20 61 6e 64 20 69 6e 70 75 74 20 74 65 78 74 20 6f 62 6a 65 63 74 2e aceholder.and.input.text.object.
2560 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>........
2580 20 20 5b 53 65 72 69 61 6c 69 7a 65 46 69 65 6c 64 5d 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 ..[SerializeField]..........priv
25a0 61 74 65 20 66 6c 6f 61 74 20 6d 5f 47 6c 6f 62 61 6c 50 6f 69 6e 74 53 69 7a 65 20 3d 20 31 34 ate.float.m_GlobalPointSize.=.14
25c0 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 0d 0a 20 20 20 20 ;............///.<summary>......
25e0 20 20 20 20 2f 2f 2f 20 4d 61 78 69 6d 75 6d 20 6e 75 6d 62 65 72 20 6f 66 20 63 68 61 72 61 63 ....///.Maximum.number.of.charac
2600 74 65 72 73 20 61 6c 6c 6f 77 65 64 20 62 65 66 6f 72 65 20 69 6e 70 75 74 20 6e 6f 20 6c 6f 6e ters.allowed.before.input.no.lon
2620 67 65 72 20 77 6f 72 6b 73 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 ger.works...........///.</summar
2640 79 3e 0d 0a 20 20 20 20 20 20 20 20 5b 53 65 72 69 61 6c 69 7a 65 46 69 65 6c 64 5d 0d 0a 20 20 y>..........[SerializeField]....
2660 20 20 20 20 20 20 70 72 69 76 61 74 65 20 69 6e 74 20 6d 5f 43 68 61 72 61 63 74 65 72 4c 69 6d ......private.int.m_CharacterLim
2680 69 74 20 3d 20 30 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 it.=.0;............///.<summary>
26a0 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 45 76 65 6e 74 20 64 65 6c 65 67 61 74 65 73 20 74 72 ..........///.Event.delegates.tr
26c0 69 67 67 65 72 65 64 20 77 68 65 6e 20 74 68 65 20 69 6e 70 75 74 20 66 69 65 6c 64 20 73 75 62 iggered.when.the.input.field.sub
26e0 6d 69 74 73 20 69 74 73 20 64 61 74 61 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 mits.its.data...........///.</su
2700 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 5b 53 65 72 69 61 6c 69 7a 65 46 69 65 6c 64 5d mmary>..........[SerializeField]
2720 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 53 75 62 6d 69 74 45 76 65 6e 74 20 6d 5f ..........private.SubmitEvent.m_
2740 4f 6e 45 6e 64 45 64 69 74 20 3d 20 6e 65 77 20 53 75 62 6d 69 74 45 76 65 6e 74 28 29 3b 0d 0a OnEndEdit.=.new.SubmitEvent();..
2760 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 20 ..........///.<summary>.........
2780 20 2f 2f 2f 20 45 76 65 6e 74 20 64 65 6c 65 67 61 74 65 73 20 74 72 69 67 67 65 72 65 64 20 77 .///.Event.delegates.triggered.w
27a0 68 65 6e 20 74 68 65 20 69 6e 70 75 74 20 66 69 65 6c 64 20 73 75 62 6d 69 74 73 20 69 74 73 20 hen.the.input.field.submits.its.
27c0 64 61 74 61 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 data...........///.</summary>...
27e0 20 20 20 20 20 20 20 5b 53 65 72 69 61 6c 69 7a 65 46 69 65 6c 64 5d 0d 0a 20 20 20 20 20 20 20 .......[SerializeField].........
2800 20 70 72 69 76 61 74 65 20 53 75 62 6d 69 74 45 76 65 6e 74 20 6d 5f 4f 6e 53 75 62 6d 69 74 20 .private.SubmitEvent.m_OnSubmit.
2820 3d 20 6e 65 77 20 53 75 62 6d 69 74 45 76 65 6e 74 28 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 =.new.SubmitEvent();............
2840 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 45 76 65 6e 74 ///.<summary>..........///.Event
2860 20 64 65 6c 65 67 61 74 65 73 20 74 72 69 67 67 65 72 65 64 20 77 68 65 6e 20 74 68 65 20 69 6e .delegates.triggered.when.the.in
2880 70 75 74 20 66 69 65 6c 64 20 69 73 20 66 6f 63 75 73 65 64 2e 0d 0a 20 20 20 20 20 20 20 20 2f put.field.is.focused.........../
28a0 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 5b 53 65 72 69 61 6c 69 7a //.</summary>..........[Serializ
28c0 65 46 69 65 6c 64 5d 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 53 65 6c 65 63 74 69 eField]..........private.Selecti
28e0 6f 6e 45 76 65 6e 74 20 6d 5f 4f 6e 53 65 6c 65 63 74 20 3d 20 6e 65 77 20 53 65 6c 65 63 74 69 onEvent.m_OnSelect.=.new.Selecti
2900 6f 6e 45 76 65 6e 74 28 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 onEvent();............///.<summa
2920 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 45 76 65 6e 74 20 64 65 6c 65 67 61 74 65 73 ry>..........///.Event.delegates
2940 20 74 72 69 67 67 65 72 65 64 20 77 68 65 6e 20 74 68 65 20 69 6e 70 75 74 20 66 69 65 6c 64 20 .triggered.when.the.input.field.
2960 66 6f 63 75 73 20 69 73 20 6c 6f 73 74 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 focus.is.lost...........///.</su
2980 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 5b 53 65 72 69 61 6c 69 7a 65 46 69 65 6c 64 5d mmary>..........[SerializeField]
29a0 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 53 65 6c 65 63 74 69 6f 6e 45 76 65 6e 74 ..........private.SelectionEvent
29c0 20 6d 5f 4f 6e 44 65 73 65 6c 65 63 74 20 3d 20 6e 65 77 20 53 65 6c 65 63 74 69 6f 6e 45 76 65 .m_OnDeselect.=.new.SelectionEve
29e0 6e 74 28 29 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 0d 0a nt();............///.<summary>..
2a00 20 20 20 20 20 20 20 20 2f 2f 2f 20 45 76 65 6e 74 20 64 65 6c 65 67 61 74 65 73 20 74 72 69 67 ........///.Event.delegates.trig
2a20 67 65 72 65 64 20 77 68 65 6e 20 74 68 65 20 74 65 78 74 20 69 73 20 73 65 6c 65 63 74 65 64 20 gered.when.the.text.is.selected.
2a40 2f 20 68 69 67 68 6c 69 67 68 74 65 64 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 /.highlighted...........///.</su
2a60 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 5b 53 65 72 69 61 6c 69 7a 65 46 69 65 6c 64 5d mmary>..........[SerializeField]
2a80 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 54 65 78 74 53 65 6c 65 63 74 69 6f 6e 45 ..........private.TextSelectionE
2aa0 76 65 6e 74 20 6d 5f 4f 6e 54 65 78 74 53 65 6c 65 63 74 69 6f 6e 20 3d 20 6e 65 77 20 54 65 78 vent.m_OnTextSelection.=.new.Tex
2ac0 74 53 65 6c 65 63 74 69 6f 6e 45 76 65 6e 74 28 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f tSelectionEvent();............//
2ae0 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 45 76 65 6e 74 20 64 /.<summary>..........///.Event.d
2b00 65 6c 65 67 61 74 65 73 20 74 72 69 67 67 65 72 65 64 20 77 68 65 6e 20 74 65 78 74 20 69 73 20 elegates.triggered.when.text.is.
2b20 6e 6f 20 6c 6f 6e 67 65 72 20 73 65 6c 65 63 74 20 2f 20 68 69 67 68 6c 69 67 68 74 65 64 2e 0d no.longer.select./.highlighted..
2b40 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>.........
2b60 20 5b 53 65 72 69 61 6c 69 7a 65 46 69 65 6c 64 5d 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 .[SerializeField]..........priva
2b80 74 65 20 54 65 78 74 53 65 6c 65 63 74 69 6f 6e 45 76 65 6e 74 20 6d 5f 4f 6e 45 6e 64 54 65 78 te.TextSelectionEvent.m_OnEndTex
2ba0 74 53 65 6c 65 63 74 69 6f 6e 20 3d 20 6e 65 77 20 54 65 78 74 53 65 6c 65 63 74 69 6f 6e 45 76 tSelection.=.new.TextSelectionEv
2bc0 65 6e 74 28 29 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 0d ent();............///.<summary>.
2be0 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 45 76 65 6e 74 20 64 65 6c 65 67 61 74 65 73 20 74 72 69 .........///.Event.delegates.tri
2c00 67 67 65 72 65 64 20 77 68 65 6e 20 74 68 65 20 69 6e 70 75 74 20 66 69 65 6c 64 20 63 68 61 6e ggered.when.the.input.field.chan
2c20 67 65 73 20 69 74 73 20 64 61 74 61 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d ges.its.data...........///.</sum
2c40 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 5b 53 65 72 69 61 6c 69 7a 65 46 69 65 6c 64 5d 0d mary>..........[SerializeField].
2c60 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 4f 6e 43 68 61 6e 67 65 45 76 65 6e 74 20 6d .........private.OnChangeEvent.m
2c80 5f 4f 6e 56 61 6c 75 65 43 68 61 6e 67 65 64 20 3d 20 6e 65 77 20 4f 6e 43 68 61 6e 67 65 45 76 _OnValueChanged.=.new.OnChangeEv
2ca0 65 6e 74 28 29 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 0d ent();............///.<summary>.
2cc0 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 45 76 65 6e 74 20 64 65 6c 65 67 61 74 65 73 20 74 72 69 .........///.Event.delegates.tri
2ce0 67 67 65 72 65 64 20 77 68 65 6e 20 74 68 65 20 73 74 61 74 75 73 20 6f 66 20 74 68 65 20 54 6f ggered.when.the.status.of.the.To
2d00 75 63 68 53 63 72 65 65 6e 4b 65 79 62 6f 61 72 64 20 63 68 61 6e 67 65 73 2e 0d 0a 20 20 20 20 uchScreenKeyboard.changes.......
2d20 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 5b 53 65 72 ....///.</summary>..........[Ser
2d40 69 61 6c 69 7a 65 46 69 65 6c 64 5d 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 54 6f ializeField]..........private.To
2d60 75 63 68 53 63 72 65 65 6e 4b 65 79 62 6f 61 72 64 45 76 65 6e 74 20 6d 5f 4f 6e 54 6f 75 63 68 uchScreenKeyboardEvent.m_OnTouch
2d80 53 63 72 65 65 6e 4b 65 79 62 6f 61 72 64 53 74 61 74 75 73 43 68 61 6e 67 65 64 20 3d 20 6e 65 ScreenKeyboardStatusChanged.=.ne
2da0 77 20 54 6f 75 63 68 53 63 72 65 65 6e 4b 65 79 62 6f 61 72 64 45 76 65 6e 74 28 29 3b 0d 0a 0d w.TouchScreenKeyboardEvent();...
2dc0 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>..........
2de0 2f 2f 2f 20 43 75 73 74 6f 6d 20 76 61 6c 69 64 61 74 69 6f 6e 20 63 61 6c 6c 62 61 63 6b 2e 0d ///.Custom.validation.callback..
2e00 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>.........
2e20 20 5b 53 65 72 69 61 6c 69 7a 65 46 69 65 6c 64 5d 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 .[SerializeField]..........priva
2e40 74 65 20 4f 6e 56 61 6c 69 64 61 74 65 49 6e 70 75 74 20 6d 5f 4f 6e 56 61 6c 69 64 61 74 65 49 te.OnValidateInput.m_OnValidateI
2e60 6e 70 75 74 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 5b 53 65 72 69 61 6c 69 7a 65 46 69 65 6c 64 nput;............[SerializeField
2e80 5d 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 43 6f 6c 6f 72 20 6d 5f 43 61 72 65 74 ]..........private.Color.m_Caret
2ea0 43 6f 6c 6f 72 20 3d 20 6e 65 77 20 43 6f 6c 6f 72 28 35 30 66 20 2f 20 32 35 35 66 2c 20 35 30 Color.=.new.Color(50f./.255f,.50
2ec0 66 20 2f 20 32 35 35 66 2c 20 35 30 66 20 2f 20 32 35 35 66 2c 20 31 66 29 3b 0d 0a 0d 0a 20 20 f./.255f,.50f./.255f,.1f);......
2ee0 20 20 20 20 20 20 5b 53 65 72 69 61 6c 69 7a 65 46 69 65 6c 64 5d 0d 0a 20 20 20 20 20 20 20 20 ......[SerializeField]..........
2f00 70 72 69 76 61 74 65 20 62 6f 6f 6c 20 6d 5f 43 75 73 74 6f 6d 43 61 72 65 74 43 6f 6c 6f 72 20 private.bool.m_CustomCaretColor.
2f20 3d 20 66 61 6c 73 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 5b 53 65 72 69 61 6c 69 7a 65 46 69 =.false;............[SerializeFi
2f40 65 6c 64 5d 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 43 6f 6c 6f 72 20 6d 5f 53 65 eld]..........private.Color.m_Se
2f60 6c 65 63 74 69 6f 6e 43 6f 6c 6f 72 20 3d 20 6e 65 77 20 43 6f 6c 6f 72 28 31 36 38 66 20 2f 20 lectionColor.=.new.Color(168f./.
2f80 32 35 35 66 2c 20 32 30 36 66 20 2f 20 32 35 35 66 2c 20 32 35 35 66 20 2f 20 32 35 35 66 2c 20 255f,.206f./.255f,.255f./.255f,.
2fa0 31 39 32 66 20 2f 20 32 35 35 66 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 192f./.255f);............///.<su
2fc0 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 6e 70 75 74 20 66 69 65 6c 64 27 mmary>..........///.Input.field'
2fe0 73 20 76 61 6c 75 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 s.value...........///.</summary>
3000 0d 0a 0d 0a 20 20 20 20 20 20 20 20 5b 53 65 72 69 61 6c 69 7a 65 46 69 65 6c 64 5d 0d 0a 20 20 ............[SerializeField]....
3020 20 20 20 20 20 20 5b 54 65 78 74 41 72 65 61 28 35 2c 20 31 30 29 5d 0d 0a 20 20 20 20 20 20 20 ......[TextArea(5,.10)].........
3040 20 70 72 6f 74 65 63 74 65 64 20 73 74 72 69 6e 67 20 6d 5f 54 65 78 74 20 3d 20 73 74 72 69 6e .protected.string.m_Text.=.strin
3060 67 2e 45 6d 70 74 79 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 5b 53 65 72 69 61 6c 69 7a 65 46 69 g.Empty;............[SerializeFi
3080 65 6c 64 5d 0d 0a 20 20 20 20 20 20 20 20 5b 52 61 6e 67 65 28 30 66 2c 20 34 66 29 5d 0d 0a 20 eld]..........[Range(0f,.4f)]...
30a0 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 66 6c 6f 61 74 20 6d 5f 43 61 72 65 74 42 6c 69 6e .......private.float.m_CaretBlin
30c0 6b 52 61 74 65 20 3d 20 30 2e 38 35 66 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 5b 53 65 72 69 61 kRate.=.0.85f;............[Seria
30e0 6c 69 7a 65 46 69 65 6c 64 5d 0d 0a 20 20 20 20 20 20 20 20 5b 52 61 6e 67 65 28 31 2c 20 35 29 lizeField]..........[Range(1,.5)
3100 5d 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 69 6e 74 20 6d 5f 43 61 72 65 74 57 69 ]..........private.int.m_CaretWi
3120 64 74 68 20 3d 20 31 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 5b 53 65 72 69 61 6c 69 7a 65 46 69 dth.=.1;............[SerializeFi
3140 65 6c 64 5d 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 62 6f 6f 6c 20 6d 5f 52 65 61 eld]..........private.bool.m_Rea
3160 64 4f 6e 6c 79 20 3d 20 66 61 6c 73 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 5b 53 65 72 69 61 dOnly.=.false;............[Seria
3180 6c 69 7a 65 46 69 65 6c 64 5d 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 62 6f 6f 6c lizeField]..........private.bool
31a0 20 6d 5f 52 69 63 68 54 65 78 74 20 3d 20 74 72 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 23 .m_RichText.=.true;............#
31c0 65 6e 64 72 65 67 69 6f 6e 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 69 endregion............protected.i
31e0 6e 74 20 6d 5f 53 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 20 3d 20 30 3b 0d 0a 20 20 20 20 20 20 nt.m_StringPosition.=.0;........
3200 20 20 70 72 6f 74 65 63 74 65 64 20 69 6e 74 20 6d 5f 53 74 72 69 6e 67 53 65 6c 65 63 74 50 6f ..protected.int.m_StringSelectPo
3220 73 69 74 69 6f 6e 20 3d 20 30 3b 0d 0a 20 20 20 20 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 69 sition.=.0;..........protected.i
3240 6e 74 20 6d 5f 43 61 72 65 74 50 6f 73 69 74 69 6f 6e 20 3d 20 30 3b 0d 0a 20 20 20 20 20 20 20 nt.m_CaretPosition.=.0;.........
3260 20 70 72 6f 74 65 63 74 65 64 20 69 6e 74 20 6d 5f 43 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 .protected.int.m_CaretSelectPosi
3280 74 69 6f 6e 20 3d 20 30 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 52 65 63 tion.=.0;............private.Rec
32a0 74 54 72 61 6e 73 66 6f 72 6d 20 63 61 72 65 74 52 65 63 74 54 72 61 6e 73 20 3d 20 6e 75 6c 6c tTransform.caretRectTrans.=.null
32c0 3b 0d 0a 20 20 20 20 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 55 49 56 65 72 74 65 78 5b 5d 20 ;..........protected.UIVertex[].
32e0 6d 5f 43 75 72 73 6f 72 56 65 72 74 73 20 3d 20 6e 75 6c 6c 3b 0d 0a 20 20 20 20 20 20 20 20 70 m_CursorVerts.=.null;..........p
3300 72 69 76 61 74 65 20 43 61 6e 76 61 73 52 65 6e 64 65 72 65 72 20 6d 5f 43 61 63 68 65 64 49 6e rivate.CanvasRenderer.m_CachedIn
3320 70 75 74 52 65 6e 64 65 72 65 72 3b 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 56 65 putRenderer;..........private.Ve
3340 63 74 6f 72 32 20 6d 5f 4c 61 73 74 50 6f 73 69 74 69 6f 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 ctor2.m_LastPosition;...........
3360 20 5b 4e 6f 6e 53 65 72 69 61 6c 69 7a 65 64 5d 0d 0a 20 20 20 20 20 20 20 20 70 72 6f 74 65 63 .[NonSerialized]..........protec
3380 74 65 64 20 4d 65 73 68 20 6d 5f 4d 65 73 68 3b 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 ted.Mesh.m_Mesh;..........privat
33a0 65 20 62 6f 6f 6c 20 6d 5f 41 6c 6c 6f 77 49 6e 70 75 74 20 3d 20 66 61 6c 73 65 3b 0d 0a 20 20 e.bool.m_AllowInput.=.false;....
33c0 20 20 20 20 20 20 2f 2f 62 6f 6f 6c 20 6d 5f 48 61 73 4c 6f 73 74 46 6f 63 75 73 20 3d 20 66 61 ......//bool.m_HasLostFocus.=.fa
33e0 6c 73 65 3b 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 62 6f 6f 6c 20 6d 5f 53 68 6f lse;..........private.bool.m_Sho
3400 75 6c 64 41 63 74 69 76 61 74 65 4e 65 78 74 55 70 64 61 74 65 20 3d 20 66 61 6c 73 65 3b 0d 0a uldActivateNextUpdate.=.false;..
3420 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 62 6f 6f 6c 20 6d 5f 55 70 64 61 74 65 44 72 61 ........private.bool.m_UpdateDra
3440 67 20 3d 20 66 61 6c 73 65 3b 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 62 6f 6f 6c g.=.false;..........private.bool
3460 20 6d 5f 44 72 61 67 50 6f 73 69 74 69 6f 6e 4f 75 74 4f 66 42 6f 75 6e 64 73 20 3d 20 66 61 6c .m_DragPositionOutOfBounds.=.fal
3480 73 65 3b 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 63 6f 6e 73 74 20 66 6c 6f 61 74 se;..........private.const.float
34a0 20 6b 48 53 63 72 6f 6c 6c 53 70 65 65 64 20 3d 20 30 2e 30 35 66 3b 0d 0a 20 20 20 20 20 20 20 .kHScrollSpeed.=.0.05f;.........
34c0 20 70 72 69 76 61 74 65 20 63 6f 6e 73 74 20 66 6c 6f 61 74 20 6b 56 53 63 72 6f 6c 6c 53 70 65 .private.const.float.kVScrollSpe
34e0 65 64 20 3d 20 30 2e 31 30 66 3b 0d 0a 20 20 20 20 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 62 ed.=.0.10f;..........protected.b
3500 6f 6f 6c 20 6d 5f 43 61 72 65 74 56 69 73 69 62 6c 65 3b 0d 0a 20 20 20 20 20 20 20 20 70 72 69 ool.m_CaretVisible;..........pri
3520 76 61 74 65 20 43 6f 72 6f 75 74 69 6e 65 20 6d 5f 42 6c 69 6e 6b 43 6f 72 6f 75 74 69 6e 65 20 vate.Coroutine.m_BlinkCoroutine.
3540 3d 20 6e 75 6c 6c 3b 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 66 6c 6f 61 74 20 6d =.null;..........private.float.m
3560 5f 42 6c 69 6e 6b 53 74 61 72 74 54 69 6d 65 20 3d 20 30 2e 30 66 3b 0d 0a 20 20 20 20 20 20 20 _BlinkStartTime.=.0.0f;.........
3580 20 70 72 69 76 61 74 65 20 43 6f 72 6f 75 74 69 6e 65 20 6d 5f 44 72 61 67 43 6f 72 6f 75 74 69 .private.Coroutine.m_DragCorouti
35a0 6e 65 20 3d 20 6e 75 6c 6c 3b 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 73 74 72 69 ne.=.null;..........private.stri
35c0 6e 67 20 6d 5f 4f 72 69 67 69 6e 61 6c 54 65 78 74 20 3d 20 22 22 3b 0d 0a 20 20 20 20 20 20 20 ng.m_OriginalText.=."";.........
35e0 20 70 72 69 76 61 74 65 20 62 6f 6f 6c 20 6d 5f 57 61 73 43 61 6e 63 65 6c 65 64 20 3d 20 66 61 .private.bool.m_WasCanceled.=.fa
3600 6c 73 65 3b 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 62 6f 6f 6c 20 6d 5f 48 61 73 lse;..........private.bool.m_Has
3620 44 6f 6e 65 46 6f 63 75 73 54 72 61 6e 73 69 74 69 6f 6e 20 3d 20 66 61 6c 73 65 3b 0d 0a 20 20 DoneFocusTransition.=.false;....
3640 20 20 20 20 20 20 70 72 69 76 61 74 65 20 57 61 69 74 46 6f 72 53 65 63 6f 6e 64 73 52 65 61 6c ......private.WaitForSecondsReal
3660 74 69 6d 65 20 6d 5f 57 61 69 74 46 6f 72 53 65 63 6f 6e 64 73 52 65 61 6c 74 69 6d 65 3b 0d 0a time.m_WaitForSecondsRealtime;..
3680 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 62 6f 6f 6c 20 6d 5f 50 72 65 76 65 6e 74 43 61 ........private.bool.m_PreventCa
36a0 6c 6c 62 61 63 6b 20 3d 20 66 61 6c 73 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 llback.=.false;............priva
36c0 74 65 20 62 6f 6f 6c 20 6d 5f 54 6f 75 63 68 4b 65 79 62 6f 61 72 64 41 6c 6c 6f 77 73 49 6e 50 te.bool.m_TouchKeyboardAllowsInP
36e0 6c 61 63 65 45 64 69 74 69 6e 67 20 3d 20 66 61 6c 73 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 laceEditing.=.false;............
3700 70 72 69 76 61 74 65 20 62 6f 6f 6c 20 6d 5f 49 73 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 55 70 private.bool.m_IsTextComponentUp
3720 64 61 74 65 52 65 71 75 69 72 65 64 20 3d 20 66 61 6c 73 65 3b 0d 0a 20 20 20 20 20 20 20 20 70 dateRequired.=.false;..........p
3740 72 69 76 61 74 65 20 62 6f 6f 6c 20 6d 5f 49 73 53 63 72 6f 6c 6c 62 61 72 55 70 64 61 74 65 52 rivate.bool.m_IsScrollbarUpdateR
3760 65 71 75 69 72 65 64 20 3d 20 66 61 6c 73 65 3b 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 equired.=.false;..........privat
3780 65 20 62 6f 6f 6c 20 6d 5f 49 73 55 70 64 61 74 69 6e 67 53 63 72 6f 6c 6c 62 61 72 56 61 6c 75 e.bool.m_IsUpdatingScrollbarValu
37a0 65 73 20 3d 20 66 61 6c 73 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 62 es.=.false;............private.b
37c0 6f 6f 6c 20 6d 5f 69 73 4c 61 73 74 4b 65 79 42 61 63 6b 73 70 61 63 65 20 3d 20 66 61 6c 73 65 ool.m_isLastKeyBackspace.=.false
37e0 3b 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 66 6c 6f 61 74 20 6d 5f 50 6f 69 6e 74 ;..........private.float.m_Point
3800 65 72 44 6f 77 6e 43 6c 69 63 6b 53 74 61 72 74 54 69 6d 65 3b 0d 0a 20 20 20 20 20 20 20 20 70 erDownClickStartTime;..........p
3820 72 69 76 61 74 65 20 66 6c 6f 61 74 20 6d 5f 4b 65 79 44 6f 77 6e 53 74 61 72 74 54 69 6d 65 3b rivate.float.m_KeyDownStartTime;
3840 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 66 6c 6f 61 74 20 6d 5f 44 6f 75 62 6c 65 ..........private.float.m_Double
3860 43 6c 69 63 6b 44 65 6c 61 79 20 3d 20 30 2e 35 66 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f ClickDelay.=.0.5f;............//
3880 20 44 6f 65 73 6e 27 74 20 69 6e 63 6c 75 64 65 20 64 6f 74 20 61 6e 64 20 40 20 6f 6e 20 70 75 .Doesn't.include.dot.and.@.on.pu
38a0 72 70 6f 73 65 21 20 53 65 65 20 75 73 61 67 65 20 66 6f 72 20 64 65 74 61 69 6c 73 2e 0d 0a 20 rpose!.See.usage.for.details....
38c0 20 20 20 20 20 20 20 63 6f 6e 73 74 20 73 74 72 69 6e 67 20 6b 45 6d 61 69 6c 53 70 65 63 69 61 .......const.string.kEmailSpecia
38e0 6c 43 68 61 72 61 63 74 65 72 73 20 3d 20 22 21 23 24 25 26 27 2a 2b 2d 2f 3d 3f 5e 5f 60 7b 7c lCharacters.=."!#$%&'*+-/=?^_`{|
3900 7d 7e 22 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 42 61 73 65 49 6e 70 75 }~";............private.BaseInpu
3920 74 20 69 6e 70 75 74 53 79 73 74 65 6d 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 t.inputSystem..........{........
3940 20 20 20 20 20 20 67 65 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 ......get..............{........
3960 20 20 20 20 20 20 20 20 20 20 69 66 20 28 45 76 65 6e 74 53 79 73 74 65 6d 2e 63 75 72 72 65 6e ..........if.(EventSystem.curren
3980 74 20 26 26 20 45 76 65 6e 74 53 79 73 74 65 6d 2e 63 75 72 72 65 6e 74 2e 63 75 72 72 65 6e 74 t.&&.EventSystem.current.current
39a0 49 6e 70 75 74 4d 6f 64 75 6c 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 InputModule)....................
39c0 20 20 72 65 74 75 72 6e 20 45 76 65 6e 74 53 79 73 74 65 6d 2e 63 75 72 72 65 6e 74 2e 63 75 72 ..return.EventSystem.current.cur
39e0 72 65 6e 74 49 6e 70 75 74 4d 6f 64 75 6c 65 2e 69 6e 70 75 74 3b 0d 0a 20 20 20 20 20 20 20 20 rentInputModule.input;..........
3a00 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 6e 75 6c 6c 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 ........return.null;............
3a20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 ..}..........}............privat
3a40 65 20 73 74 72 69 6e 67 20 63 6f 6d 70 6f 73 69 74 69 6f 6e 53 74 72 69 6e 67 0d 0a 20 20 20 20 e.string.compositionString......
3a60 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 67 65 74 20 7b 20 72 65 74 75 72 6e 20 ....{..............get.{.return.
3a80 69 6e 70 75 74 53 79 73 74 65 6d 20 21 3d 20 6e 75 6c 6c 20 3f 20 69 6e 70 75 74 53 79 73 74 65 inputSystem.!=.null.?.inputSyste
3aa0 6d 2e 63 6f 6d 70 6f 73 69 74 69 6f 6e 53 74 72 69 6e 67 20 3a 20 49 6e 70 75 74 2e 63 6f 6d 70 m.compositionString.:.Input.comp
3ac0 6f 73 69 74 69 6f 6e 53 74 72 69 6e 67 3b 20 7d 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 0d ositionString;.}..........}.....
3ae0 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 54 4d 50 5f 49 6e 70 75 74 46 69 ...........protected.TMP_InputFi
3b00 65 6c 64 28 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 53 65 eld()..........{..............Se
3b20 74 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 57 72 61 70 4d 6f 64 65 28 29 3b 0d 0a 20 20 20 20 20 tTextComponentWrapMode();.......
3b40 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 4d 65 73 68 20 6d ...}............protected.Mesh.m
3b60 65 73 68 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 67 65 74 0d esh..........{..............get.
3b80 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 20 .............{..................
3ba0 69 66 20 28 6d 5f 4d 65 73 68 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 if.(m_Mesh.==.null).............
3bc0 20 20 20 20 20 20 20 20 20 6d 5f 4d 65 73 68 20 3d 20 6e 65 77 20 4d 65 73 68 28 29 3b 0d 0a 20 .........m_Mesh.=.new.Mesh();...
3be0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 6d 5f 4d 65 73 68 3b 0d 0a 20 ...............return.m_Mesh;...
3c00 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 20 20 20 20 20 ...........}..........}.........
3c20 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 53 68 ...///.<summary>..........///.Sh
3c40 6f 75 6c 64 20 74 68 65 20 6d 6f 62 69 6c 65 20 6b 65 79 62 6f 61 72 64 20 69 6e 70 75 74 20 62 ould.the.mobile.keyboard.input.b
3c60 65 20 68 69 64 64 65 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 e.hidden...........///.</summary
3c80 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 62 6f 6f 6c 20 73 68 6f 75 6c 64 48 69 64 >..........public.bool.shouldHid
3ca0 65 4d 6f 62 69 6c 65 49 6e 70 75 74 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 eMobileInput..........{.........
3cc0 20 20 20 20 20 67 65 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 .....get..............{.........
3ce0 20 20 20 20 20 20 20 20 20 73 77 69 74 63 68 20 28 41 70 70 6c 69 63 61 74 69 6f 6e 2e 70 6c 61 .........switch.(Application.pla
3d00 74 66 6f 72 6d 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 20 tform)..................{.......
3d20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 73 65 20 52 75 6e 74 69 6d 65 50 6c 61 74 66 ...............case.RuntimePlatf
3d40 6f 72 6d 2e 41 6e 64 72 6f 69 64 3a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 orm.Android:....................
3d60 20 20 63 61 73 65 20 52 75 6e 74 69 6d 65 50 6c 61 74 66 6f 72 6d 2e 49 50 68 6f 6e 65 50 6c 61 ..case.RuntimePlatform.IPhonePla
3d80 79 65 72 3a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 73 65 20 52 yer:......................case.R
3da0 75 6e 74 69 6d 65 50 6c 61 74 66 6f 72 6d 2e 74 76 4f 53 3a 0d 0a 20 20 20 20 20 20 20 20 20 20 untimePlatform.tvOS:............
3dc0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 6d 5f 48 69 64 65 4d 6f 62 69 6c ..............return.m_HideMobil
3de0 65 49 6e 70 75 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 64 65 66 eInput;......................def
3e00 61 75 6c 74 3a 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 72 ault:..........................r
3e20 65 74 75 72 6e 20 74 72 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a eturn.true;..................}..
3e40 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 73 65 74 ............}................set
3e60 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 ..............{.................
3e80 20 73 77 69 74 63 68 28 41 70 70 6c 69 63 61 74 69 6f 6e 2e 70 6c 61 74 66 6f 72 6d 29 0d 0a 20 .switch(Application.platform)...
3ea0 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 20 ...............{................
3ec0 20 20 20 20 20 20 63 61 73 65 20 52 75 6e 74 69 6d 65 50 6c 61 74 66 6f 72 6d 2e 41 6e 64 72 6f ......case.RuntimePlatform.Andro
3ee0 69 64 3a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 73 65 20 52 75 id:......................case.Ru
3f00 6e 74 69 6d 65 50 6c 61 74 66 6f 72 6d 2e 49 50 68 6f 6e 65 50 6c 61 79 65 72 3a 0d 0a 20 20 20 ntimePlatform.IPhonePlayer:.....
3f20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 73 65 20 52 75 6e 74 69 6d 65 50 6c 61 .................case.RuntimePla
3f40 74 66 6f 72 6d 2e 74 76 4f 53 3a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 tform.tvOS:.....................
3f60 20 20 20 20 20 53 65 74 50 72 6f 70 65 72 74 79 55 74 69 6c 69 74 79 2e 53 65 74 53 74 72 75 63 .....SetPropertyUtility.SetStruc
3f80 74 28 72 65 66 20 6d 5f 48 69 64 65 4d 6f 62 69 6c 65 49 6e 70 75 74 2c 20 76 61 6c 75 65 29 3b t(ref.m_HideMobileInput,.value);
3fa0 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 72 65 61 6b 3b ..........................break;
3fc0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 64 65 66 61 75 6c 74 3a 0d 0a ......................default:..
3fe0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 48 69 64 65 4d 6f ........................m_HideMo
4000 62 69 6c 65 49 6e 70 75 74 20 3d 20 74 72 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 bileInput.=.true;...............
4020 20 20 20 20 20 20 20 20 20 20 20 62 72 65 61 6b 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 ...........break;...............
4040 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 20 20 7d 0d 0a ...}..............}..........}..
4060 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 62 6f 6f 6c 20 73 68 6f 75 6c 64 48 69 64 65 ..........public.bool.shouldHide
4080 53 6f 66 74 4b 65 79 62 6f 61 72 64 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 SoftKeyboard..........{.........
40a0 20 20 20 20 20 67 65 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 .....get..............{.........
40c0 20 20 20 20 20 20 20 20 20 73 77 69 74 63 68 20 28 41 70 70 6c 69 63 61 74 69 6f 6e 2e 70 6c 61 .........switch.(Application.pla
40e0 74 66 6f 72 6d 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 20 tform)..................{.......
4100 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 73 65 20 52 75 6e 74 69 6d 65 50 6c 61 74 66 ...............case.RuntimePlatf
4120 6f 72 6d 2e 41 6e 64 72 6f 69 64 3a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 orm.Android:....................
4140 20 20 63 61 73 65 20 52 75 6e 74 69 6d 65 50 6c 61 74 66 6f 72 6d 2e 49 50 68 6f 6e 65 50 6c 61 ..case.RuntimePlatform.IPhonePla
4160 79 65 72 3a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 73 65 20 52 yer:......................case.R
4180 75 6e 74 69 6d 65 50 6c 61 74 66 6f 72 6d 2e 74 76 4f 53 3a 0d 0a 20 20 20 20 20 20 20 20 20 20 untimePlatform.tvOS:............
41a0 20 20 20 20 20 20 20 20 20 20 63 61 73 65 20 52 75 6e 74 69 6d 65 50 6c 61 74 66 6f 72 6d 2e 57 ..........case.RuntimePlatform.W
41c0 53 41 50 6c 61 79 65 72 58 38 36 3a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 SAPlayerX86:....................
41e0 20 20 63 61 73 65 20 52 75 6e 74 69 6d 65 50 6c 61 74 66 6f 72 6d 2e 57 53 41 50 6c 61 79 65 72 ..case.RuntimePlatform.WSAPlayer
4200 58 36 34 3a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 73 65 20 52 X64:......................case.R
4220 75 6e 74 69 6d 65 50 6c 61 74 66 6f 72 6d 2e 57 53 41 50 6c 61 79 65 72 41 52 4d 3a 0d 0a 20 20 untimePlatform.WSAPlayerARM:....
4240 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 6d 5f 48 ......................return.m_H
4260 69 64 65 53 6f 66 74 4b 65 79 62 6f 61 72 64 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ideSoftKeyboard;................
4280 20 20 20 20 20 20 64 65 66 61 75 6c 74 3a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ......default:..................
42a0 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 20 20 ........return.true;............
42c0 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 20 ......}..............}..........
42e0 20 20 20 20 20 20 73 65 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 ......set..............{........
4300 20 20 20 20 20 20 20 20 20 20 73 77 69 74 63 68 20 28 41 70 70 6c 69 63 61 74 69 6f 6e 2e 70 6c ..........switch.(Application.pl
4320 61 74 66 6f 72 6d 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 atform)..................{......
4340 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 73 65 20 52 75 6e 74 69 6d 65 50 6c 61 74 ................case.RuntimePlat
4360 66 6f 72 6d 2e 41 6e 64 72 6f 69 64 3a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 form.Android:...................
4380 20 20 20 63 61 73 65 20 52 75 6e 74 69 6d 65 50 6c 61 74 66 6f 72 6d 2e 49 50 68 6f 6e 65 50 6c ...case.RuntimePlatform.IPhonePl
43a0 61 79 65 72 3a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 73 65 20 ayer:......................case.
43c0 52 75 6e 74 69 6d 65 50 6c 61 74 66 6f 72 6d 2e 74 76 4f 53 3a 0d 0a 20 20 20 20 20 20 20 20 20 RuntimePlatform.tvOS:...........
43e0 20 20 20 20 20 20 20 20 20 20 20 63 61 73 65 20 52 75 6e 74 69 6d 65 50 6c 61 74 66 6f 72 6d 2e ...........case.RuntimePlatform.
4400 57 53 41 50 6c 61 79 65 72 58 38 36 3a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 WSAPlayerX86:...................
4420 20 20 20 63 61 73 65 20 52 75 6e 74 69 6d 65 50 6c 61 74 66 6f 72 6d 2e 57 53 41 50 6c 61 79 65 ...case.RuntimePlatform.WSAPlaye
4440 72 58 36 34 3a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 73 65 20 rX64:......................case.
4460 52 75 6e 74 69 6d 65 50 6c 61 74 66 6f 72 6d 2e 57 53 41 50 6c 61 79 65 72 41 52 4d 3a 0d 0a 20 RuntimePlatform.WSAPlayerARM:...
4480 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 53 65 74 50 72 6f 70 65 72 .......................SetProper
44a0 74 79 55 74 69 6c 69 74 79 2e 53 65 74 53 74 72 75 63 74 28 72 65 66 20 6d 5f 48 69 64 65 53 6f tyUtility.SetStruct(ref.m_HideSo
44c0 66 74 4b 65 79 62 6f 61 72 64 2c 20 76 61 6c 75 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ftKeyboard,.value);.............
44e0 20 20 20 20 20 20 20 20 20 20 20 20 20 62 72 65 61 6b 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 .............break;.............
4500 20 20 20 20 20 20 20 20 20 64 65 66 61 75 6c 74 3a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 .........default:...............
4520 20 20 20 20 20 20 20 20 20 20 20 6d 5f 48 69 64 65 53 6f 66 74 4b 65 79 62 6f 61 72 64 20 3d 20 ...........m_HideSoftKeyboard.=.
4540 74 72 75 65 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 62 true;..........................b
4560 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 20 20 20 20 20 20 reak;..................}........
4580 20 20 20 20 20 20 20 20 20 20 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 ............................if.(
45a0 6d 5f 48 69 64 65 53 6f 66 74 4b 65 79 62 6f 61 72 64 20 3d 3d 20 74 72 75 65 20 26 26 20 6d 5f m_HideSoftKeyboard.==.true.&&.m_
45c0 53 6f 66 74 4b 65 79 62 6f 61 72 64 20 21 3d 20 6e 75 6c 6c 20 26 26 20 54 6f 75 63 68 53 63 72 SoftKeyboard.!=.null.&&.TouchScr
45e0 65 65 6e 4b 65 79 62 6f 61 72 64 2e 69 73 53 75 70 70 6f 72 74 65 64 20 26 26 20 6d 5f 53 6f 66 eenKeyboard.isSupported.&&.m_Sof
4600 74 4b 65 79 62 6f 61 72 64 2e 61 63 74 69 76 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 tKeyboard.active)...............
4620 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 6d 5f 53 6f 66 74 ...{......................m_Soft
4640 4b 65 79 62 6f 61 72 64 2e 61 63 74 69 76 65 20 3d 20 66 61 6c 73 65 3b 0d 0a 20 20 20 20 20 20 Keyboard.active.=.false;........
4660 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 53 6f 66 74 4b 65 79 62 6f 61 72 64 20 3d 20 6e ..............m_SoftKeyboard.=.n
4680 75 6c 6c 3b 0d 0a 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 ull;..................}.........
46a0 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 69 .....}..........}............pri
46c0 76 61 74 65 20 62 6f 6f 6c 20 69 73 4b 65 79 62 6f 61 72 64 55 73 69 6e 67 45 76 65 6e 74 73 28 vate.bool.isKeyboardUsingEvents(
46e0 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 73 77 69 74 63 68 )..........{..............switch
4700 20 28 41 70 70 6c 69 63 61 74 69 6f 6e 2e 70 6c 61 74 66 6f 72 6d 29 0d 0a 20 20 20 20 20 20 20 .(Application.platform).........
4720 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 73 65 20 52 75 6e .....{..................case.Run
4740 74 69 6d 65 50 6c 61 74 66 6f 72 6d 2e 41 6e 64 72 6f 69 64 3a 0d 0a 20 20 20 20 20 20 20 20 20 timePlatform.Android:...........
4760 20 20 20 20 20 20 20 63 61 73 65 20 52 75 6e 74 69 6d 65 50 6c 61 74 66 6f 72 6d 2e 49 50 68 6f .......case.RuntimePlatform.IPho
4780 6e 65 50 6c 61 79 65 72 3a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 73 65 20 nePlayer:..................case.
47a0 52 75 6e 74 69 6d 65 50 6c 61 74 66 6f 72 6d 2e 74 76 4f 53 3a 0d 0a 20 20 20 20 20 20 20 20 20 RuntimePlatform.tvOS:...........
47c0 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 20 20 20 ...........return.false;........
47e0 20 20 20 20 20 20 20 20 20 20 64 65 66 61 75 6c 74 3a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 ..........default:..............
4800 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 20 20 ........return.true;............
4820 20 20 7d 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 ..}..........}............///.<s
4840 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 6e 70 75 74 20 66 69 65 6c 64 ummary>..........///.Input.field
4860 27 73 20 63 75 72 72 65 6e 74 20 74 65 78 74 20 76 61 6c 75 65 2e 20 54 68 69 73 20 69 73 20 6e 's.current.text.value..This.is.n
4880 6f 74 20 6e 65 63 65 73 73 61 72 69 6c 79 20 74 68 65 20 73 61 6d 65 20 61 73 20 77 68 61 74 20 ot.necessarily.the.same.as.what.
48a0 69 73 20 76 69 73 69 62 6c 65 20 6f 6e 20 73 63 72 65 65 6e 2e 0d 0a 20 20 20 20 20 20 20 20 2f is.visible.on.screen.........../
48c0 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 72 65 6d 61 //.</summary>..........///.<rema
48e0 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 4e 6f 74 65 20 74 68 61 74 20 6e 75 6c 6c rks>..........///.Note.that.null
4900 20 69 73 20 69 6e 76 61 6c 69 64 20 76 61 6c 75 65 20 20 66 6f 72 20 49 6e 70 75 74 46 69 65 6c .is.invalid.value..for.InputFiel
4920 64 2e 74 65 78 74 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 6d 61 72 6b 73 3e 0d d.text...........///.</remarks>.
4940 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 61 6d 70 6c 65 3e 0d 0a 20 20 20 20 20 20 20 20 .........///.<example>..........
4960 2f 2f 2f 20 3c 63 6f 64 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 75 73 69 6e 67 20 55 6e ///.<code>..........///.using.Un
4980 69 74 79 45 6e 67 69 6e 65 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 75 73 69 6e 67 20 53 79 ityEngine;..........///.using.Sy
49a0 73 74 65 6d 2e 43 6f 6c 6c 65 63 74 69 6f 6e 73 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 75 stem.Collections;..........///.u
49c0 73 69 6e 67 20 55 6e 69 74 79 45 6e 67 69 6e 65 2e 55 49 3b 20 2f 2f 20 52 65 71 75 69 72 65 64 sing.UnityEngine.UI;.//.Required
49e0 20 77 68 65 6e 20 55 73 69 6e 67 20 55 49 20 65 6c 65 6d 65 6e 74 73 2e 0d 0a 20 20 20 20 20 20 .when.Using.UI.elements.........
4a00 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 70 75 62 6c 69 63 20 63 6c 61 73 73 20 ..///..........///.public.class.
4a20 45 78 61 6d 70 6c 65 20 3a 20 4d 6f 6e 6f 42 65 68 61 76 69 6f 75 72 0d 0a 20 20 20 20 20 20 20 Example.:.MonoBehaviour.........
4a40 20 2f 2f 2f 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 70 75 62 6c 69 63 20 49 .///.{..........///.....public.I
4a60 6e 70 75 74 46 69 65 6c 64 20 6d 61 69 6e 49 6e 70 75 74 46 69 65 6c 64 3b 0d 0a 20 20 20 20 20 nputField.mainInputField;.......
4a80 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 70 75 62 6c 69 63 20 76 ...///..........///.....public.v
4aa0 6f 69 64 20 53 74 61 72 74 28 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 7b 0d 0a oid.Start()..........///.....{..
4ac0 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 6d 61 69 6e 49 6e 70 75 74 46 69 65 ........///.........mainInputFie
4ae0 6c 64 2e 74 65 78 74 20 3d 20 22 45 6e 74 65 72 20 54 65 78 74 20 48 65 72 65 2e 2e 2e 22 3b 0d ld.text.=."Enter.Text.Here...";.
4b00 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 .........///.....}..........///.
4b20 7d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 63 6f 64 65 3e 0d 0a 20 20 20 20 20 20 20 20 }..........///.</code>..........
4b40 2f 2f 2f 20 3c 2f 65 78 61 6d 70 6c 65 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 ///.</example>..........public.s
4b60 74 72 69 6e 67 20 74 65 78 74 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 tring.text..........{...........
4b80 20 20 20 67 65 74 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 ...get..............{...........
4ba0 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 6d 5f 54 65 78 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 .......return.m_Text;...........
4bc0 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 65 74 0d 0a 20 20 20 20 20 20 20 20 20 ...}..............set...........
4be0 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 53 65 74 54 65 78 74 28 76 61 ...{..................SetText(va
4c00 6c 75 65 29 3b 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 lue);..............}..........}.
4c20 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>........
4c40 20 20 2f 2f 2f 20 53 65 74 20 49 6e 70 75 74 20 66 69 65 6c 64 27 73 20 63 75 72 72 65 6e 74 20 ..///.Set.Input.field's.current.
4c60 74 65 78 74 20 76 61 6c 75 65 20 77 69 74 68 6f 75 74 20 69 6e 76 6f 6b 65 20 6f 6e 56 61 6c 75 text.value.without.invoke.onValu
4c80 65 43 68 61 6e 67 65 64 2e 20 54 68 69 73 20 69 73 20 6e 6f 74 20 6e 65 63 65 73 73 61 72 69 6c eChanged..This.is.not.necessaril
4ca0 79 20 74 68 65 20 73 61 6d 65 20 61 73 20 77 68 61 74 20 69 73 20 76 69 73 69 62 6c 65 20 6f 6e y.the.same.as.what.is.visible.on
4cc0 20 73 63 72 65 65 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 .screen...........///.</summary>
4ce0 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 76 6f 69 64 20 53 65 74 54 65 78 74 57 69 74 ..........public.void.SetTextWit
4d00 68 6f 75 74 4e 6f 74 69 66 79 28 73 74 72 69 6e 67 20 69 6e 70 75 74 29 0d 0a 20 20 20 20 20 20 houtNotify(string.input)........
4d20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 53 65 74 54 65 78 74 28 69 6e 70 75 74 2c 20 ..{..............SetText(input,.
4d40 66 61 6c 73 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 76 6f false);..........}............vo
4d60 69 64 20 53 65 74 54 65 78 74 28 73 74 72 69 6e 67 20 76 61 6c 75 65 2c 20 62 6f 6f 6c 20 73 65 id.SetText(string.value,.bool.se
4d80 6e 64 43 61 6c 6c 62 61 63 6b 20 3d 20 74 72 75 65 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 ndCallback.=.true)..........{...
4da0 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 74 68 69 73 2e 74 65 78 74 20 3d 3d 20 76 61 6c 75 ...........if.(this.text.==.valu
4dc0 65 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 3b 0d 0a 0d 0a 20 e)..................return;.....
4de0 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 76 61 6c 75 65 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 ...........if.(value.==.null)...
4e00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 6c 75 65 20 3d 20 22 22 3b 0d 0a 0d 0a 20 20 ...............value.=."";......
4e20 20 20 20 20 20 20 20 20 20 20 76 61 6c 75 65 20 3d 20 76 61 6c 75 65 2e 52 65 70 6c 61 63 65 28 ..........value.=.value.Replace(
4e40 22 5c 30 22 2c 20 73 74 72 69 6e 67 2e 45 6d 70 74 79 29 3b 20 2f 2f 20 72 65 6d 6f 76 65 20 65 "\0",.string.Empty);.//.remove.e
4e60 6d 62 65 64 64 65 64 20 6e 75 6c 6c 73 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 54 mbedded.nulls................m_T
4e80 65 78 74 20 3d 20 76 61 6c 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2a 0d 0a ext.=.value;................/*..
4ea0 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 4c 69 6e 65 54 79 70 65 20 3d 3d 20 4c 69 ............if.(m_LineType.==.Li
4ec0 6e 65 54 79 70 65 2e 53 69 6e 67 6c 65 4c 69 6e 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 neType.SingleLine)..............
4ee0 20 20 20 20 76 61 6c 75 65 20 3d 20 76 61 6c 75 65 2e 52 65 70 6c 61 63 65 28 22 5c 6e 22 2c 20 ....value.=.value.Replace("\n",.
4f00 22 22 29 2e 52 65 70 6c 61 63 65 28 22 5c 74 22 2c 20 22 22 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 "").Replace("\t",."");..........
4f20 20 20 20 20 20 20 2f 2f 20 49 66 20 77 65 20 68 61 76 65 20 61 6e 20 69 6e 70 75 74 20 76 61 6c ......//.If.we.have.an.input.val
4f40 69 64 61 74 6f 72 2c 20 76 61 6c 69 64 61 74 65 20 74 68 65 20 69 6e 70 75 74 20 61 6e 64 20 61 idator,.validate.the.input.and.a
4f60 70 70 6c 79 20 74 68 65 20 63 68 61 72 61 63 74 65 72 20 6c 69 6d 69 74 20 61 74 20 74 68 65 20 pply.the.character.limit.at.the.
4f80 73 61 6d 65 20 74 69 6d 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6f 6e 56 61 same.time...............if.(onVa
4fa0 6c 69 64 61 74 65 49 6e 70 75 74 20 21 3d 20 6e 75 6c 6c 20 7c 7c 20 63 68 61 72 61 63 74 65 72 lidateInput.!=.null.||.character
4fc0 56 61 6c 69 64 61 74 69 6f 6e 20 21 3d 20 43 68 61 72 61 63 74 65 72 56 61 6c 69 64 61 74 69 6f Validation.!=.CharacterValidatio
4fe0 6e 2e 4e 6f 6e 65 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 n.None)..............{..........
5000 20 20 20 20 20 20 20 20 6d 5f 54 65 78 74 20 3d 20 22 22 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 ........m_Text.=."";............
5020 20 20 20 20 20 20 4f 6e 56 61 6c 69 64 61 74 65 49 6e 70 75 74 20 76 61 6c 69 64 61 74 6f 72 4d ......OnValidateInput.validatorM
5040 65 74 68 6f 64 20 3d 20 6f 6e 56 61 6c 69 64 61 74 65 49 6e 70 75 74 20 3f 3f 20 56 61 6c 69 64 ethod.=.onValidateInput.??.Valid
5060 61 74 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 43 61 72 65 74 50 6f 73 ate;..................m_CaretPos
5080 69 74 69 6f 6e 20 3d 20 6d 5f 43 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 20 3d 20 ition.=.m_CaretSelectPosition.=.
50a0 76 61 6c 75 65 2e 4c 65 6e 67 74 68 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 value.Length;..................i
50c0 6e 74 20 63 68 61 72 61 63 74 65 72 73 54 6f 43 68 65 63 6b 20 3d 20 63 68 61 72 61 63 74 65 72 nt.charactersToCheck.=.character
50e0 4c 69 6d 69 74 20 3e 20 30 20 3f 20 4d 61 74 68 2e 4d 69 6e 28 63 68 61 72 61 63 74 65 72 4c 69 Limit.>.0.?.Math.Min(characterLi
5100 6d 69 74 2c 20 76 61 6c 75 65 2e 4c 65 6e 67 74 68 29 20 3a 20 76 61 6c 75 65 2e 4c 65 6e 67 74 mit,.value.Length).:.value.Lengt
5120 68 3b 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 69 20 3d h;..................for.(int.i.=
5140 20 30 3b 20 69 20 3c 20 63 68 61 72 61 63 74 65 72 73 54 6f 43 68 65 63 6b 3b 20 2b 2b 69 29 0d .0;.i.<.charactersToCheck;.++i).
5160 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 .................{..............
5180 20 20 20 20 20 20 20 20 63 68 61 72 20 63 20 3d 20 76 61 6c 69 64 61 74 6f 72 4d 65 74 68 6f 64 ........char.c.=.validatorMethod
51a0 28 6d 5f 54 65 78 74 2c 20 6d 5f 54 65 78 74 2e 4c 65 6e 67 74 68 2c 20 76 61 6c 75 65 5b 69 5d (m_Text,.m_Text.Length,.value[i]
51c0 29 3b 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 63 20 21 3d );......................if.(c.!=
51e0 20 30 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 6d 5f 54 .0)..........................m_T
5200 65 78 74 20 2b 3d 20 63 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 ext.+=.c;..................}....
5220 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 65 6c 73 65 0d 0a 20 ..........}..............else...
5240 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 6d 5f ...........{..................m_
5260 54 65 78 74 20 3d 20 63 68 61 72 61 63 74 65 72 4c 69 6d 69 74 20 3e 20 30 20 26 26 20 76 61 6c Text.=.characterLimit.>.0.&&.val
5280 75 65 2e 4c 65 6e 67 74 68 20 3e 20 63 68 61 72 61 63 74 65 72 4c 69 6d 69 74 20 3f 20 76 61 6c ue.Length.>.characterLimit.?.val
52a0 75 65 2e 53 75 62 73 74 72 69 6e 67 28 30 2c 20 63 68 61 72 61 63 74 65 72 4c 69 6d 69 74 29 20 ue.Substring(0,.characterLimit).
52c0 3a 20 76 61 6c 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 :.value;..............}.........
52e0 20 20 20 20 20 2a 2f 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 23 69 66 20 55 4e 49 54 59 .....*/................#if.UNITY
5300 5f 45 44 49 54 4f 52 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 41 70 70 6c 69 63 _EDITOR..............if.(!Applic
5320 61 74 69 6f 6e 2e 69 73 50 6c 61 79 69 6e 67 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d ation.isPlaying)..............{.
5340 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 53 65 6e 64 4f 6e 56 61 6c 75 65 43 68 61 6e .................SendOnValueChan
5360 67 65 64 41 6e 64 55 70 64 61 74 65 4c 61 62 65 6c 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 gedAndUpdateLabel();............
5380 20 20 20 20 20 20 72 65 74 75 72 6e 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 ......return;..............}....
53a0 20 20 20 20 20 20 20 20 20 20 23 65 6e 64 69 66 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 ..........#endif................
53c0 69 66 20 28 6d 5f 53 6f 66 74 4b 65 79 62 6f 61 72 64 20 21 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 if.(m_SoftKeyboard.!=.null).....
53e0 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 53 6f 66 74 4b 65 79 62 6f 61 72 64 2e 74 65 78 74 .............m_SoftKeyboard.text
5400 20 3d 20 6d 5f 54 65 78 74 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f .=.m_Text;................if.(m_
5420 53 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 20 3e 20 6d 5f 54 65 78 74 2e 4c 65 6e 67 74 68 29 0d StringPosition.>.m_Text.Length).
5440 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 53 74 72 69 6e 67 50 6f 73 69 74 69 6f .................m_StringPositio
5460 6e 20 3d 20 6d 5f 53 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 20 3d 20 6d 5f 54 n.=.m_StringSelectPosition.=.m_T
5480 65 78 74 2e 4c 65 6e 67 74 68 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 20 69 66 ext.Length;..............else.if
54a0 20 28 6d 5f 53 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 20 3e 20 6d 5f 54 65 78 .(m_StringSelectPosition.>.m_Tex
54c0 74 2e 4c 65 6e 67 74 68 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 53 74 72 t.Length)..................m_Str
54e0 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 20 3d 20 6d 5f 54 65 78 74 2e 4c 65 6e 67 74 ingSelectPosition.=.m_Text.Lengt
5500 68 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 53 65 74 20 52 65 63 74 54 72 61 h;................//.Set.RectTra
5520 6e 73 66 6f 72 6d 20 72 65 6c 61 74 69 76 65 20 70 6f 73 69 74 69 6f 6e 20 74 6f 20 74 6f 70 20 nsform.relative.position.to.top.
5540 6f 66 20 76 69 65 77 70 6f 72 74 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 41 64 6a 75 73 74 of.viewport...............Adjust
5560 54 65 78 74 50 6f 73 69 74 69 6f 6e 52 65 6c 61 74 69 76 65 54 6f 56 69 65 77 70 6f 72 74 28 30 TextPositionRelativeToViewport(0
5580 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 66 6f 72 63 65 52 65 63 74 54 72 61 );................m_forceRectTra
55a0 6e 73 66 6f 72 6d 41 64 6a 75 73 74 6d 65 6e 74 20 3d 20 74 72 75 65 3b 0d 0a 0d 0a 20 20 20 20 nsformAdjustment.=.true;........
55c0 20 20 20 20 20 20 20 20 6d 5f 49 73 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 55 70 64 61 74 65 52 ........m_IsTextComponentUpdateR
55e0 65 71 75 69 72 65 64 20 3d 20 74 72 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 55 70 64 equired.=.true;..............Upd
5600 61 74 65 4c 61 62 65 6c 28 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 ateLabel();................if.(s
5620 65 6e 64 43 61 6c 6c 62 61 63 6b 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 53 65 endCallback)..................Se
5640 6e 64 4f 6e 56 61 6c 75 65 43 68 61 6e 67 65 64 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a ndOnValueChanged();..........}..
5660 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 62 6f 6f 6c 20 69 73 46 6f 63 75 73 65 ............public.bool.isFocuse
5680 64 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 67 65 74 20 7b 20 d..........{..............get.{.
56a0 72 65 74 75 72 6e 20 6d 5f 41 6c 6c 6f 77 49 6e 70 75 74 3b 20 7d 0d 0a 20 20 20 20 20 20 20 20 return.m_AllowInput;.}..........
56c0 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 66 6c 6f 61 74 20 63 61 72 65 74 42 }............public.float.caretB
56e0 6c 69 6e 6b 52 61 74 65 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 linkRate..........{.............
5700 20 67 65 74 20 7b 20 72 65 74 75 72 6e 20 6d 5f 43 61 72 65 74 42 6c 69 6e 6b 52 61 74 65 3b 20 .get.{.return.m_CaretBlinkRate;.
5720 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 65 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 }..............set..............
5740 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 53 65 74 50 72 6f 70 65 72 {..................if.(SetProper
5760 74 79 55 74 69 6c 69 74 79 2e 53 65 74 53 74 72 75 63 74 28 72 65 66 20 6d 5f 43 61 72 65 74 42 tyUtility.SetStruct(ref.m_CaretB
5780 6c 69 6e 6b 52 61 74 65 2c 20 76 61 6c 75 65 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 linkRate,.value))...............
57a0 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 69 66 20 28 6d 5f ...{......................if.(m_
57c0 41 6c 6c 6f 77 49 6e 70 75 74 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 AllowInput).....................
57e0 20 20 20 20 20 53 65 74 43 61 72 65 74 41 63 74 69 76 65 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 .....SetCaretActive();..........
5800 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 ........}..............}........
5820 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 69 6e 74 20 63 61 72 65 74 57 ..}............public.int.caretW
5840 69 64 74 68 20 7b 20 67 65 74 20 7b 20 72 65 74 75 72 6e 20 6d 5f 43 61 72 65 74 57 69 64 74 68 idth.{.get.{.return.m_CaretWidth
5860 3b 20 7d 20 73 65 74 20 7b 20 69 66 20 28 53 65 74 50 72 6f 70 65 72 74 79 55 74 69 6c 69 74 79 ;.}.set.{.if.(SetPropertyUtility
5880 2e 53 65 74 53 74 72 75 63 74 28 72 65 66 20 6d 5f 43 61 72 65 74 57 69 64 74 68 2c 20 76 61 6c .SetStruct(ref.m_CaretWidth,.val
58a0 75 65 29 29 20 4d 61 72 6b 47 65 6f 6d 65 74 72 79 41 73 44 69 72 74 79 28 29 3b 20 7d 20 7d 0d ue)).MarkGeometryAsDirty();.}.}.
58c0 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 52 65 63 74 54 72 61 6e 73 66 6f 72 6d 20 ...........public.RectTransform.
58e0 74 65 78 74 56 69 65 77 70 6f 72 74 20 7b 20 67 65 74 20 7b 20 72 65 74 75 72 6e 20 6d 5f 54 65 textViewport.{.get.{.return.m_Te
5900 78 74 56 69 65 77 70 6f 72 74 3b 20 7d 20 73 65 74 20 7b 20 53 65 74 50 72 6f 70 65 72 74 79 55 xtViewport;.}.set.{.SetPropertyU
5920 74 69 6c 69 74 79 2e 53 65 74 43 6c 61 73 73 28 72 65 66 20 6d 5f 54 65 78 74 56 69 65 77 70 6f tility.SetClass(ref.m_TextViewpo
5940 72 74 2c 20 76 61 6c 75 65 29 3b 20 7d 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 rt,.value);.}.}............publi
5960 63 20 54 4d 50 5f 54 65 78 74 20 74 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 0d 0a 20 20 20 20 20 20 c.TMP_Text.textComponent........
5980 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 67 65 74 20 7b 20 72 65 74 75 72 6e 20 6d 5f ..{..............get.{.return.m_
59a0 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 3b 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 65 TextComponent;.}..............se
59c0 74 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 t..............{................
59e0 20 20 69 66 20 28 53 65 74 50 72 6f 70 65 72 74 79 55 74 69 6c 69 74 79 2e 53 65 74 43 6c 61 73 ..if.(SetPropertyUtility.SetClas
5a00 73 28 72 65 66 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2c 20 76 61 6c 75 65 29 29 0d 0a s(ref.m_TextComponent,.value))..
5a20 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 ................{...............
5a40 20 20 20 20 20 20 20 53 65 74 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 57 72 61 70 4d 6f 64 65 28 .......SetTextComponentWrapMode(
5a60 29 3b 0d 0a 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 );..................}...........
5a80 20 20 20 7d 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 70 75 62 ...}..........}............//pub
5aa0 6c 69 63 20 54 4d 50 5f 54 65 78 74 20 70 6c 61 63 65 68 6f 6c 64 65 72 54 65 78 74 43 6f 6d 70 lic.TMP_Text.placeholderTextComp
5ac0 6f 6e 65 6e 74 20 7b 20 67 65 74 20 7b 20 72 65 74 75 72 6e 20 6d 5f 50 6c 61 63 65 68 6f 6c 64 onent.{.get.{.return.m_Placehold
5ae0 65 72 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 3b 20 7d 20 73 65 74 20 7b 20 53 65 74 50 72 6f 70 erTextComponent;.}.set.{.SetProp
5b00 65 72 74 79 55 74 69 6c 69 74 79 2e 53 65 74 43 6c 61 73 73 28 72 65 66 20 6d 5f 50 6c 61 63 65 ertyUtility.SetClass(ref.m_Place
5b20 68 6f 6c 64 65 72 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2c 20 76 61 6c 75 65 29 3b 20 7d 20 7d holderTextComponent,.value);.}.}
5b40 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 47 72 61 70 68 69 63 20 70 6c 61 63 65 ............public.Graphic.place
5b60 68 6f 6c 64 65 72 20 7b 20 67 65 74 20 7b 20 72 65 74 75 72 6e 20 6d 5f 50 6c 61 63 65 68 6f 6c holder.{.get.{.return.m_Placehol
5b80 64 65 72 3b 20 7d 20 73 65 74 20 7b 20 53 65 74 50 72 6f 70 65 72 74 79 55 74 69 6c 69 74 79 2e der;.}.set.{.SetPropertyUtility.
5ba0 53 65 74 43 6c 61 73 73 28 72 65 66 20 6d 5f 50 6c 61 63 65 68 6f 6c 64 65 72 2c 20 76 61 6c 75 SetClass(ref.m_Placeholder,.valu
5bc0 65 29 3b 20 7d 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 53 63 72 6f 6c 6c e);.}.}............public.Scroll
5be0 62 61 72 20 76 65 72 74 69 63 61 6c 53 63 72 6f 6c 6c 62 61 72 0d 0a 20 20 20 20 20 20 20 20 7b bar.verticalScrollbar..........{
5c00 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 67 65 74 20 7b 20 72 65 74 75 72 6e 20 6d 5f 56 65 72 ..............get.{.return.m_Ver
5c20 74 69 63 61 6c 53 63 72 6f 6c 6c 62 61 72 3b 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 ticalScrollbar;.}..............s
5c40 65 74 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 et..............{...............
5c60 20 20 20 69 66 20 28 6d 5f 56 65 72 74 69 63 61 6c 53 63 72 6f 6c 6c 62 61 72 20 21 3d 20 6e 75 ...if.(m_VerticalScrollbar.!=.nu
5c80 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 56 65 72 74 69 ll)......................m_Verti
5ca0 63 61 6c 53 63 72 6f 6c 6c 62 61 72 2e 6f 6e 56 61 6c 75 65 43 68 61 6e 67 65 64 2e 52 65 6d 6f calScrollbar.onValueChanged.Remo
5cc0 76 65 4c 69 73 74 65 6e 65 72 28 4f 6e 53 63 72 6f 6c 6c 62 61 72 56 61 6c 75 65 43 68 61 6e 67 veListener(OnScrollbarValueChang
5ce0 65 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 53 65 74 50 72 6f 70 65 72 e);....................SetProper
5d00 74 79 55 74 69 6c 69 74 79 2e 53 65 74 43 6c 61 73 73 28 72 65 66 20 6d 5f 56 65 72 74 69 63 61 tyUtility.SetClass(ref.m_Vertica
5d20 6c 53 63 72 6f 6c 6c 62 61 72 2c 20 76 61 6c 75 65 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 lScrollbar,.value);.............
5d40 20 20 20 20 20 20 20 69 66 20 28 6d 5f 56 65 72 74 69 63 61 6c 53 63 72 6f 6c 6c 62 61 72 29 0d .......if.(m_VerticalScrollbar).
5d60 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 .................{..............
5d80 20 20 20 20 20 20 20 20 6d 5f 56 65 72 74 69 63 61 6c 53 63 72 6f 6c 6c 62 61 72 2e 6f 6e 56 61 ........m_VerticalScrollbar.onVa
5da0 6c 75 65 43 68 61 6e 67 65 64 2e 41 64 64 4c 69 73 74 65 6e 65 72 28 4f 6e 53 63 72 6f 6c 6c 62 lueChanged.AddListener(OnScrollb
5dc0 61 72 56 61 6c 75 65 43 68 61 6e 67 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 arValueChange);.................
5de0 20 20 20 20 20 0d 0a 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 .......................}........
5e00 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 ......}..........}............pu
5e20 62 6c 69 63 20 66 6c 6f 61 74 20 73 63 72 6f 6c 6c 53 65 6e 73 69 74 69 76 69 74 79 20 7b 20 67 blic.float.scrollSensitivity.{.g
5e40 65 74 20 7b 20 72 65 74 75 72 6e 20 6d 5f 53 63 72 6f 6c 6c 53 65 6e 73 69 74 69 76 69 74 79 3b et.{.return.m_ScrollSensitivity;
5e60 20 7d 20 73 65 74 20 7b 20 69 66 20 28 53 65 74 50 72 6f 70 65 72 74 79 55 74 69 6c 69 74 79 2e .}.set.{.if.(SetPropertyUtility.
5e80 53 65 74 53 74 72 75 63 74 28 72 65 66 20 6d 5f 53 63 72 6f 6c 6c 53 65 6e 73 69 74 69 76 69 74 SetStruct(ref.m_ScrollSensitivit
5ea0 79 2c 20 76 61 6c 75 65 29 29 20 4d 61 72 6b 47 65 6f 6d 65 74 72 79 41 73 44 69 72 74 79 28 29 y,.value)).MarkGeometryAsDirty()
5ec0 3b 20 7d 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 43 6f 6c 6f 72 20 63 61 ;.}.}............public.Color.ca
5ee0 72 65 74 43 6f 6c 6f 72 20 7b 20 67 65 74 20 7b 20 72 65 74 75 72 6e 20 63 75 73 74 6f 6d 43 61 retColor.{.get.{.return.customCa
5f00 72 65 74 43 6f 6c 6f 72 20 3f 20 6d 5f 43 61 72 65 74 43 6f 6c 6f 72 20 3a 20 74 65 78 74 43 6f retColor.?.m_CaretColor.:.textCo
5f20 6d 70 6f 6e 65 6e 74 2e 63 6f 6c 6f 72 3b 20 7d 20 73 65 74 20 7b 20 69 66 20 28 53 65 74 50 72 mponent.color;.}.set.{.if.(SetPr
5f40 6f 70 65 72 74 79 55 74 69 6c 69 74 79 2e 53 65 74 43 6f 6c 6f 72 28 72 65 66 20 6d 5f 43 61 72 opertyUtility.SetColor(ref.m_Car
5f60 65 74 43 6f 6c 6f 72 2c 20 76 61 6c 75 65 29 29 20 4d 61 72 6b 47 65 6f 6d 65 74 72 79 41 73 44 etColor,.value)).MarkGeometryAsD
5f80 69 72 74 79 28 29 3b 20 7d 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 62 6f irty();.}.}............public.bo
5fa0 6f 6c 20 63 75 73 74 6f 6d 43 61 72 65 74 43 6f 6c 6f 72 20 7b 20 67 65 74 20 7b 20 72 65 74 75 ol.customCaretColor.{.get.{.retu
5fc0 72 6e 20 6d 5f 43 75 73 74 6f 6d 43 61 72 65 74 43 6f 6c 6f 72 3b 20 7d 20 73 65 74 20 7b 20 69 rn.m_CustomCaretColor;.}.set.{.i
5fe0 66 20 28 6d 5f 43 75 73 74 6f 6d 43 61 72 65 74 43 6f 6c 6f 72 20 21 3d 20 76 61 6c 75 65 29 20 f.(m_CustomCaretColor.!=.value).
6000 7b 20 6d 5f 43 75 73 74 6f 6d 43 61 72 65 74 43 6f 6c 6f 72 20 3d 20 76 61 6c 75 65 3b 20 4d 61 {.m_CustomCaretColor.=.value;.Ma
6020 72 6b 47 65 6f 6d 65 74 72 79 41 73 44 69 72 74 79 28 29 3b 20 7d 20 7d 20 7d 0d 0a 0d 0a 20 20 rkGeometryAsDirty();.}.}.}......
6040 20 20 20 20 20 20 70 75 62 6c 69 63 20 43 6f 6c 6f 72 20 73 65 6c 65 63 74 69 6f 6e 43 6f 6c 6f ......public.Color.selectionColo
6060 72 20 7b 20 67 65 74 20 7b 20 72 65 74 75 72 6e 20 6d 5f 53 65 6c 65 63 74 69 6f 6e 43 6f 6c 6f r.{.get.{.return.m_SelectionColo
6080 72 3b 20 7d 20 73 65 74 20 7b 20 69 66 20 28 53 65 74 50 72 6f 70 65 72 74 79 55 74 69 6c 69 74 r;.}.set.{.if.(SetPropertyUtilit
60a0 79 2e 53 65 74 43 6f 6c 6f 72 28 72 65 66 20 6d 5f 53 65 6c 65 63 74 69 6f 6e 43 6f 6c 6f 72 2c y.SetColor(ref.m_SelectionColor,
60c0 20 76 61 6c 75 65 29 29 20 4d 61 72 6b 47 65 6f 6d 65 74 72 79 41 73 44 69 72 74 79 28 29 3b 20 .value)).MarkGeometryAsDirty();.
60e0 7d 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 53 75 62 6d 69 74 45 76 65 6e }.}............public.SubmitEven
6100 74 20 6f 6e 45 6e 64 45 64 69 74 20 7b 20 67 65 74 20 7b 20 72 65 74 75 72 6e 20 6d 5f 4f 6e 45 t.onEndEdit.{.get.{.return.m_OnE
6120 6e 64 45 64 69 74 3b 20 7d 20 73 65 74 20 7b 20 53 65 74 50 72 6f 70 65 72 74 79 55 74 69 6c 69 ndEdit;.}.set.{.SetPropertyUtili
6140 74 79 2e 53 65 74 43 6c 61 73 73 28 72 65 66 20 6d 5f 4f 6e 45 6e 64 45 64 69 74 2c 20 76 61 6c ty.SetClass(ref.m_OnEndEdit,.val
6160 75 65 29 3b 20 7d 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 53 75 62 6d 69 ue);.}.}............public.Submi
6180 74 45 76 65 6e 74 20 6f 6e 53 75 62 6d 69 74 20 7b 20 67 65 74 20 7b 20 72 65 74 75 72 6e 20 6d tEvent.onSubmit.{.get.{.return.m
61a0 5f 4f 6e 53 75 62 6d 69 74 3b 20 7d 20 73 65 74 20 7b 20 53 65 74 50 72 6f 70 65 72 74 79 55 74 _OnSubmit;.}.set.{.SetPropertyUt
61c0 69 6c 69 74 79 2e 53 65 74 43 6c 61 73 73 28 72 65 66 20 6d 5f 4f 6e 53 75 62 6d 69 74 2c 20 76 ility.SetClass(ref.m_OnSubmit,.v
61e0 61 6c 75 65 29 3b 20 7d 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 53 65 6c alue);.}.}............public.Sel
6200 65 63 74 69 6f 6e 45 76 65 6e 74 20 6f 6e 53 65 6c 65 63 74 20 7b 20 67 65 74 20 7b 20 72 65 74 ectionEvent.onSelect.{.get.{.ret
6220 75 72 6e 20 6d 5f 4f 6e 53 65 6c 65 63 74 3b 20 7d 20 73 65 74 20 7b 20 53 65 74 50 72 6f 70 65 urn.m_OnSelect;.}.set.{.SetPrope
6240 72 74 79 55 74 69 6c 69 74 79 2e 53 65 74 43 6c 61 73 73 28 72 65 66 20 6d 5f 4f 6e 53 65 6c 65 rtyUtility.SetClass(ref.m_OnSele
6260 63 74 2c 20 76 61 6c 75 65 29 3b 20 7d 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 ct,.value);.}.}............publi
6280 63 20 53 65 6c 65 63 74 69 6f 6e 45 76 65 6e 74 20 6f 6e 44 65 73 65 6c 65 63 74 20 7b 20 67 65 c.SelectionEvent.onDeselect.{.ge
62a0 74 20 7b 20 72 65 74 75 72 6e 20 6d 5f 4f 6e 44 65 73 65 6c 65 63 74 3b 20 7d 20 73 65 74 20 7b t.{.return.m_OnDeselect;.}.set.{
62c0 20 53 65 74 50 72 6f 70 65 72 74 79 55 74 69 6c 69 74 79 2e 53 65 74 43 6c 61 73 73 28 72 65 66 .SetPropertyUtility.SetClass(ref
62e0 20 6d 5f 4f 6e 44 65 73 65 6c 65 63 74 2c 20 76 61 6c 75 65 29 3b 20 7d 20 7d 0d 0a 0d 0a 20 20 .m_OnDeselect,.value);.}.}......
6300 20 20 20 20 20 20 70 75 62 6c 69 63 20 54 65 78 74 53 65 6c 65 63 74 69 6f 6e 45 76 65 6e 74 20 ......public.TextSelectionEvent.
6320 6f 6e 54 65 78 74 53 65 6c 65 63 74 69 6f 6e 20 7b 20 67 65 74 20 7b 20 72 65 74 75 72 6e 20 6d onTextSelection.{.get.{.return.m
6340 5f 4f 6e 54 65 78 74 53 65 6c 65 63 74 69 6f 6e 3b 20 7d 20 73 65 74 20 7b 20 53 65 74 50 72 6f _OnTextSelection;.}.set.{.SetPro
6360 70 65 72 74 79 55 74 69 6c 69 74 79 2e 53 65 74 43 6c 61 73 73 28 72 65 66 20 6d 5f 4f 6e 54 65 pertyUtility.SetClass(ref.m_OnTe
6380 78 74 53 65 6c 65 63 74 69 6f 6e 2c 20 76 61 6c 75 65 29 3b 20 7d 20 7d 0d 0a 0d 0a 20 20 20 20 xtSelection,.value);.}.}........
63a0 20 20 20 20 70 75 62 6c 69 63 20 54 65 78 74 53 65 6c 65 63 74 69 6f 6e 45 76 65 6e 74 20 6f 6e ....public.TextSelectionEvent.on
63c0 45 6e 64 54 65 78 74 53 65 6c 65 63 74 69 6f 6e 20 7b 20 67 65 74 20 7b 20 72 65 74 75 72 6e 20 EndTextSelection.{.get.{.return.
63e0 6d 5f 4f 6e 45 6e 64 54 65 78 74 53 65 6c 65 63 74 69 6f 6e 3b 20 7d 20 73 65 74 20 7b 20 53 65 m_OnEndTextSelection;.}.set.{.Se
6400 74 50 72 6f 70 65 72 74 79 55 74 69 6c 69 74 79 2e 53 65 74 43 6c 61 73 73 28 72 65 66 20 6d 5f tPropertyUtility.SetClass(ref.m_
6420 4f 6e 45 6e 64 54 65 78 74 53 65 6c 65 63 74 69 6f 6e 2c 20 76 61 6c 75 65 29 3b 20 7d 20 7d 0d OnEndTextSelection,.value);.}.}.
6440 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 4f 6e 43 68 61 6e 67 65 45 76 65 6e 74 20 ...........public.OnChangeEvent.
6460 6f 6e 56 61 6c 75 65 43 68 61 6e 67 65 64 20 7b 20 67 65 74 20 7b 20 72 65 74 75 72 6e 20 6d 5f onValueChanged.{.get.{.return.m_
6480 4f 6e 56 61 6c 75 65 43 68 61 6e 67 65 64 3b 20 7d 20 73 65 74 20 7b 20 53 65 74 50 72 6f 70 65 OnValueChanged;.}.set.{.SetPrope
64a0 72 74 79 55 74 69 6c 69 74 79 2e 53 65 74 43 6c 61 73 73 28 72 65 66 20 6d 5f 4f 6e 56 61 6c 75 rtyUtility.SetClass(ref.m_OnValu
64c0 65 43 68 61 6e 67 65 64 2c 20 76 61 6c 75 65 29 3b 20 7d 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 eChanged,.value);.}.}...........
64e0 20 70 75 62 6c 69 63 20 54 6f 75 63 68 53 63 72 65 65 6e 4b 65 79 62 6f 61 72 64 45 76 65 6e 74 .public.TouchScreenKeyboardEvent
6500 20 6f 6e 54 6f 75 63 68 53 63 72 65 65 6e 4b 65 79 62 6f 61 72 64 53 74 61 74 75 73 43 68 61 6e .onTouchScreenKeyboardStatusChan
6520 67 65 64 20 7b 20 67 65 74 20 7b 20 72 65 74 75 72 6e 20 6d 5f 4f 6e 54 6f 75 63 68 53 63 72 65 ged.{.get.{.return.m_OnTouchScre
6540 65 6e 4b 65 79 62 6f 61 72 64 53 74 61 74 75 73 43 68 61 6e 67 65 64 3b 20 7d 20 73 65 74 20 7b enKeyboardStatusChanged;.}.set.{
6560 20 53 65 74 50 72 6f 70 65 72 74 79 55 74 69 6c 69 74 79 2e 53 65 74 43 6c 61 73 73 28 72 65 66 .SetPropertyUtility.SetClass(ref
6580 20 6d 5f 4f 6e 54 6f 75 63 68 53 63 72 65 65 6e 4b 65 79 62 6f 61 72 64 53 74 61 74 75 73 43 68 .m_OnTouchScreenKeyboardStatusCh
65a0 61 6e 67 65 64 2c 20 76 61 6c 75 65 29 3b 20 7d 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 anged,.value);.}.}............pu
65c0 62 6c 69 63 20 4f 6e 56 61 6c 69 64 61 74 65 49 6e 70 75 74 20 6f 6e 56 61 6c 69 64 61 74 65 49 blic.OnValidateInput.onValidateI
65e0 6e 70 75 74 20 7b 20 67 65 74 20 7b 20 72 65 74 75 72 6e 20 6d 5f 4f 6e 56 61 6c 69 64 61 74 65 nput.{.get.{.return.m_OnValidate
6600 49 6e 70 75 74 3b 20 7d 20 73 65 74 20 7b 20 53 65 74 50 72 6f 70 65 72 74 79 55 74 69 6c 69 74 Input;.}.set.{.SetPropertyUtilit
6620 79 2e 53 65 74 43 6c 61 73 73 28 72 65 66 20 6d 5f 4f 6e 56 61 6c 69 64 61 74 65 49 6e 70 75 74 y.SetClass(ref.m_OnValidateInput
6640 2c 20 76 61 6c 75 65 29 3b 20 7d 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 ,.value);.}.}............public.
6660 69 6e 74 20 63 68 61 72 61 63 74 65 72 4c 69 6d 69 74 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 int.characterLimit..........{...
6680 20 20 20 20 20 20 20 20 20 20 20 67 65 74 20 7b 20 72 65 74 75 72 6e 20 6d 5f 43 68 61 72 61 63 ...........get.{.return.m_Charac
66a0 74 65 72 4c 69 6d 69 74 3b 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 65 74 0d 0a 20 20 terLimit;.}..............set....
66c0 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 69 66 20 ..........{..................if.
66e0 28 53 65 74 50 72 6f 70 65 72 74 79 55 74 69 6c 69 74 79 2e 53 65 74 53 74 72 75 63 74 28 72 65 (SetPropertyUtility.SetStruct(re
6700 66 20 6d 5f 43 68 61 72 61 63 74 65 72 4c 69 6d 69 74 2c 20 4d 61 74 68 2e 4d 61 78 28 30 2c 20 f.m_CharacterLimit,.Math.Max(0,.
6720 76 61 6c 75 65 29 29 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 value)))..................{.....
6740 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 55 70 64 61 74 65 4c 61 62 65 6c 28 29 3b 0d .................UpdateLabel();.
6760 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 6d 5f 53 6f 66 74 4b .....................if.(m_SoftK
6780 65 79 62 6f 61 72 64 20 21 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 eyboard.!=.null)................
67a0 20 20 20 20 20 20 20 20 20 20 6d 5f 53 6f 66 74 4b 65 79 62 6f 61 72 64 2e 63 68 61 72 61 63 74 ..........m_SoftKeyboard.charact
67c0 65 72 4c 69 6d 69 74 20 3d 20 76 61 6c 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 erLimit.=.value;................
67e0 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 20 20 7d 0d 0a 0d ..}..............}..........}...
6800 0a 20 20 20 20 20 20 20 20 2f 2f 70 75 62 6c 69 63 20 62 6f 6f 6c 20 69 73 49 6e 74 65 72 61 63 .........//public.bool.isInterac
6820 74 61 62 6c 65 43 6f 6e 74 72 6f 6c 20 7b 20 73 65 74 20 7b 20 69 66 20 28 20 7d 20 7d 0d 0a 0d tableControl.{.set.{.if.(.}.}...
6840 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>..........
6860 2f 2f 2f 20 53 65 74 20 74 68 65 20 70 6f 69 6e 74 20 73 69 7a 65 20 6f 6e 20 62 6f 74 68 20 50 ///.Set.the.point.size.on.both.P
6880 6c 61 63 65 68 6f 6c 64 65 72 20 61 6e 64 20 49 6e 70 75 74 20 74 65 78 74 20 6f 62 6a 65 63 74 laceholder.and.Input.text.object
68a0 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 20 20 ...........///.</summary>.......
68c0 20 20 20 70 75 62 6c 69 63 20 66 6c 6f 61 74 20 70 6f 69 6e 74 53 69 7a 65 0d 0a 20 20 20 20 20 ...public.float.pointSize.......
68e0 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 67 65 74 20 7b 20 72 65 74 75 72 6e 20 6d ...{..............get.{.return.m
6900 5f 47 6c 6f 62 61 6c 50 6f 69 6e 74 53 69 7a 65 3b 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 _GlobalPointSize;.}.............
6920 20 73 65 74 20 7b 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 .set.{......................if.(
6940 53 65 74 50 72 6f 70 65 72 74 79 55 74 69 6c 69 74 79 2e 53 65 74 53 74 72 75 63 74 28 72 65 66 SetPropertyUtility.SetStruct(ref
6960 20 6d 5f 47 6c 6f 62 61 6c 50 6f 69 6e 74 53 69 7a 65 2c 20 4d 61 74 68 2e 4d 61 78 28 30 2c 20 .m_GlobalPointSize,.Math.Max(0,.
6980 76 61 6c 75 65 29 29 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 value)))......................{.
69a0 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 53 65 74 47 6c 6f 62 .........................SetGlob
69c0 61 6c 50 6f 69 6e 74 53 69 7a 65 28 6d 5f 47 6c 6f 62 61 6c 50 6f 69 6e 74 53 69 7a 65 29 3b 0d alPointSize(m_GlobalPointSize);.
69e0 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 55 70 64 61 74 65 4c .........................UpdateL
6a00 61 62 65 6c 28 29 3b 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 abel();......................}..
6a20 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 7d 0d 0a 0d 0a ................}..........}....
6a40 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>........../
6a60 2f 2f 20 53 65 74 73 20 74 68 65 20 46 6f 6e 74 20 41 73 73 65 74 20 6f 6e 20 62 6f 74 68 20 50 //.Sets.the.Font.Asset.on.both.P
6a80 6c 61 63 65 68 6f 6c 64 65 72 20 61 6e 64 20 49 6e 70 75 74 20 63 68 69 6c 64 20 6f 62 6a 65 63 laceholder.and.Input.child.objec
6aa0 74 73 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 ts...........///.</summary>.....
6ac0 20 20 20 20 20 70 75 62 6c 69 63 20 54 4d 50 5f 46 6f 6e 74 41 73 73 65 74 20 66 6f 6e 74 41 73 .....public.TMP_FontAsset.fontAs
6ae0 73 65 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 20 67 65 74 20 set..........{..............get.
6b00 7b 20 72 65 74 75 72 6e 20 6d 5f 47 6c 6f 62 61 6c 46 6f 6e 74 41 73 73 65 74 3b 20 7d 0d 0a 20 {.return.m_GlobalFontAsset;.}...
6b20 20 20 20 20 20 20 20 20 20 20 20 73 65 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 ...........set..............{...
6b40 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 53 65 74 50 72 6f 70 65 72 74 79 55 74 ...............if.(SetPropertyUt
6b60 69 6c 69 74 79 2e 53 65 74 43 6c 61 73 73 28 72 65 66 20 6d 5f 47 6c 6f 62 61 6c 46 6f 6e 74 41 ility.SetClass(ref.m_GlobalFontA
6b80 73 73 65 74 2c 20 76 61 6c 75 65 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b sset,.value))..................{
6ba0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 53 65 74 47 6c 6f 62 61 6c 46 ......................SetGlobalF
6bc0 6f 6e 74 41 73 73 65 74 28 6d 5f 47 6c 6f 62 61 6c 46 6f 6e 74 41 73 73 65 74 29 3b 0d 0a 20 20 ontAsset(m_GlobalFontAsset);....
6be0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 55 70 64 61 74 65 4c 61 62 65 6c 28 29 3b ..................UpdateLabel();
6c00 0d 0a 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 ..................}.............
6c20 20 7d 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 5b 53 65 72 69 61 6c 69 7a .}..........}..........[Serializ
6c40 65 46 69 65 6c 64 5d 0d 0a 20 20 20 20 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 54 4d 50 5f 46 eField]..........protected.TMP_F
6c60 6f 6e 74 41 73 73 65 74 20 6d 5f 47 6c 6f 62 61 6c 46 6f 6e 74 41 73 73 65 74 3b 0d 0a 0d 0a 20 ontAsset.m_GlobalFontAsset;.....
6c80 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>..........//
6ca0 2f 20 44 65 74 65 72 6d 69 6e 65 73 20 69 66 20 74 68 65 20 77 68 6f 6c 65 20 74 65 78 74 20 77 /.Determines.if.the.whole.text.w
6cc0 69 6c 6c 20 62 65 20 73 65 6c 65 63 74 65 64 20 77 68 65 6e 20 66 6f 63 75 73 65 64 2e 0d 0a 20 ill.be.selected.when.focused....
6ce0 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 70 .......///.</summary>..........p
6d00 75 62 6c 69 63 20 62 6f 6f 6c 20 6f 6e 46 6f 63 75 73 53 65 6c 65 63 74 41 6c 6c 0d 0a 20 20 20 ublic.bool.onFocusSelectAll.....
6d20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 67 65 74 20 7b 20 72 65 74 75 72 6e .....{..............get.{.return
6d40 20 6d 5f 4f 6e 46 6f 63 75 73 53 65 6c 65 63 74 41 6c 6c 3b 20 7d 0d 0a 20 20 20 20 20 20 20 20 .m_OnFocusSelectAll;.}..........
6d60 20 20 20 20 73 65 74 20 7b 20 6d 5f 4f 6e 46 6f 63 75 73 53 65 6c 65 63 74 41 6c 6c 20 3d 20 76 ....set.{.m_OnFocusSelectAll.=.v
6d80 61 6c 75 65 3b 20 7d 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 5b 53 65 72 alue;.}..........}..........[Ser
6da0 69 61 6c 69 7a 65 46 69 65 6c 64 5d 0d 0a 20 20 20 20 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 ializeField]..........protected.
6dc0 62 6f 6f 6c 20 6d 5f 4f 6e 46 6f 63 75 73 53 65 6c 65 63 74 41 6c 6c 20 3d 20 74 72 75 65 3b 0d bool.m_OnFocusSelectAll.=.true;.
6de0 0a 20 20 20 20 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 62 6f 6f 6c 20 6d 5f 69 73 53 65 6c 65 .........protected.bool.m_isSele
6e00 63 74 41 6c 6c 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 0d ctAll;............///.<summary>.
6e20 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 44 65 74 65 72 6d 69 6e 65 73 20 69 66 20 74 68 65 20 74 .........///.Determines.if.the.t
6e40 65 78 74 20 61 6e 64 20 63 61 72 65 74 20 70 6f 73 69 74 69 6f 6e 20 61 73 20 77 65 6c 6c 20 61 ext.and.caret.position.as.well.a
6e60 73 20 73 65 6c 65 63 74 69 6f 6e 20 77 69 6c 6c 20 62 65 20 72 65 73 65 74 20 77 68 65 6e 20 74 s.selection.will.be.reset.when.t
6e80 68 65 20 69 6e 70 75 74 20 66 69 65 6c 64 20 69 73 20 64 65 61 63 74 69 76 61 74 65 64 2e 0d 0a he.input.field.is.deactivated...
6ea0 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>..........
6ec0 70 75 62 6c 69 63 20 62 6f 6f 6c 20 72 65 73 65 74 4f 6e 44 65 41 63 74 69 76 61 74 69 6f 6e 0d public.bool.resetOnDeActivation.
6ee0 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 67 65 74 20 7b 20 72 65 .........{..............get.{.re
6f00 74 75 72 6e 20 6d 5f 52 65 73 65 74 4f 6e 44 65 41 63 74 69 76 61 74 69 6f 6e 3b 20 7d 0d 0a 20 turn.m_ResetOnDeActivation;.}...
6f20 20 20 20 20 20 20 20 20 20 20 20 73 65 74 20 7b 20 6d 5f 52 65 73 65 74 4f 6e 44 65 41 63 74 69 ...........set.{.m_ResetOnDeActi
6f40 76 61 74 69 6f 6e 20 3d 20 76 61 6c 75 65 3b 20 7d 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 vation.=.value;.}..........}....
6f60 20 20 20 20 20 20 5b 53 65 72 69 61 6c 69 7a 65 46 69 65 6c 64 5d 0d 0a 20 20 20 20 20 20 20 20 ......[SerializeField]..........
6f80 70 72 6f 74 65 63 74 65 64 20 62 6f 6f 6c 20 6d 5f 52 65 73 65 74 4f 6e 44 65 41 63 74 69 76 61 protected.bool.m_ResetOnDeActiva
6fa0 74 69 6f 6e 20 3d 20 74 72 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 62 6f tion.=.true;..........private.bo
6fc0 6f 6c 20 6d 5f 53 65 6c 65 63 74 69 6f 6e 53 74 69 6c 6c 41 63 74 69 76 65 20 3d 20 66 61 6c 73 ol.m_SelectionStillActive.=.fals
6fe0 65 3b 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 62 6f 6f 6c 20 6d 5f 52 65 6c 65 61 e;..........private.bool.m_Relea
7000 73 65 53 65 6c 65 63 74 69 6f 6e 20 3d 20 66 61 6c 73 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 seSelection.=.false;............
7020 70 72 69 76 61 74 65 20 47 61 6d 65 4f 62 6a 65 63 74 20 6d 5f 53 65 6c 65 63 74 65 64 4f 62 6a private.GameObject.m_SelectedObj
7040 65 63 74 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 0d 0a 20 ect;............///.<summary>...
7060 20 20 20 20 20 20 20 2f 2f 2f 20 43 6f 6e 74 72 6f 6c 73 20 77 68 65 74 68 65 72 20 74 68 65 20 .......///.Controls.whether.the.
7080 6f 72 69 67 69 6e 61 6c 20 74 65 78 74 20 69 73 20 72 65 73 74 6f 72 65 64 20 77 68 65 6e 20 70 original.text.is.restored.when.p
70a0 72 65 73 73 69 6e 67 20 22 45 53 43 22 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 ressing."ESC"...........///.</su
70c0 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 62 6f 6f 6c 20 72 65 73 74 mmary>..........public.bool.rest
70e0 6f 72 65 4f 72 69 67 69 6e 61 6c 54 65 78 74 4f 6e 45 73 63 61 70 65 0d 0a 20 20 20 20 20 20 20 oreOriginalTextOnEscape.........
7100 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 67 65 74 20 7b 20 72 65 74 75 72 6e 20 6d 5f 52 .{..............get.{.return.m_R
7120 65 73 74 6f 72 65 4f 72 69 67 69 6e 61 6c 54 65 78 74 4f 6e 45 73 63 61 70 65 3b 20 7d 0d 0a 20 estoreOriginalTextOnEscape;.}...
7140 20 20 20 20 20 20 20 20 20 20 20 73 65 74 20 7b 20 6d 5f 52 65 73 74 6f 72 65 4f 72 69 67 69 6e ...........set.{.m_RestoreOrigin
7160 61 6c 54 65 78 74 4f 6e 45 73 63 61 70 65 20 3d 20 76 61 6c 75 65 3b 20 7d 0d 0a 20 20 20 20 20 alTextOnEscape.=.value;.}.......
7180 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 5b 53 65 72 69 61 6c 69 7a 65 46 69 65 6c 64 5d 0d 0a ...}..........[SerializeField]..
71a0 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 62 6f 6f 6c 20 6d 5f 52 65 73 74 6f 72 65 4f 72 ........private.bool.m_RestoreOr
71c0 69 67 69 6e 61 6c 54 65 78 74 4f 6e 45 73 63 61 70 65 20 3d 20 74 72 75 65 3b 0d 0a 0d 0a 20 20 iginalTextOnEscape.=.true;......
71e0 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 2f ......///.<summary>..........///
7200 20 49 73 20 52 69 63 68 20 54 65 78 74 20 65 64 69 74 69 6e 67 20 61 6c 6c 6f 77 65 64 3f 0d 0a .Is.Rich.Text.editing.allowed?..
7220 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>..........
7240 70 75 62 6c 69 63 20 62 6f 6f 6c 20 69 73 52 69 63 68 54 65 78 74 45 64 69 74 69 6e 67 41 6c 6c public.bool.isRichTextEditingAll
7260 6f 77 65 64 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 67 65 74 owed..........{..............get
7280 20 7b 20 72 65 74 75 72 6e 20 6d 5f 69 73 52 69 63 68 54 65 78 74 45 64 69 74 69 6e 67 41 6c 6c .{.return.m_isRichTextEditingAll
72a0 6f 77 65 64 3b 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 65 74 20 7b 20 6d 5f 69 73 52 owed;.}..............set.{.m_isR
72c0 69 63 68 54 65 78 74 45 64 69 74 69 6e 67 41 6c 6c 6f 77 65 64 20 3d 20 76 61 6c 75 65 3b 20 7d ichTextEditingAllowed.=.value;.}
72e0 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 5b 53 65 72 69 61 6c 69 7a 65 46 ..........}..........[SerializeF
7300 69 65 6c 64 5d 0d 0a 20 20 20 20 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 62 6f 6f 6c 20 6d 5f ield]..........protected.bool.m_
7320 69 73 52 69 63 68 54 65 78 74 45 64 69 74 69 6e 67 41 6c 6c 6f 77 65 64 20 3d 20 66 61 6c 73 65 isRichTextEditingAllowed.=.false
7340 3b 0d 0a 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 43 6f 6e 74 65 6e 74 20 54 79 70 65 20 72 ;..............//.Content.Type.r
7360 65 6c 61 74 65 64 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 43 6f 6e 74 65 6e 74 54 79 elated..........public.ContentTy
7380 70 65 20 63 6f 6e 74 65 6e 74 54 79 70 65 20 7b 20 67 65 74 20 7b 20 72 65 74 75 72 6e 20 6d 5f pe.contentType.{.get.{.return.m_
73a0 43 6f 6e 74 65 6e 74 54 79 70 65 3b 20 7d 20 73 65 74 20 7b 20 69 66 20 28 53 65 74 50 72 6f 70 ContentType;.}.set.{.if.(SetProp
73c0 65 72 74 79 55 74 69 6c 69 74 79 2e 53 65 74 53 74 72 75 63 74 28 72 65 66 20 6d 5f 43 6f 6e 74 ertyUtility.SetStruct(ref.m_Cont
73e0 65 6e 74 54 79 70 65 2c 20 76 61 6c 75 65 29 29 20 45 6e 66 6f 72 63 65 43 6f 6e 74 65 6e 74 54 entType,.value)).EnforceContentT
7400 79 70 65 28 29 3b 20 7d 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 4c 69 6e ype();.}.}............public.Lin
7420 65 54 79 70 65 20 6c 69 6e 65 54 79 70 65 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 eType.lineType..........{.......
7440 20 20 20 20 20 20 20 67 65 74 20 7b 20 72 65 74 75 72 6e 20 6d 5f 4c 69 6e 65 54 79 70 65 3b 20 .......get.{.return.m_LineType;.
7460 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 65 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 }..............set..............
7480 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 53 65 74 50 72 6f 70 65 72 {..................if.(SetProper
74a0 74 79 55 74 69 6c 69 74 79 2e 53 65 74 53 74 72 75 63 74 28 72 65 66 20 6d 5f 4c 69 6e 65 54 79 tyUtility.SetStruct(ref.m_LineTy
74c0 70 65 2c 20 76 61 6c 75 65 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a pe,.value))..................{..
74e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 53 65 74 54 6f 43 75 73 74 6f 6d 49 ....................SetToCustomI
7500 66 43 6f 6e 74 65 6e 74 54 79 70 65 49 73 4e 6f 74 28 43 6f 6e 74 65 6e 74 54 79 70 65 2e 53 74 fContentTypeIsNot(ContentType.St
7520 61 6e 64 61 72 64 2c 20 43 6f 6e 74 65 6e 74 54 79 70 65 2e 41 75 74 6f 63 6f 72 72 65 63 74 65 andard,.ContentType.Autocorrecte
7540 64 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 53 65 74 54 65 78 74 d);......................SetText
7560 43 6f 6d 70 6f 6e 65 6e 74 57 72 61 70 4d 6f 64 65 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 ComponentWrapMode();............
7580 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 20 20 ......}..............}..........
75a0 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 0a 20 20 20 20 }............///.<summary>......
75c0 20 20 20 20 2f 2f 2f 20 4c 69 6d 69 74 73 20 74 68 65 20 6e 75 6d 62 65 72 20 6f 66 20 6c 69 6e ....///.Limits.the.number.of.lin
75e0 65 73 20 6f 66 20 74 65 78 74 20 69 6e 20 74 68 65 20 49 6e 70 75 74 20 46 69 65 6c 64 2e 0d 0a es.of.text.in.the.Input.Field...
7600 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>..........
7620 70 75 62 6c 69 63 20 69 6e 74 20 6c 69 6e 65 4c 69 6d 69 74 0d 0a 20 20 20 20 20 20 20 20 7b 0d public.int.lineLimit..........{.
7640 0a 20 20 20 20 20 20 20 20 20 20 20 20 67 65 74 20 7b 20 72 65 74 75 72 6e 20 6d 5f 4c 69 6e 65 .............get.{.return.m_Line
7660 4c 69 6d 69 74 3b 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 65 74 0d 0a 20 20 20 20 20 Limit;.}..............set.......
7680 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 69 66 20 28 6d 5f .......{..................if.(m_
76a0 4c 69 6e 65 54 79 70 65 20 3d 3d 20 4c 69 6e 65 54 79 70 65 2e 53 69 6e 67 6c 65 4c 69 6e 65 29 LineType.==.LineType.SingleLine)
76c0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 4c 69 6e 65 4c 69 6d 69 ......................m_LineLimi
76e0 74 20 3d 20 31 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 t.=.1;..................else....
7700 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 53 65 74 50 72 6f 70 65 72 74 79 55 74 69 ..................SetPropertyUti
7720 6c 69 74 79 2e 53 65 74 53 74 72 75 63 74 28 72 65 66 20 6d 5f 4c 69 6e 65 4c 69 6d 69 74 2c 20 lity.SetStruct(ref.m_LineLimit,.
7740 76 61 6c 75 65 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 value);................}........
7760 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 5b 53 65 72 69 61 6c 69 7a 65 46 69 65 6c 64 5d 0d 0a 20 ..}..........[SerializeField]...
7780 20 20 20 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 69 6e 74 20 6d 5f 4c 69 6e 65 4c 69 6d 69 74 .......protected.int.m_LineLimit
77a0 20 3d 20 30 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 49 6e 70 75 74 54 79 70 .=.0;............public.InputTyp
77c0 65 20 69 6e 70 75 74 54 79 70 65 20 7b 20 67 65 74 20 7b 20 72 65 74 75 72 6e 20 6d 5f 49 6e 70 e.inputType.{.get.{.return.m_Inp
77e0 75 74 54 79 70 65 3b 20 7d 20 73 65 74 20 7b 20 69 66 20 28 53 65 74 50 72 6f 70 65 72 74 79 55 utType;.}.set.{.if.(SetPropertyU
7800 74 69 6c 69 74 79 2e 53 65 74 53 74 72 75 63 74 28 72 65 66 20 6d 5f 49 6e 70 75 74 54 79 70 65 tility.SetStruct(ref.m_InputType
7820 2c 20 76 61 6c 75 65 29 29 20 53 65 74 54 6f 43 75 73 74 6f 6d 28 29 3b 20 7d 20 7d 0d 0a 0d 0a ,.value)).SetToCustom();.}.}....
7840 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 54 6f 75 63 68 53 63 72 65 65 6e 4b 65 79 62 6f 61 ........public.TouchScreenKeyboa
7860 72 64 54 79 70 65 20 6b 65 79 62 6f 61 72 64 54 79 70 65 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a rdType.keyboardType..........{..
7880 20 20 20 20 20 20 20 20 20 20 20 20 67 65 74 20 7b 20 72 65 74 75 72 6e 20 6d 5f 4b 65 79 62 6f ............get.{.return.m_Keybo
78a0 61 72 64 54 79 70 65 3b 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 65 74 0d 0a 20 20 20 ardType;.}..............set.....
78c0 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 69 66 20 28 .........{..................if.(
78e0 53 65 74 50 72 6f 70 65 72 74 79 55 74 69 6c 69 74 79 2e 53 65 74 53 74 72 75 63 74 28 72 65 66 SetPropertyUtility.SetStruct(ref
7900 20 6d 5f 4b 65 79 62 6f 61 72 64 54 79 70 65 2c 20 76 61 6c 75 65 29 29 0d 0a 20 20 20 20 20 20 .m_KeyboardType,.value))........
7920 20 20 20 20 20 20 20 20 20 20 20 20 20 20 53 65 74 54 6f 43 75 73 74 6f 6d 28 29 3b 0d 0a 20 20 ..............SetToCustom();....
7940 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 20 20 20 20 20 20 ..........}..........}..........
7960 20 20 70 75 62 6c 69 63 20 43 68 61 72 61 63 74 65 72 56 61 6c 69 64 61 74 69 6f 6e 20 63 68 61 ..public.CharacterValidation.cha
7980 72 61 63 74 65 72 56 61 6c 69 64 61 74 69 6f 6e 20 7b 20 67 65 74 20 7b 20 72 65 74 75 72 6e 20 racterValidation.{.get.{.return.
79a0 6d 5f 43 68 61 72 61 63 74 65 72 56 61 6c 69 64 61 74 69 6f 6e 3b 20 7d 20 73 65 74 20 7b 20 69 m_CharacterValidation;.}.set.{.i
79c0 66 20 28 53 65 74 50 72 6f 70 65 72 74 79 55 74 69 6c 69 74 79 2e 53 65 74 53 74 72 75 63 74 28 f.(SetPropertyUtility.SetStruct(
79e0 72 65 66 20 6d 5f 43 68 61 72 61 63 74 65 72 56 61 6c 69 64 61 74 69 6f 6e 2c 20 76 61 6c 75 65 ref.m_CharacterValidation,.value
7a00 29 29 20 53 65 74 54 6f 43 75 73 74 6f 6d 28 29 3b 20 7d 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 )).SetToCustom();.}.}...........
7a20 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 53 65 74 73 .///.<summary>..........///.Sets
7a40 20 74 68 65 20 49 6e 70 75 74 20 56 61 6c 69 64 61 74 69 6f 6e 20 74 6f 20 75 73 65 20 61 20 43 .the.Input.Validation.to.use.a.C
7a60 75 73 74 6f 6d 20 49 6e 70 75 74 20 56 61 6c 69 64 61 74 69 6f 6e 20 73 63 72 69 70 74 2e 0d 0a ustom.Input.Validation.script...
7a80 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>..........
7aa0 70 75 62 6c 69 63 20 54 4d 50 5f 49 6e 70 75 74 56 61 6c 69 64 61 74 6f 72 20 69 6e 70 75 74 56 public.TMP_InputValidator.inputV
7ac0 61 6c 69 64 61 74 6f 72 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 alidator..........{.............
7ae0 20 67 65 74 20 7b 20 72 65 74 75 72 6e 20 6d 5f 49 6e 70 75 74 56 61 6c 69 64 61 74 6f 72 3b 20 .get.{.return.m_InputValidator;.
7b00 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 65 74 20 7b 20 20 69 66 20 28 53 65 74 50 72 6f }..............set.{..if.(SetPro
7b20 70 65 72 74 79 55 74 69 6c 69 74 79 2e 53 65 74 43 6c 61 73 73 28 72 65 66 20 6d 5f 49 6e 70 75 pertyUtility.SetClass(ref.m_Inpu
7b40 74 56 61 6c 69 64 61 74 6f 72 2c 20 76 61 6c 75 65 29 29 20 53 65 74 54 6f 43 75 73 74 6f 6d 28 tValidator,.value)).SetToCustom(
7b60 43 68 61 72 61 63 74 65 72 56 61 6c 69 64 61 74 69 6f 6e 2e 43 75 73 74 6f 6d 56 61 6c 69 64 61 CharacterValidation.CustomValida
7b80 74 6f 72 29 3b 20 7d 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 5b 53 65 72 tor);.}..........}..........[Ser
7ba0 69 61 6c 69 7a 65 46 69 65 6c 64 5d 0d 0a 20 20 20 20 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 ializeField]..........protected.
7bc0 54 4d 50 5f 49 6e 70 75 74 56 61 6c 69 64 61 74 6f 72 20 6d 5f 49 6e 70 75 74 56 61 6c 69 64 61 TMP_InputValidator.m_InputValida
7be0 74 6f 72 20 3d 20 6e 75 6c 6c 3b 20 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 62 tor.=.null;.............public.b
7c00 6f 6f 6c 20 72 65 61 64 4f 6e 6c 79 20 7b 20 67 65 74 20 7b 20 72 65 74 75 72 6e 20 6d 5f 52 65 ool.readOnly.{.get.{.return.m_Re
7c20 61 64 4f 6e 6c 79 3b 20 7d 20 73 65 74 20 7b 20 6d 5f 52 65 61 64 4f 6e 6c 79 20 3d 20 76 61 6c adOnly;.}.set.{.m_ReadOnly.=.val
7c40 75 65 3b 20 7d 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 62 6f 6f 6c 20 72 ue;.}.}............public.bool.r
7c60 69 63 68 54 65 78 74 20 7b 20 67 65 74 20 7b 20 72 65 74 75 72 6e 20 6d 5f 52 69 63 68 54 65 78 ichText.{.get.{.return.m_RichTex
7c80 74 3b 20 7d 20 73 65 74 20 7b 20 6d 5f 52 69 63 68 54 65 78 74 20 3d 20 76 61 6c 75 65 3b 20 53 t;.}.set.{.m_RichText.=.value;.S
7ca0 65 74 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 52 69 63 68 54 65 78 74 4d 6f 64 65 28 29 3b 20 7d etTextComponentRichTextMode();.}
7cc0 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 44 65 72 69 76 65 64 20 70 72 6f 70 65 72 74 .}............//.Derived.propert
7ce0 79 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 62 6f 6f 6c 20 6d 75 6c 74 69 4c 69 6e 65 y..........public.bool.multiLine
7d00 20 7b 20 67 65 74 20 7b 20 72 65 74 75 72 6e 20 6d 5f 4c 69 6e 65 54 79 70 65 20 3d 3d 20 4c 69 .{.get.{.return.m_LineType.==.Li
7d20 6e 65 54 79 70 65 2e 4d 75 6c 74 69 4c 69 6e 65 4e 65 77 6c 69 6e 65 20 7c 7c 20 6c 69 6e 65 54 neType.MultiLineNewline.||.lineT
7d40 79 70 65 20 3d 3d 20 4c 69 6e 65 54 79 70 65 2e 4d 75 6c 74 69 4c 69 6e 65 53 75 62 6d 69 74 3b ype.==.LineType.MultiLineSubmit;
7d60 20 7d 20 7d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 4e 6f 74 20 73 68 6f 77 6e 20 69 6e 20 49 6e .}.}..........//.Not.shown.in.In
7d80 73 70 65 63 74 6f 72 2e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 63 68 61 72 20 61 73 spector...........public.char.as
7da0 74 65 72 69 73 6b 43 68 61 72 20 7b 20 67 65 74 20 7b 20 72 65 74 75 72 6e 20 6d 5f 41 73 74 65 teriskChar.{.get.{.return.m_Aste
7dc0 72 69 73 6b 43 68 61 72 3b 20 7d 20 73 65 74 20 7b 20 69 66 20 28 53 65 74 50 72 6f 70 65 72 74 riskChar;.}.set.{.if.(SetPropert
7de0 79 55 74 69 6c 69 74 79 2e 53 65 74 53 74 72 75 63 74 28 72 65 66 20 6d 5f 41 73 74 65 72 69 73 yUtility.SetStruct(ref.m_Asteris
7e00 6b 43 68 61 72 2c 20 76 61 6c 75 65 29 29 20 55 70 64 61 74 65 4c 61 62 65 6c 28 29 3b 20 7d 20 kChar,.value)).UpdateLabel();.}.
7e20 7d 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 62 6f 6f 6c 20 77 61 73 43 61 6e 63 65 6c }..........public.bool.wasCancel
7e40 65 64 20 7b 20 67 65 74 20 7b 20 72 65 74 75 72 6e 20 6d 5f 57 61 73 43 61 6e 63 65 6c 65 64 3b ed.{.get.{.return.m_WasCanceled;
7e60 20 7d 20 7d 0d 0a 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 76 6f 69 64 .}.}..............protected.void
7e80 20 43 6c 61 6d 70 53 74 72 69 6e 67 50 6f 73 28 72 65 66 20 69 6e 74 20 70 6f 73 29 0d 0a 20 20 .ClampStringPos(ref.int.pos)....
7ea0 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 70 6f 73 20 3c 20 30 ......{..............if.(pos.<.0
7ec0 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 70 6f 73 20 3d 20 30 3b 0d 0a 20 20 20 )..................pos.=.0;.....
7ee0 20 20 20 20 20 20 20 20 20 65 6c 73 65 20 69 66 20 28 70 6f 73 20 3e 20 74 65 78 74 2e 4c 65 6e .........else.if.(pos.>.text.Len
7f00 67 74 68 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 70 6f 73 20 3d 20 74 65 78 74 gth)..................pos.=.text
7f20 2e 4c 65 6e 67 74 68 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 .Length;..........}............p
7f40 72 6f 74 65 63 74 65 64 20 76 6f 69 64 20 43 6c 61 6d 70 43 61 72 65 74 50 6f 73 28 72 65 66 20 rotected.void.ClampCaretPos(ref.
7f60 69 6e 74 20 70 6f 73 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 int.pos)..........{.............
7f80 20 69 66 20 28 70 6f 73 20 3c 20 30 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 70 .if.(pos.<.0)..................p
7fa0 6f 73 20 3d 20 30 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 20 69 66 20 28 70 6f os.=.0;..............else.if.(po
7fc0 73 20 3e 20 6d 5f 54 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 s.>.m_TextComponent.textInfo.cha
7fe0 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 20 20 20 20 20 20 racterCount.-.1)................
8000 20 20 70 6f 73 20 3d 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 65 78 74 49 6e 66 6f ..pos.=.m_TextComponent.textInfo
8020 2e 63 68 61 72 61 63 74 65 72 43 6f 75 6e 74 20 2d 20 31 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d .characterCount.-.1;..........}.
8040 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>........
8060 20 20 2f 2f 2f 20 43 75 72 72 65 6e 74 20 70 6f 73 69 74 69 6f 6e 20 6f 66 20 74 68 65 20 63 75 ..///.Current.position.of.the.cu
8080 72 73 6f 72 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 47 65 74 74 65 72 73 20 61 72 65 20 70 rsor...........///.Getters.are.p
80a0 75 62 6c 69 63 20 53 65 74 74 65 72 73 20 61 72 65 20 70 72 6f 74 65 63 74 65 64 0d 0a 20 20 20 ublic.Setters.are.protected.....
80c0 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 .....///.</summary>............p
80e0 72 6f 74 65 63 74 65 64 20 69 6e 74 20 63 61 72 65 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e rotected.int.caretPositionIntern
8100 61 6c 20 7b 20 67 65 74 20 7b 20 72 65 74 75 72 6e 20 6d 5f 43 61 72 65 74 50 6f 73 69 74 69 6f al.{.get.{.return.m_CaretPositio
8120 6e 20 2b 20 63 6f 6d 70 6f 73 69 74 69 6f 6e 53 74 72 69 6e 67 2e 4c 65 6e 67 74 68 3b 20 7d 20 n.+.compositionString.Length;.}.
8140 73 65 74 20 7b 20 6d 5f 43 61 72 65 74 50 6f 73 69 74 69 6f 6e 20 3d 20 76 61 6c 75 65 3b 20 43 set.{.m_CaretPosition.=.value;.C
8160 6c 61 6d 70 43 61 72 65 74 50 6f 73 28 72 65 66 20 6d 5f 43 61 72 65 74 50 6f 73 69 74 69 6f 6e lampCaretPos(ref.m_CaretPosition
8180 29 3b 20 7d 20 7d 0d 0a 20 20 20 20 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 69 6e 74 20 73 74 );.}.}..........protected.int.st
81a0 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 7b 20 67 65 74 20 7b 20 72 65 74 ringPositionInternal.{.get.{.ret
81c0 75 72 6e 20 6d 5f 53 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 20 2b 20 63 6f 6d 70 6f 73 69 74 69 urn.m_StringPosition.+.compositi
81e0 6f 6e 53 74 72 69 6e 67 2e 4c 65 6e 67 74 68 3b 20 7d 20 73 65 74 20 7b 20 6d 5f 53 74 72 69 6e onString.Length;.}.set.{.m_Strin
8200 67 50 6f 73 69 74 69 6f 6e 20 3d 20 76 61 6c 75 65 3b 20 43 6c 61 6d 70 53 74 72 69 6e 67 50 6f gPosition.=.value;.ClampStringPo
8220 73 28 72 65 66 20 6d 5f 53 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 29 3b 20 7d 20 7d 0d 0a 0d 0a s(ref.m_StringPosition);.}.}....
8240 20 20 20 20 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 69 6e 74 20 63 61 72 65 74 53 65 6c 65 63 ........protected.int.caretSelec
8260 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 7b 20 67 65 74 20 7b 20 72 65 74 75 72 6e tPositionInternal.{.get.{.return
8280 20 6d 5f 43 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 20 2b 20 63 6f 6d 70 6f 73 69 .m_CaretSelectPosition.+.composi
82a0 74 69 6f 6e 53 74 72 69 6e 67 2e 4c 65 6e 67 74 68 3b 20 7d 20 73 65 74 20 7b 20 6d 5f 43 61 72 tionString.Length;.}.set.{.m_Car
82c0 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 20 3d 20 76 61 6c 75 65 3b 20 43 6c 61 6d 70 43 etSelectPosition.=.value;.ClampC
82e0 61 72 65 74 50 6f 73 28 72 65 66 20 6d 5f 43 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f aretPos(ref.m_CaretSelectPositio
8300 6e 29 3b 20 7d 20 7d 0d 0a 20 20 20 20 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 69 6e 74 20 73 n);.}.}..........protected.int.s
8320 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 7b 20 67 65 tringSelectPositionInternal.{.ge
8340 74 20 7b 20 72 65 74 75 72 6e 20 6d 5f 53 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f t.{.return.m_StringSelectPositio
8360 6e 20 2b 20 63 6f 6d 70 6f 73 69 74 69 6f 6e 53 74 72 69 6e 67 2e 4c 65 6e 67 74 68 3b 20 7d 20 n.+.compositionString.Length;.}.
8380 73 65 74 20 7b 20 6d 5f 53 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 20 3d 20 76 set.{.m_StringSelectPosition.=.v
83a0 61 6c 75 65 3b 20 43 6c 61 6d 70 53 74 72 69 6e 67 50 6f 73 28 72 65 66 20 6d 5f 53 74 72 69 6e alue;.ClampStringPos(ref.m_Strin
83c0 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 29 3b 20 7d 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 gSelectPosition);.}.}...........
83e0 20 70 72 69 76 61 74 65 20 62 6f 6f 6c 20 68 61 73 53 65 6c 65 63 74 69 6f 6e 20 7b 20 67 65 74 .private.bool.hasSelection.{.get
8400 20 7b 20 72 65 74 75 72 6e 20 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c .{.return.stringPositionInternal
8420 20 21 3d 20 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c .!=.stringSelectPositionInternal
8440 3b 20 7d 20 7d 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 62 6f 6f 6c 20 6d 5f 69 73 ;.}.}..........private.bool.m_is
8460 53 65 6c 65 63 74 65 64 3b 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 62 6f 6f 6c 20 Selected;..........private.bool.
8480 6d 5f 49 73 53 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 44 69 72 74 79 3b 0d 0a 20 20 20 20 20 20 m_IsStringPositionDirty;........
84a0 20 20 70 72 69 76 61 74 65 20 62 6f 6f 6c 20 6d 5f 49 73 43 61 72 65 74 50 6f 73 69 74 69 6f 6e ..private.bool.m_IsCaretPosition
84c0 44 69 72 74 79 3b 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 62 6f 6f 6c 20 6d 5f 66 Dirty;..........private.bool.m_f
84e0 6f 72 63 65 52 65 63 74 54 72 61 6e 73 66 6f 72 6d 41 64 6a 75 73 74 6d 65 6e 74 3b 0d 0a 0d 0a orceRectTransformAdjustment;....
8500 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>........../
8520 2f 2f 20 47 65 74 3a 20 52 65 74 75 72 6e 73 20 74 68 65 20 66 6f 63 75 73 20 70 6f 73 69 74 69 //.Get:.Returns.the.focus.positi
8540 6f 6e 20 61 73 20 74 68 61 74 73 20 74 68 65 20 70 6f 73 69 74 69 6f 6e 20 74 68 61 74 20 6d 6f on.as.thats.the.position.that.mo
8560 76 65 73 20 61 72 6f 75 6e 64 20 65 76 65 6e 20 64 75 72 69 6e 67 20 73 65 6c 65 63 74 69 6f 6e ves.around.even.during.selection
8580 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 53 65 74 3a 20 53 65 74 20 62 6f 74 68 20 74 68 65 ...........///.Set:.Set.both.the
85a0 20 61 6e 63 68 6f 72 20 61 6e 64 20 66 6f 63 75 73 20 70 6f 73 69 74 69 6f 6e 20 73 75 63 68 20 .anchor.and.focus.position.such.
85c0 74 68 61 74 20 61 20 73 65 6c 65 63 74 69 6f 6e 20 64 6f 65 73 6e 27 74 20 68 61 70 70 65 6e 0d that.a.selection.doesn't.happen.
85e0 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>.........
8600 20 70 75 62 6c 69 63 20 69 6e 74 20 63 61 72 65 74 50 6f 73 69 74 69 6f 6e 0d 0a 20 20 20 20 20 .public.int.caretPosition.......
8620 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 67 65 74 20 7b 20 72 65 74 75 72 6e 20 63 ...{..............get.{.return.c
8640 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 3b 20 7d 0d 0a 20 aretSelectPositionInternal;.}...
8660 20 20 20 20 20 20 20 20 20 20 20 73 65 74 20 7b 20 73 65 6c 65 63 74 69 6f 6e 41 6e 63 68 6f 72 ...........set.{.selectionAnchor
8680 50 6f 73 69 74 69 6f 6e 20 3d 20 76 61 6c 75 65 3b 20 73 65 6c 65 63 74 69 6f 6e 46 6f 63 75 73 Position.=.value;.selectionFocus
86a0 50 6f 73 69 74 69 6f 6e 20 3d 20 76 61 6c 75 65 3b 20 6d 5f 49 73 53 74 72 69 6e 67 50 6f 73 69 Position.=.value;.m_IsStringPosi
86c0 74 69 6f 6e 44 69 72 74 79 20 3d 20 74 72 75 65 3b 20 7d 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a tionDirty.=.true;.}..........}..
86e0 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 20 ..........///.<summary>.........
8700 20 2f 2f 2f 20 47 65 74 3a 20 52 65 74 75 72 6e 73 20 74 68 65 20 66 69 78 65 64 20 70 6f 73 69 .///.Get:.Returns.the.fixed.posi
8720 74 69 6f 6e 20 6f 66 20 73 65 6c 65 63 74 69 6f 6e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 53 tion.of.selection..........///.S
8740 65 74 3a 20 49 66 20 63 6f 6d 70 6f 73 69 74 69 6f 6e 53 74 72 69 6e 67 20 69 73 20 30 20 73 65 et:.If.compositionString.is.0.se
8760 74 20 74 68 65 20 66 69 78 65 64 20 70 6f 73 69 74 69 6f 6e 0d 0a 20 20 20 20 20 20 20 20 2f 2f t.the.fixed.position..........//
8780 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 69 6e 74 /.</summary>..........public.int
87a0 20 73 65 6c 65 63 74 69 6f 6e 41 6e 63 68 6f 72 50 6f 73 69 74 69 6f 6e 0d 0a 20 20 20 20 20 20 .selectionAnchorPosition........
87c0 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 67 65 74 0d 0a 20 20 20 20 20 20 20 20 20 20 ..{..............get............
87e0 20 20 7b 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 61 72 65 ..{..................return.care
8800 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 tPositionInternal;..............
8820 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 65 74 0d 0a 20 20 20 20 20 20 20 20 20 20 }................set............
8840 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 63 6f 6d 70 6f 73 69 ..{..................if.(composi
8860 74 69 6f 6e 53 74 72 69 6e 67 2e 4c 65 6e 67 74 68 20 21 3d 20 30 29 0d 0a 20 20 20 20 20 20 20 tionString.Length.!=.0).........
8880 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 .............return;............
88a0 20 20 20 20 20 20 20 20 63 61 72 65 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 ........caretPositionInternal.=.
88c0 76 61 6c 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 49 73 53 74 72 69 value;..................m_IsStri
88e0 6e 67 50 6f 73 69 74 69 6f 6e 44 69 72 74 79 20 3d 20 74 72 75 65 3b 0d 0a 20 20 20 20 20 20 20 ngPositionDirty.=.true;.........
8900 20 20 20 20 20 7d 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 .....}..........}............///
8920 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 47 65 74 3a 20 52 65 74 .<summary>..........///.Get:.Ret
8940 75 72 6e 73 20 74 68 65 20 76 61 72 69 61 62 6c 65 20 70 6f 73 69 74 69 6f 6e 20 6f 66 20 73 65 urns.the.variable.position.of.se
8960 6c 65 63 74 69 6f 6e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 53 65 74 3a 20 49 66 20 63 6f 6d lection..........///.Set:.If.com
8980 70 6f 73 69 74 69 6f 6e 53 74 72 69 6e 67 20 69 73 20 30 20 73 65 74 20 74 68 65 20 76 61 72 69 positionString.is.0.set.the.vari
89a0 61 62 6c 65 20 70 6f 73 69 74 69 6f 6e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d able.position..........///.</sum
89c0 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 69 6e 74 20 73 65 6c 65 63 74 mary>..........public.int.select
89e0 69 6f 6e 46 6f 63 75 73 50 6f 73 69 74 69 6f 6e 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 ionFocusPosition..........{.....
8a00 20 20 20 20 20 20 20 20 20 67 65 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 .........get..............{.....
8a20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 63 61 72 65 74 53 65 6c 65 63 74 50 .............return.caretSelectP
8a40 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d ositionInternal;..............}.
8a60 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 65 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d .............set..............{.
8a80 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 6f 6d 70 6f 73 69 74 69 6f 6e .................if.(composition
8aa0 53 74 72 69 6e 67 2e 4c 65 6e 67 74 68 20 21 3d 20 30 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 String.Length.!=.0).............
8ac0 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 .........return;................
8ae0 20 20 20 20 63 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 ....caretSelectPositionInternal.
8b00 3d 20 76 61 6c 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 49 73 53 74 =.value;..................m_IsSt
8b20 72 69 6e 67 50 6f 73 69 74 69 6f 6e 44 69 72 74 79 20 3d 20 74 72 75 65 3b 0d 0a 20 20 20 20 20 ringPositionDirty.=.true;.......
8b40 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 20 20 20 20 20 20 20 .......}..........}.............
8b60 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 0d 0a 20 20 .///.<summary>..........///.....
8b80 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 70 75 ......///.</summary>..........pu
8ba0 62 6c 69 63 20 69 6e 74 20 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 0d 0a 20 20 20 20 20 20 20 blic.int.stringPosition.........
8bc0 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 67 65 74 20 7b 20 72 65 74 75 72 6e 20 73 74 72 .{..............get.{.return.str
8be0 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 3b 20 7d 0d 0a 20 20 ingSelectPositionInternal;.}....
8c00 20 20 20 20 20 20 20 20 20 20 73 65 74 20 7b 20 73 65 6c 65 63 74 69 6f 6e 53 74 72 69 6e 67 41 ..........set.{.selectionStringA
8c20 6e 63 68 6f 72 50 6f 73 69 74 69 6f 6e 20 3d 20 76 61 6c 75 65 3b 20 73 65 6c 65 63 74 69 6f 6e nchorPosition.=.value;.selection
8c40 53 74 72 69 6e 67 46 6f 63 75 73 50 6f 73 69 74 69 6f 6e 20 3d 20 76 61 6c 75 65 3b 20 6d 5f 49 StringFocusPosition.=.value;.m_I
8c60 73 43 61 72 65 74 50 6f 73 69 74 69 6f 6e 44 69 72 74 79 20 3d 20 74 72 75 65 3b 20 7d 0d 0a 20 sCaretPositionDirty.=.true;.}...
8c80 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 61 .......}..............///.<summa
8ca0 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 68 65 20 66 69 78 65 64 20 70 6f 73 69 74 ry>..........///.The.fixed.posit
8cc0 69 6f 6e 20 6f 66 20 74 68 65 20 73 65 6c 65 63 74 69 6f 6e 20 69 6e 20 74 68 65 20 72 61 77 20 ion.of.the.selection.in.the.raw.
8ce0 73 74 72 69 6e 67 20 77 68 69 63 68 20 6d 61 79 20 63 6f 6e 74 61 69 6e 73 20 72 69 63 68 20 74 string.which.may.contains.rich.t
8d00 65 78 74 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 ext...........///.</summary>....
8d20 20 20 20 20 20 20 70 75 62 6c 69 63 20 69 6e 74 20 73 65 6c 65 63 74 69 6f 6e 53 74 72 69 6e 67 ......public.int.selectionString
8d40 41 6e 63 68 6f 72 50 6f 73 69 74 69 6f 6e 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 AnchorPosition..........{.......
8d60 20 20 20 20 20 20 20 67 65 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 .......get..............{.......
8d80 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e ...........return.stringPosition
8da0 49 6e 74 65 72 6e 61 6c 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 Internal;..............}........
8dc0 20 20 20 20 20 20 20 20 73 65 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 ........set..............{......
8de0 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 6f 6d 70 6f 73 69 74 69 6f 6e 53 74 72 69 6e ............if.(compositionStrin
8e00 67 2e 4c 65 6e 67 74 68 20 21 3d 20 30 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 g.Length.!=.0)..................
8e20 20 20 20 20 72 65 74 75 72 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 ....return;....................s
8e40 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 76 61 6c 75 65 3b 0d 0a tringPositionInternal.=.value;..
8e60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 49 73 43 61 72 65 74 50 6f 73 69 74 69 6f ................m_IsCaretPositio
8e80 6e 44 69 72 74 79 20 3d 20 74 72 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 nDirty.=.true;..............}...
8ea0 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 61 .......}..............///.<summa
8ec0 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 68 65 20 76 61 72 69 61 62 6c 65 20 70 6f ry>..........///.The.variable.po
8ee0 73 69 74 69 6f 6e 20 6f 66 20 74 68 65 20 73 65 6c 65 63 74 69 6f 6e 20 69 6e 20 74 68 65 20 72 sition.of.the.selection.in.the.r
8f00 61 77 20 73 74 72 69 6e 67 20 77 68 69 63 68 20 6d 61 79 20 63 6f 6e 74 61 69 6e 73 20 72 69 63 aw.string.which.may.contains.ric
8f20 68 20 74 65 78 74 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 h.text...........///.</summary>.
8f40 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 69 6e 74 20 73 65 6c 65 63 74 69 6f 6e 53 74 72 .........public.int.selectionStr
8f60 69 6e 67 46 6f 63 75 73 50 6f 73 69 74 69 6f 6e 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 ingFocusPosition..........{.....
8f80 20 20 20 20 20 20 20 20 20 67 65 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 .........get..............{.....
8fa0 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 73 74 72 69 6e 67 53 65 6c 65 63 74 .............return.stringSelect
8fc0 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d PositionInternal;..............}
8fe0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 65 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b ..............set..............{
9000 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 6f 6d 70 6f 73 69 74 69 6f ..................if.(compositio
9020 6e 53 74 72 69 6e 67 2e 4c 65 6e 67 74 68 20 21 3d 20 30 29 0d 0a 20 20 20 20 20 20 20 20 20 20 nString.Length.!=.0)............
9040 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ..........return;...............
9060 20 20 20 20 20 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 .....stringSelectPositionInterna
9080 6c 20 3d 20 76 61 6c 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 49 73 l.=.value;..................m_Is
90a0 43 61 72 65 74 50 6f 73 69 74 69 6f 6e 44 69 72 74 79 20 3d 20 74 72 75 65 3b 0d 0a 20 20 20 20 CaretPositionDirty.=.true;......
90c0 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 20 20 20 20 20 20 ........}..........}............
90e0 20 20 23 69 66 20 55 4e 49 54 59 5f 45 44 49 54 4f 52 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 52 ..#if.UNITY_EDITOR..........//.R
9100 65 6d 65 6d 62 65 72 3a 20 54 68 69 73 20 69 73 20 4e 4f 54 20 72 65 6c 61 74 65 64 20 74 6f 20 emember:.This.is.NOT.related.to.
9120 74 65 78 74 20 76 61 6c 69 64 61 74 69 6f 6e 21 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 54 68 69 text.validation!..........//.Thi
9140 73 20 69 73 20 55 6e 69 74 79 27 73 20 6f 77 6e 20 4f 6e 56 61 6c 69 64 61 74 65 20 6d 65 74 68 s.is.Unity's.own.OnValidate.meth
9160 6f 64 20 77 68 69 63 68 20 69 73 20 69 6e 76 6f 6b 65 64 20 77 68 65 6e 20 63 68 61 6e 67 69 6e od.which.is.invoked.when.changin
9180 67 20 76 61 6c 75 65 73 20 69 6e 20 74 68 65 20 49 6e 73 70 65 63 74 6f 72 2e 0d 0a 20 20 20 20 g.values.in.the.Inspector.......
91a0 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 6f 76 65 72 72 69 64 65 20 76 6f 69 64 20 4f 6e 56 61 ....protected.override.void.OnVa
91c0 6c 69 64 61 74 65 28 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 lidate()..........{.............
91e0 20 62 61 73 65 2e 4f 6e 56 61 6c 69 64 61 74 65 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 .base.OnValidate();.............
9200 20 45 6e 66 6f 72 63 65 43 6f 6e 74 65 6e 74 54 79 70 65 28 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 .EnforceContentType();..........
9220 20 20 20 20 20 20 6d 5f 43 68 61 72 61 63 74 65 72 4c 69 6d 69 74 20 3d 20 4d 61 74 68 2e 4d 61 ......m_CharacterLimit.=.Math.Ma
9240 78 28 30 2c 20 6d 5f 43 68 61 72 61 63 74 65 72 4c 69 6d 69 74 29 3b 0d 0a 0d 0a 20 20 20 20 20 x(0,.m_CharacterLimit);.........
9260 20 20 20 20 20 20 20 2f 2f 54 68 69 73 20 63 61 6e 20 62 65 20 69 6e 76 6f 6b 65 64 20 62 65 66 .......//This.can.be.invoked.bef
9280 6f 72 65 20 4f 6e 45 6e 61 62 6c 65 64 20 69 73 20 63 61 6c 6c 65 64 2e 20 53 6f 20 77 65 20 73 ore.OnEnabled.is.called..So.we.s
92a0 68 6f 75 6c 64 6e 27 74 20 62 65 20 61 63 63 65 73 73 69 6e 67 20 6f 74 68 65 72 20 6f 62 6a 65 houldn't.be.accessing.other.obje
92c0 63 74 73 2c 20 62 65 66 6f 72 65 20 4f 6e 45 6e 61 62 6c 65 20 69 73 20 63 61 6c 6c 65 64 2e 0d cts,.before.OnEnable.is.called..
92e0 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 49 73 41 63 74 69 76 65 28 29 29 0d 0a 20 .............if.(!IsActive())...
9300 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 ...............return;..........
9320 20 20 20 20 20 20 53 65 74 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 52 69 63 68 54 65 78 74 4d 6f ......SetTextComponentRichTextMo
9340 64 65 28 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 55 70 64 61 74 65 4c 61 62 65 6c de();................UpdateLabel
9360 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 41 6c 6c 6f 77 49 6e 70 75 ();..............if.(m_AllowInpu
9380 74 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 53 65 74 43 61 72 65 74 41 63 74 69 t)..................SetCaretActi
93a0 76 65 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 23 65 6e 64 69 66 ve();..........}..........#endif
93c0 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 6f 76 65 72 72 69 64 65 20 76 ............protected.override.v
93e0 6f 69 64 20 4f 6e 45 6e 61 62 6c 65 28 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 oid.OnEnable()..........{.......
9400 20 20 20 20 20 20 20 2f 2f 44 65 62 75 67 2e 4c 6f 67 28 22 2a 2a 2a 20 4f 6e 45 6e 61 62 6c 65 .......//Debug.Log("***.OnEnable
9420 28 29 20 2a 2a 2a 20 2d 20 22 20 2b 20 74 68 69 73 2e 6e 61 6d 65 29 3b 0d 0a 0d 0a 20 20 20 20 ().***.-.".+.this.name);........
9440 20 20 20 20 20 20 20 20 62 61 73 65 2e 4f 6e 45 6e 61 62 6c 65 28 29 3b 0d 0a 0d 0a 20 20 20 20 ........base.OnEnable();........
9460 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 54 65 78 74 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 ........if.(m_Text.==.null).....
9480 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 54 65 78 74 20 3d 20 73 74 72 69 6e 67 2e 45 6d 70 .............m_Text.=.string.Emp
94a0 74 79 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 41 70 70 6c 69 63 61 74 69 ty;................if.(Applicati
94c0 6f 6e 2e 69 73 50 6c 61 79 69 6e 67 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 on.isPlaying)..............{....
94e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 43 61 63 68 65 64 49 6e 70 75 74 52 ..............if.(m_CachedInputR
9500 65 6e 64 65 72 65 72 20 3d 3d 20 6e 75 6c 6c 20 26 26 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 enderer.==.null.&&.m_TextCompone
9520 6e 74 20 21 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a nt.!=.null)..................{..
9540 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 69 66 20 ....................//.Check.if.
9560 49 6e 70 75 74 20 46 69 65 6c 64 20 69 73 20 64 72 69 76 65 6e 20 62 79 20 61 6e 79 20 6c 61 79 Input.Field.is.driven.by.any.lay
9580 6f 75 74 20 63 6f 6d 70 6f 6e 65 6e 74 73 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 out.components..................
95a0 20 20 20 20 6d 5f 49 73 44 72 69 76 65 6e 42 79 4c 61 79 6f 75 74 43 6f 6d 70 6f 6e 65 6e 74 73 ....m_IsDrivenByLayoutComponents
95c0 20 3d 20 47 65 74 43 6f 6d 70 6f 6e 65 6e 74 3c 49 4c 61 79 6f 75 74 43 6f 6e 74 72 6f 6c 6c 65 .=.GetComponent<ILayoutControlle
95e0 72 3e 28 29 20 21 3d 20 6e 75 6c 6c 20 3f 20 74 72 75 65 20 3a 20 66 61 6c 73 65 3b 0d 0a 0d 0a r>().!=.null.?.true.:.false;....
9600 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 47 61 6d 65 4f 62 6a 65 63 74 20 67 ....................GameObject.g
9620 6f 20 3d 20 6e 65 77 20 47 61 6d 65 4f 62 6a 65 63 74 28 74 72 61 6e 73 66 6f 72 6d 2e 6e 61 6d o.=.new.GameObject(transform.nam
9640 65 20 2b 20 22 20 49 6e 70 75 74 20 43 61 72 65 74 22 2c 20 74 79 70 65 6f 66 28 52 65 63 74 54 e.+.".Input.Caret",.typeof(RectT
9660 72 61 6e 73 66 6f 72 6d 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ransform));.....................
9680 20 20 20 2f 2f 20 41 64 64 20 4d 61 73 6b 61 62 6c 65 47 72 61 70 68 69 63 20 43 6f 6d 70 6f 6e ...//.Add.MaskableGraphic.Compon
96a0 65 6e 74 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 53 65 6c ent......................TMP_Sel
96c0 65 63 74 69 6f 6e 43 61 72 65 74 20 63 61 72 65 74 20 3d 20 67 6f 2e 41 64 64 43 6f 6d 70 6f 6e ectionCaret.caret.=.go.AddCompon
96e0 65 6e 74 3c 54 4d 50 5f 53 65 6c 65 63 74 69 6f 6e 43 61 72 65 74 3e 28 29 3b 0d 0a 20 20 20 20 ent<TMP_SelectionCaret>();......
9700 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 72 65 74 2e 72 61 79 63 61 73 74 54 61 72 ................caret.raycastTar
9720 67 65 74 20 3d 20 66 61 6c 73 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 get.=.false;....................
9740 20 20 63 61 72 65 74 2e 63 6f 6c 6f 72 20 3d 20 43 6f 6c 6f 72 2e 63 6c 65 61 72 3b 0d 0a 0d 0a ..caret.color.=.Color.clear;....
9760 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 67 6f 2e 68 69 64 65 46 6c 61 67 73 ....................go.hideFlags
9780 20 3d 20 48 69 64 65 46 6c 61 67 73 2e 44 6f 6e 74 53 61 76 65 3b 0d 0a 20 20 20 20 20 20 20 20 .=.HideFlags.DontSave;..........
97a0 20 20 20 20 20 20 20 20 20 20 20 20 67 6f 2e 74 72 61 6e 73 66 6f 72 6d 2e 53 65 74 50 61 72 65 ............go.transform.SetPare
97c0 6e 74 28 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 72 61 6e 73 66 6f 72 6d 2e 70 61 72 nt(m_TextComponent.transform.par
97e0 65 6e 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 67 6f 2e 74 72 ent);......................go.tr
9800 61 6e 73 66 6f 72 6d 2e 53 65 74 41 73 46 69 72 73 74 53 69 62 6c 69 6e 67 28 29 3b 0d 0a 20 20 ansform.SetAsFirstSibling();....
9820 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 67 6f 2e 6c 61 79 65 72 20 3d 20 67 61 6d ..................go.layer.=.gam
9840 65 4f 62 6a 65 63 74 2e 6c 61 79 65 72 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 eObject.layer;..................
9860 20 20 20 20 20 20 63 61 72 65 74 52 65 63 74 54 72 61 6e 73 20 3d 20 67 6f 2e 47 65 74 43 6f 6d ......caretRectTrans.=.go.GetCom
9880 70 6f 6e 65 6e 74 3c 52 65 63 74 54 72 61 6e 73 66 6f 72 6d 3e 28 29 3b 0d 0a 20 20 20 20 20 20 ponent<RectTransform>();........
98a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 43 61 63 68 65 64 49 6e 70 75 74 52 65 6e 64 65 ..............m_CachedInputRende
98c0 72 65 72 20 3d 20 67 6f 2e 47 65 74 43 6f 6d 70 6f 6e 65 6e 74 3c 43 61 6e 76 61 73 52 65 6e 64 rer.=.go.GetComponent<CanvasRend
98e0 65 72 65 72 3e 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f erer>();......................m_
9900 43 61 63 68 65 64 49 6e 70 75 74 52 65 6e 64 65 72 65 72 2e 53 65 74 4d 61 74 65 72 69 61 6c 28 CachedInputRenderer.SetMaterial(
9920 47 72 61 70 68 69 63 2e 64 65 66 61 75 6c 74 47 72 61 70 68 69 63 4d 61 74 65 72 69 61 6c 2c 20 Graphic.defaultGraphicMaterial,.
9940 54 65 78 74 75 72 65 32 44 2e 77 68 69 74 65 54 65 78 74 75 72 65 29 3b 0d 0a 0d 0a 20 20 20 20 Texture2D.whiteTexture);........
9960 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4e 65 65 64 65 64 20 61 73 20 69 66 20 ................//.Needed.as.if.
9980 61 6e 79 20 6c 61 79 6f 75 74 20 69 73 20 70 72 65 73 65 6e 74 20 77 65 20 77 61 6e 74 20 74 68 any.layout.is.present.we.want.th
99a0 65 20 63 61 72 65 74 20 74 6f 20 61 6c 77 61 79 73 20 62 65 20 74 68 65 20 73 61 6d 65 20 61 73 e.caret.to.always.be.the.same.as
99c0 20 74 68 65 20 74 65 78 74 20 61 72 65 61 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .the.text.area..................
99e0 20 20 20 20 20 67 6f 2e 41 64 64 43 6f 6d 70 6f 6e 65 6e 74 3c 4c 61 79 6f 75 74 45 6c 65 6d 65 .....go.AddComponent<LayoutEleme
9a00 6e 74 3e 28 29 2e 69 67 6e 6f 72 65 4c 61 79 6f 75 74 20 3d 20 74 72 75 65 3b 0d 0a 0d 0a 20 20 nt>().ignoreLayout.=.true;......
9a20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 41 73 73 69 67 6e 50 6f 73 69 74 69 6f 6e ..................AssignPosition
9a40 69 6e 67 49 66 4e 65 65 64 65 64 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ingIfNeeded();..................
9a60 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 20 20 20 20 20 20 20 }..............}................
9a80 2f 2f 20 49 66 20 77 65 20 68 61 76 65 20 61 20 63 61 63 68 65 64 20 72 65 6e 64 65 72 65 72 20 //.If.we.have.a.cached.renderer.
9aa0 74 68 65 6e 20 77 65 20 68 61 64 20 4f 6e 44 69 73 61 62 6c 65 20 63 61 6c 6c 65 64 20 73 6f 20 then.we.had.OnDisable.called.so.
9ac0 6a 75 73 74 20 72 65 73 74 6f 72 65 20 74 68 65 20 6d 61 74 65 72 69 61 6c 2e 0d 0a 20 20 20 20 just.restore.the.material.......
9ae0 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 43 61 63 68 65 64 49 6e 70 75 74 52 65 6e 64 65 72 65 ........if.(m_CachedInputRendere
9b00 72 20 21 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 43 61 r.!=.null)..................m_Ca
9b20 63 68 65 64 49 6e 70 75 74 52 65 6e 64 65 72 65 72 2e 53 65 74 4d 61 74 65 72 69 61 6c 28 47 72 chedInputRenderer.SetMaterial(Gr
9b40 61 70 68 69 63 2e 64 65 66 61 75 6c 74 47 72 61 70 68 69 63 4d 61 74 65 72 69 61 6c 2c 20 54 65 aphic.defaultGraphicMaterial,.Te
9b60 78 74 75 72 65 32 44 2e 77 68 69 74 65 54 65 78 74 75 72 65 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 xture2D.whiteTexture);..........
9b80 20 20 20 20 20 20 69 66 20 28 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 20 21 3d 20 6e 75 6c ......if.(m_TextComponent.!=.nul
9ba0 6c 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 l)..............{...............
9bc0 20 20 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 52 65 67 69 73 74 65 72 44 69 72 74 79 ...m_TextComponent.RegisterDirty
9be0 56 65 72 74 69 63 65 73 43 61 6c 6c 62 61 63 6b 28 4d 61 72 6b 47 65 6f 6d 65 74 72 79 41 73 44 VerticesCallback(MarkGeometryAsD
9c00 69 72 74 79 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 54 65 78 74 43 6f irty);..................m_TextCo
9c20 6d 70 6f 6e 65 6e 74 2e 52 65 67 69 73 74 65 72 44 69 72 74 79 56 65 72 74 69 63 65 73 43 61 6c mponent.RegisterDirtyVerticesCal
9c40 6c 62 61 63 6b 28 55 70 64 61 74 65 4c 61 62 65 6c 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 lback(UpdateLabel);.............
9c60 20 20 20 20 20 2f 2f 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 69 67 6e 6f 72 65 52 65 63 .....//m_TextComponent.ignoreRec
9c80 74 4d 61 73 6b 43 75 6c 6c 69 6e 67 20 3d 20 6d 75 6c 74 69 4c 69 6e 65 3b 0d 0a 0d 0a 20 20 20 tMaskCulling.=.multiLine;.......
9ca0 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 6d 5f 44 65 66 61 75 6c 74 54 72 61 6e 73 66 6f 72 .............//m_DefaultTransfor
9cc0 6d 50 6f 73 69 74 69 6f 6e 20 3d 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 72 65 63 74 mPosition.=.m_TextComponent.rect
9ce0 54 72 61 6e 73 66 6f 72 6d 2e 6c 6f 63 61 6c 50 6f 73 69 74 69 6f 6e 3b 0d 0a 0d 0a 20 20 20 20 Transform.localPosition;........
9d00 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 61 63 68 65 20 72 65 66 65 72 65 6e 63 65 20 74 ............//.Cache.reference.t
9d20 6f 20 56 65 72 74 69 63 61 6c 20 53 63 72 6f 6c 6c 62 61 72 20 52 65 63 74 54 72 61 6e 73 66 6f o.Vertical.Scrollbar.RectTransfo
9d40 72 6d 20 61 6e 64 20 61 64 64 20 6c 69 73 74 65 6e 65 72 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 rm.and.add.listener.............
9d60 20 20 20 20 20 20 69 66 20 28 6d 5f 56 65 72 74 69 63 61 6c 53 63 72 6f 6c 6c 62 61 72 20 21 3d ......if.(m_VerticalScrollbar.!=
9d80 20 6e 75 6c 6c 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 20 .null)..................{.......
9da0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 69 ...............m_TextComponent.i
9dc0 67 6e 6f 72 65 52 65 63 74 4d 61 73 6b 43 75 6c 6c 69 6e 67 20 3d 20 74 72 75 65 3b 0d 0a 20 20 gnoreRectMaskCulling.=.true;....
9de0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 56 65 72 74 69 63 61 6c 53 63 72 6f ..................m_VerticalScro
9e00 6c 6c 62 61 72 2e 6f 6e 56 61 6c 75 65 43 68 61 6e 67 65 64 2e 41 64 64 4c 69 73 74 65 6e 65 72 llbar.onValueChanged.AddListener
9e20 28 4f 6e 53 63 72 6f 6c 6c 62 61 72 56 61 6c 75 65 43 68 61 6e 67 65 29 3b 0d 0a 20 20 20 20 20 (OnScrollbarValueChange);.......
9e40 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 20 ...........}....................
9e60 55 70 64 61 74 65 4c 61 62 65 6c 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d UpdateLabel();..............}...
9e80 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 53 75 62 73 63 72 69 62 65 20 74 6f 20 65 76 65 .............//.Subscribe.to.eve
9ea0 6e 74 20 66 69 72 65 64 20 77 68 65 6e 20 74 65 78 74 20 6f 62 6a 65 63 74 20 68 61 73 20 62 65 nt.fired.when.text.object.has.be
9ec0 65 6e 20 72 65 67 65 6e 65 72 61 74 65 64 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 54 4d 50 en.regenerated...............TMP
9ee0 72 6f 5f 45 76 65 6e 74 4d 61 6e 61 67 65 72 2e 54 45 58 54 5f 43 48 41 4e 47 45 44 5f 45 56 45 ro_EventManager.TEXT_CHANGED_EVE
9f00 4e 54 2e 41 64 64 28 4f 4e 5f 54 45 58 54 5f 43 48 41 4e 47 45 44 29 3b 0d 0a 20 20 20 20 20 20 NT.Add(ON_TEXT_CHANGED);........
9f20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 6f 76 65 72 72 69 64 ..}............protected.overrid
9f40 65 20 76 6f 69 64 20 4f 6e 44 69 73 61 62 6c 65 28 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 e.void.OnDisable()..........{...
9f60 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 74 68 65 20 63 6f 72 6f 75 74 69 6e 65 20 77 69 6c 6c ...........//.the.coroutine.will
9f80 20 62 65 20 74 65 72 6d 69 6e 61 74 65 64 2c 20 73 6f 20 74 68 69 73 20 77 69 6c 6c 20 65 6e 73 .be.terminated,.so.this.will.ens
9fa0 75 72 65 20 69 74 20 72 65 73 74 61 72 74 73 20 77 68 65 6e 20 77 65 20 61 72 65 20 6e 65 78 74 ure.it.restarts.when.we.are.next
9fc0 20 61 63 74 69 76 61 74 65 64 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 42 6c 69 6e 6b 43 .activated..............m_BlinkC
9fe0 6f 72 6f 75 74 69 6e 65 20 3d 20 6e 75 6c 6c 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 oroutine.=.null;................
a000 44 65 61 63 74 69 76 61 74 65 49 6e 70 75 74 46 69 65 6c 64 28 29 3b 0d 0a 20 20 20 20 20 20 20 DeactivateInputField();.........
a020 20 20 20 20 20 69 66 20 28 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 20 21 3d 20 6e 75 6c 6c .....if.(m_TextComponent.!=.null
a040 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 )..............{................
a060 20 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 55 6e 72 65 67 69 73 74 65 72 44 69 72 74 ..m_TextComponent.UnregisterDirt
a080 79 56 65 72 74 69 63 65 73 43 61 6c 6c 62 61 63 6b 28 4d 61 72 6b 47 65 6f 6d 65 74 72 79 41 73 yVerticesCallback(MarkGeometryAs
a0a0 44 69 72 74 79 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 54 65 78 74 43 Dirty);..................m_TextC
a0c0 6f 6d 70 6f 6e 65 6e 74 2e 55 6e 72 65 67 69 73 74 65 72 44 69 72 74 79 56 65 72 74 69 63 65 73 omponent.UnregisterDirtyVertices
a0e0 43 61 6c 6c 62 61 63 6b 28 55 70 64 61 74 65 4c 61 62 65 6c 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 Callback(UpdateLabel);..........
a100 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 56 65 72 74 69 63 61 6c 53 63 72 6f 6c 6c 62 61 ..........if.(m_VerticalScrollba
a120 72 20 21 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 r.!=.null)......................
a140 6d 5f 56 65 72 74 69 63 61 6c 53 63 72 6f 6c 6c 62 61 72 2e 6f 6e 56 61 6c 75 65 43 68 61 6e 67 m_VerticalScrollbar.onValueChang
a160 65 64 2e 52 65 6d 6f 76 65 4c 69 73 74 65 6e 65 72 28 4f 6e 53 63 72 6f 6c 6c 62 61 72 56 61 6c ed.RemoveListener(OnScrollbarVal
a180 75 65 43 68 61 6e 67 65 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 ueChange);................}.....
a1a0 20 20 20 20 20 20 20 20 20 43 61 6e 76 61 73 55 70 64 61 74 65 52 65 67 69 73 74 72 79 2e 55 6e .........CanvasUpdateRegistry.Un
a1c0 52 65 67 69 73 74 65 72 43 61 6e 76 61 73 45 6c 65 6d 65 6e 74 46 6f 72 52 65 62 75 69 6c 64 28 RegisterCanvasElementForRebuild(
a1e0 74 68 69 73 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 6c 65 61 72 20 6e this);................//.Clear.n
a200 65 65 64 73 20 74 6f 20 62 65 20 63 61 6c 6c 65 64 20 6f 74 68 65 72 77 69 73 65 20 73 79 6e 63 eeds.to.be.called.otherwise.sync
a220 20 6e 65 76 65 72 20 68 61 70 70 65 6e 73 20 61 73 20 74 68 65 20 6f 62 6a 65 63 74 20 69 73 20 .never.happens.as.the.object.is.
a240 64 69 73 61 62 6c 65 64 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 43 61 63 disabled...............if.(m_Cac
a260 68 65 64 49 6e 70 75 74 52 65 6e 64 65 72 65 72 20 21 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 hedInputRenderer.!=.null).......
a280 20 20 20 20 20 20 20 20 20 20 20 6d 5f 43 61 63 68 65 64 49 6e 70 75 74 52 65 6e 64 65 72 65 72 ...........m_CachedInputRenderer
a2a0 2e 43 6c 65 61 72 28 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 4d .Clear();................if.(m_M
a2c0 65 73 68 20 21 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 44 65 esh.!=.null)..................De
a2e0 73 74 72 6f 79 49 6d 6d 65 64 69 61 74 65 28 6d 5f 4d 65 73 68 29 3b 0d 0a 20 20 20 20 20 20 20 stroyImmediate(m_Mesh);.........
a300 20 20 20 20 20 6d 5f 4d 65 73 68 20 3d 20 6e 75 6c 6c 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 .....m_Mesh.=.null;.............
a320 20 20 20 2f 2f 20 55 6e 73 75 62 73 63 72 69 62 65 20 74 6f 20 65 76 65 6e 74 20 74 72 69 67 67 ...//.Unsubscribe.to.event.trigg
a340 65 72 65 64 20 77 68 65 6e 20 74 65 78 74 20 6f 62 6a 65 63 74 20 68 61 73 20 62 65 65 6e 20 72 ered.when.text.object.has.been.r
a360 65 67 65 6e 65 72 61 74 65 64 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 54 4d 50 72 6f 5f 45 76 egenerated..............TMPro_Ev
a380 65 6e 74 4d 61 6e 61 67 65 72 2e 54 45 58 54 5f 43 48 41 4e 47 45 44 5f 45 56 45 4e 54 2e 52 65 entManager.TEXT_CHANGED_EVENT.Re
a3a0 6d 6f 76 65 28 4f 4e 5f 54 45 58 54 5f 43 48 41 4e 47 45 44 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 move(ON_TEXT_CHANGED);..........
a3c0 20 20 20 20 20 20 62 61 73 65 2e 4f 6e 44 69 73 61 62 6c 65 28 29 3b 0d 0a 20 20 20 20 20 20 20 ......base.OnDisable();.........
a3e0 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>...
a400 20 20 20 20 20 20 20 2f 2f 2f 20 4d 65 74 68 6f 64 20 75 73 65 64 20 74 6f 20 75 70 64 61 74 65 .......///.Method.used.to.update
a420 20 74 68 65 20 74 72 61 63 6b 69 6e 67 20 6f 66 20 74 68 65 20 63 61 72 65 74 20 70 6f 73 69 74 .the.tracking.of.the.caret.posit
a440 69 6f 6e 20 77 68 65 6e 20 74 68 65 20 74 65 78 74 20 6f 62 6a 65 63 74 20 68 61 73 20 62 65 65 ion.when.the.text.object.has.bee
a460 6e 20 72 65 67 65 6e 65 72 61 74 65 64 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 n.regenerated...........///.</su
a480 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=
a4a0 22 6f 62 6a 22 3e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 "obj"></param>..........private.
a4c0 76 6f 69 64 20 4f 4e 5f 54 45 58 54 5f 43 48 41 4e 47 45 44 28 55 6e 69 74 79 45 6e 67 69 6e 65 void.ON_TEXT_CHANGED(UnityEngine
a4e0 2e 4f 62 6a 65 63 74 20 6f 62 6a 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 .Object.obj)..........{.........
a500 20 20 20 20 20 69 66 20 28 6f 62 6a 20 3d 3d 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 20 .....if.(obj.==.m_TextComponent.
a520 26 26 20 41 70 70 6c 69 63 61 74 69 6f 6e 2e 69 73 50 6c 61 79 69 6e 67 20 26 26 20 63 6f 6d 70 &&.Application.isPlaying.&&.comp
a540 6f 73 69 74 69 6f 6e 53 74 72 69 6e 67 2e 4c 65 6e 67 74 68 20 3d 3d 20 30 29 0d 0a 20 20 20 20 ositionString.Length.==.0)......
a560 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 63 61 72 65 74 ........{..................caret
a580 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 47 65 74 43 61 72 65 74 50 6f 73 69 74 PositionInternal.=.GetCaretPosit
a5a0 69 6f 6e 46 72 6f 6d 53 74 72 69 6e 67 49 6e 64 65 78 28 73 74 72 69 6e 67 50 6f 73 69 74 69 6f ionFromStringIndex(stringPositio
a5c0 6e 49 6e 74 65 72 6e 61 6c 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 72 nInternal);..................car
a5e0 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 47 65 74 43 61 etSelectPositionInternal.=.GetCa
a600 72 65 74 50 6f 73 69 74 69 6f 6e 46 72 6f 6d 53 74 72 69 6e 67 49 6e 64 65 78 28 73 74 72 69 6e retPositionFromStringIndex(strin
a620 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 29 3b 0d 0a 0d 0a 20 20 20 gSelectPositionInternal);.......
a640 20 20 20 20 20 20 20 20 20 20 20 20 20 23 69 66 20 54 4d 50 5f 44 45 42 55 47 5f 4d 4f 44 45 0d .............#if.TMP_DEBUG_MODE.
a660 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 44 65 62 75 67 2e 4c 6f 67 28 22 .....................Debug.Log("
a680 43 61 72 65 74 20 50 6f 73 69 74 69 6f 6e 3a 20 22 20 2b 20 63 61 72 65 74 50 6f 73 69 74 69 6f Caret.Position:.".+.caretPositio
a6a0 6e 49 6e 74 65 72 6e 61 6c 20 2b 20 22 20 53 65 6c 65 63 74 69 6f 6e 20 50 6f 73 69 74 69 6f 6e nInternal.+.".Selection.Position
a6c0 3a 20 22 20 2b 20 63 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 :.".+.caretSelectPositionInterna
a6e0 6c 20 2b 20 22 20 20 53 74 72 69 6e 67 20 50 6f 73 69 74 69 6f 6e 3a 20 22 20 2b 20 73 74 72 69 l.+."..String.Position:.".+.stri
a700 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2b 20 22 20 53 74 72 69 6e 67 20 53 65 ngPositionInternal.+.".String.Se
a720 6c 65 63 74 20 50 6f 73 69 74 69 6f 6e 3a 20 22 20 2b 20 73 74 72 69 6e 67 53 65 6c 65 63 74 50 lect.Position:.".+.stringSelectP
a740 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 ositionInternal);...............
a760 20 20 20 23 65 6e 64 69 66 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 ...#endif..............}........
a780 20 20 7d 0d 0a 0d 0a 0d 0a 20 20 20 20 20 20 20 20 49 45 6e 75 6d 65 72 61 74 6f 72 20 43 61 72 ..}..............IEnumerator.Car
a7a0 65 74 42 6c 69 6e 6b 28 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 etBlink()..........{............
a7c0 20 20 2f 2f 20 41 6c 77 61 79 73 20 65 6e 73 75 72 65 20 63 61 72 65 74 20 69 73 20 69 6e 69 74 ..//.Always.ensure.caret.is.init
a7e0 69 61 6c 6c 79 20 76 69 73 69 62 6c 65 20 73 69 6e 63 65 20 69 74 20 63 61 6e 20 6f 74 68 65 72 ially.visible.since.it.can.other
a800 77 69 73 65 20 62 65 20 63 6f 6e 66 75 73 69 6e 67 20 66 6f 72 20 61 20 6d 6f 6d 65 6e 74 2e 0d wise.be.confusing.for.a.moment..
a820 0a 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 43 61 72 65 74 56 69 73 69 62 6c 65 20 3d 20 74 72 .............m_CaretVisible.=.tr
a840 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 79 69 65 6c 64 20 72 65 74 75 72 6e 20 6e 75 ue;..............yield.return.nu
a860 6c 6c 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 77 68 69 6c 65 20 28 28 69 73 46 6f 63 ll;................while.((isFoc
a880 75 73 65 64 20 7c 7c 20 6d 5f 53 65 6c 65 63 74 69 6f 6e 53 74 69 6c 6c 41 63 74 69 76 65 29 20 used.||.m_SelectionStillActive).
a8a0 26 26 20 6d 5f 43 61 72 65 74 42 6c 69 6e 6b 52 61 74 65 20 3e 20 30 29 0d 0a 20 20 20 20 20 20 &&.m_CaretBlinkRate.>.0)........
a8c0 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 2f 2f 20 74 68 65 20 ......{..................//.the.
a8e0 62 6c 69 6e 6b 20 72 61 74 65 20 69 73 20 65 78 70 72 65 73 73 65 64 20 61 73 20 61 20 66 72 65 blink.rate.is.expressed.as.a.fre
a900 71 75 65 6e 63 79 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 62 6c quency..................float.bl
a920 69 6e 6b 50 65 72 69 6f 64 20 3d 20 31 66 20 2f 20 6d 5f 43 61 72 65 74 42 6c 69 6e 6b 52 61 74 inkPeriod.=.1f./.m_CaretBlinkRat
a940 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 74 68 65 20 63 61 72 e;....................//.the.car
a960 65 74 20 73 68 6f 75 6c 64 20 62 65 20 4f 4e 20 69 66 20 77 65 20 61 72 65 20 69 6e 20 74 68 65 et.should.be.ON.if.we.are.in.the
a980 20 66 69 72 73 74 20 68 61 6c 66 20 6f 66 20 74 68 65 20 62 6c 69 6e 6b 20 70 65 72 69 6f 64 0d .first.half.of.the.blink.period.
a9a0 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 6f 6f 6c 20 62 6c 69 6e 6b 53 74 61 74 65 .................bool.blinkState
a9c0 20 3d 20 28 54 69 6d 65 2e 75 6e 73 63 61 6c 65 64 54 69 6d 65 20 2d 20 6d 5f 42 6c 69 6e 6b 53 .=.(Time.unscaledTime.-.m_BlinkS
a9e0 74 61 72 74 54 69 6d 65 29 20 25 20 62 6c 69 6e 6b 50 65 72 69 6f 64 20 3c 20 62 6c 69 6e 6b 50 tartTime).%.blinkPeriod.<.blinkP
aa00 65 72 69 6f 64 20 2f 20 32 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 eriod./.2;..................if.(
aa20 6d 5f 43 61 72 65 74 56 69 73 69 62 6c 65 20 21 3d 20 62 6c 69 6e 6b 53 74 61 74 65 29 0d 0a 20 m_CaretVisible.!=.blinkState)...
aa40 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 20 ...............{................
aa60 20 20 20 20 20 20 6d 5f 43 61 72 65 74 56 69 73 69 62 6c 65 20 3d 20 62 6c 69 6e 6b 53 74 61 74 ......m_CaretVisible.=.blinkStat
aa80 65 3b 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 21 68 61 73 e;......................if.(!has
aaa0 53 65 6c 65 63 74 69 6f 6e 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 Selection)......................
aac0 20 20 20 20 4d 61 72 6b 47 65 6f 6d 65 74 72 79 41 73 44 69 72 74 79 28 29 3b 0d 0a 20 20 20 20 ....MarkGeometryAsDirty();......
aae0 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 ............}...................
ab00 20 2f 2f 20 54 68 65 6e 20 77 61 69 74 20 61 67 61 69 6e 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 .//.Then.wait.again.............
ab20 20 20 20 20 20 20 79 69 65 6c 64 20 72 65 74 75 72 6e 20 6e 75 6c 6c 3b 0d 0a 20 20 20 20 20 20 ......yield.return.null;........
ab40 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 42 6c 69 6e 6b 43 6f 72 6f ......}..............m_BlinkCoro
ab60 75 74 69 6e 65 20 3d 20 6e 75 6c 6c 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 utine.=.null;..........}........
ab80 20 20 20 20 76 6f 69 64 20 53 65 74 43 61 72 65 74 56 69 73 69 62 6c 65 28 29 0d 0a 20 20 20 20 ....void.SetCaretVisible()......
aba0 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 6d 5f 41 6c 6c 6f 77 49 ....{..............if.(!m_AllowI
abc0 6e 70 75 74 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 3b 0d 0a nput)..................return;..
abe0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 43 61 72 65 74 56 69 73 69 62 6c 65 20 3d 20 74 ..............m_CaretVisible.=.t
ac00 72 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 42 6c 69 6e 6b 53 74 61 72 74 54 69 rue;..............m_BlinkStartTi
ac20 6d 65 20 3d 20 54 69 6d 65 2e 75 6e 73 63 61 6c 65 64 54 69 6d 65 3b 0d 0a 20 20 20 20 20 20 20 me.=.Time.unscaledTime;.........
ac40 20 20 20 20 20 53 65 74 43 61 72 65 74 41 63 74 69 76 65 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 .....SetCaretActive();..........
ac60 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 53 65 74 43 61 72 65 74 41 63 74 69 76 65 20 77 }............//.SetCaretActive.w
ac80 69 6c 6c 20 6e 6f 74 20 73 65 74 20 74 68 65 20 63 61 72 65 74 20 69 6d 6d 65 64 69 61 74 65 6c ill.not.set.the.caret.immediatel
aca0 79 20 76 69 73 69 62 6c 65 20 2d 20 69 74 20 77 69 6c 6c 20 77 61 69 74 20 66 6f 72 20 74 68 65 y.visible.-.it.will.wait.for.the
acc0 20 6e 65 78 74 20 74 69 6d 65 20 74 6f 20 62 6c 69 6e 6b 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f .next.time.to.blink...........//
ace0 20 48 6f 77 65 76 65 72 2c 20 69 74 20 77 69 6c 6c 20 68 61 6e 64 6c 65 20 74 68 69 6e 67 73 20 .However,.it.will.handle.things.
ad00 63 6f 72 72 65 63 74 6c 79 20 69 66 20 74 68 65 20 62 6c 69 6e 6b 20 73 70 65 65 64 20 63 68 61 correctly.if.the.blink.speed.cha
ad20 6e 67 65 64 20 66 72 6f 6d 20 7a 65 72 6f 20 74 6f 20 6e 6f 6e 2d 7a 65 72 6f 20 6f 72 20 6e 6f nged.from.zero.to.non-zero.or.no
ad40 6e 2d 7a 65 72 6f 20 74 6f 20 7a 65 72 6f 2e 0d 0a 20 20 20 20 20 20 20 20 76 6f 69 64 20 53 65 n-zero.to.zero...........void.Se
ad60 74 43 61 72 65 74 41 63 74 69 76 65 28 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 tCaretActive()..........{.......
ad80 20 20 20 20 20 20 20 69 66 20 28 21 6d 5f 41 6c 6c 6f 77 49 6e 70 75 74 29 0d 0a 20 20 20 20 20 .......if.(!m_AllowInput).......
ada0 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 ...........return;..............
adc0 20 20 69 66 20 28 6d 5f 43 61 72 65 74 42 6c 69 6e 6b 52 61 74 65 20 3e 20 30 2e 30 66 29 0d 0a ..if.(m_CaretBlinkRate.>.0.0f)..
ade0 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 69 ............{..................i
ae00 66 20 28 6d 5f 42 6c 69 6e 6b 43 6f 72 6f 75 74 69 6e 65 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 f.(m_BlinkCoroutine.==.null)....
ae20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 42 6c 69 6e 6b 43 6f 72 6f 75 74 69 ..................m_BlinkCorouti
ae40 6e 65 20 3d 20 53 74 61 72 74 43 6f 72 6f 75 74 69 6e 65 28 43 61 72 65 74 42 6c 69 6e 6b 28 29 ne.=.StartCoroutine(CaretBlink()
ae60 29 3b 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 20 20 20 20 65 );..............}..............e
ae80 6c 73 65 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 lse..............{..............
aea0 20 20 20 20 6d 5f 43 61 72 65 74 56 69 73 69 62 6c 65 20 3d 20 74 72 75 65 3b 0d 0a 20 20 20 20 ....m_CaretVisible.=.true;......
aec0 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 ........}..........}............
aee0 70 72 6f 74 65 63 74 65 64 20 76 6f 69 64 20 4f 6e 46 6f 63 75 73 28 29 0d 0a 20 20 20 20 20 20 protected.void.OnFocus()........
af00 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 4f 6e 46 6f 63 75 73 53 65 ..{..............if.(m_OnFocusSe
af20 6c 65 63 74 41 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 53 65 6c 65 63 74 lectAll)..................Select
af40 41 6c 6c 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 6f All();..........}............pro
af60 74 65 63 74 65 64 20 76 6f 69 64 20 53 65 6c 65 63 74 41 6c 6c 28 29 0d 0a 20 20 20 20 20 20 20 tected.void.SelectAll().........
af80 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 69 73 53 65 6c 65 63 74 41 6c 6c 20 3d 20 .{..............m_isSelectAll.=.
afa0 74 72 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 74 72 69 6e 67 50 6f 73 69 74 69 6f true;..............stringPositio
afc0 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 74 65 78 74 2e 4c 65 6e 67 74 68 3b 0d 0a 20 20 20 20 20 20 nInternal.=.text.Length;........
afe0 20 20 20 20 20 20 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e ......stringSelectPositionIntern
b000 61 6c 20 3d 20 30 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 al.=.0;..........}............//
b020 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 4d 6f 76 65 20 74 6f /.<summary>..........///.Move.to
b040 20 74 68 65 20 65 6e 64 20 6f 66 20 74 68 65 20 74 65 78 74 2e 0d 0a 20 20 20 20 20 20 20 20 2f .the.end.of.the.text.........../
b060 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
b080 6d 20 6e 61 6d 65 3d 22 73 68 69 66 74 22 3e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 m.name="shift"></param>.........
b0a0 20 70 75 62 6c 69 63 20 76 6f 69 64 20 4d 6f 76 65 54 65 78 74 45 6e 64 28 62 6f 6f 6c 20 73 68 .public.void.MoveTextEnd(bool.sh
b0c0 69 66 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 20 20 69 66 20 ift)..........{..............if.
b0e0 28 6d 5f 69 73 52 69 63 68 54 65 78 74 45 64 69 74 69 6e 67 41 6c 6c 6f 77 65 64 29 0d 0a 20 20 (m_isRichTextEditingAllowed)....
b100 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 69 6e 74 ..........{..................int
b120 20 70 6f 73 69 74 69 6f 6e 20 3d 20 74 65 78 74 2e 4c 65 6e 67 74 68 3b 0d 0a 0d 0a 20 20 20 20 .position.=.text.Length;........
b140 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 68 69 66 74 29 0d 0a 20 20 20 20 20 20 20 20 ............if.(shift)..........
b160 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 73 ........{......................s
b180 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 70 6f tringSelectPositionInternal.=.po
b1a0 73 69 74 69 6f 6e 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 sition;..................}......
b1c0 20 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 20 20 ............else................
b1e0 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 73 74 72 69 6e 67 50 ..{......................stringP
b200 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 70 6f 73 69 74 69 6f 6e 3b 0d 0a 20 20 20 ositionInternal.=.position;.....
b220 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 .................stringSelectPos
b240 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e itionInternal.=.stringPositionIn
b260 74 65 72 6e 61 6c 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 ternal;..................}......
b280 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 0d 0a 20 20 20 ........}..............else.....
b2a0 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 69 6e 74 20 .........{..................int.
b2c0 70 6f 73 69 74 69 6f 6e 20 3d 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 65 78 74 49 position.=.m_TextComponent.textI
b2e0 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 43 6f 75 6e 74 20 2d 20 31 3b 0d 0a 0d 0a 20 20 20 20 20 nfo.characterCount.-.1;.........
b300 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 68 69 66 74 29 0d 0a 20 20 20 20 20 20 20 20 20 ...........if.(shift)...........
b320 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 63 61 .......{......................ca
b340 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 70 6f 73 69 retSelectPositionInternal.=.posi
b360 74 69 6f 6e 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 74 72 69 6e tion;......................strin
b380 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 47 65 74 53 74 72 gSelectPositionInternal.=.GetStr
b3a0 69 6e 67 49 6e 64 65 78 46 72 6f 6d 43 61 72 65 74 50 6f 73 69 74 69 6f 6e 28 70 6f 73 69 74 69 ingIndexFromCaretPosition(positi
b3c0 6f 6e 29 3b 0d 0a 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 on);..................}.........
b3e0 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 20 20 20 20 7b .........else..................{
b400 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 72 65 74 50 6f 73 69 74 ......................caretPosit
b420 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 63 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f ionInternal.=.caretSelectPositio
b440 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 70 6f 73 69 74 69 6f 6e 3b 0d 0a 20 20 20 20 20 20 20 20 20 nInternal.=.position;...........
b460 20 20 20 20 20 20 20 20 20 20 20 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 ...........stringSelectPositionI
b480 6e 74 65 72 6e 61 6c 20 3d 20 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c nternal.=.stringPositionInternal
b4a0 20 3d 20 47 65 74 53 74 72 69 6e 67 49 6e 64 65 78 46 72 6f 6d 43 61 72 65 74 50 6f 73 69 74 69 .=.GetStringIndexFromCaretPositi
b4c0 6f 6e 28 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 7d on(position);..................}
b4e0 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 20 20 20 20 55 ..............}................U
b500 70 64 61 74 65 4c 61 62 65 6c 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 pdateLabel();..........}........
b520 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 4d ....///.<summary>..........///.M
b540 6f 76 65 20 74 6f 20 74 68 65 20 73 74 61 72 74 20 6f 66 20 74 68 65 20 74 65 78 74 2e 0d 0a 20 ove.to.the.start.of.the.text....
b560 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>........../
b580 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 73 68 69 66 74 22 3e 3c 2f 70 61 72 61 6d 3e 0d //.<param.name="shift"></param>.
b5a0 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 76 6f 69 64 20 4d 6f 76 65 54 65 78 74 53 74 61 .........public.void.MoveTextSta
b5c0 72 74 28 62 6f 6f 6c 20 73 68 69 66 74 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 rt(bool.shift)..........{.......
b5e0 20 20 20 20 20 20 20 69 66 20 28 6d 5f 69 73 52 69 63 68 54 65 78 74 45 64 69 74 69 6e 67 41 6c .......if.(m_isRichTextEditingAl
b600 6c 6f 77 65 64 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 lowed)..............{...........
b620 20 20 20 20 20 20 20 69 6e 74 20 70 6f 73 69 74 69 6f 6e 20 3d 20 30 3b 0d 0a 0d 0a 20 20 20 20 .......int.position.=.0;........
b640 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 68 69 66 74 29 0d 0a 20 20 20 20 20 20 20 20 ............if.(shift)..........
b660 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 73 ........{......................s
b680 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 70 6f tringSelectPositionInternal.=.po
b6a0 73 69 74 69 6f 6e 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 sition;..................}......
b6c0 20 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 20 20 ............else................
b6e0 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 73 74 72 69 6e 67 50 ..{......................stringP
b700 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 70 6f 73 69 74 69 6f 6e 3b 0d 0a 20 20 20 ositionInternal.=.position;.....
b720 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 .................stringSelectPos
b740 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e itionInternal.=.stringPositionIn
b760 74 65 72 6e 61 6c 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 ternal;..................}......
b780 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 0d 0a 20 20 20 ........}..............else.....
b7a0 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 69 6e 74 20 .........{..................int.
b7c0 70 6f 73 69 74 69 6f 6e 20 3d 20 30 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 position.=.0;...................
b7e0 20 69 66 20 28 73 68 69 66 74 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a .if.(shift)..................{..
b800 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 72 65 74 53 65 6c 65 63 74 50 ....................caretSelectP
b820 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 70 6f 73 69 74 69 6f 6e 3b 0d 0a 20 20 20 ositionInternal.=.position;.....
b840 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 .................stringSelectPos
b860 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 47 65 74 53 74 72 69 6e 67 49 6e 64 65 78 46 72 itionInternal.=.GetStringIndexFr
b880 6f 6d 43 61 72 65 74 50 6f 73 69 74 69 6f 6e 28 70 6f 73 69 74 69 6f 6e 29 3b 0d 0a 20 20 20 20 omCaretPosition(position);......
b8a0 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 65 ............}..................e
b8c0 6c 73 65 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 lse..................{..........
b8e0 20 20 20 20 20 20 20 20 20 20 20 20 63 61 72 65 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 ............caretPositionInterna
b900 6c 20 3d 20 63 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 l.=.caretSelectPositionInternal.
b920 3d 20 70 6f 73 69 74 69 6f 6e 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 =.position;.....................
b940 20 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 .stringSelectPositionInternal.=.
b960 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 47 65 74 53 74 72 69 stringPositionInternal.=.GetStri
b980 6e 67 49 6e 64 65 78 46 72 6f 6d 43 61 72 65 74 50 6f 73 69 74 69 6f 6e 28 70 6f 73 69 74 69 6f ngIndexFromCaretPosition(positio
b9a0 6e 29 3b 0d 0a 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 n);..................}..........
b9c0 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 55 70 64 61 74 65 4c 61 62 65 6c ....}................UpdateLabel
b9e0 28 29 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 ();..........}..............///.
ba00 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 4d 6f 76 65 20 74 6f 20 74 <summary>..........///.Move.to.t
ba20 68 65 20 65 6e 64 20 6f 66 20 74 68 65 20 63 75 72 72 65 6e 74 20 6c 69 6e 65 20 6f 66 20 74 65 he.end.of.the.current.line.of.te
ba40 78 74 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 xt...........///.</summary>.....
ba60 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 73 68 69 66 74 22 3e 3c 2f 70 .....///.<param.name="shift"></p
ba80 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 76 6f 69 64 20 4d 6f 76 65 54 aram>..........public.void.MoveT
baa0 6f 45 6e 64 4f 66 4c 69 6e 65 28 62 6f 6f 6c 20 73 68 69 66 74 2c 20 62 6f 6f 6c 20 63 74 72 6c oEndOfLine(bool.shift,.bool.ctrl
bac0 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 2f 2f 20 47 65 74 )..........{..............//.Get
bae0 20 74 68 65 20 6c 69 6e 65 20 74 68 65 20 63 61 72 65 74 20 69 73 20 63 75 72 72 65 6e 74 6c 79 .the.line.the.caret.is.currently
bb00 20 6c 6f 63 61 74 65 64 20 6f 6e 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 20 63 75 .located.on...............int.cu
bb20 72 72 65 6e 74 4c 69 6e 65 20 3d 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 65 78 74 rrentLine.=.m_TextComponent.text
bb40 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 49 6e 66 6f 5b 63 61 72 65 74 50 6f 73 69 74 69 6f 6e Info.characterInfo[caretPosition
bb60 49 6e 74 65 72 6e 61 6c 5d 2e 6c 69 6e 65 4e 75 6d 62 65 72 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 Internal].lineNumber;...........
bb80 20 20 20 20 20 2f 2f 20 47 65 74 20 74 68 65 20 6c 61 73 74 20 63 68 61 72 61 63 74 65 72 20 6f .....//.Get.the.last.character.o
bba0 66 20 74 68 65 20 67 69 76 65 6e 20 6c 69 6e 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 f.the.given.line...............i
bbc0 6e 74 20 63 68 61 72 61 63 74 65 72 49 6e 64 65 78 20 3d 20 63 74 72 6c 20 3d 3d 20 74 72 75 65 nt.characterIndex.=.ctrl.==.true
bbe0 20 3f 20 6d 5f 54 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 .?.m_TextComponent.textInfo.char
bc00 61 63 74 65 72 43 6f 75 6e 74 20 2d 20 31 20 3a 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 acterCount.-.1.:.m_TextComponent
bc20 2e 74 65 78 74 49 6e 66 6f 2e 6c 69 6e 65 49 6e 66 6f 5b 63 75 72 72 65 6e 74 4c 69 6e 65 5d 2e .textInfo.lineInfo[currentLine].
bc40 6c 61 73 74 43 68 61 72 61 63 74 65 72 49 6e 64 65 78 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 lastCharacterIndex;.............
bc60 20 20 20 69 6e 74 20 70 6f 73 69 74 69 6f 6e 20 3d 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e ...int.position.=.m_TextComponen
bc80 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 72 61 63 74 t.textInfo.characterInfo[charact
bca0 65 72 49 6e 64 65 78 5d 2e 69 6e 64 65 78 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 erIndex].index;................i
bcc0 66 20 28 73 68 69 66 74 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 f.(shift)..............{........
bce0 20 20 20 20 20 20 20 20 20 20 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e ..........stringSelectPositionIn
bd00 74 65 72 6e 61 6c 20 3d 20 70 6f 73 69 74 69 6f 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 ternal.=.position;..............
bd20 20 20 20 20 20 20 63 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 ......caretSelectPositionInterna
bd40 6c 20 3d 20 63 68 61 72 61 63 74 65 72 49 6e 64 65 78 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 l.=.characterIndex;.............
bd60 20 7d 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 20 20 20 20 20 .}..............else............
bd80 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 74 72 69 6e 67 50 6f 73 69 74 ..{..................stringPosit
bda0 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 70 6f 73 69 74 69 6f 6e 3b 0d 0a 20 20 20 20 20 20 20 ionInternal.=.position;.........
bdc0 20 20 20 20 20 20 20 20 20 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 .........stringSelectPositionInt
bde0 65 72 6e 61 6c 20 3d 20 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 3b 0d ernal.=.stringPositionInternal;.
be00 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 72 65 74 53 65 6c 65 63 74 50 6f ...................caretSelectPo
be20 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 63 61 72 65 74 50 6f 73 69 74 69 6f 6e 49 6e sitionInternal.=.caretPositionIn
be40 74 65 72 6e 61 6c 20 3d 20 63 68 61 72 61 63 74 65 72 49 6e 64 65 78 3b 0d 0a 20 20 20 20 20 20 ternal.=.characterIndex;........
be60 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 55 70 64 61 74 65 4c 61 62 ......}................UpdateLab
be80 65 6c 28 29 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 el();..........}............///.
bea0 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 4d 6f 76 65 20 74 6f 20 74 <summary>..........///.Move.to.t
bec0 68 65 20 73 74 61 72 74 20 6f 66 20 74 68 65 20 63 75 72 72 65 6e 74 20 6c 69 6e 65 20 6f 66 20 he.start.of.the.current.line.of.
bee0 74 65 78 74 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 text...........///.</summary>...
bf00 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 73 68 69 66 74 22 3e 3c .......///.<param.name="shift"><
bf20 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 76 6f 69 64 20 4d 6f 76 /param>..........public.void.Mov
bf40 65 54 6f 53 74 61 72 74 4f 66 4c 69 6e 65 28 62 6f 6f 6c 20 73 68 69 66 74 2c 20 62 6f 6f 6c 20 eToStartOfLine(bool.shift,.bool.
bf60 63 74 72 6c 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 2f 2f ctrl)..........{..............//
bf80 20 47 65 74 20 74 68 65 20 6c 69 6e 65 20 74 68 65 20 63 61 72 65 74 20 69 73 20 63 75 72 72 65 .Get.the.line.the.caret.is.curre
bfa0 6e 74 6c 79 20 6c 6f 63 61 74 65 64 20 6f 6e 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 6e ntly.located.on...............in
bfc0 74 20 63 75 72 72 65 6e 74 4c 69 6e 65 20 3d 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e t.currentLine.=.m_TextComponent.
bfe0 74 65 78 74 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 49 6e 66 6f 5b 63 61 72 65 74 50 6f 73 69 textInfo.characterInfo[caretPosi
c000 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 5d 2e 6c 69 6e 65 4e 75 6d 62 65 72 3b 0d 0a 0d 0a 20 20 20 tionInternal].lineNumber;.......
c020 20 20 20 20 20 20 20 20 20 2f 2f 20 47 65 74 20 74 68 65 20 66 69 72 73 74 20 63 68 61 72 61 63 .........//.Get.the.first.charac
c040 74 65 72 20 6f 66 20 74 68 65 20 67 69 76 65 6e 20 6c 69 6e 65 2e 0d 0a 20 20 20 20 20 20 20 20 ter.of.the.given.line...........
c060 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 63 74 72 6c 20 3d 3d ....int.characterIndex.=.ctrl.==
c080 20 74 72 75 65 20 3f 20 30 20 3a 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 65 78 74 .true.?.0.:.m_TextComponent.text
c0a0 49 6e 66 6f 2e 6c 69 6e 65 49 6e 66 6f 5b 63 75 72 72 65 6e 74 4c 69 6e 65 5d 2e 66 69 72 73 74 Info.lineInfo[currentLine].first
c0c0 43 68 61 72 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 69 CharacterIndex;................i
c0e0 6e 74 20 70 6f 73 69 74 69 6f 6e 20 3d 20 30 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 nt.position.=.0;..............if
c100 20 28 63 68 61 72 61 63 74 65 72 49 6e 64 65 78 20 3e 20 30 29 0d 0a 20 20 20 20 20 20 20 20 20 .(characterIndex.>.0)...........
c120 20 20 20 20 20 20 20 70 6f 73 69 74 69 6f 6e 20 3d 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e .......position.=.m_TextComponen
c140 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 72 61 63 74 t.textInfo.characterInfo[charact
c160 65 72 49 6e 64 65 78 20 2d 20 31 5d 2e 69 6e 64 65 78 20 2b 20 6d 5f 54 65 78 74 43 6f 6d 70 6f erIndex.-.1].index.+.m_TextCompo
c180 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 66 6f 5b 63 68 61 72 nent.textInfo.characterInfo[char
c1a0 61 63 74 65 72 49 6e 64 65 78 20 2d 20 31 5d 2e 73 74 72 69 6e 67 4c 65 6e 67 74 68 3b 0d 0a 0d acterIndex.-.1].stringLength;...
c1c0 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 68 69 66 74 29 0d 0a 20 20 20 20 20 20 20 .............if.(shift).........
c1e0 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 74 72 69 6e 67 53 65 .....{..................stringSe
c200 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 70 6f 73 69 74 69 6f 6e 3b lectPositionInternal.=.position;
c220 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 72 65 74 53 65 6c 65 63 74 50 ....................caretSelectP
c240 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 63 68 61 72 61 63 74 65 72 49 6e 64 65 78 ositionInternal.=.characterIndex
c260 3b 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 20 20 20 20 65 6c ;..............}..............el
c280 73 65 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 se..............{...............
c2a0 20 20 20 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 70 6f 73 69 ...stringPositionInternal.=.posi
c2c0 74 69 6f 6e 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 74 72 69 6e 67 53 65 6c tion;..................stringSel
c2e0 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 73 74 72 69 6e 67 50 6f 73 69 ectPositionInternal.=.stringPosi
c300 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 tionInternal;...................
c320 20 63 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 63 .caretSelectPositionInternal.=.c
c340 61 72 65 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 63 68 61 72 61 63 74 65 72 aretPositionInternal.=.character
c360 49 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 20 20 20 20 20 Index;..............}...........
c380 20 20 20 20 20 55 70 64 61 74 65 4c 61 62 65 6c 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a .....UpdateLabel();..........}..
c3a0 0d 0a 0d 0a 20 20 20 20 20 20 20 20 73 74 61 74 69 63 20 73 74 72 69 6e 67 20 63 6c 69 70 62 6f ............static.string.clipbo
c3c0 61 72 64 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 67 65 74 0d ard..........{..............get.
c3e0 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 20 .............{..................
c400 72 65 74 75 72 6e 20 47 55 49 55 74 69 6c 69 74 79 2e 73 79 73 74 65 6d 43 6f 70 79 42 75 66 66 return.GUIUtility.systemCopyBuff
c420 65 72 3b 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 20 20 20 20 er;..............}..............
c440 73 65 74 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 set..............{..............
c460 20 20 20 20 47 55 49 55 74 69 6c 69 74 79 2e 73 79 73 74 65 6d 43 6f 70 79 42 75 66 66 65 72 20 ....GUIUtility.systemCopyBuffer.
c480 3d 20 76 61 6c 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 =.value;..............}.........
c4a0 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 62 6f 6f 6c 20 49 6e 50 6c 61 .}............private.bool.InPla
c4c0 63 65 45 64 69 74 69 6e 67 28 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 ceEditing()..........{..........
c4e0 20 20 20 20 69 66 20 28 6d 5f 54 6f 75 63 68 4b 65 79 62 6f 61 72 64 41 6c 6c 6f 77 73 49 6e 50 ....if.(m_TouchKeyboardAllowsInP
c500 6c 61 63 65 45 64 69 74 69 6e 67 20 7c 7c 20 28 54 6f 75 63 68 53 63 72 65 65 6e 4b 65 79 62 6f laceEditing.||.(TouchScreenKeybo
c520 61 72 64 2e 69 73 53 75 70 70 6f 72 74 65 64 20 26 26 20 28 41 70 70 6c 69 63 61 74 69 6f 6e 2e ard.isSupported.&&.(Application.
c540 70 6c 61 74 66 6f 72 6d 20 3d 3d 20 52 75 6e 74 69 6d 65 50 6c 61 74 66 6f 72 6d 2e 57 53 41 50 platform.==.RuntimePlatform.WSAP
c560 6c 61 79 65 72 58 38 36 20 7c 7c 20 41 70 70 6c 69 63 61 74 69 6f 6e 2e 70 6c 61 74 66 6f 72 6d layerX86.||.Application.platform
c580 20 3d 3d 20 52 75 6e 74 69 6d 65 50 6c 61 74 66 6f 72 6d 2e 57 53 41 50 6c 61 79 65 72 58 36 34 .==.RuntimePlatform.WSAPlayerX64
c5a0 20 7c 7c 20 41 70 70 6c 69 63 61 74 69 6f 6e 2e 70 6c 61 74 66 6f 72 6d 20 3d 3d 20 52 75 6e 74 .||.Application.platform.==.Runt
c5c0 69 6d 65 50 6c 61 74 66 6f 72 6d 2e 57 53 41 50 6c 61 79 65 72 41 52 4d 29 29 29 0d 0a 20 20 20 imePlatform.WSAPlayerARM))).....
c5e0 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 0d 0a 20 20 20 .............return.true;.......
c600 20 20 20 20 20 20 20 20 20 69 66 20 28 54 6f 75 63 68 53 63 72 65 65 6e 4b 65 79 62 6f 61 72 64 .........if.(TouchScreenKeyboard
c620 2e 69 73 53 75 70 70 6f 72 74 65 64 20 26 26 20 73 68 6f 75 6c 64 48 69 64 65 53 6f 66 74 4b 65 .isSupported.&&.shouldHideSoftKe
c640 79 62 6f 61 72 64 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 yboard)..................return.
c660 74 72 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 54 6f 75 63 68 53 63 true;................if.(TouchSc
c680 72 65 65 6e 4b 65 79 62 6f 61 72 64 2e 69 73 53 75 70 70 6f 72 74 65 64 20 26 26 20 73 68 6f 75 reenKeyboard.isSupported.&&.shou
c6a0 6c 64 48 69 64 65 53 6f 66 74 4b 65 79 62 6f 61 72 64 20 3d 3d 20 66 61 6c 73 65 20 26 26 20 73 ldHideSoftKeyboard.==.false.&&.s
c6c0 68 6f 75 6c 64 48 69 64 65 4d 6f 62 69 6c 65 49 6e 70 75 74 20 3d 3d 20 66 61 6c 73 65 29 0d 0a houldHideMobileInput.==.false)..
c6e0 20 20 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 0d ................return.false;...
c700 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 20 20 20 20 20 .............return.true;.......
c720 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 76 6f 69 64 20 55 70 64 61 74 65 53 74 72 69 6e ...}............void.UpdateStrin
c740 67 50 6f 73 69 74 69 6f 6e 46 72 6f 6d 4b 65 79 62 6f 61 72 64 28 29 0d 0a 20 20 20 20 20 20 20 gPositionFromKeyboard().........
c760 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 54 4f 44 4f 3a 20 4d 69 67 68 74 20 77 .{..............//.TODO:.Might.w
c780 61 6e 74 20 74 6f 20 61 64 64 20 6e 75 6c 6c 20 63 68 65 63 6b 20 68 65 72 65 2e 0d 0a 20 20 20 ant.to.add.null.check.here......
c7a0 20 20 20 20 20 20 20 20 20 76 61 72 20 73 65 6c 65 63 74 69 6f 6e 52 61 6e 67 65 20 3d 20 6d 5f .........var.selectionRange.=.m_
c7c0 53 6f 66 74 4b 65 79 62 6f 61 72 64 2e 73 65 6c 65 63 74 69 6f 6e 3b 0d 0a 0d 0a 20 20 20 20 20 SoftKeyboard.selection;.........
c7e0 20 20 20 20 20 20 20 69 66 20 28 73 65 6c 65 63 74 69 6f 6e 52 61 6e 67 65 2e 73 74 61 72 74 20 .......if.(selectionRange.start.
c800 3d 3d 20 30 20 26 26 20 73 65 6c 65 63 74 69 6f 6e 52 61 6e 67 65 2e 6c 65 6e 67 74 68 20 3d 3d ==.0.&&.selectionRange.length.==
c820 20 30 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 3b 0d 0a 0d 0a .0)..................return;....
c840 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 73 65 6c 65 63 74 69 6f 6e 53 74 61 72 74 20 3d ............var.selectionStart.=
c860 20 73 65 6c 65 63 74 69 6f 6e 52 61 6e 67 65 2e 73 74 61 72 74 3b 0d 0a 20 20 20 20 20 20 20 20 .selectionRange.start;..........
c880 20 20 20 20 76 61 72 20 73 65 6c 65 63 74 69 6f 6e 45 6e 64 20 3d 20 73 65 6c 65 63 74 69 6f 6e ....var.selectionEnd.=.selection
c8a0 52 61 6e 67 65 2e 65 6e 64 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 73 74 Range.end;................var.st
c8c0 72 69 6e 67 50 6f 73 69 74 69 6f 6e 43 68 61 6e 67 65 64 20 3d 20 66 61 6c 73 65 3b 0d 0a 0d 0a ringPositionChanged.=.false;....
c8e0 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e ............if.(stringPositionIn
c900 74 65 72 6e 61 6c 20 21 3d 20 73 65 6c 65 63 74 69 6f 6e 53 74 61 72 74 29 0d 0a 20 20 20 20 20 ternal.!=.selectionStart).......
c920 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 73 74 72 69 6e 67 .......{..................string
c940 50 6f 73 69 74 69 6f 6e 43 68 61 6e 67 65 64 20 3d 20 74 72 75 65 3b 0d 0a 20 20 20 20 20 20 20 PositionChanged.=.true;.........
c960 20 20 20 20 20 20 20 20 20 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 .........stringPositionInternal.
c980 3d 20 73 65 6c 65 63 74 69 6f 6e 53 74 61 72 74 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 =.selectionStart;...............
c9a0 20 20 20 20 20 63 61 72 65 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 47 65 74 .....caretPositionInternal.=.Get
c9c0 43 61 72 65 74 50 6f 73 69 74 69 6f 6e 46 72 6f 6d 53 74 72 69 6e 67 49 6e 64 65 78 28 73 74 72 CaretPositionFromStringIndex(str
c9e0 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 ingPositionInternal);...........
ca00 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 74 72 69 6e 67 53 65 ...}................if.(stringSe
ca20 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 21 3d 20 73 65 6c 65 63 74 69 6f lectPositionInternal.!=.selectio
ca40 6e 45 6e 64 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 nEnd)..............{............
ca60 20 20 20 20 20 20 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e ......stringSelectPositionIntern
ca80 61 6c 20 3d 20 73 65 6c 65 63 74 69 6f 6e 45 6e 64 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 al.=.selectionEnd;..............
caa0 20 20 20 20 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 43 68 61 6e 67 65 64 20 3d 20 74 72 75 65 ....stringPositionChanged.=.true
cac0 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 72 65 74 53 65 6c 65 63 74 ;....................caretSelect
cae0 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 47 65 74 43 61 72 65 74 50 6f 73 69 74 PositionInternal.=.GetCaretPosit
cb00 69 6f 6e 46 72 6f 6d 53 74 72 69 6e 67 49 6e 64 65 78 28 73 74 72 69 6e 67 53 65 6c 65 63 74 50 ionFromStringIndex(stringSelectP
cb20 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d ositionInternal);..............}
cb40 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 74 72 69 6e 67 50 6f 73 69 74 69 ................if.(stringPositi
cb60 6f 6e 43 68 61 6e 67 65 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 onChanged)..............{.......
cb80 20 20 20 20 20 20 20 20 20 20 20 6d 5f 42 6c 69 6e 6b 53 74 61 72 74 54 69 6d 65 20 3d 20 54 69 ...........m_BlinkStartTime.=.Ti
cba0 6d 65 2e 75 6e 73 63 61 6c 65 64 54 69 6d 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 me.unscaledTime;................
cbc0 20 20 20 20 55 70 64 61 74 65 4c 61 62 65 6c 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 ....UpdateLabel();..............
cbe0 7d 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 6d }..........}............///.<sum
cc00 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 55 70 64 61 74 65 20 74 68 65 20 74 65 mary>..........///.Update.the.te
cc20 78 74 20 62 61 73 65 64 20 6f 6e 20 69 6e 70 75 74 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 xt.based.on.input...........///.
cc40 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 54 4f 44 4f 3a 20 4d 61 6b </summary>..........//.TODO:.Mak
cc60 65 20 4c 61 74 65 55 70 64 61 74 65 20 61 20 63 6f 72 6f 75 74 69 6e 65 20 69 6e 73 74 65 61 64 e.LateUpdate.a.coroutine.instead
cc80 2e 20 41 6c 6c 6f 77 73 20 75 73 20 74 6f 20 63 6f 6e 74 72 6f 6c 20 74 68 65 20 75 70 64 61 74 ..Allows.us.to.control.the.updat
cca0 65 20 74 6f 20 6f 6e 6c 79 20 62 65 20 77 68 65 6e 20 74 68 65 20 66 69 65 6c 64 20 69 73 20 61 e.to.only.be.when.the.field.is.a
ccc0 63 74 69 76 65 2e 0d 0a 20 20 20 20 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 76 69 72 74 75 61 ctive...........protected.virtua
cce0 6c 20 76 6f 69 64 20 4c 61 74 65 55 70 64 61 74 65 28 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a l.void.LateUpdate()..........{..
cd00 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4f 6e 6c 79 20 61 63 74 69 76 61 74 65 20 69 66 20 ............//.Only.activate.if.
cd20 77 65 20 61 72 65 20 6e 6f 74 20 61 6c 72 65 61 64 79 20 61 63 74 69 76 61 74 65 64 2e 0d 0a 20 we.are.not.already.activated....
cd40 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 53 68 6f 75 6c 64 41 63 74 69 76 61 74 65 4e ...........if.(m_ShouldActivateN
cd60 65 78 74 55 70 64 61 74 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 extUpdate)..............{.......
cd80 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 69 73 46 6f 63 75 73 65 64 29 0d 0a 20 20 20 20 ...........if.(!isFocused)......
cda0 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 ............{...................
cdc0 20 20 20 41 63 74 69 76 61 74 65 49 6e 70 75 74 46 69 65 6c 64 49 6e 74 65 72 6e 61 6c 28 29 3b ...ActivateInputFieldInternal();
cde0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 53 68 6f 75 6c 64 41 63 ......................m_ShouldAc
ce00 74 69 76 61 74 65 4e 65 78 74 55 70 64 61 74 65 20 3d 20 66 61 6c 73 65 3b 0d 0a 20 20 20 20 20 tivateNextUpdate.=.false;.......
ce20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 3b 0d 0a 20 20 20 20 20 20 20 20 ...............return;..........
ce40 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 20 2f 2f 20 ........}....................//.
ce60 52 65 73 65 74 20 61 73 20 77 65 20 61 72 65 20 61 6c 72 65 61 64 79 20 61 63 74 69 76 61 74 65 Reset.as.we.are.already.activate
ce80 64 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 53 68 6f 75 6c 64 41 63 74 69 d...................m_ShouldActi
cea0 76 61 74 65 4e 65 78 74 55 70 64 61 74 65 20 3d 20 66 61 6c 73 65 3b 0d 0a 20 20 20 20 20 20 20 vateNextUpdate.=.false;.........
cec0 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 55 70 64 61 74 65 20 .....}................//.Update.
cee0 53 63 72 6f 6c 6c 62 61 72 20 69 66 20 6e 65 65 64 65 64 0d 0a 20 20 20 20 20 20 20 20 20 20 20 Scrollbar.if.needed.............
cf00 20 69 66 20 28 6d 5f 49 73 53 63 72 6f 6c 6c 62 61 72 55 70 64 61 74 65 52 65 71 75 69 72 65 64 .if.(m_IsScrollbarUpdateRequired
cf20 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 )..............{................
cf40 20 20 55 70 64 61 74 65 53 63 72 6f 6c 6c 62 61 72 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 ..UpdateScrollbar();............
cf60 20 20 20 20 20 20 6d 5f 49 73 53 63 72 6f 6c 6c 62 61 72 55 70 64 61 74 65 52 65 71 75 69 72 65 ......m_IsScrollbarUpdateRequire
cf80 64 20 3d 20 66 61 6c 73 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 d.=.false;..............}.......
cfa0 20 20 20 20 20 20 20 20 20 2f 2f 20 48 61 6e 64 6c 65 20 64 6f 75 62 6c 65 20 63 6c 69 63 6b 20 .........//.Handle.double.click.
cfc0 74 6f 20 72 65 73 65 74 20 2f 20 64 65 73 65 6c 65 63 74 20 49 6e 70 75 74 20 46 69 65 6c 64 20 to.reset./.deselect.Input.Field.
cfe0 77 68 65 6e 20 52 65 73 65 74 4f 6e 41 63 74 69 76 61 74 69 6f 6e 20 69 73 20 66 61 6c 73 65 2e when.ResetOnActivation.is.false.
d000 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 69 73 46 6f 63 75 73 65 64 20 26 26 20 ..............if.(!isFocused.&&.
d020 6d 5f 53 65 6c 65 63 74 69 6f 6e 53 74 69 6c 6c 41 63 74 69 76 65 29 0d 0a 20 20 20 20 20 20 20 m_SelectionStillActive).........
d040 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 47 61 6d 65 4f 62 6a 65 .....{..................GameObje
d060 63 74 20 73 65 6c 65 63 74 65 64 4f 62 6a 65 63 74 20 3d 20 45 76 65 6e 74 53 79 73 74 65 6d 2e ct.selectedObject.=.EventSystem.
d080 63 75 72 72 65 6e 74 20 21 3d 20 6e 75 6c 6c 20 3f 20 45 76 65 6e 74 53 79 73 74 65 6d 2e 63 75 current.!=.null.?.EventSystem.cu
d0a0 72 72 65 6e 74 2e 63 75 72 72 65 6e 74 53 65 6c 65 63 74 65 64 47 61 6d 65 4f 62 6a 65 63 74 20 rrent.currentSelectedGameObject.
d0c0 3a 20 6e 75 6c 6c 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 73 :.null;....................if.(s
d0e0 65 6c 65 63 74 65 64 4f 62 6a 65 63 74 20 21 3d 20 6e 75 6c 6c 20 26 26 20 73 65 6c 65 63 74 65 electedObject.!=.null.&&.selecte
d100 64 4f 62 6a 65 63 74 20 21 3d 20 74 68 69 73 2e 67 61 6d 65 4f 62 6a 65 63 74 29 0d 0a 20 20 20 dObject.!=.this.gameObject).....
d120 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 .............{..................
d140 20 20 20 20 69 66 20 28 73 65 6c 65 63 74 65 64 4f 62 6a 65 63 74 20 21 3d 20 6d 5f 53 65 6c 65 ....if.(selectedObject.!=.m_Sele
d160 63 74 65 64 4f 62 6a 65 63 74 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ctedObject).....................
d180 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 6d 5f 53 65 .{..........................m_Se
d1a0 6c 65 63 74 65 64 4f 62 6a 65 63 74 20 3d 20 73 65 6c 65 63 74 65 64 4f 62 6a 65 63 74 3b 0d 0a lectedObject.=.selectedObject;..
d1c0 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 20 43 68 65 ..........................//.Che
d1e0 63 6b 20 69 66 20 6f 62 6a 65 63 74 20 68 61 73 20 61 20 54 4d 50 20 49 6e 70 75 74 20 46 69 65 ck.if.object.has.a.TMP.Input.Fie
d200 6c 64 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 ld..........................if.(
d220 73 65 6c 65 63 74 65 64 4f 62 6a 65 63 74 2e 47 65 74 43 6f 6d 70 6f 6e 65 6e 74 3c 54 4d 50 5f selectedObject.GetComponent<TMP_
d240 49 6e 70 75 74 46 69 65 6c 64 3e 28 29 20 21 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 InputField>().!=.null)..........
d260 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 ................{...............
d280 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 52 65 6c 65 61 73 65 20 73 65 6c 65 63 74 ...............//.Release.select
d2a0 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 20 20 20 ion.............................
d2c0 20 6d 5f 53 65 6c 65 63 74 69 6f 6e 53 74 69 6c 6c 41 63 74 69 76 65 20 3d 20 66 61 6c 73 65 3b .m_SelectionStillActive.=.false;
d2e0 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 4d 61 ..............................Ma
d300 72 6b 47 65 6f 6d 65 74 72 79 41 73 44 69 72 74 79 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 rkGeometryAsDirty();............
d320 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 53 65 6c 65 63 74 65 64 4f 62 6a 65 ..................m_SelectedObje
d340 63 74 20 3d 20 6e 75 6c 6c 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ct.=.null;......................
d360 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 0d 0a ....}......................}....
d380 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 3b 0d 0a 20 20 20 ....................return;.....
d3a0 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 20 20 .............}..................
d3c0 20 20 69 66 20 28 49 6e 70 75 74 2e 47 65 74 4b 65 79 44 6f 77 6e 28 4b 65 79 43 6f 64 65 2e 4d ..if.(Input.GetKeyDown(KeyCode.M
d3e0 6f 75 73 65 30 29 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 ouse0))..................{......
d400 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 44 6f 75 ................//.Check.for.Dou
d420 62 6c 65 20 43 6c 69 63 6b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 ble.Click......................b
d440 6f 6f 6c 20 69 73 44 6f 75 62 6c 65 43 6c 69 63 6b 20 3d 20 66 61 6c 73 65 3b 0d 0a 20 20 20 20 ool.isDoubleClick.=.false;......
d460 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 74 69 6d 65 53 74 61 6d 70 20 ................float.timeStamp.
d480 3d 20 54 69 6d 65 2e 75 6e 73 63 61 6c 65 64 54 69 6d 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 =.Time.unscaledTime;............
d4a0 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 4b 65 79 44 6f 77 6e 53 74 61 72 74 54 69 ............if.(m_KeyDownStartTi
d4c0 6d 65 20 2b 20 6d 5f 44 6f 75 62 6c 65 43 6c 69 63 6b 44 65 6c 61 79 20 3e 20 74 69 6d 65 53 74 me.+.m_DoubleClickDelay.>.timeSt
d4e0 61 6d 70 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 69 73 amp)..........................is
d500 44 6f 75 62 6c 65 43 6c 69 63 6b 20 3d 20 74 72 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 DoubleClick.=.true;.............
d520 20 20 20 20 20 20 20 20 20 20 20 6d 5f 4b 65 79 44 6f 77 6e 53 74 61 72 74 54 69 6d 65 20 3d 20 ...........m_KeyDownStartTime.=.
d540 74 69 6d 65 53 74 61 6d 70 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 timeStamp;......................
d560 20 20 69 66 20 28 69 73 44 6f 75 62 6c 65 43 6c 69 63 6b 29 0d 0a 20 20 20 20 20 20 20 20 20 20 ..if.(isDoubleClick)............
d580 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 ..........{.....................
d5a0 20 20 20 20 20 2f 2f 6d 5f 53 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 20 3d 20 6d 5f 53 74 72 69 .....//m_StringPosition.=.m_Stri
d5c0 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 20 3d 20 30 3b 0d 0a 20 20 20 20 20 20 20 20 20 ngSelectPosition.=.0;...........
d5e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 6d 5f 43 61 72 65 74 50 6f 73 69 74 69 6f 6e ...............//m_CaretPosition
d600 20 3d 20 6d 5f 43 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 20 3d 20 30 3b 0d 0a 20 .=.m_CaretSelectPosition.=.0;...
d620 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 6d 5f 54 65 78 74 43 .......................//m_TextC
d640 6f 6d 70 6f 6e 65 6e 74 2e 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 6c 6f 63 61 6c 50 6f 73 69 omponent.rectTransform.localPosi
d660 74 69 6f 6e 20 3d 20 6d 5f 44 65 66 61 75 6c 74 54 72 61 6e 73 66 6f 72 6d 50 6f 73 69 74 69 6f tion.=.m_DefaultTransformPositio
d680 6e 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 2f n;............................//
d6a0 69 66 20 28 63 61 72 65 74 52 65 63 74 54 72 61 6e 73 20 21 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 if.(caretRectTrans.!=.null).....
d6c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 63 61 72 65 74 .....................//....caret
d6e0 52 65 63 74 54 72 61 6e 73 2e 6c 6f 63 61 6c 50 6f 73 69 74 69 6f 6e 20 3d 20 56 65 63 74 6f 72 RectTrans.localPosition.=.Vector
d700 33 2e 7a 65 72 6f 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 3.zero;.........................
d720 20 20 20 6d 5f 53 65 6c 65 63 74 69 6f 6e 53 74 69 6c 6c 41 63 74 69 76 65 20 3d 20 66 61 6c 73 ...m_SelectionStillActive.=.fals
d740 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 4d 61 e;............................Ma
d760 72 6b 47 65 6f 6d 65 74 72 79 41 73 44 69 72 74 79 28 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 rkGeometryAsDirty();............
d780 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 3b 0d 0a 20 20 20 20 20 20 20 ................return;.........
d7a0 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 .............}..................
d7c0 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 20 20 20 20 20 20 20 }..............}................
d7e0 69 66 20 28 49 6e 50 6c 61 63 65 45 64 69 74 69 6e 67 28 29 20 26 26 20 69 73 4b 65 79 62 6f 61 if.(InPlaceEditing().&&.isKeyboa
d800 72 64 55 73 69 6e 67 45 76 65 6e 74 73 28 29 20 7c 7c 20 21 69 73 46 6f 63 75 73 65 64 29 0d 0a rdUsingEvents().||.!isFocused)..
d820 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 72 ............{..................r
d840 65 74 75 72 6e 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 eturn;..............}...........
d860 20 20 20 20 20 41 73 73 69 67 6e 50 6f 73 69 74 69 6f 6e 69 6e 67 49 66 4e 65 65 64 65 64 28 29 .....AssignPositioningIfNeeded()
d880 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 53 6f 66 74 4b 65 79 62 6f ;................if.(m_SoftKeybo
d8a0 61 72 64 20 3d 3d 20 6e 75 6c 6c 20 7c 7c 20 6d 5f 53 6f 66 74 4b 65 79 62 6f 61 72 64 2e 73 74 ard.==.null.||.m_SoftKeyboard.st
d8c0 61 74 75 73 20 21 3d 20 54 6f 75 63 68 53 63 72 65 65 6e 4b 65 79 62 6f 61 72 64 2e 53 74 61 74 atus.!=.TouchScreenKeyboard.Stat
d8e0 75 73 2e 56 69 73 69 62 6c 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 us.Visible)..............{......
d900 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 53 6f 66 74 4b 65 79 62 6f 61 72 64 20 21 ............if.(m_SoftKeyboard.!
d920 3d 20 6e 75 6c 6c 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 =.null)..................{......
d940 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 6d 5f 52 65 61 64 4f 6e 6c 79 29 ................if.(!m_ReadOnly)
d960 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 65 78 74 20 3d ..........................text.=
d980 20 6d 5f 53 6f 66 74 4b 65 79 62 6f 61 72 64 2e 74 65 78 74 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 .m_SoftKeyboard.text;...........
d9a0 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 53 6f 66 74 4b 65 79 62 6f 61 72 64 2e .............if.(m_SoftKeyboard.
d9c0 73 74 61 74 75 73 20 3d 3d 20 54 6f 75 63 68 53 63 72 65 65 6e 4b 65 79 62 6f 61 72 64 2e 53 74 status.==.TouchScreenKeyboard.St
d9e0 61 74 75 73 2e 4c 6f 73 74 46 6f 63 75 73 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 atus.LostFocus).................
da00 20 20 20 20 20 20 20 20 20 53 65 6e 64 54 6f 75 63 68 53 63 72 65 65 6e 4b 65 79 62 6f 61 72 64 .........SendTouchScreenKeyboard
da20 53 74 61 74 75 73 43 68 61 6e 67 65 64 28 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 StatusChanged();................
da40 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 53 6f 66 74 4b 65 79 62 6f 61 72 64 2e 73 74 61 74 75 ........if.(m_SoftKeyboard.statu
da60 73 20 3d 3d 20 54 6f 75 63 68 53 63 72 65 65 6e 4b 65 79 62 6f 61 72 64 2e 53 74 61 74 75 73 2e s.==.TouchScreenKeyboard.Status.
da80 43 61 6e 63 65 6c 65 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b Canceled)......................{
daa0 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 6d 5f 52 65 6c 65 ..........................m_Rele
dac0 61 73 65 53 65 6c 65 63 74 69 6f 6e 20 3d 20 74 72 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 aseSelection.=.true;............
dae0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 57 61 73 43 61 6e 63 65 6c 65 64 20 3d 20 74 72 ..............m_WasCanceled.=.tr
db00 75 65 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 53 65 6e ue;..........................Sen
db20 64 54 6f 75 63 68 53 63 72 65 65 6e 4b 65 79 62 6f 61 72 64 53 74 61 74 75 73 43 68 61 6e 67 65 dTouchScreenKeyboardStatusChange
db40 64 28 29 3b 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 0d 0a 20 d();......................}.....
db60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 53 6f 66 74 4b 65 79 ...................if.(m_SoftKey
db80 62 6f 61 72 64 2e 73 74 61 74 75 73 20 3d 3d 20 54 6f 75 63 68 53 63 72 65 65 6e 4b 65 79 62 6f board.status.==.TouchScreenKeybo
dba0 61 72 64 2e 53 74 61 74 75 73 2e 44 6f 6e 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ard.Status.Done)................
dbc0 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 ......{.........................
dbe0 20 6d 5f 52 65 6c 65 61 73 65 53 65 6c 65 63 74 69 6f 6e 20 3d 20 74 72 75 65 3b 0d 0a 20 20 20 .m_ReleaseSelection.=.true;.....
dc00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4f 6e 53 75 62 6d 69 74 28 6e 75 .....................OnSubmit(nu
dc20 6c 6c 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 53 65 ll);..........................Se
dc40 6e 64 54 6f 75 63 68 53 63 72 65 65 6e 4b 65 79 62 6f 61 72 64 53 74 61 74 75 73 43 68 61 6e 67 ndTouchScreenKeyboardStatusChang
dc60 65 64 28 29 3b 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 ed();......................}....
dc80 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 20 ..............}.................
dca0 20 20 20 4f 6e 44 65 73 65 6c 65 63 74 28 6e 75 6c 6c 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 ...OnDeselect(null);............
dcc0 20 20 20 20 20 20 72 65 74 75 72 6e 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a ......return;..............}....
dce0 20 20 20 20 20 20 20 20 20 20 20 20 73 74 72 69 6e 67 20 76 61 6c 20 3d 20 6d 5f 53 6f 66 74 4b ............string.val.=.m_SoftK
dd00 65 79 62 6f 61 72 64 2e 74 65 78 74 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 eyboard.text;................if.
dd20 28 6d 5f 54 65 78 74 20 21 3d 20 76 61 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a (m_Text.!=.val)..............{..
dd40 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 52 65 61 64 4f 6e 6c 79 29 0d ................if.(m_ReadOnly).
dd60 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 .................{..............
dd80 20 20 20 20 20 20 20 20 6d 5f 53 6f 66 74 4b 65 79 62 6f 61 72 64 2e 74 65 78 74 20 3d 20 6d 5f ........m_SoftKeyboard.text.=.m_
dda0 54 65 78 74 3b 0d 0a 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 Text;..................}........
ddc0 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 20 20 20 20 ..........else..................
dde0 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 54 65 78 74 20 3d 20 {......................m_Text.=.
de00 22 22 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 66 6f 72 20 28 "";........................for.(
de20 69 6e 74 20 69 20 3d 20 30 3b 20 69 20 3c 20 76 61 6c 2e 4c 65 6e 67 74 68 3b 20 2b 2b 69 29 0d int.i.=.0;.i.<.val.Length;.++i).
de40 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 .....................{..........
de60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 68 61 72 20 63 20 3d 20 76 61 6c 5b 69 5d 3b ................char.c.=.val[i];
de80 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 69 66 20 28 ............................if.(
dea0 63 20 3d 3d 20 27 5c 72 27 20 7c 7c 20 28 69 6e 74 29 63 20 3d 3d 20 33 29 0d 0a 20 20 20 20 20 c.==.'\r'.||.(int)c.==.3).......
dec0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 20 3d 20 27 5c 6e 27 3b .......................c.=.'\n';
dee0 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 69 66 20 28 ............................if.(
df00 6f 6e 56 61 6c 69 64 61 74 65 49 6e 70 75 74 20 21 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 onValidateInput.!=.null)........
df20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 20 3d 20 6f 6e 56 61 6c 69 ......................c.=.onVali
df40 64 61 74 65 49 6e 70 75 74 28 6d 5f 54 65 78 74 2c 20 6d 5f 54 65 78 74 2e 4c 65 6e 67 74 68 2c dateInput(m_Text,.m_Text.Length,
df60 20 63 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 65 6c .c);..........................el
df80 73 65 20 69 66 20 28 63 68 61 72 61 63 74 65 72 56 61 6c 69 64 61 74 69 6f 6e 20 21 3d 20 43 68 se.if.(characterValidation.!=.Ch
dfa0 61 72 61 63 74 65 72 56 61 6c 69 64 61 74 69 6f 6e 2e 4e 6f 6e 65 29 0d 0a 20 20 20 20 20 20 20 aracterValidation.None).........
dfc0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 20 3d 20 56 61 6c 69 64 61 74 .....................c.=.Validat
dfe0 65 28 6d 5f 54 65 78 74 2c 20 6d 5f 54 65 78 74 2e 4c 65 6e 67 74 68 2c 20 63 29 3b 0d 0a 0d 0a e(m_Text,.m_Text.Length,.c);....
e000 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 6c 69 6e 65 ........................if.(line
e020 54 79 70 65 20 3d 3d 20 4c 69 6e 65 54 79 70 65 2e 4d 75 6c 74 69 4c 69 6e 65 53 75 62 6d 69 74 Type.==.LineType.MultiLineSubmit
e040 20 26 26 20 63 20 3d 3d 20 27 5c 6e 27 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .&&.c.==.'\n')..................
e060 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 ........{.......................
e080 20 20 20 20 20 20 20 6d 5f 53 6f 66 74 4b 65 79 62 6f 61 72 64 2e 74 65 78 74 20 3d 20 6d 5f 54 .......m_SoftKeyboard.text.=.m_T
e0a0 65 78 74 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 ext;............................
e0c0 20 20 20 20 4f 6e 53 75 62 6d 69 74 28 6e 75 6c 6c 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ....OnSubmit(null);.............
e0e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4f 6e 44 65 73 65 6c 65 63 74 28 6e 75 6c 6c .................OnDeselect(null
e100 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 20 20 );..............................
e120 72 65 74 75 72 6e 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 return;.........................
e140 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 20 20 20 20 69 66 .}............................if
e160 20 28 63 20 21 3d 20 30 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .(c.!=.0).......................
e180 20 20 20 20 20 20 20 6d 5f 54 65 78 74 20 2b 3d 20 63 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 .......m_Text.+=.c;.............
e1a0 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 20 20 20 .........}......................
e1c0 20 20 69 66 20 28 63 68 61 72 61 63 74 65 72 4c 69 6d 69 74 20 3e 20 30 20 26 26 20 6d 5f 54 65 ..if.(characterLimit.>.0.&&.m_Te
e1e0 78 74 2e 4c 65 6e 67 74 68 20 3e 20 63 68 61 72 61 63 74 65 72 4c 69 6d 69 74 29 0d 0a 20 20 20 xt.Length.>.characterLimit).....
e200 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 54 65 78 74 20 3d 20 6d 5f .....................m_Text.=.m_
e220 54 65 78 74 2e 53 75 62 73 74 72 69 6e 67 28 30 2c 20 63 68 61 72 61 63 74 65 72 4c 69 6d 69 74 Text.Substring(0,.characterLimit
e240 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 55 70 64 61 74 65 );........................Update
e260 53 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 46 72 6f 6d 4b 65 79 62 6f 61 72 64 28 29 3b 0d 0a 0d StringPositionFromKeyboard();...
e280 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 53 65 74 20 6b 65 79 62 .....................//.Set.keyb
e2a0 6f 61 72 64 20 74 65 78 74 20 62 65 66 6f 72 65 20 75 70 64 61 74 69 6e 67 20 6c 61 62 65 6c 2c oard.text.before.updating.label,
e2c0 20 61 73 20 77 65 20 6d 69 67 68 74 20 68 61 76 65 20 63 68 61 6e 67 65 64 20 69 74 20 77 69 74 .as.we.might.have.changed.it.wit
e2e0 68 20 76 61 6c 69 64 61 74 69 6f 6e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 h.validation....................
e300 20 20 2f 2f 20 61 6e 64 20 75 70 64 61 74 65 20 6c 61 62 65 6c 20 77 69 6c 6c 20 74 61 6b 65 20 ..//.and.update.label.will.take.
e320 74 68 65 20 6f 6c 64 20 76 61 6c 75 65 20 66 72 6f 6d 20 6b 65 79 62 6f 61 72 64 20 69 66 20 77 the.old.value.from.keyboard.if.w
e340 65 20 64 6f 6e 27 74 20 63 68 61 6e 67 65 20 69 74 20 68 65 72 65 0d 0a 20 20 20 20 20 20 20 20 e.don't.change.it.here..........
e360 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 54 65 78 74 20 21 3d 20 76 61 6c 29 0d 0a ............if.(m_Text.!=.val)..
e380 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 53 6f 66 74 4b 65 ........................m_SoftKe
e3a0 79 62 6f 61 72 64 2e 74 65 78 74 20 3d 20 6d 5f 54 65 78 74 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 yboard.text.=.m_Text;...........
e3c0 20 20 20 20 20 20 20 20 20 20 20 20 20 53 65 6e 64 4f 6e 56 61 6c 75 65 43 68 61 6e 67 65 64 41 .............SendOnValueChangedA
e3e0 6e 64 55 70 64 61 74 65 4c 61 62 65 6c 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ndUpdateLabel();................
e400 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 20 20 20 20 20 20 ..}..............}..............
e420 65 6c 73 65 20 69 66 20 28 6d 5f 48 69 64 65 4d 6f 62 69 6c 65 49 6e 70 75 74 20 26 26 20 41 70 else.if.(m_HideMobileInput.&&.Ap
e440 70 6c 69 63 61 74 69 6f 6e 2e 70 6c 61 74 66 6f 72 6d 20 3d 3d 20 52 75 6e 74 69 6d 65 50 6c 61 plication.platform.==.RuntimePla
e460 74 66 6f 72 6d 2e 41 6e 64 72 6f 69 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 tform.Android)..............{...
e480 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 55 70 64 61 74 65 53 74 72 69 6e 67 50 6f 73 69 74 ...............UpdateStringPosit
e4a0 69 6f 6e 46 72 6f 6d 4b 65 79 62 6f 61 72 64 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 ionFromKeyboard();..............
e4c0 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 65 6c 73 65 20 69 66 20 28 6d 5f 48 69 }................//else.if.(m_Hi
e4e0 64 65 4d 6f 62 69 6c 65 49 6e 70 75 74 29 20 2f 2f 20 6d 5f 4b 65 79 62 6f 61 72 64 2e 63 61 6e deMobileInput).//.m_Keyboard.can
e500 53 65 74 53 65 6c 65 63 74 69 6f 6e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 7b 0d 0a 20 SetSelection..............//{...
e520 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 69 6e 74 20 6c 65 6e 67 74 68 20 3d 20 73 74 ...........//....int.length.=.st
e540 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3c 20 73 74 72 69 6e 67 53 65 6c ringPositionInternal.<.stringSel
e560 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3f 20 73 74 72 69 6e 67 53 65 6c 65 ectPositionInternal.?.stringSele
e580 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2d 20 73 74 72 69 6e 67 50 6f 73 69 74 ctPositionInternal.-.stringPosit
e5a0 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3a 20 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 ionInternal.:.stringPositionInte
e5c0 72 6e 61 6c 20 2d 20 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 rnal.-.stringSelectPositionInter
e5e0 6e 61 6c 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 6d 5f 53 6f 66 74 4b 65 nal;..............//....m_SoftKe
e600 79 62 6f 61 72 64 2e 73 65 6c 65 63 74 69 6f 6e 20 3d 20 6e 65 77 20 52 61 6e 67 65 49 6e 74 28 yboard.selection.=.new.RangeInt(
e620 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3c 20 73 74 72 69 6e 67 53 stringPositionInternal.<.stringS
e640 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3f 20 73 74 72 69 6e 67 50 6f electPositionInternal.?.stringPo
e660 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3a 20 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 sitionInternal.:.stringSelectPos
e680 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 2c 20 6c 65 6e 67 74 68 29 3b 0d 0a 20 20 20 20 20 20 20 itionInternal,.length);.........
e6a0 20 20 20 20 20 2f 2f 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 65 6c 73 65 20 69 66 20 .....//}..............//else.if.
e6c0 28 21 6d 5f 48 69 64 65 4d 6f 62 69 6c 65 49 6e 70 75 74 29 20 2f 2f 20 6d 5f 4b 65 79 62 6f 61 (!m_HideMobileInput).//.m_Keyboa
e6e0 72 64 2e 63 61 6e 47 65 74 53 65 6c 65 63 74 69 6f 6e 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 rd.canGetSelection).............
e700 20 2f 2f 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 55 70 64 61 74 65 53 74 .//{..............//....UpdateSt
e720 72 69 6e 67 50 6f 73 69 74 69 6f 6e 46 72 6f 6d 4b 65 79 62 6f 61 72 64 28 29 3b 0d 0a 20 20 20 ringPositionFromKeyboard();.....
e740 20 20 20 20 20 20 20 20 20 2f 2f 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 .........//}................if.(
e760 6d 5f 53 6f 66 74 4b 65 79 62 6f 61 72 64 2e 73 74 61 74 75 73 20 21 3d 20 54 6f 75 63 68 53 63 m_SoftKeyboard.status.!=.TouchSc
e780 72 65 65 6e 4b 65 79 62 6f 61 72 64 2e 53 74 61 74 75 73 2e 56 69 73 69 62 6c 65 29 0d 0a 20 20 reenKeyboard.Status.Visible)....
e7a0 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 69 66 20 ..........{..................if.
e7c0 28 6d 5f 53 6f 66 74 4b 65 79 62 6f 61 72 64 2e 73 74 61 74 75 73 20 3d 3d 20 54 6f 75 63 68 53 (m_SoftKeyboard.status.==.TouchS
e7e0 63 72 65 65 6e 4b 65 79 62 6f 61 72 64 2e 53 74 61 74 75 73 2e 43 61 6e 63 65 6c 65 64 29 0d 0a creenKeyboard.Status.Canceled)..
e800 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 57 61 73 43 61 6e 63 65 6c 65 ....................m_WasCancele
e820 64 20 3d 20 74 72 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4f 6e 44 d.=.true;....................OnD
e840 65 73 65 6c 65 63 74 28 6e 75 6c 6c 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 eselect(null);..............}...
e860 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 62 6f .......}..............private.bo
e880 6f 6c 20 4d 61 79 44 72 61 67 28 50 6f 69 6e 74 65 72 45 76 65 6e 74 44 61 74 61 20 65 76 65 6e ol.MayDrag(PointerEventData.even
e8a0 74 44 61 74 61 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 72 tData)..........{..............r
e8c0 65 74 75 72 6e 20 49 73 41 63 74 69 76 65 28 29 20 26 26 0d 0a 20 20 20 20 20 20 20 20 20 20 20 eturn.IsActive().&&.............
e8e0 20 20 20 20 20 20 20 20 49 73 49 6e 74 65 72 61 63 74 61 62 6c 65 28 29 20 26 26 0d 0a 20 20 20 ........IsInteractable().&&.....
e900 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 65 76 65 6e 74 44 61 74 61 2e 62 75 74 74 6f 6e ................eventData.button
e920 20 3d 3d 20 50 6f 69 6e 74 65 72 45 76 65 6e 74 44 61 74 61 2e 49 6e 70 75 74 42 75 74 74 6f 6e .==.PointerEventData.InputButton
e940 2e 4c 65 66 74 20 26 26 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 54 .Left.&&.....................m_T
e960 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 20 21 3d 20 6e 75 6c 6c 20 26 26 0d 0a 20 20 20 20 20 20 20 extComponent.!=.null.&&.........
e980 20 20 20 20 20 20 20 20 20 20 20 20 28 6d 5f 53 6f 66 74 4b 65 79 62 6f 61 72 64 20 3d 3d 20 6e ............(m_SoftKeyboard.==.n
e9a0 75 6c 6c 20 7c 7c 20 73 68 6f 75 6c 64 48 69 64 65 53 6f 66 74 4b 65 79 62 6f 61 72 64 20 7c 7c ull.||.shouldHideSoftKeyboard.||
e9c0 20 73 68 6f 75 6c 64 48 69 64 65 4d 6f 62 69 6c 65 49 6e 70 75 74 29 3b 0d 0a 20 20 20 20 20 20 .shouldHideMobileInput);........
e9e0 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 76 69 72 74 75 61 6c 20 76 6f ..}............public.virtual.vo
ea00 69 64 20 4f 6e 42 65 67 69 6e 44 72 61 67 28 50 6f 69 6e 74 65 72 45 76 65 6e 74 44 61 74 61 20 id.OnBeginDrag(PointerEventData.
ea20 65 76 65 6e 74 44 61 74 61 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 eventData)..........{...........
ea40 20 20 20 69 66 20 28 21 4d 61 79 44 72 61 67 28 65 76 65 6e 74 44 61 74 61 29 29 0d 0a 20 20 20 ...if.(!MayDrag(eventData)).....
ea60 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 .............return;............
ea80 20 20 20 20 6d 5f 55 70 64 61 74 65 44 72 61 67 20 3d 20 74 72 75 65 3b 0d 0a 20 20 20 20 20 20 ....m_UpdateDrag.=.true;........
eaa0 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 76 69 72 74 75 61 6c 20 76 6f ..}............public.virtual.vo
eac0 69 64 20 4f 6e 44 72 61 67 28 50 6f 69 6e 74 65 72 45 76 65 6e 74 44 61 74 61 20 65 76 65 6e 74 id.OnDrag(PointerEventData.event
eae0 44 61 74 61 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 66 Data)..........{..............if
eb00 20 28 21 4d 61 79 44 72 61 67 28 65 76 65 6e 74 44 61 74 61 29 29 0d 0a 20 20 20 20 20 20 20 20 .(!MayDrag(eventData))..........
eb20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 ........return;................i
eb40 6e 74 20 69 6e 73 65 72 74 69 6f 6e 49 6e 64 65 78 20 3d 20 54 4d 50 5f 54 65 78 74 55 74 69 6c nt.insertionIndex.=.TMP_TextUtil
eb60 69 74 69 65 73 2e 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 ities.GetCursorIndexFromPosition
eb80 28 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2c 20 65 76 65 6e 74 44 61 74 61 2e 70 6f 73 69 (m_TextComponent,.eventData.posi
eba0 74 69 6f 6e 2c 20 65 76 65 6e 74 44 61 74 61 2e 70 72 65 73 73 45 76 65 6e 74 43 61 6d 65 72 61 tion,.eventData.pressEventCamera
ebc0 2c 20 6f 75 74 20 43 61 72 65 74 50 6f 73 69 74 69 6f 6e 20 69 6e 73 65 72 74 69 6f 6e 53 69 64 ,.out.CaretPosition.insertionSid
ebe0 65 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 69 73 52 69 63 68 54 e);................if.(m_isRichT
ec00 65 78 74 45 64 69 74 69 6e 67 41 6c 6c 6f 77 65 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 extEditingAllowed)..............
ec20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 69 6e 73 65 72 74 69 6f 6e {..................if.(insertion
ec40 53 69 64 65 20 3d 3d 20 43 61 72 65 74 50 6f 73 69 74 69 6f 6e 2e 4c 65 66 74 29 0d 0a 20 20 20 Side.==.CaretPosition.Left).....
ec60 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 .............{..................
ec80 20 20 20 20 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c ....stringSelectPositionInternal
eca0 20 3d 20 6d 5f 54 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 .=.m_TextComponent.textInfo.char
ecc0 61 63 74 65 72 49 6e 66 6f 5b 69 6e 73 65 72 74 69 6f 6e 49 6e 64 65 78 5d 2e 69 6e 64 65 78 3b acterInfo[insertionIndex].index;
ece0 0d 0a 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 ..................}.............
ed00 20 20 20 20 20 65 6c 73 65 20 69 66 20 28 69 6e 73 65 72 74 69 6f 6e 53 69 64 65 20 3d 3d 20 43 .....else.if.(insertionSide.==.C
ed20 61 72 65 74 50 6f 73 69 74 69 6f 6e 2e 52 69 67 68 74 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 aretPosition.Right).............
ed40 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 73 74 72 69 .....{......................stri
ed60 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 6d 5f 54 65 78 ngSelectPositionInternal.=.m_Tex
ed80 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 66 tComponent.textInfo.characterInf
eda0 6f 5b 69 6e 73 65 72 74 69 6f 6e 49 6e 64 65 78 5d 2e 69 6e 64 65 78 20 2b 20 6d 5f 54 65 78 74 o[insertionIndex].index.+.m_Text
edc0 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 66 6f Component.textInfo.characterInfo
ede0 5b 69 6e 73 65 72 74 69 6f 6e 49 6e 64 65 78 5d 2e 73 74 72 69 6e 67 4c 65 6e 67 74 68 3b 0d 0a [insertionIndex].stringLength;..
ee00 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 20 7d ................}..............}
ee20 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 20 20 20 20 20 20 20 ..............else..............
ee40 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 69 6e 73 65 72 74 69 6f 6e {..................if.(insertion
ee60 53 69 64 65 20 3d 3d 20 43 61 72 65 74 50 6f 73 69 74 69 6f 6e 2e 4c 65 66 74 29 0d 0a 20 20 20 Side.==.CaretPosition.Left).....
ee80 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 .............{..................
eea0 20 20 20 20 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c ....stringSelectPositionInternal
eec0 20 3d 20 69 6e 73 65 72 74 69 6f 6e 49 6e 64 65 78 20 3d 3d 20 30 0d 0a 20 20 20 20 20 20 20 20 .=.insertionIndex.==.0..........
eee0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 3f 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e ................?.m_TextComponen
ef00 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 30 5d 2e 69 6e 64 65 t.textInfo.characterInfo[0].inde
ef20 78 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 3a 20 6d 5f 54 x..........................:.m_T
ef40 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 74 65 72 49 extComponent.textInfo.characterI
ef60 6e 66 6f 5b 69 6e 73 65 72 74 69 6f 6e 49 6e 64 65 78 20 2d 20 31 5d 2e 69 6e 64 65 78 20 2b 20 nfo[insertionIndex.-.1].index.+.
ef80 6d 5f 54 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 74 m_TextComponent.textInfo.charact
efa0 65 72 49 6e 66 6f 5b 69 6e 73 65 72 74 69 6f 6e 49 6e 64 65 78 20 2d 20 31 5d 2e 73 74 72 69 6e erInfo[insertionIndex.-.1].strin
efc0 67 4c 65 6e 67 74 68 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 gLength;..................}.....
efe0 20 20 20 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 20 69 66 20 28 69 6e 73 65 72 74 69 6f 6e 53 .............else.if.(insertionS
f000 69 64 65 20 3d 3d 20 43 61 72 65 74 50 6f 73 69 74 69 6f 6e 2e 52 69 67 68 74 29 0d 0a 20 20 20 ide.==.CaretPosition.Right).....
f020 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 .............{..................
f040 20 20 20 20 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c ....stringSelectPositionInternal
f060 20 3d 20 6d 5f 54 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 .=.m_TextComponent.textInfo.char
f080 61 63 74 65 72 49 6e 66 6f 5b 69 6e 73 65 72 74 69 6f 6e 49 6e 64 65 78 5d 2e 69 6e 64 65 78 20 acterInfo[insertionIndex].index.
f0a0 2b 20 6d 5f 54 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 +.m_TextComponent.textInfo.chara
f0c0 63 74 65 72 49 6e 66 6f 5b 69 6e 73 65 72 74 69 6f 6e 49 6e 64 65 78 5d 2e 73 74 72 69 6e 67 4c cterInfo[insertionIndex].stringL
f0e0 65 6e 67 74 68 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 ength;..................}.......
f100 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 63 61 72 65 74 53 65 6c .......}................caretSel
f120 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 47 65 74 43 61 72 65 74 50 6f ectPositionInternal.=.GetCaretPo
f140 73 69 74 69 6f 6e 46 72 6f 6d 53 74 72 69 6e 67 49 6e 64 65 78 28 73 74 72 69 6e 67 53 65 6c 65 sitionFromStringIndex(stringSele
f160 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 ctPositionInternal);............
f180 20 20 20 20 4d 61 72 6b 47 65 6f 6d 65 74 72 79 41 73 44 69 72 74 79 28 29 3b 0d 0a 0d 0a 20 20 ....MarkGeometryAsDirty();......
f1a0 20 20 20 20 20 20 20 20 20 20 6d 5f 44 72 61 67 50 6f 73 69 74 69 6f 6e 4f 75 74 4f 66 42 6f 75 ..........m_DragPositionOutOfBou
f1c0 6e 64 73 20 3d 20 21 52 65 63 74 54 72 61 6e 73 66 6f 72 6d 55 74 69 6c 69 74 79 2e 52 65 63 74 nds.=.!RectTransformUtility.Rect
f1e0 61 6e 67 6c 65 43 6f 6e 74 61 69 6e 73 53 63 72 65 65 6e 50 6f 69 6e 74 28 74 65 78 74 56 69 65 angleContainsScreenPoint(textVie
f200 77 70 6f 72 74 2c 20 65 76 65 6e 74 44 61 74 61 2e 70 6f 73 69 74 69 6f 6e 2c 20 65 76 65 6e 74 wport,.eventData.position,.event
f220 44 61 74 61 2e 70 72 65 73 73 45 76 65 6e 74 43 61 6d 65 72 61 29 3b 0d 0a 20 20 20 20 20 20 20 Data.pressEventCamera);.........
f240 20 20 20 20 20 69 66 20 28 6d 5f 44 72 61 67 50 6f 73 69 74 69 6f 6e 4f 75 74 4f 66 42 6f 75 6e .....if.(m_DragPositionOutOfBoun
f260 64 73 20 26 26 20 6d 5f 44 72 61 67 43 6f 72 6f 75 74 69 6e 65 20 3d 3d 20 6e 75 6c 6c 29 0d 0a ds.&&.m_DragCoroutine.==.null)..
f280 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 44 72 61 67 43 6f 72 6f 75 74 69 6e 65 20 ................m_DragCoroutine.
f2a0 3d 20 53 74 61 72 74 43 6f 72 6f 75 74 69 6e 65 28 4d 6f 75 73 65 44 72 61 67 4f 75 74 73 69 64 =.StartCoroutine(MouseDragOutsid
f2c0 65 52 65 63 74 28 65 76 65 6e 74 44 61 74 61 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 eRect(eventData));..............
f2e0 20 20 65 76 65 6e 74 44 61 74 61 2e 55 73 65 28 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 ..eventData.Use();..............
f300 20 20 23 69 66 20 54 4d 50 5f 44 45 42 55 47 5f 4d 4f 44 45 0d 0a 20 20 20 20 20 20 20 20 20 20 ..#if.TMP_DEBUG_MODE............
f320 20 20 20 20 20 20 44 65 62 75 67 2e 4c 6f 67 28 22 43 61 72 65 74 20 50 6f 73 69 74 69 6f 6e 3a ......Debug.Log("Caret.Position:
f340 20 22 20 2b 20 63 61 72 65 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2b 20 22 20 53 .".+.caretPositionInternal.+.".S
f360 65 6c 65 63 74 69 6f 6e 20 50 6f 73 69 74 69 6f 6e 3a 20 22 20 2b 20 63 61 72 65 74 53 65 6c 65 election.Position:.".+.caretSele
f380 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2b 20 22 20 20 53 74 72 69 6e 67 20 50 ctPositionInternal.+."..String.P
f3a0 6f 73 69 74 69 6f 6e 3a 20 22 20 2b 20 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 osition:.".+.stringPositionInter
f3c0 6e 61 6c 20 2b 20 22 20 53 74 72 69 6e 67 20 53 65 6c 65 63 74 20 50 6f 73 69 74 69 6f 6e 3a 20 nal.+.".String.Select.Position:.
f3e0 22 20 2b 20 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c ".+.stringSelectPositionInternal
f400 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 23 65 6e 64 69 66 0d 0a 20 20 20 20 20 20 20 20 );..............#endif..........
f420 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 49 45 6e 75 6d 65 72 61 74 6f 72 20 4d 6f 75 73 65 44 72 }............IEnumerator.MouseDr
f440 61 67 4f 75 74 73 69 64 65 52 65 63 74 28 50 6f 69 6e 74 65 72 45 76 65 6e 74 44 61 74 61 20 65 agOutsideRect(PointerEventData.e
f460 76 65 6e 74 44 61 74 61 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 ventData)..........{............
f480 20 20 77 68 69 6c 65 20 28 6d 5f 55 70 64 61 74 65 44 72 61 67 20 26 26 20 6d 5f 44 72 61 67 50 ..while.(m_UpdateDrag.&&.m_DragP
f4a0 6f 73 69 74 69 6f 6e 4f 75 74 4f 66 42 6f 75 6e 64 73 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ositionOutOfBounds).............
f4c0 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 52 65 63 74 54 72 61 6e 73 66 6f 72 .{..................RectTransfor
f4e0 6d 55 74 69 6c 69 74 79 2e 53 63 72 65 65 6e 50 6f 69 6e 74 54 6f 4c 6f 63 61 6c 50 6f 69 6e 74 mUtility.ScreenPointToLocalPoint
f500 49 6e 52 65 63 74 61 6e 67 6c 65 28 74 65 78 74 56 69 65 77 70 6f 72 74 2c 20 65 76 65 6e 74 44 InRectangle(textViewport,.eventD
f520 61 74 61 2e 70 6f 73 69 74 69 6f 6e 2c 20 65 76 65 6e 74 44 61 74 61 2e 70 72 65 73 73 45 76 65 ata.position,.eventData.pressEve
f540 6e 74 43 61 6d 65 72 61 2c 20 6f 75 74 20 56 65 63 74 6f 72 32 20 6c 6f 63 61 6c 4d 6f 75 73 65 ntCamera,.out.Vector2.localMouse
f560 50 6f 73 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 52 65 63 74 20 72 65 Pos);....................Rect.re
f580 63 74 20 3d 20 74 65 78 74 56 69 65 77 70 6f 72 74 2e 72 65 63 74 3b 0d 0a 0d 0a 20 20 20 20 20 ct.=.textViewport.rect;.........
f5a0 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 75 6c 74 69 4c 69 6e 65 29 0d 0a 20 20 20 20 20 ...........if.(multiLine).......
f5c0 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 ...........{....................
f5e0 20 20 69 66 20 28 6c 6f 63 61 6c 4d 6f 75 73 65 50 6f 73 2e 79 20 3e 20 72 65 63 74 2e 79 4d 61 ..if.(localMousePos.y.>.rect.yMa
f600 78 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 4d 6f 76 65 x)..........................Move
f620 55 70 28 74 72 75 65 2c 20 74 72 75 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 Up(true,.true);.................
f640 20 20 20 20 20 65 6c 73 65 20 69 66 20 28 6c 6f 63 61 6c 4d 6f 75 73 65 50 6f 73 2e 79 20 3c 20 .....else.if.(localMousePos.y.<.
f660 72 65 63 74 2e 79 4d 69 6e 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 rect.yMin)......................
f680 20 20 20 20 4d 6f 76 65 44 6f 77 6e 28 74 72 75 65 2c 20 74 72 75 65 29 3b 0d 0a 20 20 20 20 20 ....MoveDown(true,.true);.......
f6a0 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 65 6c ...........}..................el
f6c0 73 65 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 se..................{...........
f6e0 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6c 6f 63 61 6c 4d 6f 75 73 65 50 6f 73 2e 78 20 3c ...........if.(localMousePos.x.<
f700 20 72 65 63 74 2e 78 4d 69 6e 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .rect.xMin).....................
f720 20 20 20 20 20 4d 6f 76 65 4c 65 66 74 28 74 72 75 65 2c 20 66 61 6c 73 65 29 3b 0d 0a 20 20 20 .....MoveLeft(true,.false);.....
f740 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 6c 6f 63 61 6c 4d .................else.if.(localM
f760 6f 75 73 65 50 6f 73 2e 78 20 3e 20 72 65 63 74 2e 78 4d 61 78 29 0d 0a 20 20 20 20 20 20 20 20 ousePos.x.>.rect.xMax)..........
f780 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4d 6f 76 65 52 69 67 68 74 28 74 72 75 65 2c 20 ................MoveRight(true,.
f7a0 66 61 6c 73 65 29 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 false);..................}......
f7c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 55 70 64 61 74 65 4c 61 62 65 6c 28 29 3b 0d 0a 0d 0a ..............UpdateLabel();....
f7e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 64 65 6c 61 79 20 3d 20 6d 75 ................float.delay.=.mu
f800 6c 74 69 4c 69 6e 65 20 3f 20 6b 56 53 63 72 6f 6c 6c 53 70 65 65 64 20 3a 20 6b 48 53 63 72 6f ltiLine.?.kVScrollSpeed.:.kHScro
f820 6c 6c 53 70 65 65 64 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 llSpeed;....................if.(
f840 6d 5f 57 61 69 74 46 6f 72 53 65 63 6f 6e 64 73 52 65 61 6c 74 69 6d 65 20 3d 3d 20 6e 75 6c 6c m_WaitForSecondsRealtime.==.null
f860 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 57 61 69 74 46 6f 72 )......................m_WaitFor
f880 53 65 63 6f 6e 64 73 52 65 61 6c 74 69 6d 65 20 3d 20 6e 65 77 20 57 61 69 74 46 6f 72 53 65 63 SecondsRealtime.=.new.WaitForSec
f8a0 6f 6e 64 73 52 65 61 6c 74 69 6d 65 28 64 65 6c 61 79 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 ondsRealtime(delay);............
f8c0 20 20 20 20 20 20 65 6c 73 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ......else......................
f8e0 6d 5f 57 61 69 74 46 6f 72 53 65 63 6f 6e 64 73 52 65 61 6c 74 69 6d 65 2e 77 61 69 74 54 69 6d m_WaitForSecondsRealtime.waitTim
f900 65 20 3d 20 64 65 6c 61 79 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 79 69 e.=.delay;....................yi
f920 65 6c 64 20 72 65 74 75 72 6e 20 6d 5f 57 61 69 74 46 6f 72 53 65 63 6f 6e 64 73 52 65 61 6c 74 eld.return.m_WaitForSecondsRealt
f940 69 6d 65 3b 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 20 20 20 ime;..............}.............
f960 20 6d 5f 44 72 61 67 43 6f 72 6f 75 74 69 6e 65 20 3d 20 6e 75 6c 6c 3b 0d 0a 20 20 20 20 20 20 .m_DragCoroutine.=.null;........
f980 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 76 69 72 74 75 61 6c 20 76 6f ..}............public.virtual.vo
f9a0 69 64 20 4f 6e 45 6e 64 44 72 61 67 28 50 6f 69 6e 74 65 72 45 76 65 6e 74 44 61 74 61 20 65 76 id.OnEndDrag(PointerEventData.ev
f9c0 65 6e 74 44 61 74 61 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 entData)..........{.............
f9e0 20 69 66 20 28 21 4d 61 79 44 72 61 67 28 65 76 65 6e 74 44 61 74 61 29 29 0d 0a 20 20 20 20 20 .if.(!MayDrag(eventData)).......
fa00 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 ...........return;..............
fa20 20 20 6d 5f 55 70 64 61 74 65 44 72 61 67 20 3d 20 66 61 6c 73 65 3b 0d 0a 20 20 20 20 20 20 20 ..m_UpdateDrag.=.false;.........
fa40 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 6f 76 65 72 72 69 64 65 20 76 6f .}............public.override.vo
fa60 69 64 20 4f 6e 50 6f 69 6e 74 65 72 44 6f 77 6e 28 50 6f 69 6e 74 65 72 45 76 65 6e 74 44 61 74 id.OnPointerDown(PointerEventDat
fa80 61 20 65 76 65 6e 74 44 61 74 61 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 a.eventData)..........{.........
faa0 20 20 20 20 20 69 66 20 28 21 4d 61 79 44 72 61 67 28 65 76 65 6e 74 44 61 74 61 29 29 0d 0a 20 .....if.(!MayDrag(eventData))...
fac0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 ...............return;..........
fae0 20 20 20 20 20 20 45 76 65 6e 74 53 79 73 74 65 6d 2e 63 75 72 72 65 6e 74 2e 53 65 74 53 65 6c ......EventSystem.current.SetSel
fb00 65 63 74 65 64 47 61 6d 65 4f 62 6a 65 63 74 28 67 61 6d 65 4f 62 6a 65 63 74 2c 20 65 76 65 6e ectedGameObject(gameObject,.even
fb20 74 44 61 74 61 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 62 6f 6f 6c 20 68 61 64 46 tData);................bool.hadF
fb40 6f 63 75 73 42 65 66 6f 72 65 20 3d 20 6d 5f 41 6c 6c 6f 77 49 6e 70 75 74 3b 0d 0a 20 20 20 20 ocusBefore.=.m_AllowInput;......
fb60 20 20 20 20 20 20 20 20 62 61 73 65 2e 4f 6e 50 6f 69 6e 74 65 72 44 6f 77 6e 28 65 76 65 6e 74 ........base.OnPointerDown(event
fb80 44 61 74 61 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 49 6e 50 6c 61 63 Data);................if.(InPlac
fba0 65 45 64 69 74 69 6e 67 28 29 20 3d 3d 20 66 61 6c 73 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 eEditing().==.false)............
fbc0 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 6d 5f 53 6f 66 74 4b ..{..................if.(m_SoftK
fbe0 65 79 62 6f 61 72 64 20 3d 3d 20 6e 75 6c 6c 20 7c 7c 20 21 6d 5f 53 6f 66 74 4b 65 79 62 6f 61 eyboard.==.null.||.!m_SoftKeyboa
fc00 72 64 2e 61 63 74 69 76 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 rd.active)..................{...
fc20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4f 6e 53 65 6c 65 63 74 28 65 76 65 6e ...................OnSelect(even
fc40 74 44 61 74 61 29 3b 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 tData);......................ret
fc60 75 72 6e 3b 0d 0a 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 urn;..................}.........
fc80 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 62 6f 6f 6c 20 73 68 69 66 74 .....}................bool.shift
fca0 20 3d 20 49 6e 70 75 74 2e 47 65 74 4b 65 79 28 4b 65 79 43 6f 64 65 2e 4c 65 66 74 53 68 69 66 .=.Input.GetKey(KeyCode.LeftShif
fcc0 74 29 20 7c 7c 20 49 6e 70 75 74 2e 47 65 74 4b 65 79 28 4b 65 79 43 6f 64 65 2e 52 69 67 68 74 t).||.Input.GetKey(KeyCode.Right
fce0 53 68 69 66 74 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 68 65 63 6b 20 Shift);................//.Check.
fd00 66 6f 72 20 44 6f 75 62 6c 65 20 43 6c 69 63 6b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 62 6f for.Double.Click..............bo
fd20 6f 6c 20 69 73 44 6f 75 62 6c 65 43 6c 69 63 6b 20 3d 20 66 61 6c 73 65 3b 0d 0a 20 20 20 20 20 ol.isDoubleClick.=.false;.......
fd40 20 20 20 20 20 20 20 66 6c 6f 61 74 20 74 69 6d 65 53 74 61 6d 70 20 3d 20 54 69 6d 65 2e 75 6e .......float.timeStamp.=.Time.un
fd60 73 63 61 6c 65 64 54 69 6d 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d scaledTime;................if.(m
fd80 5f 50 6f 69 6e 74 65 72 44 6f 77 6e 43 6c 69 63 6b 53 74 61 72 74 54 69 6d 65 20 2b 20 6d 5f 44 _PointerDownClickStartTime.+.m_D
fda0 6f 75 62 6c 65 43 6c 69 63 6b 44 65 6c 61 79 20 3e 20 74 69 6d 65 53 74 61 6d 70 29 0d 0a 20 20 oubleClickDelay.>.timeStamp)....
fdc0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 73 44 6f 75 62 6c 65 43 6c 69 63 6b 20 3d 20 74 72 ..............isDoubleClick.=.tr
fde0 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 50 6f 69 6e 74 65 72 44 6f 77 6e ue;................m_PointerDown
fe00 43 6c 69 63 6b 53 74 61 72 74 54 69 6d 65 20 3d 20 74 69 6d 65 53 74 61 6d 70 3b 0d 0a 0d 0a 20 ClickStartTime.=.timeStamp;.....
fe20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4f 6e 6c 79 20 73 65 74 20 63 61 72 65 74 20 70 6f 73 ...........//.Only.set.caret.pos
fe40 69 74 69 6f 6e 20 69 66 20 77 65 20 64 69 64 6e 27 74 20 6a 75 73 74 20 67 65 74 20 66 6f 63 75 ition.if.we.didn't.just.get.focu
fe60 73 20 6e 6f 77 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4f 74 68 65 72 77 69 73 65 s.now...............//.Otherwise
fe80 20 69 74 20 77 69 6c 6c 20 6f 76 65 72 77 72 69 74 65 20 74 68 65 20 73 65 6c 65 63 74 20 61 6c .it.will.overwrite.the.select.al
fea0 6c 20 6f 6e 20 66 6f 63 75 73 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 68 61 64 l.on.focus...............if.(had
fec0 46 6f 63 75 73 42 65 66 6f 72 65 20 7c 7c 20 21 6d 5f 4f 6e 46 6f 63 75 73 53 65 6c 65 63 74 41 FocusBefore.||.!m_OnFocusSelectA
fee0 6c 6c 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 ll)..............{..............
ff00 20 20 20 20 69 6e 74 20 69 6e 73 65 72 74 69 6f 6e 49 6e 64 65 78 20 3d 20 54 4d 50 5f 54 65 78 ....int.insertionIndex.=.TMP_Tex
ff20 74 55 74 69 6c 69 74 69 65 73 2e 47 65 74 43 75 72 73 6f 72 49 6e 64 65 78 46 72 6f 6d 50 6f 73 tUtilities.GetCursorIndexFromPos
ff40 69 74 69 6f 6e 28 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2c 20 65 76 65 6e 74 44 61 74 61 ition(m_TextComponent,.eventData
ff60 2e 70 6f 73 69 74 69 6f 6e 2c 20 65 76 65 6e 74 44 61 74 61 2e 70 72 65 73 73 45 76 65 6e 74 43 .position,.eventData.pressEventC
ff80 61 6d 65 72 61 2c 20 6f 75 74 20 43 61 72 65 74 50 6f 73 69 74 69 6f 6e 20 69 6e 73 65 72 74 69 amera,.out.CaretPosition.inserti
ffa0 6f 6e 53 69 64 65 29 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 onSide);....................if.(
ffc0 73 68 69 66 74 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 20 shift)..................{.......
ffe0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 69 73 52 69 63 68 54 65 78 74 45 ...............if.(m_isRichTextE
10000 64 69 74 69 6e 67 41 6c 6c 6f 77 65 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ditingAllowed)..................
10020 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
10040 66 20 28 69 6e 73 65 72 74 69 6f 6e 53 69 64 65 20 3d 3d 20 43 61 72 65 74 50 6f 73 69 74 69 6f f.(insertionSide.==.CaretPositio
10060 6e 2e 4c 65 66 74 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 n.Left).........................
10080 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 20 20 20 20 .{..............................
100a0 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 6d stringSelectPositionInternal.=.m
100c0 5f 54 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 74 65 _TextComponent.textInfo.characte
100e0 72 49 6e 66 6f 5b 69 6e 73 65 72 74 69 6f 6e 49 6e 64 65 78 5d 2e 69 6e 64 65 78 3b 0d 0a 20 20 rInfo[insertionIndex].index;....
10100 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 20 20 20 ......................}.........
10120 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 6e 73 65 72 74 .................else.if.(insert
10140 69 6f 6e 53 69 64 65 20 3d 3d 20 43 61 72 65 74 50 6f 73 69 74 69 6f 6e 2e 52 69 67 68 74 29 0d ionSide.==.CaretPosition.Right).
10160 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 20 .........................{......
10180 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 74 72 69 6e 67 53 65 ........................stringSe
101a0 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 6d 5f 54 65 78 74 43 6f 6d lectPositionInternal.=.m_TextCom
101c0 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 66 6f 5b 69 6e ponent.textInfo.characterInfo[in
101e0 73 65 72 74 69 6f 6e 49 6e 64 65 78 5d 2e 69 6e 64 65 78 20 2b 20 6d 5f 54 65 78 74 43 6f 6d 70 sertionIndex].index.+.m_TextComp
10200 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 66 6f 5b 69 6e 73 onent.textInfo.characterInfo[ins
10220 65 72 74 69 6f 6e 49 6e 64 65 78 5d 2e 73 74 72 69 6e 67 4c 65 6e 67 74 68 3b 0d 0a 20 20 20 20 ertionIndex].stringLength;......
10240 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 20 20 20 20 20 ....................}...........
10260 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 20 ...........}....................
10280 20 20 65 6c 73 65 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 ..else......................{...
102a0 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 69 6e 73 65 72 .......................if.(inser
102c0 74 69 6f 6e 53 69 64 65 20 3d 3d 20 43 61 72 65 74 50 6f 73 69 74 69 6f 6e 2e 4c 65 66 74 29 0d tionSide.==.CaretPosition.Left).
102e0 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 20 .........................{......
10300 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 74 72 69 6e 67 53 65 ........................stringSe
10320 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 69 6e 73 65 72 74 69 6f 6e lectPositionInternal.=.insertion
10340 49 6e 64 65 78 20 3d 3d 20 30 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 Index.==.0......................
10360 20 20 20 20 20 20 20 20 20 20 20 20 3f 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 65 ............?.m_TextComponent.te
10380 78 74 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 49 6e 66 6f 5b 30 5d 2e 69 6e 64 65 78 0d 0a 20 xtInfo.characterInfo[0].index...
103a0 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 3a ...............................:
103c0 20 6d 5f 54 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 .m_TextComponent.textInfo.charac
103e0 74 65 72 49 6e 66 6f 5b 69 6e 73 65 72 74 69 6f 6e 49 6e 64 65 78 20 2d 20 31 5d 2e 69 6e 64 65 terInfo[insertionIndex.-.1].inde
10400 78 20 2b 20 6d 5f 54 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 x.+.m_TextComponent.textInfo.cha
10420 72 61 63 74 65 72 49 6e 66 6f 5b 69 6e 73 65 72 74 69 6f 6e 49 6e 64 65 78 20 2d 20 31 5d 2e 73 racterInfo[insertionIndex.-.1].s
10440 74 72 69 6e 67 4c 65 6e 67 74 68 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 tringLength;....................
10460 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 20 20 20 20 20 20 ......}.........................
10480 20 65 6c 73 65 20 69 66 20 28 69 6e 73 65 72 74 69 6f 6e 53 69 64 65 20 3d 3d 20 43 61 72 65 74 .else.if.(insertionSide.==.Caret
104a0 50 6f 73 69 74 69 6f 6e 2e 52 69 67 68 74 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 Position.Right).................
104c0 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 20 .........{......................
104e0 20 20 20 20 20 20 20 20 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 ........stringSelectPositionInte
10500 72 6e 61 6c 20 3d 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 65 78 74 49 6e 66 6f 2e rnal.=.m_TextComponent.textInfo.
10520 63 68 61 72 61 63 74 65 72 49 6e 66 6f 5b 69 6e 73 65 72 74 69 6f 6e 49 6e 64 65 78 5d 2e 69 6e characterInfo[insertionIndex].in
10540 64 65 78 20 2b 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 65 78 74 49 6e 66 6f 2e 63 dex.+.m_TextComponent.textInfo.c
10560 68 61 72 61 63 74 65 72 49 6e 66 6f 5b 69 6e 73 65 72 74 69 6f 6e 49 6e 64 65 78 5d 2e 73 74 72 haracterInfo[insertionIndex].str
10580 69 6e 67 4c 65 6e 67 74 68 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ingLength;......................
105a0 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 20 ....}......................}....
105c0 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 20 ..............}.................
105e0 20 65 6c 73 65 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 .else..................{........
10600 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 69 73 52 69 63 68 54 65 78 74 45 64 ..............if.(m_isRichTextEd
10620 69 74 69 6e 67 41 6c 6c 6f 77 65 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 itingAllowed)...................
10640 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 66 ...{..........................if
10660 20 28 69 6e 73 65 72 74 69 6f 6e 53 69 64 65 20 3d 3d 20 43 61 72 65 74 50 6f 73 69 74 69 6f 6e .(insertionSide.==.CaretPosition
10680 2e 4c 65 66 74 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 .Left)..........................
106a0 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 20 20 20 20 73 {..............................s
106c0 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 73 74 72 69 6e 67 53 65 tringPositionInternal.=.stringSe
106e0 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 6d 5f 54 65 78 74 43 6f 6d lectPositionInternal.=.m_TextCom
10700 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 66 6f 5b 69 6e ponent.textInfo.characterInfo[in
10720 73 65 72 74 69 6f 6e 49 6e 64 65 78 5d 2e 69 6e 64 65 78 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 sertionIndex].index;............
10740 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 20 ..............}.................
10760 20 20 20 20 20 20 20 20 20 65 6c 73 65 20 69 66 20 28 69 6e 73 65 72 74 69 6f 6e 53 69 64 65 20 .........else.if.(insertionSide.
10780 3d 3d 20 43 61 72 65 74 50 6f 73 69 74 69 6f 6e 2e 52 69 67 68 74 29 0d 0a 20 20 20 20 20 20 20 ==.CaretPosition.Right).........
107a0 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 20 .................{..............
107c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e ................stringPositionIn
107e0 74 65 72 6e 61 6c 20 3d 20 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 ternal.=.stringSelectPositionInt
10800 65 72 6e 61 6c 20 3d 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 65 78 74 49 6e 66 6f ernal.=.m_TextComponent.textInfo
10820 2e 63 68 61 72 61 63 74 65 72 49 6e 66 6f 5b 69 6e 73 65 72 74 69 6f 6e 49 6e 64 65 78 5d 2e 69 .characterInfo[insertionIndex].i
10840 6e 64 65 78 20 2b 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 65 78 74 49 6e 66 6f 2e ndex.+.m_TextComponent.textInfo.
10860 63 68 61 72 61 63 74 65 72 49 6e 66 6f 5b 69 6e 73 65 72 74 69 6f 6e 49 6e 64 65 78 5d 2e 73 74 characterInfo[insertionIndex].st
10880 72 69 6e 67 4c 65 6e 67 74 68 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ringLength;.....................
108a0 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 .....}......................}...
108c0 20 20 20 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 20 ...................else.........
108e0 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 .............{..................
10900 20 20 20 20 20 20 20 20 69 66 20 28 69 6e 73 65 72 74 69 6f 6e 53 69 64 65 20 3d 3d 20 43 61 72 ........if.(insertionSide.==.Car
10920 65 74 50 6f 73 69 74 69 6f 6e 2e 4c 65 66 74 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 etPosition.Left)................
10940 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 ..........{.....................
10960 20 20 20 20 20 20 20 20 20 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 .........stringPositionInternal.
10980 3d 20 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d =.stringSelectPositionInternal.=
109a0 20 69 6e 73 65 72 74 69 6f 6e 49 6e 64 65 78 20 3d 3d 20 30 0d 0a 20 20 20 20 20 20 20 20 20 20 .insertionIndex.==.0............
109c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 3f 20 6d 5f 54 65 78 74 43 6f ......................?.m_TextCo
109e0 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 66 6f 5b 30 mponent.textInfo.characterInfo[0
10a00 5d 2e 69 6e 64 65 78 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 ].index.........................
10a20 20 20 20 20 20 20 20 20 20 3a 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 65 78 74 49 .........:.m_TextComponent.textI
10a40 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 49 6e 66 6f 5b 69 6e 73 65 72 74 69 6f 6e 49 6e 64 65 78 nfo.characterInfo[insertionIndex
10a60 20 2d 20 31 5d 2e 69 6e 64 65 78 20 2b 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 65 .-.1].index.+.m_TextComponent.te
10a80 78 74 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 49 6e 66 6f 5b 69 6e 73 65 72 74 69 6f 6e 49 6e xtInfo.characterInfo[insertionIn
10aa0 64 65 78 20 2d 20 31 5d 2e 73 74 72 69 6e 67 4c 65 6e 67 74 68 3b 0d 0a 20 20 20 20 20 20 20 20 dex.-.1].stringLength;..........
10ac0 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 20 20 ................}...............
10ae0 20 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 20 69 66 20 28 69 6e 73 65 72 74 69 6f 6e 53 69 64 ...........else.if.(insertionSid
10b00 65 20 3d 3d 20 43 61 72 65 74 50 6f 73 69 74 69 6f 6e 2e 52 69 67 68 74 29 0d 0a 20 20 20 20 20 e.==.CaretPosition.Right).......
10b20 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 ...................{............
10b40 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e ..................stringPosition
10b60 49 6e 74 65 72 6e 61 6c 20 3d 20 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 Internal.=.stringSelectPositionI
10b80 6e 74 65 72 6e 61 6c 20 3d 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 65 78 74 49 6e nternal.=.m_TextComponent.textIn
10ba0 66 6f 2e 63 68 61 72 61 63 74 65 72 49 6e 66 6f 5b 69 6e 73 65 72 74 69 6f 6e 49 6e 64 65 78 5d fo.characterInfo[insertionIndex]
10bc0 2e 69 6e 64 65 78 20 2b 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 65 78 74 49 6e 66 .index.+.m_TextComponent.textInf
10be0 6f 2e 63 68 61 72 61 63 74 65 72 49 6e 66 6f 5b 69 6e 73 65 72 74 69 6f 6e 49 6e 64 65 78 5d 2e o.characterInfo[insertionIndex].
10c00 73 74 72 69 6e 67 4c 65 6e 67 74 68 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 stringLength;...................
10c20 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 20 20 20 7d 0d .......}......................}.
10c40 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 0d 0a 20 20 20 20 20 20 20 20 .................}..............
10c60 20 20 20 20 20 20 20 20 69 66 20 28 69 73 44 6f 75 62 6c 65 43 6c 69 63 6b 29 0d 0a 20 20 20 20 ........if.(isDoubleClick)......
10c80 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 ............{...................
10ca0 20 20 20 69 6e 74 20 77 6f 72 64 49 6e 64 65 78 20 3d 20 54 4d 50 5f 54 65 78 74 55 74 69 6c 69 ...int.wordIndex.=.TMP_TextUtili
10cc0 74 69 65 73 2e 46 69 6e 64 49 6e 74 65 72 73 65 63 74 69 6e 67 57 6f 72 64 28 6d 5f 54 65 78 74 ties.FindIntersectingWord(m_Text
10ce0 43 6f 6d 70 6f 6e 65 6e 74 2c 20 65 76 65 6e 74 44 61 74 61 2e 70 6f 73 69 74 69 6f 6e 2c 20 65 Component,.eventData.position,.e
10d00 76 65 6e 74 44 61 74 61 2e 70 72 65 73 73 45 76 65 6e 74 43 61 6d 65 72 61 29 3b 0d 0a 0d 0a 20 ventData.pressEventCamera);.....
10d20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 77 6f 72 64 49 6e 64 65 78 ...................if.(wordIndex
10d40 20 21 3d 20 2d 31 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 .!=.-1)......................{..
10d60 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 4f 44 4f 3a ........................//.TODO:
10d80 20 53 68 6f 75 6c 64 20 62 65 68 61 76 69 6f 72 20 62 65 20 64 69 66 66 65 72 65 6e 74 20 69 66 .Should.behavior.be.different.if
10da0 20 72 69 63 68 20 74 65 78 74 20 65 64 69 74 69 6e 67 20 69 73 20 65 6e 61 62 6c 65 64 20 6f 72 .rich.text.editing.is.enabled.or
10dc0 20 6e 6f 74 3f 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 .not?...........................
10de0 20 2f 2f 20 53 65 6c 65 63 74 20 63 75 72 72 65 6e 74 20 77 6f 72 64 0d 0a 20 20 20 20 20 20 20 .//.Select.current.word.........
10e00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 72 65 74 50 6f 73 69 74 69 6f 6e 49 6e .................caretPositionIn
10e20 74 65 72 6e 61 6c 20 3d 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 65 78 74 49 6e 66 ternal.=.m_TextComponent.textInf
10e40 6f 2e 77 6f 72 64 49 6e 66 6f 5b 77 6f 72 64 49 6e 64 65 78 5d 2e 66 69 72 73 74 43 68 61 72 61 o.wordInfo[wordIndex].firstChara
10e60 63 74 65 72 49 6e 64 65 78 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 cterIndex;......................
10e80 20 20 20 20 63 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 ....caretSelectPositionInternal.
10ea0 3d 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 65 78 74 49 6e 66 6f 2e 77 6f 72 64 49 =.m_TextComponent.textInfo.wordI
10ec0 6e 66 6f 5b 77 6f 72 64 49 6e 64 65 78 5d 2e 6c 61 73 74 43 68 61 72 61 63 74 65 72 49 6e 64 65 nfo[wordIndex].lastCharacterInde
10ee0 78 20 2b 20 31 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 x.+.1;..........................
10f00 20 20 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 6d 5f 54 65 78 ..stringPositionInternal.=.m_Tex
10f20 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 66 tComponent.textInfo.characterInf
10f40 6f 5b 63 61 72 65 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 5d 2e 69 6e 64 65 78 3b 0d o[caretPositionInternal].index;.
10f60 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 73 74 72 69 6e 67 53 .........................stringS
10f80 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 6d 5f 54 65 78 74 43 6f electPositionInternal.=.m_TextCo
10fa0 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 66 6f 5b 63 mponent.textInfo.characterInfo[c
10fc0 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2d 20 31 5d 2e aretSelectPositionInternal.-.1].
10fe0 69 6e 64 65 78 20 2b 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 65 78 74 49 6e 66 6f index.+.m_TextComponent.textInfo
11000 2e 63 68 61 72 61 63 74 65 72 49 6e 66 6f 5b 63 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 .characterInfo[caretSelectPositi
11020 6f 6e 49 6e 74 65 72 6e 61 6c 20 2d 20 31 5d 2e 73 74 72 69 6e 67 4c 65 6e 67 74 68 3b 0d 0a 20 onInternal.-.1].stringLength;...
11040 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 ...................}............
11060 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 20 20 20 20 ..........else..................
11080 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 2f ....{........................../
110a0 2f 20 53 65 6c 65 63 74 20 63 75 72 72 65 6e 74 20 63 68 61 72 61 63 74 65 72 0d 0a 20 20 20 20 /.Select.current.character......
110c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 72 65 74 50 6f 73 69 74 69 6f ....................caretPositio
110e0 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 69 6e 73 65 72 74 69 6f 6e 49 6e 64 65 78 3b 20 0d 0a 20 20 nInternal.=.insertionIndex;.....
11100 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 72 65 74 53 65 6c 65 63 ......................caretSelec
11120 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 63 61 72 65 74 50 6f 73 69 74 69 6f tPositionInternal.=.caretPositio
11140 6e 49 6e 74 65 72 6e 61 6c 20 2b 20 31 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 nInternal.+.1;..................
11160 20 20 20 20 20 20 20 20 20 20 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c ..........stringPositionInternal
11180 20 3d 20 6d 5f 54 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 .=.m_TextComponent.textInfo.char
111a0 61 63 74 65 72 49 6e 66 6f 5b 69 6e 73 65 72 74 69 6f 6e 49 6e 64 65 78 5d 2e 69 6e 64 65 78 3b acterInfo[insertionIndex].index;
111c0 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 73 74 72 69 6e 67 ..........................string
111e0 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 73 74 72 69 6e 67 50 SelectPositionInternal.=.stringP
11200 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2b 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e ositionInternal.+.m_TextComponen
11220 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 6e 73 65 72 74 69 t.textInfo.characterInfo[inserti
11240 6f 6e 49 6e 64 65 78 5d 2e 73 74 72 69 6e 67 4c 65 6e 67 74 68 3b 0d 0a 20 20 20 20 20 20 20 20 onIndex].stringLength;..........
11260 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 ............}..................}
11280 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 20 20 ..................else..........
112a0 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 63 ........{......................c
112c0 61 72 65 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 63 61 72 65 74 53 65 6c 65 aretPositionInternal.=.caretSele
112e0 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 47 65 74 43 61 72 65 74 50 6f 73 ctPositionInternal.=.GetCaretPos
11300 69 74 69 6f 6e 46 72 6f 6d 53 74 72 69 6e 67 49 6e 64 65 78 28 73 74 72 69 6e 67 50 6f 73 69 74 itionFromStringIndex(stringPosit
11320 69 6f 6e 49 6e 74 65 72 6e 61 6c 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d ionInternal);..................}
11340 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 20 20 20 20 55 ..............}................U
11360 70 64 61 74 65 4c 61 62 65 6c 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 76 65 6e 74 pdateLabel();..............event
11380 44 61 74 61 2e 55 73 65 28 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 23 69 66 20 54 Data.Use();................#if.T
113a0 4d 50 5f 44 45 42 55 47 5f 4d 4f 44 45 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 44 MP_DEBUG_MODE..................D
113c0 65 62 75 67 2e 4c 6f 67 28 22 43 61 72 65 74 20 50 6f 73 69 74 69 6f 6e 3a 20 22 20 2b 20 63 61 ebug.Log("Caret.Position:.".+.ca
113e0 72 65 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2b 20 22 20 53 65 6c 65 63 74 69 6f retPositionInternal.+.".Selectio
11400 6e 20 50 6f 73 69 74 69 6f 6e 3a 20 22 20 2b 20 63 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 n.Position:.".+.caretSelectPosit
11420 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2b 20 22 20 20 53 74 72 69 6e 67 20 50 6f 73 69 74 69 6f 6e ionInternal.+."..String.Position
11440 3a 20 22 20 2b 20 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2b 20 22 :.".+.stringPositionInternal.+."
11460 20 53 74 72 69 6e 67 20 53 65 6c 65 63 74 20 50 6f 73 69 74 69 6f 6e 3a 20 22 20 2b 20 73 74 72 .String.Select.Position:.".+.str
11480 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 29 3b 0d 0a 20 20 20 ingSelectPositionInternal);.....
114a0 20 20 20 20 20 20 20 20 20 23 65 6e 64 69 66 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 .........#endif..........}......
114c0 20 20 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 65 6e 75 6d 20 45 64 69 74 53 74 61 74 65 0d 0a ......protected.enum.EditState..
114e0 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 43 6f 6e 74 69 6e 75 65 2c ........{..............Continue,
11500 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 46 69 6e 69 73 68 0d 0a 20 20 20 20 20 20 20 20 7d 0d ..............Finish..........}.
11520 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 45 64 69 74 53 74 61 74 65 20 4b ...........protected.EditState.K
11540 65 79 50 72 65 73 73 65 64 28 45 76 65 6e 74 20 65 76 74 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d eyPressed(Event.evt)..........{.
11560 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 63 75 72 72 65 6e 74 45 76 65 6e 74 4d 6f 64 .............var.currentEventMod
11580 69 66 69 65 72 73 20 3d 20 65 76 74 2e 6d 6f 64 69 66 69 65 72 73 3b 0d 0a 20 20 20 20 20 20 20 ifiers.=.evt.modifiers;.........
115a0 20 20 20 20 20 62 6f 6f 6c 20 63 74 72 6c 20 3d 20 53 79 73 74 65 6d 49 6e 66 6f 2e 6f 70 65 72 .....bool.ctrl.=.SystemInfo.oper
115c0 61 74 69 6e 67 53 79 73 74 65 6d 46 61 6d 69 6c 79 20 3d 3d 20 4f 70 65 72 61 74 69 6e 67 53 79 atingSystemFamily.==.OperatingSy
115e0 73 74 65 6d 46 61 6d 69 6c 79 2e 4d 61 63 4f 53 58 20 3f 20 28 63 75 72 72 65 6e 74 45 76 65 6e stemFamily.MacOSX.?.(currentEven
11600 74 4d 6f 64 69 66 69 65 72 73 20 26 20 45 76 65 6e 74 4d 6f 64 69 66 69 65 72 73 2e 43 6f 6d 6d tModifiers.&.EventModifiers.Comm
11620 61 6e 64 29 20 21 3d 20 30 20 3a 20 28 63 75 72 72 65 6e 74 45 76 65 6e 74 4d 6f 64 69 66 69 65 and).!=.0.:.(currentEventModifie
11640 72 73 20 26 20 45 76 65 6e 74 4d 6f 64 69 66 69 65 72 73 2e 43 6f 6e 74 72 6f 6c 29 20 21 3d 20 rs.&.EventModifiers.Control).!=.
11660 30 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 62 6f 6f 6c 20 73 68 69 66 74 20 3d 20 28 63 75 0;..............bool.shift.=.(cu
11680 72 72 65 6e 74 45 76 65 6e 74 4d 6f 64 69 66 69 65 72 73 20 26 20 45 76 65 6e 74 4d 6f 64 69 66 rrentEventModifiers.&.EventModif
116a0 69 65 72 73 2e 53 68 69 66 74 29 20 21 3d 20 30 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 62 iers.Shift).!=.0;..............b
116c0 6f 6f 6c 20 61 6c 74 20 3d 20 28 63 75 72 72 65 6e 74 45 76 65 6e 74 4d 6f 64 69 66 69 65 72 73 ool.alt.=.(currentEventModifiers
116e0 20 26 20 45 76 65 6e 74 4d 6f 64 69 66 69 65 72 73 2e 41 6c 74 29 20 21 3d 20 30 3b 0d 0a 20 20 .&.EventModifiers.Alt).!=.0;....
11700 20 20 20 20 20 20 20 20 20 20 62 6f 6f 6c 20 63 74 72 6c 4f 6e 6c 79 20 3d 20 63 74 72 6c 20 26 ..........bool.ctrlOnly.=.ctrl.&
11720 26 20 21 61 6c 74 20 26 26 20 21 73 68 69 66 74 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 &.!alt.&&.!shift;...............
11740 20 73 77 69 74 63 68 20 28 65 76 74 2e 6b 65 79 43 6f 64 65 29 0d 0a 20 20 20 20 20 20 20 20 20 .switch.(evt.keyCode)...........
11760 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 73 65 20 4b 65 79 43 6f ...{..................case.KeyCo
11780 64 65 2e 42 61 63 6b 73 70 61 63 65 3a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 de.Backspace:...................
117a0 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 42 61 ...{..........................Ba
117c0 63 6b 73 70 61 63 65 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ckspace();......................
117e0 20 20 20 20 72 65 74 75 72 6e 20 45 64 69 74 53 74 61 74 65 2e 43 6f 6e 74 69 6e 75 65 3b 0d 0a ....return.EditState.Continue;..
11800 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 20 20 20 20 20 ....................}...........
11820 20 20 20 20 20 20 20 20 20 63 61 73 65 20 4b 65 79 43 6f 64 65 2e 44 65 6c 65 74 65 3a 0d 0a 20 .........case.KeyCode.Delete:...
11840 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 ...................{............
11860 20 20 20 20 20 20 20 20 20 20 20 20 20 20 44 65 6c 65 74 65 4b 65 79 28 29 3b 0d 0a 20 20 20 20 ..............DeleteKey();......
11880 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 45 64 69 74 53 ....................return.EditS
118a0 74 61 74 65 2e 43 6f 6e 74 69 6e 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 tate.Continue;..................
118c0 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 63 61 73 65 20 4b 65 ....}....................case.Ke
118e0 79 43 6f 64 65 2e 48 6f 6d 65 3a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 yCode.Home:.....................
11900 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 4d 6f 76 65 .{..........................Move
11920 54 6f 53 74 61 72 74 4f 66 4c 69 6e 65 28 73 68 69 66 74 2c 20 63 74 72 6c 29 3b 0d 0a 20 20 20 ToStartOfLine(shift,.ctrl);.....
11940 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 45 64 69 74 .....................return.Edit
11960 53 74 61 74 65 2e 43 6f 6e 74 69 6e 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 State.Continue;.................
11980 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 20 63 61 73 65 20 4b .....}....................case.K
119a0 65 79 43 6f 64 65 2e 45 6e 64 3a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 eyCode.End:.....................
119c0 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 4d 6f 76 65 .{..........................Move
119e0 54 6f 45 6e 64 4f 66 4c 69 6e 65 28 73 68 69 66 74 2c 20 63 74 72 6c 29 3b 0d 0a 20 20 20 20 20 ToEndOfLine(shift,.ctrl);.......
11a00 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 45 64 69 74 53 74 ...................return.EditSt
11a20 61 74 65 2e 43 6f 6e 74 69 6e 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ate.Continue;...................
11a40 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 53 65 6c 65 63 ...}....................//.Selec
11a60 74 20 41 6c 6c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 73 65 20 4b 65 79 43 t.All..................case.KeyC
11a80 6f 64 65 2e 41 3a 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 ode.A:......................{...
11aa0 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 63 74 72 6c 4f .......................if.(ctrlO
11ac0 6e 6c 79 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 nly)..........................{.
11ae0 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 53 65 6c .............................Sel
11b00 65 63 74 41 6c 6c 28 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 ectAll();.......................
11b20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 45 64 69 74 53 74 61 74 65 2e 43 6f 6e 74 69 6e 75 65 .......return.EditState.Continue
11b40 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 7d 0d 0a 20 20 ;..........................}....
11b60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 72 65 61 6b 3b 0d 0a 20 20 ......................break;....
11b80 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 20 20 20 20 20 20 20 ..................}.............
11ba0 20 20 20 20 20 20 20 2f 2f 20 43 6f 70 79 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .......//.Copy..................
11bc0 63 61 73 65 20 4b 65 79 43 6f 64 65 2e 43 3a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 case.KeyCode.C:.................
11be0 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 .....{..........................
11c00 69 66 20 28 63 74 72 6c 4f 6e 6c 79 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 if.(ctrlOnly)...................
11c20 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 20 .......{........................
11c40 20 20 20 20 20 20 69 66 20 28 69 6e 70 75 74 54 79 70 65 20 21 3d 20 49 6e 70 75 74 54 79 70 65 ......if.(inputType.!=.InputType
11c60 2e 50 61 73 73 77 6f 72 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .Password)......................
11c80 20 20 20 20 20 20 20 20 20 20 20 20 63 6c 69 70 62 6f 61 72 64 20 3d 20 47 65 74 53 65 6c 65 63 ............clipboard.=.GetSelec
11ca0 74 65 64 53 74 72 69 6e 67 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 tedString();....................
11cc0 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 20 20 20 20 ..........else..................
11ce0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 6c 69 70 62 6f 61 72 64 20 3d 20 22 22 3b 0d ................clipboard.=."";.
11d00 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 74 .............................ret
11d20 75 72 6e 20 45 64 69 74 53 74 61 74 65 2e 43 6f 6e 74 69 6e 75 65 3b 0d 0a 20 20 20 20 20 20 20 urn.EditState.Continue;.........
11d40 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 20 .................}..............
11d60 20 20 20 20 20 20 20 20 20 20 20 20 62 72 65 61 6b 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 ............break;..............
11d80 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 20 2f 2f 20 ........}....................//.
11da0 50 61 73 74 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 73 65 20 4b 65 79 43 Paste..................case.KeyC
11dc0 6f 64 65 2e 56 3a 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 ode.V:......................{...
11de0 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 63 74 72 6c 4f .......................if.(ctrlO
11e00 6e 6c 79 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 nly)..........................{.
11e20 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 41 70 70 .............................App
11e40 65 6e 64 28 63 6c 69 70 62 6f 61 72 64 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 end(clipboard);.................
11e60 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 45 64 69 74 53 74 61 74 65 2e 43 6f .............return.EditState.Co
11e80 6e 74 69 6e 75 65 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 ntinue;.........................
11ea0 20 7d 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 72 65 61 .}..........................brea
11ec0 6b 3b 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 0d 0a 20 20 20 k;......................}.......
11ee0 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 75 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 .............//.Cut.............
11f00 20 20 20 20 20 63 61 73 65 20 4b 65 79 43 6f 64 65 2e 58 3a 0d 0a 20 20 20 20 20 20 20 20 20 20 .....case.KeyCode.X:............
11f20 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 ..........{.....................
11f40 20 20 20 20 20 69 66 20 28 63 74 72 6c 4f 6e 6c 79 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 .....if.(ctrlOnly)..............
11f60 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 ............{...................
11f80 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 69 6e 70 75 74 54 79 70 65 20 21 3d 20 49 6e 70 75 ...........if.(inputType.!=.Inpu
11fa0 74 54 79 70 65 2e 50 61 73 73 77 6f 72 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 tType.Password).................
11fc0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 6c 69 70 62 6f 61 72 64 20 3d 20 47 65 74 .................clipboard.=.Get
11fe0 53 65 6c 65 63 74 65 64 53 74 72 69 6e 67 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 SelectedString();...............
12000 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 20 20 20 20 20 ...............else.............
12020 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 6c 69 70 62 6f 61 72 64 20 3d .....................clipboard.=
12040 20 22 22 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 ."";............................
12060 20 20 44 65 6c 65 74 65 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ..Delete();.....................
12080 20 20 20 20 20 20 20 20 20 55 70 64 61 74 65 54 6f 75 63 68 4b 65 79 62 6f 61 72 64 46 72 6f 6d .........UpdateTouchKeyboardFrom
120a0 45 64 69 74 43 68 61 6e 67 65 73 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 EditChanges();..................
120c0 20 20 20 20 20 20 20 20 20 20 20 20 53 65 6e 64 4f 6e 56 61 6c 75 65 43 68 61 6e 67 65 64 41 6e ............SendOnValueChangedAn
120e0 64 55 70 64 61 74 65 4c 61 62 65 6c 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 dUpdateLabel();.................
12100 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 45 64 69 74 53 74 61 74 65 2e 43 6f .............return.EditState.Co
12120 6e 74 69 6e 75 65 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 ntinue;.........................
12140 20 7d 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 72 65 61 .}..........................brea
12160 6b 3b 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 0d 0a 20 20 20 k;......................}.......
12180 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 73 65 20 4b 65 79 43 6f 64 65 2e 4c 65 66 74 41 72 .............case.KeyCode.LeftAr
121a0 72 6f 77 3a 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 row:......................{.....
121c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4d 6f 76 65 4c 65 66 74 28 73 68 .....................MoveLeft(sh
121e0 69 66 74 2c 20 63 74 72 6c 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ift,.ctrl);.....................
12200 20 20 20 20 20 72 65 74 75 72 6e 20 45 64 69 74 53 74 61 74 65 2e 43 6f 6e 74 69 6e 75 65 3b 0d .....return.EditState.Continue;.
12220 0a 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 20 20 20 20 .....................}..........
12240 20 20 20 20 20 20 20 20 20 20 63 61 73 65 20 4b 65 79 43 6f 64 65 2e 52 69 67 68 74 41 72 72 6f ..........case.KeyCode.RightArro
12260 77 3a 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 w:......................{.......
12280 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4d 6f 76 65 52 69 67 68 74 28 73 68 69 ...................MoveRight(shi
122a0 66 74 2c 20 63 74 72 6c 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ft,.ctrl);......................
122c0 20 20 20 20 72 65 74 75 72 6e 20 45 64 69 74 53 74 61 74 65 2e 43 6f 6e 74 69 6e 75 65 3b 0d 0a ....return.EditState.Continue;..
122e0 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 20 20 20 20 20 ....................}...........
12300 20 20 20 20 20 20 20 20 20 63 61 73 65 20 4b 65 79 43 6f 64 65 2e 55 70 41 72 72 6f 77 3a 0d 0a .........case.KeyCode.UpArrow:..
12320 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 20 ....................{...........
12340 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4d 6f 76 65 55 70 28 73 68 69 66 74 29 3b 0d 0a 20 ...............MoveUp(shift);...
12360 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 45 64 .......................return.Ed
12380 69 74 53 74 61 74 65 2e 43 6f 6e 74 69 6e 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 itState.Continue;...............
123a0 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 20 63 61 73 65 .......}....................case
123c0 20 4b 65 79 43 6f 64 65 2e 44 6f 77 6e 41 72 72 6f 77 3a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 .KeyCode.DownArrow:.............
123e0 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 20 .........{......................
12400 20 20 20 20 4d 6f 76 65 44 6f 77 6e 28 73 68 69 66 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 ....MoveDown(shift);............
12420 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 45 64 69 74 53 74 61 74 65 2e 43 ..............return.EditState.C
12440 6f 6e 74 69 6e 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d ontinue;......................}.
12460 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 73 65 20 4b 65 79 43 6f 64 65 2e ...................case.KeyCode.
12480 50 61 67 65 55 70 3a 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 PageUp:......................{..
124a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4d 6f 76 65 50 61 67 65 ........................MovePage
124c0 55 70 28 73 68 69 66 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 Up(shift);......................
124e0 20 20 20 20 72 65 74 75 72 6e 20 45 64 69 74 53 74 61 74 65 2e 43 6f 6e 74 69 6e 75 65 3b 0d 0a ....return.EditState.Continue;..
12500 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 20 20 20 20 20 ....................}...........
12520 20 20 20 20 20 20 20 20 20 63 61 73 65 20 4b 65 79 43 6f 64 65 2e 50 61 67 65 44 6f 77 6e 3a 0d .........case.KeyCode.PageDown:.
12540 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 .....................{..........
12560 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4d 6f 76 65 50 61 67 65 44 6f 77 6e 28 73 68 69 ................MovePageDown(shi
12580 66 74 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 72 65 ft);..........................re
125a0 74 75 72 6e 20 45 64 69 74 53 74 61 74 65 2e 43 6f 6e 74 69 6e 75 65 3b 0d 0a 20 20 20 20 20 20 turn.EditState.Continue;........
125c0 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 20 ..............}.................
125e0 20 20 20 2f 2f 20 53 75 62 6d 69 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 ...//.Submit..................ca
12600 73 65 20 4b 65 79 43 6f 64 65 2e 52 65 74 75 72 6e 3a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 se.KeyCode.Return:..............
12620 20 20 20 20 63 61 73 65 20 4b 65 79 43 6f 64 65 2e 4b 65 79 70 61 64 45 6e 74 65 72 3a 0d 0a 20 ....case.KeyCode.KeypadEnter:...
12640 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 ...................{............
12660 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6c 69 6e 65 54 79 70 65 20 21 3d 20 4c 69 ..............if.(lineType.!=.Li
12680 6e 65 54 79 70 65 2e 4d 75 6c 74 69 4c 69 6e 65 4e 65 77 6c 69 6e 65 29 0d 0a 20 20 20 20 20 20 neType.MultiLineNewline)........
126a0 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 ..................{.............
126c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 52 65 6c 65 61 73 65 53 65 6c 65 63 74 .................m_ReleaseSelect
126e0 69 6f 6e 20 3d 20 74 72 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ion.=.true;.....................
12700 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 45 64 69 74 53 74 61 74 65 2e 46 69 6e 69 73 68 .........return.EditState.Finish
12720 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 7d 0d 0a 20 20 ;..........................}....
12740 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 72 65 61 6b 3b 0d 0a 20 20 ......................break;....
12760 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 20 20 20 20 20 20 20 ..................}.............
12780 20 20 20 20 20 20 20 63 61 73 65 20 4b 65 79 43 6f 64 65 2e 45 73 63 61 70 65 3a 0d 0a 20 20 20 .......case.KeyCode.Escape:.....
127a0 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 20 .................{..............
127c0 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 52 65 6c 65 61 73 65 53 65 6c 65 63 74 69 6f 6e 20 3d ............m_ReleaseSelection.=
127e0 20 74 72 75 65 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 .true;..........................
12800 6d 5f 57 61 73 43 61 6e 63 65 6c 65 64 20 3d 20 74 72 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 m_WasCanceled.=.true;...........
12820 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 45 64 69 74 53 74 61 74 65 2e ...............return.EditState.
12840 46 69 6e 69 73 68 3b 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 Finish;......................}..
12860 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 63 68 61 ............}................cha
12880 72 20 63 20 3d 20 65 76 74 2e 63 68 61 72 61 63 74 65 72 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 r.c.=.evt.character;............
128a0 20 20 20 20 2f 2f 20 44 6f 6e 27 74 20 61 6c 6c 6f 77 20 72 65 74 75 72 6e 20 63 68 61 72 73 20 ....//.Don't.allow.return.chars.
128c0 6f 72 20 74 61 62 75 6c 61 74 6f 72 20 6b 65 79 20 74 6f 20 62 65 20 65 6e 74 65 72 65 64 20 69 or.tabulator.key.to.be.entered.i
128e0 6e 74 6f 20 73 69 6e 67 6c 65 20 6c 69 6e 65 20 66 69 65 6c 64 73 2e 0d 0a 20 20 20 20 20 20 20 nto.single.line.fields..........
12900 20 20 20 20 20 69 66 20 28 21 6d 75 6c 74 69 4c 69 6e 65 20 26 26 20 28 63 20 3d 3d 20 27 5c 74 .....if.(!multiLine.&&.(c.==.'\t
12920 27 20 7c 7c 20 63 20 3d 3d 20 27 5c 72 27 20 7c 7c 20 63 20 3d 3d 20 31 30 29 29 0d 0a 20 20 20 '.||.c.==.'\r'.||.c.==.10)).....
12940 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 45 64 69 74 53 74 61 74 65 2e 43 6f .............return.EditState.Co
12960 6e 74 69 6e 75 65 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 ntinue;................//.Conver
12980 74 20 63 61 72 72 69 61 67 65 20 72 65 74 75 72 6e 20 61 6e 64 20 65 6e 64 2d 6f 66 2d 74 65 78 t.carriage.return.and.end-of-tex
129a0 74 20 63 68 61 72 61 63 74 65 72 73 20 74 6f 20 6e 65 77 6c 69 6e 65 2e 0d 0a 20 20 20 20 20 20 t.characters.to.newline.........
129c0 20 20 20 20 20 20 69 66 20 28 63 20 3d 3d 20 27 5c 72 27 20 7c 7c 20 28 69 6e 74 29 63 20 3d 3d ......if.(c.==.'\r'.||.(int)c.==
129e0 20 33 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 20 3d 20 27 5c 6e 27 3b 0d 0a .3)..................c.=.'\n';..
12a00 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 49 73 56 61 6c 69 64 43 68 61 72 28 63 29 ..............if.(IsValidChar(c)
12a20 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 )..............{................
12a40 20 20 41 70 70 65 6e 64 28 63 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 ..Append(c);..............}.....
12a60 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 20 3d 3d 20 30 29 0d 0a 20 20 20 20 20 20 20 20 ...........if.(c.==.0)..........
12a80 20 20 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 63 6f 6d 70 6f ....{..................if.(compo
12aa0 73 69 74 69 6f 6e 53 74 72 69 6e 67 2e 4c 65 6e 67 74 68 20 3e 20 30 29 0d 0a 20 20 20 20 20 20 sitionString.Length.>.0)........
12ac0 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 ..........{.....................
12ae0 20 55 70 64 61 74 65 4c 61 62 65 6c 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .UpdateLabel();.................
12b00 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 20 20 20 20 20 20 72 .}..............}..............r
12b20 65 74 75 72 6e 20 45 64 69 74 53 74 61 74 65 2e 43 6f 6e 74 69 6e 75 65 3b 0d 0a 20 20 20 20 20 eturn.EditState.Continue;.......
12b40 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 76 69 72 74 75 61 ...}............protected.virtua
12b60 6c 20 62 6f 6f 6c 20 49 73 56 61 6c 69 64 43 68 61 72 28 63 68 61 72 20 63 29 0d 0a 20 20 20 20 l.bool.IsValidChar(char.c)......
12b80 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 44 65 6c 65 74 65 20 6b 65 79 ....{..............//.Delete.key
12ba0 20 6f 6e 20 6d 61 63 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 28 69 6e 74 29 63 20 .on.mac..............if.((int)c.
12bc0 3d 3d 20 31 32 37 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 ==.127)..................return.
12be0 66 61 6c 73 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 41 63 63 65 70 74 20 6e 65 false;..............//.Accept.ne
12c00 77 6c 69 6e 65 20 61 6e 64 20 74 61 62 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 wline.and.tab..............if.(c
12c20 20 3d 3d 20 27 5c 74 27 20 7c 7c 20 63 20 3d 3d 20 27 5c 6e 27 29 0d 0a 20 20 20 20 20 20 20 20 .==.'\t'.||.c.==.'\n')..........
12c40 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 74 72 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 ........return.true;............
12c60 20 20 20 20 72 65 74 75 72 6e 20 74 72 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 ....return.true;................
12c80 2f 2f 20 57 69 74 68 20 74 68 65 20 61 64 64 69 74 69 6f 6e 20 6f 66 20 44 79 6e 61 6d 69 63 20 //.With.the.addition.of.Dynamic.
12ca0 73 75 70 70 6f 72 74 2c 20 49 20 74 68 69 6e 6b 20 74 68 69 73 20 77 69 6c 6c 20 62 65 73 74 20 support,.I.think.this.will.best.
12cc0 62 65 20 68 61 6e 64 6c 65 64 20 62 79 20 74 68 65 20 74 65 78 74 20 63 6f 6d 70 6f 6e 65 6e 74 be.handled.by.the.text.component
12ce0 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 72 65 74 75 72 6e 20 6d 5f 54 65 78 74 43 6f ...............//return.m_TextCo
12d00 6d 70 6f 6e 65 6e 74 2e 66 6f 6e 74 2e 48 61 73 43 68 61 72 61 63 74 65 72 28 63 2c 20 74 72 75 mponent.font.HasCharacter(c,.tru
12d20 65 29 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 e);..........}............///.<s
12d40 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 48 61 6e 64 6c 65 20 74 68 65 20 ummary>..........///.Handle.the.
12d60 73 70 65 63 69 66 69 65 64 20 65 76 65 6e 74 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f specified.event...........///.</
12d80 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 45 76 65 6e 74 20 summary>..........private.Event.
12da0 6d 5f 50 72 6f 63 65 73 73 69 6e 67 45 76 65 6e 74 20 3d 20 6e 65 77 20 45 76 65 6e 74 28 29 3b m_ProcessingEvent.=.new.Event();
12dc0 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 76 6f 69 64 20 50 72 6f 63 65 73 73 45 ............public.void.ProcessE
12de0 76 65 6e 74 28 45 76 65 6e 74 20 65 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 vent(Event.e)..........{........
12e00 20 20 20 20 20 20 4b 65 79 50 72 65 73 73 65 64 28 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d ......KeyPressed(e);..........}.
12e20 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>......
12e40 20 20 20 20 2f 2f 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 ....///...........///.</summary>
12e60 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 65 76 65 6e 74 ..........///.<param.name="event
12e80 44 61 74 61 22 3e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 76 Data"></param>..........public.v
12ea0 69 72 74 75 61 6c 20 76 6f 69 64 20 4f 6e 55 70 64 61 74 65 53 65 6c 65 63 74 65 64 28 42 61 73 irtual.void.OnUpdateSelected(Bas
12ec0 65 45 76 65 6e 74 44 61 74 61 20 65 76 65 6e 74 44 61 74 61 29 0d 0a 20 20 20 20 20 20 20 20 7b eEventData.eventData)..........{
12ee0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 69 73 46 6f 63 75 73 65 64 29 0d 0a 20 ..............if.(!isFocused)...
12f00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 ...............return;..........
12f20 20 20 20 20 20 20 62 6f 6f 6c 20 63 6f 6e 73 75 6d 65 64 45 76 65 6e 74 20 3d 20 66 61 6c 73 65 ......bool.consumedEvent.=.false
12f40 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 77 68 69 6c 65 20 28 45 76 65 6e 74 2e 50 6f 70 45 ;..............while.(Event.PopE
12f60 76 65 6e 74 28 6d 5f 50 72 6f 63 65 73 73 69 6e 67 45 76 65 6e 74 29 29 0d 0a 20 20 20 20 20 20 vent(m_ProcessingEvent))........
12f80 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 69 66 20 28 6d 5f 50 ......{..................if.(m_P
12fa0 72 6f 63 65 73 73 69 6e 67 45 76 65 6e 74 2e 72 61 77 54 79 70 65 20 3d 3d 20 45 76 65 6e 74 54 rocessingEvent.rawType.==.EventT
12fc0 79 70 65 2e 4b 65 79 44 6f 77 6e 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d ype.KeyDown)..................{.
12fe0 0a 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 67 .....................//Debug.Log
13000 28 22 45 76 65 6e 74 3a 20 22 20 2b 20 6d 5f 50 72 6f 63 65 73 73 69 6e 67 45 76 65 6e 74 2e 54 ("Event:.".+.m_ProcessingEvent.T
13020 6f 53 74 72 69 6e 67 28 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 oString());.....................
13040 20 20 20 63 6f 6e 73 75 6d 65 64 45 76 65 6e 74 20 3d 20 74 72 75 65 3b 0d 0a 20 20 20 20 20 20 ...consumedEvent.=.true;........
13060 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 73 68 6f 75 6c 64 43 6f 6e 74 69 6e 75 65 ..............var.shouldContinue
13080 20 3d 20 4b 65 79 50 72 65 73 73 65 64 28 6d 5f 50 72 6f 63 65 73 73 69 6e 67 45 76 65 6e 74 29 .=.KeyPressed(m_ProcessingEvent)
130a0 3b 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 73 68 6f 75 6c ;......................if.(shoul
130c0 64 43 6f 6e 74 69 6e 75 65 20 3d 3d 20 45 64 69 74 53 74 61 74 65 2e 46 69 6e 69 73 68 29 0d 0a dContinue.==.EditState.Finish)..
130e0 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 20 ....................{...........
13100 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 53 65 6e 64 4f 6e 53 75 62 6d 69 74 28 29 3b 0d 0a ...............SendOnSubmit();..
13120 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 44 65 61 63 74 69 76 61 ........................Deactiva
13140 74 65 49 6e 70 75 74 46 69 65 6c 64 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 teInputField();.................
13160 20 20 20 20 20 20 20 20 20 62 72 65 61 6b 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .........break;.................
13180 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 0d 0a 0d 0a 20 20 20 .....}..................}.......
131a0 20 20 20 20 20 20 20 20 20 20 20 20 20 73 77 69 74 63 68 20 28 6d 5f 50 72 6f 63 65 73 73 69 6e .............switch.(m_Processin
131c0 67 45 76 65 6e 74 2e 74 79 70 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d gEvent.type)..................{.
131e0 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 73 65 20 45 76 65 6e 74 54 .....................case.EventT
13200 79 70 65 2e 56 61 6c 69 64 61 74 65 43 6f 6d 6d 61 6e 64 3a 0d 0a 20 20 20 20 20 20 20 20 20 20 ype.ValidateCommand:............
13220 20 20 20 20 20 20 20 20 20 20 63 61 73 65 20 45 76 65 6e 74 54 79 70 65 2e 45 78 65 63 75 74 65 ..........case.EventType.Execute
13240 43 6f 6d 6d 61 6e 64 3a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 Command:........................
13260 20 20 73 77 69 74 63 68 20 28 6d 5f 50 72 6f 63 65 73 73 69 6e 67 45 76 65 6e 74 2e 63 6f 6d 6d ..switch.(m_ProcessingEvent.comm
13280 61 6e 64 4e 61 6d 65 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 andName)........................
132a0 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 20 20 20 ..{.............................
132c0 20 63 61 73 65 20 22 53 65 6c 65 63 74 41 6c 6c 22 3a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 .case."SelectAll":..............
132e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 53 65 6c 65 63 74 41 6c 6c 28 29 3b ....................SelectAll();
13300 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 ................................
13320 20 20 63 6f 6e 73 75 6d 65 64 45 76 65 6e 74 20 3d 20 74 72 75 65 3b 0d 0a 20 20 20 20 20 20 20 ..consumedEvent.=.true;.........
13340 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 62 72 65 61 6b 3b 0d .........................break;.
13360 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 .........................}......
13380 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 72 65 61 6b 3b 0d 0a 20 20 20 20 ....................break;......
133a0 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 7d 0d 0a 0d 0a ............}..............}....
133c0 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 6f 6e 73 75 6d 65 64 45 76 65 6e 74 29 0d 0a ............if.(consumedEvent)..
133e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 55 70 64 61 74 65 4c 61 62 65 6c 28 29 3b 0d 0a ................UpdateLabel();..
13400 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 76 65 6e 74 44 61 74 61 2e 55 73 65 28 29 3b 0d 0a ..............eventData.Use();..
13420 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
13440 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 ary>..........///...........///.
13460 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 6e </summary>..........///.<param.n
13480 61 6d 65 3d 22 65 76 65 6e 74 44 61 74 61 22 3e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 ame="eventData"></param>........
134a0 20 20 70 75 62 6c 69 63 20 76 69 72 74 75 61 6c 20 76 6f 69 64 20 4f 6e 53 63 72 6f 6c 6c 28 50 ..public.virtual.void.OnScroll(P
134c0 6f 69 6e 74 65 72 45 76 65 6e 74 44 61 74 61 20 65 76 65 6e 74 44 61 74 61 29 0d 0a 20 20 20 20 ointerEventData.eventData)......
134e0 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 54 65 78 74 43 6f 6d ....{..............if.(m_TextCom
13500 70 6f 6e 65 6e 74 2e 70 72 65 66 65 72 72 65 64 48 65 69 67 68 74 20 3c 20 6d 5f 54 65 78 74 56 ponent.preferredHeight.<.m_TextV
13520 69 65 77 70 6f 72 74 2e 72 65 63 74 2e 68 65 69 67 68 74 29 20 72 65 74 75 72 6e 3b 0d 0a 0d 0a iewport.rect.height).return;....
13540 20 20 20 20 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 73 63 72 6f 6c 6c 44 69 72 65 63 74 69 6f ............float.scrollDirectio
13560 6e 20 3d 20 2d 65 76 65 6e 74 44 61 74 61 2e 73 63 72 6f 6c 6c 44 65 6c 74 61 2e 79 3b 0d 0a 0d n.=.-eventData.scrollDelta.y;...
13580 0a 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 53 63 72 6f 6c 6c 50 6f 73 69 74 69 6f 6e 20 3d 20 .............m_ScrollPosition.=.
135a0 6d 5f 53 63 72 6f 6c 6c 50 6f 73 69 74 69 6f 6e 20 2b 20 28 31 66 20 2f 20 6d 5f 54 65 78 74 43 m_ScrollPosition.+.(1f./.m_TextC
135c0 6f 6d 70 6f 6e 65 6e 74 2e 74 65 78 74 49 6e 66 6f 2e 6c 69 6e 65 43 6f 75 6e 74 29 20 2a 20 73 omponent.textInfo.lineCount).*.s
135e0 63 72 6f 6c 6c 44 69 72 65 63 74 69 6f 6e 20 2a 20 6d 5f 53 63 72 6f 6c 6c 53 65 6e 73 69 74 69 crollDirection.*.m_ScrollSensiti
13600 76 69 74 79 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 53 63 72 6f 6c 6c 50 6f 73 vity;................m_ScrollPos
13620 69 74 69 6f 6e 20 3d 20 4d 61 74 68 66 2e 43 6c 61 6d 70 30 31 28 6d 5f 53 63 72 6f 6c 6c 50 6f ition.=.Mathf.Clamp01(m_ScrollPo
13640 73 69 74 69 6f 6e 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 41 64 6a 75 73 74 54 65 sition);................AdjustTe
13660 78 74 50 6f 73 69 74 69 6f 6e 52 65 6c 61 74 69 76 65 54 6f 56 69 65 77 70 6f 72 74 28 6d 5f 53 xtPositionRelativeToViewport(m_S
13680 63 72 6f 6c 6c 50 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 2f crollPosition);................/
136a0 2f 20 44 69 73 61 62 6c 65 20 66 6f 63 75 73 20 75 6e 74 69 6c 20 75 73 65 72 20 72 65 2d 73 65 /.Disable.focus.until.user.re-se
136c0 6c 65 63 74 65 64 20 74 68 65 20 69 6e 70 75 74 20 66 69 65 6c 64 2e 0d 0a 20 20 20 20 20 20 20 lected.the.input.field..........
136e0 20 20 20 20 20 6d 5f 41 6c 6c 6f 77 49 6e 70 75 74 20 3d 20 66 61 6c 73 65 3b 0d 0a 0d 0a 20 20 .....m_AllowInput.=.false;......
13700 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 56 65 72 74 69 63 61 6c 53 63 72 6f 6c 6c 62 61 ..........if.(m_VerticalScrollba
13720 72 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 r)..............{...............
13740 20 20 20 6d 5f 49 73 55 70 64 61 74 69 6e 67 53 63 72 6f 6c 6c 62 61 72 56 61 6c 75 65 73 20 3d ...m_IsUpdatingScrollbarValues.=
13760 20 74 72 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 56 65 72 74 69 63 .true;..................m_Vertic
13780 61 6c 53 63 72 6f 6c 6c 62 61 72 2e 76 61 6c 75 65 20 3d 20 6d 5f 53 63 72 6f 6c 6c 50 6f 73 69 alScrollbar.value.=.m_ScrollPosi
137a0 74 69 6f 6e 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 tion;..............}............
137c0 20 20 20 20 2f 2f 44 65 62 75 67 2e 4c 6f 67 28 22 53 63 72 6f 6c 6c 20 50 6f 73 69 74 69 6f 6e ....//Debug.Log("Scroll.Position
137e0 3a 22 20 2b 20 6d 5f 53 63 72 6f 6c 6c 50 6f 73 69 74 69 6f 6e 29 3b 0d 0a 20 20 20 20 20 20 20 :".+.m_ScrollPosition);.........
13800 20 7d 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 69 6e 67 20 47 .}..............private.string.G
13820 65 74 53 65 6c 65 63 74 65 64 53 74 72 69 6e 67 28 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 etSelectedString()..........{...
13840 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 68 61 73 53 65 6c 65 63 74 69 6f 6e 29 0d 0a 20 ...........if.(!hasSelection)...
13860 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 22 22 3b 0d 0a 0d 0a 20 20 20 ...............return."";.......
13880 20 20 20 20 20 20 20 20 20 69 6e 74 20 73 74 61 72 74 50 6f 73 20 3d 20 73 74 72 69 6e 67 50 6f .........int.startPos.=.stringPo
138a0 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 sitionInternal;..............int
138c0 20 65 6e 64 50 6f 73 20 3d 20 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e .endPos.=.stringSelectPositionIn
138e0 74 65 72 6e 61 6c 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 45 6e 73 75 72 65 ternal;................//.Ensure
13900 20 70 6f 73 20 69 73 20 61 6c 77 61 79 73 20 6c 65 73 73 20 74 68 65 6e 20 73 65 6c 50 6f 73 20 .pos.is.always.less.then.selPos.
13920 74 6f 20 6d 61 6b 65 20 74 68 65 20 63 6f 64 65 20 73 69 6d 70 6c 65 72 0d 0a 20 20 20 20 20 20 to.make.the.code.simpler........
13940 20 20 20 20 20 20 69 66 20 28 73 74 61 72 74 50 6f 73 20 3e 20 65 6e 64 50 6f 73 29 0d 0a 20 20 ......if.(startPos.>.endPos)....
13960 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 69 6e 74 ..........{..................int
13980 20 74 65 6d 70 20 3d 20 73 74 61 72 74 50 6f 73 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 .temp.=.startPos;...............
139a0 20 20 20 73 74 61 72 74 50 6f 73 20 3d 20 65 6e 64 50 6f 73 3b 0d 0a 20 20 20 20 20 20 20 20 20 ...startPos.=.endPos;...........
139c0 20 20 20 20 20 20 20 65 6e 64 50 6f 73 20 3d 20 74 65 6d 70 3b 0d 0a 20 20 20 20 20 20 20 20 20 .......endPos.=.temp;...........
139e0 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 66 6f 72 20 28 69 6e 74 20 69 ...}................//for.(int.i
13a00 20 3d 20 6d 5f 43 61 72 65 74 50 6f 73 69 74 69 6f 6e 3b 20 69 20 3c 20 6d 5f 43 61 72 65 74 53 .=.m_CaretPosition;.i.<.m_CaretS
13a20 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 3b 20 69 2b 2b 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 electPosition;.i++).............
13a40 20 2f 2f 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 44 65 62 75 67 2e 4c 6f .//{..............//....Debug.Lo
13a60 67 28 22 43 68 61 72 61 63 74 65 72 20 5b 22 20 2b 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e g("Character.[".+.m_TextComponen
13a80 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 2e 63 68 61 72 t.textInfo.characterInfo[i].char
13aa0 61 63 74 65 72 20 2b 20 22 5d 20 75 73 69 6e 67 20 53 74 79 6c 65 20 5b 22 20 2b 20 6d 5f 54 65 acter.+."].using.Style.[".+.m_Te
13ac0 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
13ae0 66 6f 5b 69 5d 2e 73 74 79 6c 65 20 2b 20 22 5d 20 68 61 73 20 62 65 65 6e 20 73 65 6c 65 63 74 fo[i].style.+."].has.been.select
13b00 65 64 2e 22 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 7d 0d 0a 0d 0a 0d 0a 20 20 20 ed.");..............//}.........
13b20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 74 65 78 74 2e 53 75 62 73 74 72 69 6e 67 28 73 .........return.text.Substring(s
13b40 74 61 72 74 50 6f 73 2c 20 65 6e 64 50 6f 73 20 2d 20 73 74 61 72 74 50 6f 73 29 3b 0d 0a 20 20 tartPos,.endPos.-.startPos);....
13b60 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 69 6e 74 20 46 ......}............private.int.F
13b80 69 6e 64 4e 65 78 74 57 6f 72 64 42 65 67 69 6e 28 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 indNextWordBegin()..........{...
13ba0 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 ...........if.(stringSelectPosit
13bc0 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2b 20 31 20 3e 3d 20 74 65 78 74 2e 4c 65 6e 67 74 68 29 0d ionInternal.+.1.>=.text.Length).
13be0 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 65 78 74 2e 4c 65 6e .................return.text.Len
13c00 67 74 68 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 20 73 70 61 63 65 4c 6f 63 gth;................int.spaceLoc
13c20 20 3d 20 74 65 78 74 2e 49 6e 64 65 78 4f 66 41 6e 79 28 6b 53 65 70 61 72 61 74 6f 72 73 2c 20 .=.text.IndexOfAny(kSeparators,.
13c40 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2b 20 31 stringSelectPositionInternal.+.1
13c60 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 70 61 63 65 4c 6f 63 20 3d );................if.(spaceLoc.=
13c80 3d 20 2d 31 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 70 61 63 65 4c 6f 63 20 =.-1)..................spaceLoc.
13ca0 3d 20 74 65 78 74 2e 4c 65 6e 67 74 68 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 =.text.Length;..............else
13cc0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 70 61 63 65 4c 6f 63 2b 2b 3b 0d 0a 0d ..................spaceLoc++;...
13ce0 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 73 70 61 63 65 4c 6f 63 3b 0d 0a 20 .............return.spaceLoc;...
13d00 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 76 6f 69 64 .......}............private.void
13d20 20 4d 6f 76 65 52 69 67 68 74 28 62 6f 6f 6c 20 73 68 69 66 74 2c 20 62 6f 6f 6c 20 63 74 72 6c .MoveRight(bool.shift,.bool.ctrl
13d40 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 66 20 28 68 61 )..........{..............if.(ha
13d60 73 53 65 6c 65 63 74 69 6f 6e 20 26 26 20 21 73 68 69 66 74 29 0d 0a 20 20 20 20 20 20 20 20 20 sSelection.&&.!shift)...........
13d80 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 42 79 20 63 6f 6e 76 ...{..................//.By.conv
13da0 65 6e 74 69 6f 6e 2c 20 69 66 20 77 65 20 68 61 76 65 20 61 20 73 65 6c 65 63 74 69 6f 6e 20 61 ention,.if.we.have.a.selection.a
13dc0 6e 64 20 6d 6f 76 65 20 72 69 67 68 74 20 77 69 74 68 6f 75 74 20 68 6f 6c 64 69 6e 67 20 73 68 nd.move.right.without.holding.sh
13de0 69 66 74 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 77 65 20 6a 75 73 74 ift,..................//.we.just
13e00 20 70 6c 61 63 65 20 74 68 65 20 63 75 72 73 6f 72 20 61 74 20 74 68 65 20 65 6e 64 2e 0d 0a 20 .place.the.cursor.at.the.end....
13e20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 ...............stringPositionInt
13e40 65 72 6e 61 6c 20 3d 20 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 ernal.=.stringSelectPositionInte
13e60 72 6e 61 6c 20 3d 20 4d 61 74 68 66 2e 4d 61 78 28 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 rnal.=.Mathf.Max(stringPositionI
13e80 6e 74 65 72 6e 61 6c 2c 20 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 nternal,.stringSelectPositionInt
13ea0 65 72 6e 61 6c 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 72 65 74 50 6f ernal);..................caretPo
13ec0 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 63 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 sitionInternal.=.caretSelectPosi
13ee0 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 47 65 74 43 61 72 65 74 50 6f 73 69 74 69 6f 6e 46 tionInternal.=.GetCaretPositionF
13f00 72 6f 6d 53 74 72 69 6e 67 49 6e 64 65 78 28 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 romStringIndex(stringSelectPosit
13f20 69 6f 6e 49 6e 74 65 72 6e 61 6c 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ionInternal);...................
13f40 20 23 69 66 20 54 4d 50 5f 44 45 42 55 47 5f 4d 4f 44 45 0d 0a 20 20 20 20 20 20 20 20 20 20 20 .#if.TMP_DEBUG_MODE.............
13f60 20 20 20 20 20 20 20 20 20 44 65 62 75 67 2e 4c 6f 67 28 22 43 61 72 65 74 20 50 6f 73 69 74 69 .........Debug.Log("Caret.Positi
13f80 6f 6e 3a 20 22 20 2b 20 63 61 72 65 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2b 20 on:.".+.caretPositionInternal.+.
13fa0 22 20 53 65 6c 65 63 74 69 6f 6e 20 50 6f 73 69 74 69 6f 6e 3a 20 22 20 2b 20 63 61 72 65 74 53 ".Selection.Position:.".+.caretS
13fc0 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2b 20 22 20 20 53 74 72 69 6e electPositionInternal.+."..Strin
13fe0 67 20 50 6f 73 69 74 69 6f 6e 3a 20 22 20 2b 20 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e g.Position:.".+.stringPositionIn
14000 74 65 72 6e 61 6c 20 2b 20 22 20 53 74 72 69 6e 67 20 53 65 6c 65 63 74 20 50 6f 73 69 74 69 6f ternal.+.".String.Select.Positio
14020 6e 3a 20 22 20 2b 20 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 n:.".+.stringSelectPositionInter
14040 6e 61 6c 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 23 65 6e 64 69 66 0d 0a 20 nal);..................#endif...
14060 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 3b 0d 0a 20 20 20 20 20 20 20 20 ...............return;..........
14080 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 20 70 6f 73 69 74 69 6f ....}................int.positio
140a0 6e 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 74 72 6c 29 0d 0a 20 20 20 20 20 n;..............if.(ctrl).......
140c0 20 20 20 20 20 20 20 20 20 20 20 70 6f 73 69 74 69 6f 6e 20 3d 20 46 69 6e 64 4e 65 78 74 57 6f ...........position.=.FindNextWo
140e0 72 64 42 65 67 69 6e 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 0d 0a 20 20 rdBegin();..............else....
14100 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 69 66 20 ..........{..................if.
14120 28 6d 5f 69 73 52 69 63 68 54 65 78 74 45 64 69 74 69 6e 67 41 6c 6c 6f 77 65 64 29 0d 0a 20 20 (m_isRichTextEditingAllowed)....
14140 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 20 20 ..............{.................
14160 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 66 6f 72 20 53 75 72 .....//.Special.handling.for.Sur
14180 72 6f 67 61 74 65 20 70 61 69 72 73 20 61 6e 64 20 44 69 61 63 72 69 74 69 63 61 6c 20 6d 61 72 rogate.pairs.and.Diacritical.mar
141a0 6b 73 2e 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 73 74 72 ks.......................if.(str
141c0 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3c 20 74 65 78 74 ingSelectPositionInternal.<.text
141e0 2e 4c 65 6e 67 74 68 20 26 26 20 63 68 61 72 2e 49 73 48 69 67 68 53 75 72 72 6f 67 61 74 65 28 .Length.&&.char.IsHighSurrogate(
14200 74 65 78 74 5b 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 text[stringSelectPositionInterna
14220 6c 5d 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 70 6f l]))..........................po
14240 73 69 74 69 6f 6e 20 3d 20 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 sition.=.stringSelectPositionInt
14260 65 72 6e 61 6c 20 2b 20 32 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ernal.+.2;......................
14280 65 6c 73 65 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 70 6f else..........................po
142a0 73 69 74 69 6f 6e 20 3d 20 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 sition.=.stringSelectPositionInt
142c0 65 72 6e 61 6c 20 2b 20 31 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 ernal.+.1;..................}...
142e0 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 20 20 20 20 20 ...............else.............
14300 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 70 6f 73 69 .....{......................posi
14320 74 69 6f 6e 20 3d 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 65 78 74 49 6e 66 6f 2e tion.=.m_TextComponent.textInfo.
14340 63 68 61 72 61 63 74 65 72 49 6e 66 6f 5b 63 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f characterInfo[caretSelectPositio
14360 6e 49 6e 74 65 72 6e 61 6c 5d 2e 69 6e 64 65 78 20 2b 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 nInternal].index.+.m_TextCompone
14380 6e 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 61 72 65 74 53 nt.textInfo.characterInfo[caretS
143a0 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 5d 2e 73 74 72 69 6e 67 4c 65 6e electPositionInternal].stringLen
143c0 67 74 68 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 20 gth;..................}.........
143e0 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 68 69 66 .......}................if.(shif
14400 74 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 t)..............{...............
14420 20 20 20 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 ...stringSelectPositionInternal.
14440 3d 20 70 6f 73 69 74 69 6f 6e 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 72 =.position;..................car
14460 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 47 65 74 43 61 etSelectPositionInternal.=.GetCa
14480 72 65 74 50 6f 73 69 74 69 6f 6e 46 72 6f 6d 53 74 72 69 6e 67 49 6e 64 65 78 28 73 74 72 69 6e retPositionFromStringIndex(strin
144a0 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 29 3b 0d 0a 20 20 20 20 20 gSelectPositionInternal);.......
144c0 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 0d 0a 20 20 20 20 .......}..............else......
144e0 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 73 74 72 69 6e ........{..................strin
14500 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 73 74 72 69 6e 67 gSelectPositionInternal.=.string
14520 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 70 6f 73 69 74 69 6f 6e 3b 0d 0a 0d 0a PositionInternal.=.position;....
14540 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4f 6e 6c 79 20 69 6e 63 72 65 61 73 65 ................//.Only.increase
14560 20 63 61 72 65 74 20 70 6f 73 69 74 69 6f 6e 20 61 73 20 77 65 20 63 72 6f 73 73 20 63 68 61 72 .caret.position.as.we.cross.char
14580 61 63 74 65 72 20 62 6f 75 6e 64 61 72 79 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 acter.boundary..................
145a0 20 69 66 20 28 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3e 3d 20 6d .if.(stringPositionInternal.>=.m
145c0 5f 54 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 74 65 _TextComponent.textInfo.characte
145e0 72 49 6e 66 6f 5b 63 61 72 65 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 5d 2e 69 6e 64 rInfo[caretPositionInternal].ind
14600 65 78 20 2b 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 65 78 74 49 6e 66 6f 2e 63 68 ex.+.m_TextComponent.textInfo.ch
14620 61 72 61 63 74 65 72 49 6e 66 6f 5b 63 61 72 65 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 aracterInfo[caretPositionInterna
14640 6c 5d 2e 73 74 72 69 6e 67 4c 65 6e 67 74 68 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 l].stringLength)................
14660 20 20 20 20 20 20 63 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 ......caretSelectPositionInterna
14680 6c 20 3d 20 63 61 72 65 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 47 65 74 43 l.=.caretPositionInternal.=.GetC
146a0 61 72 65 74 50 6f 73 69 74 69 6f 6e 46 72 6f 6d 53 74 72 69 6e 67 49 6e 64 65 78 28 73 74 72 69 aretPositionFromStringIndex(stri
146c0 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 29 3b 0d 0a 20 20 20 20 ngSelectPositionInternal);......
146e0 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 23 69 66 20 54 4d 50 ........}................#if.TMP
14700 5f 44 45 42 55 47 5f 4d 4f 44 45 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 44 65 62 _DEBUG_MODE..................Deb
14720 75 67 2e 4c 6f 67 28 22 43 61 72 65 74 20 50 6f 73 69 74 69 6f 6e 3a 20 22 20 2b 20 63 61 72 65 ug.Log("Caret.Position:.".+.care
14740 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2b 20 22 20 20 53 65 6c 65 63 74 69 6f 6e tPositionInternal.+."..Selection
14760 20 50 6f 73 69 74 69 6f 6e 3a 20 22 20 2b 20 63 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 .Position:.".+.caretSelectPositi
14780 6f 6e 49 6e 74 65 72 6e 61 6c 20 2b 20 22 20 20 53 74 72 69 6e 67 20 50 6f 73 69 74 69 6f 6e 3a onInternal.+."..String.Position:
147a0 20 22 20 2b 20 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2b 20 22 20 .".+.stringPositionInternal.+.".
147c0 20 53 74 72 69 6e 67 20 53 65 6c 65 63 74 20 50 6f 73 69 74 69 6f 6e 3a 20 22 20 2b 20 73 74 72 .String.Select.Position:.".+.str
147e0 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 29 3b 0d 0a 20 20 20 ingSelectPositionInternal);.....
14800 20 20 20 20 20 20 20 20 20 23 65 6e 64 69 66 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 .........#endif..........}......
14820 20 20 20 20 20 20 70 72 69 76 61 74 65 20 69 6e 74 20 46 69 6e 64 50 72 65 76 57 6f 72 64 42 65 ......private.int.FindPrevWordBe
14840 67 69 6e 28 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 66 gin()..........{..............if
14860 20 28 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2d .(stringSelectPositionInternal.-
14880 20 32 20 3c 20 30 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 .2.<.0)..................return.
148a0 30 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 20 73 70 61 63 65 4c 6f 63 20 3d 0;................int.spaceLoc.=
148c0 20 74 65 78 74 2e 4c 61 73 74 49 6e 64 65 78 4f 66 41 6e 79 28 6b 53 65 70 61 72 61 74 6f 72 73 .text.LastIndexOfAny(kSeparators
148e0 2c 20 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2d ,.stringSelectPositionInternal.-
14900 20 32 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 70 61 63 65 4c 6f 63 .2);................if.(spaceLoc
14920 20 3d 3d 20 2d 31 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 70 61 63 65 4c 6f .==.-1)..................spaceLo
14940 63 20 3d 20 30 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 20 c.=.0;..............else........
14960 20 20 20 20 20 20 20 20 20 20 73 70 61 63 65 4c 6f 63 2b 2b 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 ..........spaceLoc++;...........
14980 20 20 20 20 20 72 65 74 75 72 6e 20 73 70 61 63 65 4c 6f 63 3b 0d 0a 20 20 20 20 20 20 20 20 7d .....return.spaceLoc;..........}
149a0 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 76 6f 69 64 20 4d 6f 76 65 4c 65 66 ............private.void.MoveLef
149c0 74 28 62 6f 6f 6c 20 73 68 69 66 74 2c 20 62 6f 6f 6c 20 63 74 72 6c 29 0d 0a 20 20 20 20 20 20 t(bool.shift,.bool.ctrl)........
149e0 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 68 61 73 53 65 6c 65 63 74 69 6f ..{..............if.(hasSelectio
14a00 6e 20 26 26 20 21 73 68 69 66 74 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 n.&&.!shift)..............{.....
14a20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 42 79 20 63 6f 6e 76 65 6e 74 69 6f 6e 2c 20 69 .............//.By.convention,.i
14a40 66 20 77 65 20 68 61 76 65 20 61 20 73 65 6c 65 63 74 69 6f 6e 20 61 6e 64 20 6d 6f 76 65 20 6c f.we.have.a.selection.and.move.l
14a60 65 66 74 20 77 69 74 68 6f 75 74 20 68 6f 6c 64 69 6e 67 20 73 68 69 66 74 2c 0d 0a 20 20 20 20 eft.without.holding.shift,......
14a80 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 77 65 20 6a 75 73 74 20 70 6c 61 63 65 20 74 68 65 ............//.we.just.place.the
14aa0 20 63 75 72 73 6f 72 20 61 74 20 74 68 65 20 73 74 61 72 74 2e 0d 0a 20 20 20 20 20 20 20 20 20 .cursor.at.the.start............
14ac0 20 20 20 20 20 20 20 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 .......stringPositionInternal.=.
14ae0 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 4d stringSelectPositionInternal.=.M
14b00 61 74 68 66 2e 4d 69 6e 28 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 2c athf.Min(stringPositionInternal,
14b20 20 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 29 3b 0d .stringSelectPositionInternal);.
14b40 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 72 65 74 50 6f 73 69 74 69 6f 6e 49 6e .................caretPositionIn
14b60 74 65 72 6e 61 6c 20 3d 20 63 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 ternal.=.caretSelectPositionInte
14b80 72 6e 61 6c 20 3d 20 47 65 74 43 61 72 65 74 50 6f 73 69 74 69 6f 6e 46 72 6f 6d 53 74 72 69 6e rnal.=.GetCaretPositionFromStrin
14ba0 67 49 6e 64 65 78 28 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 gIndex(stringSelectPositionInter
14bc0 6e 61 6c 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 23 69 66 20 54 4d 50 nal);....................#if.TMP
14be0 5f 44 45 42 55 47 5f 4d 4f 44 45 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 _DEBUG_MODE.....................
14c00 20 44 65 62 75 67 2e 4c 6f 67 28 22 43 61 72 65 74 20 50 6f 73 69 74 69 6f 6e 3a 20 22 20 2b 20 .Debug.Log("Caret.Position:.".+.
14c20 63 61 72 65 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2b 20 22 20 53 65 6c 65 63 74 caretPositionInternal.+.".Select
14c40 69 6f 6e 20 50 6f 73 69 74 69 6f 6e 3a 20 22 20 2b 20 63 61 72 65 74 53 65 6c 65 63 74 50 6f 73 ion.Position:.".+.caretSelectPos
14c60 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2b 20 22 20 20 53 74 72 69 6e 67 20 50 6f 73 69 74 69 itionInternal.+."..String.Positi
14c80 6f 6e 3a 20 22 20 2b 20 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2b on:.".+.stringPositionInternal.+
14ca0 20 22 20 53 74 72 69 6e 67 20 53 65 6c 65 63 74 20 50 6f 73 69 74 69 6f 6e 3a 20 22 20 2b 20 73 .".String.Select.Position:.".+.s
14cc0 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 29 3b 0d 0a 20 tringSelectPositionInternal);...
14ce0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 23 65 6e 64 69 66 0d 0a 20 20 20 20 20 20 20 20 20 ...............#endif...........
14d00 20 20 20 20 20 20 20 72 65 74 75 72 6e 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d .......return;..............}...
14d20 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 20 70 6f 73 69 74 69 6f 6e 3b 0d 0a 20 20 20 20 .............int.position;......
14d40 20 20 20 20 20 20 20 20 69 66 20 28 63 74 72 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 ........if.(ctrl)...............
14d60 20 20 20 70 6f 73 69 74 69 6f 6e 20 3d 20 46 69 6e 64 50 72 65 76 57 6f 72 64 42 65 67 69 6e 28 ...position.=.FindPrevWordBegin(
14d80 29 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 20 20 20 20 20 );..............else............
14da0 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 6d 5f 69 73 52 69 63 ..{..................if.(m_isRic
14dc0 68 54 65 78 74 45 64 69 74 69 6e 67 41 6c 6c 6f 77 65 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 hTextEditingAllowed)............
14de0 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 2f 2f 20 ......{......................//.
14e00 53 70 65 63 69 61 6c 20 68 61 6e 64 6c 69 6e 67 20 66 6f 72 20 53 75 72 72 6f 67 61 74 65 20 70 Special.handling.for.Surrogate.p
14e20 61 69 72 73 20 61 6e 64 20 44 69 61 63 72 69 74 69 63 61 6c 20 6d 61 72 6b 73 2e 0d 0a 20 20 20 airs.and.Diacritical.marks......
14e40 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 74 72 69 6e 67 53 65 6c 65 63 .................if.(stringSelec
14e60 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3e 20 30 20 26 26 20 63 68 61 72 2e 49 73 tPositionInternal.>.0.&&.char.Is
14e80 4c 6f 77 53 75 72 72 6f 67 61 74 65 28 74 65 78 74 5b 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f LowSurrogate(text[stringSelectPo
14ea0 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2d 20 31 5d 29 29 0d 0a 20 20 20 20 20 20 20 20 20 sitionInternal.-.1]))...........
14ec0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 70 6f 73 69 74 69 6f 6e 20 3d 20 73 74 72 69 6e 67 ...............position.=.string
14ee0 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2d 20 32 3b 0d 0a 20 20 20 SelectPositionInternal.-.2;.....
14f00 20 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 20 20 20 .................else...........
14f20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 70 6f 73 69 74 69 6f 6e 20 3d 20 20 73 74 72 69 6e ...............position.=..strin
14f40 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2d 20 31 3b 0d 0a 20 20 gSelectPositionInternal.-.1;....
14f60 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 20 ..............}.................
14f80 20 65 6c 73 65 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 .else..................{........
14fa0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 70 6f 73 69 74 69 6f 6e 20 3d 20 47 65 74 53 74 ..............//position.=.GetSt
14fc0 72 69 6e 67 49 6e 64 65 78 46 72 6f 6d 43 61 72 65 74 50 6f 73 69 74 69 6f 6e 28 63 61 72 65 74 ringIndexFromCaretPosition(caret
14fe0 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2d 20 31 29 3b 0d 0a 20 20 SelectPositionInternal.-.1);....
15000 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 70 6f 73 69 74 69 6f 6e 20 3d 20 63 61 72 ..................position.=.car
15020 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3c 20 32 0d 0a 20 20 etSelectPositionInternal.<.2....
15040 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 3f 20 6d 5f 54 65 78 74 43 6f ......................?.m_TextCo
15060 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 66 6f 5b 30 mponent.textInfo.characterInfo[0
15080 5d 2e 69 6e 64 65 78 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 ].index.........................
150a0 20 3a 20 6d 5f 54 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 .:.m_TextComponent.textInfo.char
150c0 61 63 74 65 72 49 6e 66 6f 5b 63 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 acterInfo[caretSelectPositionInt
150e0 65 72 6e 61 6c 20 2d 20 32 5d 2e 69 6e 64 65 78 20 2b 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 ernal.-.2].index.+.m_TextCompone
15100 6e 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 61 72 65 74 53 nt.textInfo.characterInfo[caretS
15120 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2d 20 32 5d 2e 73 74 72 69 6e electPositionInternal.-.2].strin
15140 67 4c 65 6e 67 74 68 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 gLength;..................}.....
15160 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 69 66 20 28 73 68 .........}................if.(sh
15180 69 66 74 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 ift)..............{.............
151a0 20 20 20 20 20 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 .....stringSelectPositionInterna
151c0 6c 20 3d 20 70 6f 73 69 74 69 6f 6e 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 l.=.position;..................c
151e0 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 47 65 74 aretSelectPositionInternal.=.Get
15200 43 61 72 65 74 50 6f 73 69 74 69 6f 6e 46 72 6f 6d 53 74 72 69 6e 67 49 6e 64 65 78 28 73 74 72 CaretPositionFromStringIndex(str
15220 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 29 3b 0d 0a 20 20 20 ingSelectPositionInternal);.....
15240 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 0d 0a 20 20 .........}..............else....
15260 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 73 74 72 ..........{..................str
15280 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 73 74 72 69 ingSelectPositionInternal.=.stri
152a0 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 70 6f 73 69 74 69 6f 6e 3b 0d 0a ngPositionInternal.=.position;..
152c0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4f 6e 6c 79 20 64 65 63 72 65 61 ..................//.Only.decrea
152e0 73 65 20 63 61 72 65 74 20 70 6f 73 69 74 69 6f 6e 20 61 73 20 77 65 20 63 72 6f 73 73 20 63 68 se.caret.position.as.we.cross.ch
15300 61 72 61 63 74 65 72 20 62 6f 75 6e 64 61 72 79 2e 20 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 aracter.boundary................
15320 20 20 20 20 69 66 20 28 63 61 72 65 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3e 20 ....if.(caretPositionInternal.>.
15340 30 20 26 26 20 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3c 3d 20 6d 0.&&.stringPositionInternal.<=.m
15360 5f 54 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 74 65 _TextComponent.textInfo.characte
15380 72 49 6e 66 6f 5b 63 61 72 65 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2d 20 31 5d rInfo[caretPositionInternal.-.1]
153a0 2e 69 6e 64 65 78 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 72 .index)......................car
153c0 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 63 61 72 65 74 etSelectPositionInternal.=.caret
153e0 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 47 65 74 43 61 72 65 74 50 6f 73 69 74 PositionInternal.=.GetCaretPosit
15400 69 6f 6e 46 72 6f 6d 53 74 72 69 6e 67 49 6e 64 65 78 28 73 74 72 69 6e 67 53 65 6c 65 63 74 50 ionFromStringIndex(stringSelectP
15420 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d ositionInternal);..............}
15440 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 23 69 66 20 54 4d 50 5f 44 45 42 55 47 5f 4d 4f ................#if.TMP_DEBUG_MO
15460 44 45 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 44 65 62 75 67 2e 4c 6f 67 28 22 43 DE..................Debug.Log("C
15480 61 72 65 74 20 50 6f 73 69 74 69 6f 6e 3a 20 22 20 2b 20 63 61 72 65 74 50 6f 73 69 74 69 6f 6e aret.Position:.".+.caretPosition
154a0 49 6e 74 65 72 6e 61 6c 20 2b 20 22 20 20 53 65 6c 65 63 74 69 6f 6e 20 50 6f 73 69 74 69 6f 6e Internal.+."..Selection.Position
154c0 3a 20 22 20 2b 20 63 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 :.".+.caretSelectPositionInterna
154e0 6c 20 2b 20 22 20 20 53 74 72 69 6e 67 20 50 6f 73 69 74 69 6f 6e 3a 20 22 20 2b 20 73 74 72 69 l.+."..String.Position:.".+.stri
15500 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2b 20 22 20 20 53 74 72 69 6e 67 20 53 ngPositionInternal.+."..String.S
15520 65 6c 65 63 74 20 50 6f 73 69 74 69 6f 6e 3a 20 22 20 2b 20 73 74 72 69 6e 67 53 65 6c 65 63 74 elect.Position:.".+.stringSelect
15540 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 PositionInternal);..............
15560 23 65 6e 64 69 66 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 70 #endif..........}..............p
15580 72 69 76 61 74 65 20 69 6e 74 20 4c 69 6e 65 55 70 43 68 61 72 61 63 74 65 72 50 6f 73 69 74 69 rivate.int.LineUpCharacterPositi
155a0 6f 6e 28 69 6e 74 20 6f 72 69 67 69 6e 61 6c 50 6f 73 2c 20 62 6f 6f 6c 20 67 6f 54 6f 46 69 72 on(int.originalPos,.bool.goToFir
155c0 73 74 43 68 61 72 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 stChar)..........{..............
155e0 69 66 20 28 6f 72 69 67 69 6e 61 6c 50 6f 73 20 3e 3d 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 if.(originalPos.>=.m_TextCompone
15600 6e 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 29 0d 0a 20 20 20 nt.textInfo.characterCount).....
15620 20 20 20 20 20 20 20 20 20 20 20 20 20 6f 72 69 67 69 6e 61 6c 50 6f 73 20 2d 3d 20 31 3b 0d 0a .............originalPos.-=.1;..
15640 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 49 6e 66 6f 20 ..............TMP_CharacterInfo.
15660 6f 72 69 67 69 6e 43 68 61 72 20 3d 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 65 78 originChar.=.m_TextComponent.tex
15680 74 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 49 6e 66 6f 5b 6f 72 69 67 69 6e 61 6c 50 6f 73 5d tInfo.characterInfo[originalPos]
156a0 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 20 6f 72 69 67 69 6e 4c 69 6e 65 20 3d 20 ;..............int.originLine.=.
156c0 6f 72 69 67 69 6e 43 68 61 72 2e 6c 69 6e 65 4e 75 6d 62 65 72 3b 0d 0a 0d 0a 20 20 20 20 20 20 originChar.lineNumber;..........
156e0 20 20 20 20 20 20 2f 2f 20 57 65 20 61 72 65 20 6f 6e 20 74 68 65 20 66 69 72 73 74 20 6c 69 6e ......//.We.are.on.the.first.lin
15700 65 20 72 65 74 75 72 6e 20 66 69 72 73 74 20 63 68 61 72 61 63 74 65 72 0d 0a 20 20 20 20 20 20 e.return.first.character........
15720 20 20 20 20 20 20 69 66 20 28 6f 72 69 67 69 6e 4c 69 6e 65 20 2d 20 31 20 3c 20 30 29 0d 0a 20 ......if.(originLine.-.1.<.0)...
15740 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 67 6f 54 6f 46 69 72 73 74 43 ...............return.goToFirstC
15760 68 61 72 20 3f 20 30 20 3a 20 6f 72 69 67 69 6e 61 6c 50 6f 73 3b 0d 0a 0d 0a 20 20 20 20 20 20 har.?.0.:.originalPos;..........
15780 20 20 20 20 20 20 69 6e 74 20 65 6e 64 43 68 61 72 49 64 78 20 3d 20 6d 5f 54 65 78 74 43 6f 6d ......int.endCharIdx.=.m_TextCom
157a0 70 6f 6e 65 6e 74 2e 74 65 78 74 49 6e 66 6f 2e 6c 69 6e 65 49 6e 66 6f 5b 6f 72 69 67 69 6e 4c ponent.textInfo.lineInfo[originL
157c0 69 6e 65 5d 2e 66 69 72 73 74 43 68 61 72 61 63 74 65 72 49 6e 64 65 78 20 2d 20 31 3b 0d 0a 0d ine].firstCharacterIndex.-.1;...
157e0 0a 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 2d 31 3b 0d 0a .............int.closest.=.-1;..
15800 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 20 3d 20 54 4d 50 ............float.distance.=.TMP
15820 5f 4d 61 74 68 2e 46 4c 4f 41 54 5f 4d 41 58 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 6c _Math.FLOAT_MAX;..............fl
15840 6f 61 74 20 72 61 6e 67 65 20 3d 20 30 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 6f oat.range.=.0;................fo
15860 72 20 28 69 6e 74 20 69 20 3d 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 65 78 74 49 r.(int.i.=.m_TextComponent.textI
15880 6e 66 6f 2e 6c 69 6e 65 49 6e 66 6f 5b 6f 72 69 67 69 6e 4c 69 6e 65 20 2d 20 31 5d 2e 66 69 72 nfo.lineInfo[originLine.-.1].fir
158a0 73 74 43 68 61 72 61 63 74 65 72 49 6e 64 65 78 3b 20 69 20 3c 20 65 6e 64 43 68 61 72 49 64 78 stCharacterIndex;.i.<.endCharIdx
158c0 3b 20 2b 2b 69 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)..............{...........
158e0 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 6e 74 .......TMP_CharacterInfo.current
15900 43 68 61 72 20 3d 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 65 78 74 49 6e 66 6f 2e Char.=.m_TextComponent.textInfo.
15920 63 68 61 72 61 63 74 65 72 49 6e 66 6f 5b 69 5d 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 characterInfo[i];...............
15940 20 20 20 20 20 66 6c 6f 61 74 20 64 20 3d 20 6f 72 69 67 69 6e 43 68 61 72 2e 6f 72 69 67 69 6e .....float.d.=.originChar.origin
15960 20 2d 20 63 75 72 72 65 6e 74 43 68 61 72 2e 6f 72 69 67 69 6e 3b 0d 0a 20 20 20 20 20 20 20 20 .-.currentChar.origin;..........
15980 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 72 20 3d 20 64 20 2f 20 28 63 75 72 72 65 6e 74 43 68 ........float.r.=.d./.(currentCh
159a0 61 72 2e 78 41 64 76 61 6e 63 65 20 2d 20 63 75 72 72 65 6e 74 43 68 61 72 2e 6f 72 69 67 69 6e ar.xAdvance.-.currentChar.origin
159c0 29 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 72 20 3e 3d 20 30 );....................if.(r.>=.0
159e0 20 26 26 20 72 20 3c 3d 20 31 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a .&&.r.<=.1)..................{..
15a00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 72 20 3c 20 30 2e 35 66 ....................if.(r.<.0.5f
15a20 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 72 65 74 75 72 )..........................retur
15a40 6e 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 65 6c 73 65 0d 0a n.i;......................else..
15a60 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 72 6e 20 69 ........................return.i
15a80 20 2b 20 31 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 .+.1;..................}........
15aa0 20 20 20 20 20 20 20 20 20 20 20 20 64 20 3d 20 4d 61 74 68 66 2e 41 62 73 28 64 29 3b 0d 0a 0d ............d.=.Mathf.Abs(d);...
15ac0 0a 20 20 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 .................if.(d.<.distanc
15ae0 65 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 20 20 20 20 20 e)..................{...........
15b00 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;.........
15b20 20 20 20 20 20 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 .............distance.=.d;......
15b40 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 61 6e 67 65 20 3d 20 72 3b 0d 0a 20 20 20 20 ................range.=.r;......
15b60 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 7d 0d 0a 0d 0a ............}..............}....
15b80 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 6c 6f 73 65 73 74 20 3d 3d 20 2d 31 29 20 72 ............if.(closest.==.-1).r
15ba0 65 74 75 72 6e 20 65 6e 64 43 68 61 72 49 64 78 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 eturn.endCharIdx;...............
15bc0 20 2f 2f 44 65 62 75 67 2e 4c 6f 67 28 22 52 65 74 75 72 6e 69 6e 67 20 6e 65 61 72 65 73 74 20 .//Debug.Log("Returning.nearest.
15be0 63 68 61 72 61 63 74 65 72 20 77 69 74 68 20 52 61 6e 67 65 20 3d 20 22 20 2b 20 72 61 6e 67 65 character.with.Range.=.".+.range
15c00 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 72 61 6e 67 65 20 3c 20 30 2e );................if.(range.<.0.
15c20 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 20 63 6c 6f 73 5f)..................return.clos
15c40 65 73 74 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 20 20 20 est;..............else..........
15c60 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 63 6c 6f 73 65 73 74 20 2b 20 31 3b 0d 0a 20 20 20 ........return.closest.+.1;.....
15c80 20 20 20 20 20 7d 0d 0a 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 69 6e 74 20 .....}..............private.int.
15ca0 4c 69 6e 65 44 6f 77 6e 43 68 61 72 61 63 74 65 72 50 6f 73 69 74 69 6f 6e 28 69 6e 74 20 6f 72 LineDownCharacterPosition(int.or
15cc0 69 67 69 6e 61 6c 50 6f 73 2c 20 62 6f 6f 6c 20 67 6f 54 6f 4c 61 73 74 43 68 61 72 29 0d 0a 20 iginalPos,.bool.goToLastChar)...
15ce0 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 6f 72 69 67 69 6e .......{..............if.(origin
15d00 61 6c 50 6f 73 20 3e 3d 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 65 78 74 49 6e 66 alPos.>=.m_TextComponent.textInf
15d20 6f 2e 63 68 61 72 61 63 74 65 72 43 6f 75 6e 74 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 o.characterCount)...............
15d40 20 20 20 72 65 74 75 72 6e 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 65 78 74 49 6e ...return.m_TextComponent.textIn
15d60 66 6f 2e 63 68 61 72 61 63 74 65 72 43 6f 75 6e 74 20 2d 20 31 3b 20 2f 2f 20 74 65 78 74 2e 4c fo.characterCount.-.1;.//.text.L
15d80 65 6e 67 74 68 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 ength;................TMP_Charac
15da0 74 65 72 49 6e 66 6f 20 6f 72 69 67 69 6e 43 68 61 72 20 3d 20 6d 5f 54 65 78 74 43 6f 6d 70 6f terInfo.originChar.=.m_TextCompo
15dc0 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 66 6f 5b 6f 72 69 67 nent.textInfo.characterInfo[orig
15de0 69 6e 61 6c 50 6f 73 5d 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 20 6f 72 69 67 69 inalPos];..............int.origi
15e00 6e 4c 69 6e 65 20 3d 20 6f 72 69 67 69 6e 43 68 61 72 2e 6c 69 6e 65 4e 75 6d 62 65 72 3b 0d 0a nLine.=.originChar.lineNumber;..
15e20 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 2f 20 57 65 20 61 72 65 20 6f 6e 20 74 68 65 ..............////.We.are.on.the
15e40 20 6c 61 73 74 20 6c 69 6e 65 20 72 65 74 75 72 6e 20 6c 61 73 74 20 63 68 61 72 61 63 74 65 72 .last.line.return.last.character
15e60 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6f 72 69 67 69 6e 4c 69 6e 65 20 2b 20 31 ..............if.(originLine.+.1
15e80 20 3e 3d 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 65 78 74 49 6e 66 6f 2e 6c 69 6e .>=.m_TextComponent.textInfo.lin
15ea0 65 43 6f 75 6e 74 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 eCount)..................return.
15ec0 67 6f 54 6f 4c 61 73 74 43 68 61 72 20 3f 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 goToLastChar.?.m_TextComponent.t
15ee0 65 78 74 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 43 6f 75 6e 74 20 2d 20 31 20 3a 20 6f 72 69 extInfo.characterCount.-.1.:.ori
15f00 67 69 6e 61 6c 50 6f 73 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4e 65 65 64 ginalPos;................//.Need
15f20 20 74 6f 20 64 65 74 65 72 6d 69 6e 65 20 65 6e 64 20 6c 69 6e 65 20 66 6f 72 20 6e 65 78 74 20 .to.determine.end.line.for.next.
15f40 6c 69 6e 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 20 65 6e 64 43 68 61 72 49 64 line...............int.endCharId
15f60 78 20 3d 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 65 78 74 49 6e 66 6f 2e 6c 69 6e x.=.m_TextComponent.textInfo.lin
15f80 65 49 6e 66 6f 5b 6f 72 69 67 69 6e 4c 69 6e 65 20 2b 20 31 5d 2e 6c 61 73 74 43 68 61 72 61 63 eInfo[originLine.+.1].lastCharac
15fa0 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 69 6e 74 20 63 6c 6f terIndex;................int.clo
15fc0 73 65 73 74 20 3d 20 2d 31 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 64 69 sest.=.-1;..............float.di
15fe0 73 74 61 6e 63 65 20 3d 20 54 4d 50 5f 4d 61 74 68 2e 46 4c 4f 41 54 5f 4d 41 58 3b 0d 0a 20 20 stance.=.TMP_Math.FLOAT_MAX;....
16000 20 20 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 72 61 6e 67 65 20 3d 20 30 3b 0d 0a 0d 0a 20 20 ..........float.range.=.0;......
16020 20 20 20 20 20 20 20 20 20 20 66 6f 72 20 28 69 6e 74 20 69 20 3d 20 6d 5f 54 65 78 74 43 6f 6d ..........for.(int.i.=.m_TextCom
16040 70 6f 6e 65 6e 74 2e 74 65 78 74 49 6e 66 6f 2e 6c 69 6e 65 49 6e 66 6f 5b 6f 72 69 67 69 6e 4c ponent.textInfo.lineInfo[originL
16060 69 6e 65 20 2b 20 31 5d 2e 66 69 72 73 74 43 68 61 72 61 63 74 65 72 49 6e 64 65 78 3b 20 69 20 ine.+.1].firstCharacterIndex;.i.
16080 3c 20 65 6e 64 43 68 61 72 49 64 78 3b 20 2b 2b 69 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 <.endCharIdx;.++i)..............
160a0 7b 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 72 {..................TMP_Character
160c0 49 6e 66 6f 20 63 75 72 72 65 6e 74 43 68 61 72 20 3d 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 Info.currentChar.=.m_TextCompone
160e0 6e 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 0d nt.textInfo.characterInfo[i];...
16100 0a 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 6f 72 69 67 69 .................float.d.=.origi
16120 6e 43 68 61 72 2e 6f 72 69 67 69 6e 20 2d 20 63 75 72 72 65 6e 74 43 68 61 72 2e 6f 72 69 67 69 nChar.origin.-.currentChar.origi
16140 6e 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 72 20 3d 20 64 20 n;..................float.r.=.d.
16160 2f 20 28 63 75 72 72 65 6e 74 43 68 61 72 2e 78 41 64 76 61 6e 63 65 20 2d 20 63 75 72 72 65 6e /.(currentChar.xAdvance.-.curren
16180 74 43 68 61 72 2e 6f 72 69 67 69 6e 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 tChar.origin);..................
161a0 20 20 69 66 20 28 72 20 3e 3d 20 30 20 26 26 20 72 20 3c 3d 20 31 29 0d 0a 20 20 20 20 20 20 20 ..if.(r.>=.0.&&.r.<=.1).........
161c0 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 20 .........{......................
161e0 69 66 20 28 72 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 20 if.(r.<.0.5f)...................
16200 20 20 20 20 20 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 .......return.i;................
16220 20 20 20 20 20 20 65 6c 73 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ......else......................
16240 20 20 20 20 72 65 74 75 72 6e 20 69 20 2b 20 31 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 ....return.i.+.1;...............
16260 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 64 20 3d 20 4d 61 74 68 ...}....................d.=.Math
16280 66 2e 41 62 73 28 64 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 f.Abs(d);....................if.
162a0 28 64 20 3c 20 64 69 73 74 61 6e 63 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 (d.<.distance)..................
162c0 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 73 65 73 74 20 3d {......................closest.=
162e0 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 64 69 73 74 61 6e 63 .i;......................distanc
16300 65 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 72 61 6e 67 e.=.d;......................rang
16320 65 20 3d 20 72 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 e.=.r;..................}.......
16340 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 6c 6f 73 .......}................if.(clos
16360 65 73 74 20 3d 3d 20 2d 31 29 20 72 65 74 75 72 6e 20 65 6e 64 43 68 61 72 49 64 78 3b 0d 0a 0d est.==.-1).return.endCharIdx;...
16380 0a 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 52 65 74 75 72 6e .............//Debug.Log("Return
163a0 69 6e 67 20 6e 65 61 72 65 73 74 20 63 68 61 72 61 63 74 65 72 20 77 69 74 68 20 52 61 6e 67 65 ing.nearest.character.with.Range
163c0 20 3d 20 22 20 2b 20 72 61 6e 67 65 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 .=.".+.range);................if
163e0 20 28 72 61 6e 67 65 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 .(range.<.0.5f).................
16400 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 20 20 20 20 65 6c .return.closest;..............el
16420 73 65 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 6c 6f 73 65 se..................return.close
16440 73 74 20 2b 20 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 st.+.1;..........}..............
16460 20 70 72 69 76 61 74 65 20 69 6e 74 20 50 61 67 65 55 70 43 68 61 72 61 63 74 65 72 50 6f 73 69 .private.int.PageUpCharacterPosi
16480 74 69 6f 6e 28 69 6e 74 20 6f 72 69 67 69 6e 61 6c 50 6f 73 2c 20 62 6f 6f 6c 20 67 6f 54 6f 46 tion(int.originalPos,.bool.goToF
164a0 69 72 73 74 43 68 61 72 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 irstChar)..........{............
164c0 20 20 69 66 20 28 6f 72 69 67 69 6e 61 6c 50 6f 73 20 3e 3d 20 6d 5f 54 65 78 74 43 6f 6d 70 6f ..if.(originalPos.>=.m_TextCompo
164e0 6e 65 6e 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 29 0d 0a 20 nent.textInfo.characterCount)...
16500 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6f 72 69 67 69 6e 61 6c 50 6f 73 20 2d 3d 20 31 3b ...............originalPos.-=.1;
16520 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 49 6e 66 ................TMP_CharacterInf
16540 6f 20 6f 72 69 67 69 6e 43 68 61 72 20 3d 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 o.originChar.=.m_TextComponent.t
16560 65 78 74 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 49 6e 66 6f 5b 6f 72 69 67 69 6e 61 6c 50 6f extInfo.characterInfo[originalPo
16580 73 5d 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 20 6f 72 69 67 69 6e 4c 69 6e 65 20 s];..............int.originLine.
165a0 3d 20 6f 72 69 67 69 6e 43 68 61 72 2e 6c 69 6e 65 4e 75 6d 62 65 72 3b 0d 0a 0d 0a 20 20 20 20 =.originChar.lineNumber;........
165c0 20 20 20 20 20 20 20 20 2f 2f 20 57 65 20 61 72 65 20 6f 6e 20 74 68 65 20 66 69 72 73 74 20 6c ........//.We.are.on.the.first.l
165e0 69 6e 65 20 72 65 74 75 72 6e 20 66 69 72 73 74 20 63 68 61 72 61 63 74 65 72 0d 0a 20 20 20 20 ine.return.first.character......
16600 20 20 20 20 20 20 20 20 69 66 20 28 6f 72 69 67 69 6e 4c 69 6e 65 20 2d 20 31 20 3c 20 30 29 0d ........if.(originLine.-.1.<.0).
16620 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 67 6f 54 6f 46 69 72 73 .................return.goToFirs
16640 74 43 68 61 72 20 3f 20 30 20 3a 20 6f 72 69 67 69 6e 61 6c 50 6f 73 3b 0d 0a 0d 0a 20 20 20 20 tChar.?.0.:.originalPos;........
16660 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 76 69 65 77 70 6f 72 74 48 65 69 67 68 74 20 3d 20 6d ........float.viewportHeight.=.m
16680 5f 54 65 78 74 56 69 65 77 70 6f 72 74 2e 72 65 63 74 2e 68 65 69 67 68 74 3b 0d 0a 0d 0a 20 20 _TextViewport.rect.height;......
166a0 20 20 20 20 20 20 20 20 20 20 69 6e 74 20 6e 65 77 4c 69 6e 65 20 3d 20 6f 72 69 67 69 6e 4c 69 ..........int.newLine.=.originLi
166c0 6e 65 20 2d 20 31 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 74 65 72 61 74 65 20 ne.-.1;..............//.Iterate.
166e0 74 68 72 6f 75 67 68 20 65 61 63 68 20 73 75 62 73 65 71 75 65 6e 74 20 6c 69 6e 65 20 74 6f 20 through.each.subsequent.line.to.
16700 66 69 6e 64 20 74 68 65 20 66 69 72 73 74 20 62 61 73 65 6c 69 6e 65 20 74 68 61 74 20 69 73 20 find.the.first.baseline.that.is.
16720 6e 6f 74 20 76 69 73 69 62 6c 65 20 69 6e 20 74 68 65 20 76 69 65 77 70 6f 72 74 2e 0d 0a 20 20 not.visible.in.the.viewport.....
16740 20 20 20 20 20 20 20 20 20 20 66 6f 72 20 28 3b 20 6e 65 77 4c 69 6e 65 20 3e 20 30 3b 20 6e 65 ..........for.(;.newLine.>.0;.ne
16760 77 4c 69 6e 65 2d 2d 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 wLine--)..............{.........
16780 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 65 78 .........if.(m_TextComponent.tex
167a0 74 49 6e 66 6f 2e 6c 69 6e 65 49 6e 66 6f 5b 6e 65 77 4c 69 6e 65 5d 2e 62 61 73 65 6c 69 6e 65 tInfo.lineInfo[newLine].baseline
167c0 20 3e 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 65 78 74 49 6e 66 6f 2e 6c 69 6e 65 .>.m_TextComponent.textInfo.line
167e0 49 6e 66 6f 5b 6f 72 69 67 69 6e 4c 69 6e 65 5d 2e 62 61 73 65 6c 69 6e 65 20 2b 20 76 69 65 77 Info[originLine].baseline.+.view
16800 70 6f 72 74 48 65 69 67 68 74 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 portHeight).....................
16820 20 62 72 65 61 6b 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 .break;..............}..........
16840 20 20 20 20 20 20 69 6e 74 20 65 6e 64 43 68 61 72 49 64 78 20 3d 20 6d 5f 54 65 78 74 43 6f 6d ......int.endCharIdx.=.m_TextCom
16860 70 6f 6e 65 6e 74 2e 74 65 78 74 49 6e 66 6f 2e 6c 69 6e 65 49 6e 66 6f 5b 6e 65 77 4c 69 6e 65 ponent.textInfo.lineInfo[newLine
16880 5d 2e 6c 61 73 74 43 68 61 72 61 63 74 65 72 49 6e 64 65 78 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 ].lastCharacterIndex;...........
168a0 20 20 20 20 20 69 6e 74 20 63 6c 6f 73 65 73 74 20 3d 20 2d 31 3b 0d 0a 20 20 20 20 20 20 20 20 .....int.closest.=.-1;..........
168c0 20 20 20 20 66 6c 6f 61 74 20 64 69 73 74 61 6e 63 65 20 3d 20 54 4d 50 5f 4d 61 74 68 2e 46 4c ....float.distance.=.TMP_Math.FL
168e0 4f 41 54 5f 4d 41 58 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 72 61 6e 67 OAT_MAX;..............float.rang
16900 65 20 3d 20 30 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 e.=.0;................for.(int.i
16920 20 3d 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 65 78 74 49 6e 66 6f 2e 6c 69 6e 65 .=.m_TextComponent.textInfo.line
16940 49 6e 66 6f 5b 6e 65 77 4c 69 6e 65 5d 2e 66 69 72 73 74 43 68 61 72 61 63 74 65 72 49 6e 64 65 Info[newLine].firstCharacterInde
16960 78 3b 20 69 20 3c 20 65 6e 64 43 68 61 72 49 64 78 3b 20 2b 2b 69 29 0d 0a 20 20 20 20 20 20 20 x;.i.<.endCharIdx;.++i).........
16980 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 43 68 61 72 .....{..................TMP_Char
169a0 61 63 74 65 72 49 6e 66 6f 20 63 75 72 72 65 6e 74 43 68 61 72 20 3d 20 6d 5f 54 65 78 74 43 6f acterInfo.currentChar.=.m_TextCo
169c0 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 66 6f 5b 69 mponent.textInfo.characterInfo[i
169e0 5d 3b 0d 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 64 20 3d 20 ];....................float.d.=.
16a00 6f 72 69 67 69 6e 43 68 61 72 2e 6f 72 69 67 69 6e 20 2d 20 63 75 72 72 65 6e 74 43 68 61 72 2e originChar.origin.-.currentChar.
16a20 6f 72 69 67 69 6e 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 72 origin;..................float.r
16a40 20 3d 20 64 20 2f 20 28 63 75 72 72 65 6e 74 43 68 61 72 2e 78 41 64 76 61 6e 63 65 20 2d 20 63 .=.d./.(currentChar.xAdvance.-.c
16a60 75 72 72 65 6e 74 43 68 61 72 2e 6f 72 69 67 69 6e 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 urrentChar.origin);.............
16a80 20 20 20 20 20 20 20 69 66 20 28 72 20 3e 3d 20 30 20 26 26 20 72 20 3c 3d 20 31 29 0d 0a 20 20 .......if.(r.>=.0.&&.r.<=.1)....
16aa0 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 20 20 ..............{.................
16ac0 20 20 20 20 20 69 66 20 28 72 20 3c 20 30 2e 35 66 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 .....if.(r.<.0.5f)..............
16ae0 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 20 20 20 20 20 ............return.i;...........
16b00 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 20 20 20 ...........else.................
16b20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 69 20 2b 20 31 3b 0d 0a 20 20 20 20 20 20 20 20 .........return.i.+.1;..........
16b40 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 20 64 20 3d ........}....................d.=
16b60 20 4d 61 74 68 66 2e 41 62 73 28 64 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .Mathf.Abs(d);..................
16b80 20 20 69 66 20 28 64 20 3c 20 64 69 73 74 61 6e 63 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ..if.(d.<.distance).............
16ba0 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 73 .....{......................clos
16bc0 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 64 69 est.=.i;......................di
16be0 73 74 61 6e 63 65 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 stance.=.d;.....................
16c00 20 72 61 6e 67 65 20 3d 20 72 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a .range.=.r;..................}..
16c20 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 69 66 20 ............}................if.
16c40 28 63 6c 6f 73 65 73 74 20 3d 3d 20 2d 31 29 20 72 65 74 75 72 6e 20 65 6e 64 43 68 61 72 49 64 (closest.==.-1).return.endCharId
16c60 78 3b 0d 0a 0d 0a 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 52 x;................//Debug.Log("R
16c80 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 77 69 74 68 20 eturning.nearest.character.with.
16ca0 52 61 6e 67 65 20 3d 20 22 20 2b 20 72 61 6e 67 65 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 Range.=.".+.range);.............
16cc0 20 20 20 69 66 20 28 72 61 6e 67 65 20 3c 20 30 2e 35 66 29 0d 0a 20 20 20 20 20 20 20 20 20 20 ...if.(range.<.0.5f)............
16ce0 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 20 ......return.closest;...........
16d00 20 20 20 65 6c 73 65 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 ...else..................return.
16d20 63 6c 6f 73 65 73 74 20 2b 20 31 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 0d 0a 20 20 20 closest.+.1;..........}.........
16d40 20 20 20 20 20 20 70 72 69 76 61 74 65 20 69 6e 74 20 50 61 67 65 44 6f 77 6e 43 68 61 72 61 63 ......private.int.PageDownCharac
16d60 74 65 72 50 6f 73 69 74 69 6f 6e 28 69 6e 74 20 6f 72 69 67 69 6e 61 6c 50 6f 73 2c 20 62 6f 6f terPosition(int.originalPos,.boo
16d80 6c 20 67 6f 54 6f 4c 61 73 74 43 68 61 72 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 l.goToLastChar)..........{......
16da0 20 20 20 20 20 20 20 20 69 66 20 28 6f 72 69 67 69 6e 61 6c 50 6f 73 20 3e 3d 20 6d 5f 54 65 78 ........if.(originalPos.>=.m_Tex
16dc0 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 43 6f 75 tComponent.textInfo.characterCou
16de0 6e 74 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 6d 5f 54 65 nt)..................return.m_Te
16e00 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 43 6f xtComponent.textInfo.characterCo
16e20 75 6e 74 20 2d 20 31 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 unt.-.1;................TMP_Char
16e40 61 63 74 65 72 49 6e 66 6f 20 6f 72 69 67 69 6e 43 68 61 72 20 3d 20 6d 5f 54 65 78 74 43 6f 6d acterInfo.originChar.=.m_TextCom
16e60 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 66 6f 5b 6f 72 ponent.textInfo.characterInfo[or
16e80 69 67 69 6e 61 6c 50 6f 73 5d 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 20 6f 72 69 iginalPos];..............int.ori
16ea0 67 69 6e 4c 69 6e 65 20 3d 20 6f 72 69 67 69 6e 43 68 61 72 2e 6c 69 6e 65 4e 75 6d 62 65 72 3b ginLine.=.originChar.lineNumber;
16ec0 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 57 65 20 61 72 65 20 6f 6e 20 74 68 65 ................//.We.are.on.the
16ee0 20 6c 61 73 74 20 6c 69 6e 65 20 72 65 74 75 72 6e 20 6c 61 73 74 20 63 68 61 72 61 63 74 65 72 .last.line.return.last.character
16f00 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6f 72 69 67 69 6e 4c 69 6e 65 20 2b 20 31 ..............if.(originLine.+.1
16f20 20 3e 3d 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 65 78 74 49 6e 66 6f 2e 6c 69 6e .>=.m_TextComponent.textInfo.lin
16f40 65 43 6f 75 6e 74 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 eCount)..................return.
16f60 67 6f 54 6f 4c 61 73 74 43 68 61 72 20 3f 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 goToLastChar.?.m_TextComponent.t
16f80 65 78 74 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 43 6f 75 6e 74 20 2d 20 31 20 3a 20 6f 72 69 extInfo.characterCount.-.1.:.ori
16fa0 67 69 6e 61 6c 50 6f 73 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 76 ginalPos;................float.v
16fc0 69 65 77 70 6f 72 74 48 65 69 67 68 74 20 3d 20 6d 5f 54 65 78 74 56 69 65 77 70 6f 72 74 2e 72 iewportHeight.=.m_TextViewport.r
16fe0 65 63 74 2e 68 65 69 67 68 74 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 20 6e ect.height;................int.n
17000 65 77 4c 69 6e 65 20 3d 20 6f 72 69 67 69 6e 4c 69 6e 65 20 2b 20 31 3b 0d 0a 20 20 20 20 20 20 ewLine.=.originLine.+.1;........
17020 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 20 73 75 ......//.Iterate.through.each.su
17040 62 73 65 71 75 65 6e 74 20 6c 69 6e 65 20 74 6f 20 66 69 6e 64 20 74 68 65 20 66 69 72 73 74 20 bsequent.line.to.find.the.first.
17060 62 61 73 65 6c 69 6e 65 20 74 68 61 74 20 69 73 20 6e 6f 74 20 76 69 73 69 62 6c 65 20 69 6e 20 baseline.that.is.not.visible.in.
17080 74 68 65 20 76 69 65 77 70 6f 72 74 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 20 28 the.viewport...............for.(
170a0 3b 20 6e 65 77 4c 69 6e 65 20 3c 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 65 78 74 ;.newLine.<.m_TextComponent.text
170c0 49 6e 66 6f 2e 6c 69 6e 65 43 6f 75 6e 74 20 2d 20 31 3b 20 6e 65 77 4c 69 6e 65 2b 2b 29 0d 0a Info.lineCount.-.1;.newLine++)..
170e0 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 69 ............{..................i
17100 66 20 28 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 65 78 74 49 6e 66 6f 2e 6c 69 6e 65 f.(m_TextComponent.textInfo.line
17120 49 6e 66 6f 5b 6e 65 77 4c 69 6e 65 5d 2e 62 61 73 65 6c 69 6e 65 20 3c 20 6d 5f 54 65 78 74 43 Info[newLine].baseline.<.m_TextC
17140 6f 6d 70 6f 6e 65 6e 74 2e 74 65 78 74 49 6e 66 6f 2e 6c 69 6e 65 49 6e 66 6f 5b 6f 72 69 67 69 omponent.textInfo.lineInfo[origi
17160 6e 4c 69 6e 65 5d 2e 62 61 73 65 6c 69 6e 65 20 2d 20 76 69 65 77 70 6f 72 74 48 65 69 67 68 74 nLine].baseline.-.viewportHeight
17180 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 72 65 61 6b 3b 0d 0a 20 )......................break;...
171a0 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 20 4e ...........}................//.N
171c0 65 65 64 20 74 6f 20 64 65 74 65 72 6d 69 6e 65 20 65 6e 64 20 6c 69 6e 65 20 66 6f 72 20 6e 65 eed.to.determine.end.line.for.ne
171e0 78 74 20 6c 69 6e 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 20 65 6e 64 43 68 61 xt.line...............int.endCha
17200 72 49 64 78 20 3d 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 65 78 74 49 6e 66 6f 2e rIdx.=.m_TextComponent.textInfo.
17220 6c 69 6e 65 49 6e 66 6f 5b 6e 65 77 4c 69 6e 65 5d 2e 6c 61 73 74 43 68 61 72 61 63 74 65 72 49 lineInfo[newLine].lastCharacterI
17240 6e 64 65 78 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 20 63 6c 6f 73 65 73 74 ndex;................int.closest
17260 20 3d 20 2d 31 3b 0d 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 .=.-1;..............float.distan
17280 63 65 20 3d 20 54 4d 50 5f 4d 61 74 68 2e 46 4c 4f 41 54 5f 4d 41 58 3b 0d 0a 20 20 20 20 20 20 ce.=.TMP_Math.FLOAT_MAX;........
172a0 20 20 20 20 20 20 66 6c 6f 61 74 20 72 61 6e 67 65 20 3d 20 30 3b 0d 0a 0d 0a 20 20 20 20 20 20 ......float.range.=.0;..........
172c0 20 20 20 20 20 20 66 6f 72 20 28 69 6e 74 20 69 20 3d 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 ......for.(int.i.=.m_TextCompone
172e0 6e 74 2e 74 65 78 74 49 6e 66 6f 2e 6c 69 6e 65 49 6e 66 6f 5b 6e 65 77 4c 69 6e 65 5d 2e 66 69 nt.textInfo.lineInfo[newLine].fi
17300 72 73 74 43 68 61 72 61 63 74 65 72 49 6e 64 65 78 3b 20 69 20 3c 20 65 6e 64 43 68 61 72 49 64 rstCharacterIndex;.i.<.endCharId
17320 78 3b 20 2b 2b 69 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 x;.++i)..............{..........
17340 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 6e ........TMP_CharacterInfo.curren
17360 74 43 68 61 72 20 3d 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 65 78 74 49 6e 66 6f tChar.=.m_TextComponent.textInfo
17380 2e 63 68 61 72 61 63 74 65 72 49 6e 66 6f 5b 69 5d 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 .characterInfo[i];..............
173a0 20 20 20 20 20 20 66 6c 6f 61 74 20 64 20 3d 20 6f 72 69 67 69 6e 43 68 61 72 2e 6f 72 69 67 69 ......float.d.=.originChar.origi
173c0 6e 20 2d 20 63 75 72 72 65 6e 74 43 68 61 72 2e 6f 72 69 67 69 6e 3b 0d 0a 20 20 20 20 20 20 20 n.-.currentChar.origin;.........
173e0 20 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 72 20 3d 20 64 20 2f 20 28 63 75 72 72 65 6e 74 43 .........float.r.=.d./.(currentC
17400 68 61 72 2e 78 41 64 76 61 6e 63 65 20 2d 20 63 75 72 72 65 6e 74 43 68 61 72 2e 6f 72 69 67 69 har.xAdvance.-.currentChar.origi
17420 6e 29 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 72 20 3e 3d 20 n);....................if.(r.>=.
17440 30 20 26 26 20 72 20 3c 3d 20 31 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0.&&.r.<=.1)..................{.
17460 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 72 20 3c 20 30 2e 35 .....................if.(r.<.0.5
17480 66 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 72 65 74 75 f)..........................retu
174a0 72 6e 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 65 6c 73 65 0d rn.i;......................else.
174c0 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 72 65 74 75 72 6e 20 .........................return.
174e0 69 20 2b 20 31 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 i.+.1;..................}.......
17500 20 20 20 20 20 20 20 20 20 20 20 20 20 64 20 3d 20 4d 61 74 68 66 2e 41 62 73 28 64 29 3b 0d 0a .............d.=.Mathf.Abs(d);..
17520 0d 0a 20 20 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 ..................if.(d.<.distan
17540 63 65 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 20 20 20 20 ce)..................{..........
17560 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 20 ............closest.=.i;........
17580 20 20 20 20 20 20 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 ..............distance.=.d;.....
175a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 61 6e 67 65 20 3d 20 72 3b 0d 0a 20 20 20 .................range.=.r;.....
175c0 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 7d 0d 0a 0d .............}..............}...
175e0 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 6c 6f 73 65 73 74 20 3d 3d 20 2d 31 29 20 .............if.(closest.==.-1).
17600 72 65 74 75 72 6e 20 65 6e 64 43 68 61 72 49 64 78 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 return.endCharIdx;..............
17620 20 20 69 66 20 28 72 61 6e 67 65 20 3c 20 30 2e 35 66 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ..if.(range.<.0.5f).............
17640 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 20 20 .....return.closest;............
17660 20 20 65 6c 73 65 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 ..else..................return.c
17680 6c 6f 73 65 73 74 20 2b 20 31 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 0d 0a 20 20 20 20 losest.+.1;..........}..........
176a0 20 20 20 20 70 72 69 76 61 74 65 20 76 6f 69 64 20 4d 6f 76 65 44 6f 77 6e 28 62 6f 6f 6c 20 73 ....private.void.MoveDown(bool.s
176c0 68 69 66 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 20 20 4d 6f hift)..........{..............Mo
176e0 76 65 44 6f 77 6e 28 73 68 69 66 74 2c 20 74 72 75 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d veDown(shift,.true);..........}.
17700 0a 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 76 6f 69 64 20 4d 6f 76 65 44 6f .............private.void.MoveDo
17720 77 6e 28 62 6f 6f 6c 20 73 68 69 66 74 2c 20 62 6f 6f 6c 20 67 6f 54 6f 4c 61 73 74 43 68 61 72 wn(bool.shift,.bool.goToLastChar
17740 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 66 20 28 68 61 )..........{..............if.(ha
17760 73 53 65 6c 65 63 74 69 6f 6e 20 26 26 20 21 73 68 69 66 74 29 0d 0a 20 20 20 20 20 20 20 20 20 sSelection.&&.!shift)...........
17780 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 66 20 77 65 20 68 ...{..................//.If.we.h
177a0 61 76 65 20 61 20 73 65 6c 65 63 74 69 6f 6e 20 61 6e 64 20 70 72 65 73 73 20 64 6f 77 6e 20 77 ave.a.selection.and.press.down.w
177c0 69 74 68 6f 75 74 20 73 68 69 66 74 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f ithout.shift,................../
177e0 2f 20 73 65 74 20 63 61 72 65 74 20 74 6f 20 65 6e 64 20 6f 66 20 73 65 6c 65 63 74 69 6f 6e 20 /.set.caret.to.end.of.selection.
17800 62 65 66 6f 72 65 20 77 65 20 6d 6f 76 65 20 69 74 20 64 6f 77 6e 2e 0d 0a 20 20 20 20 20 20 20 before.we.move.it.down..........
17820 20 20 20 20 20 20 20 20 20 63 61 72 65 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d .........caretPositionInternal.=
17840 20 63 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 4d .caretSelectPositionInternal.=.M
17860 61 74 68 66 2e 4d 61 78 28 63 61 72 65 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 2c 20 athf.Max(caretPositionInternal,.
17880 63 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 29 3b 0d 0a 20 caretSelectPositionInternal);...
178a0 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 69 6e 74 20 ...........}................int.
178c0 70 6f 73 69 74 69 6f 6e 20 3d 20 6d 75 6c 74 69 4c 69 6e 65 20 3f 20 4c 69 6e 65 44 6f 77 6e 43 position.=.multiLine.?.LineDownC
178e0 68 61 72 61 63 74 65 72 50 6f 73 69 74 69 6f 6e 28 63 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 haracterPosition(caretSelectPosi
17900 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 2c 20 67 6f 54 6f 4c 61 73 74 43 68 61 72 29 20 3a 20 6d 5f tionInternal,.goToLastChar).:.m_
17920 54 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 74 65 72 TextComponent.textInfo.character
17940 43 6f 75 6e 74 20 2d 20 31 3b 20 2f 2f 20 74 65 78 74 2e 4c 65 6e 67 74 68 3b 0d 0a 0d 0a 20 20 Count.-.1;.//.text.Length;......
17960 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 68 69 66 74 29 0d 0a 20 20 20 20 20 20 20 20 20 20 ..........if.(shift)............
17980 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 72 65 74 53 65 6c 65 63 74 ..{..................caretSelect
179a0 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 70 6f 73 69 74 69 6f 6e 3b 0d 0a 20 20 PositionInternal.=.position;....
179c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 ..............stringSelectPositi
179e0 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 47 65 74 53 74 72 69 6e 67 49 6e 64 65 78 46 72 6f 6d 43 onInternal.=.GetStringIndexFromC
17a00 61 72 65 74 50 6f 73 69 74 69 6f 6e 28 63 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e aretPosition(caretSelectPosition
17a20 49 6e 74 65 72 6e 61 6c 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 Internal);..............}.......
17a40 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 20 20 20 20 .......else..............{......
17a60 20 20 20 20 20 20 20 20 20 20 20 20 63 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 ............caretSelectPositionI
17a80 6e 74 65 72 6e 61 6c 20 3d 20 63 61 72 65 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 nternal.=.caretPositionInternal.
17aa0 3d 20 70 6f 73 69 74 69 6f 6e 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 74 72 =.position;..................str
17ac0 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 73 74 72 69 ingSelectPositionInternal.=.stri
17ae0 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 47 65 74 53 74 72 69 6e 67 49 6e ngPositionInternal.=.GetStringIn
17b00 64 65 78 46 72 6f 6d 43 61 72 65 74 50 6f 73 69 74 69 6f 6e 28 63 61 72 65 74 53 65 6c 65 63 74 dexFromCaretPosition(caretSelect
17b20 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 PositionInternal);..............
17b40 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 23 69 66 20 54 4d 50 5f 44 45 42 55 47 5f 4d }................#if.TMP_DEBUG_M
17b60 4f 44 45 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 44 65 62 75 67 2e 4c 6f 67 28 22 ODE..................Debug.Log("
17b80 43 61 72 65 74 20 50 6f 73 69 74 69 6f 6e 3a 20 22 20 2b 20 63 61 72 65 74 50 6f 73 69 74 69 6f Caret.Position:.".+.caretPositio
17ba0 6e 49 6e 74 65 72 6e 61 6c 20 2b 20 22 20 53 65 6c 65 63 74 69 6f 6e 20 50 6f 73 69 74 69 6f 6e nInternal.+.".Selection.Position
17bc0 3a 20 22 20 2b 20 63 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 :.".+.caretSelectPositionInterna
17be0 6c 20 2b 20 22 20 20 53 74 72 69 6e 67 20 50 6f 73 69 74 69 6f 6e 3a 20 22 20 2b 20 73 74 72 69 l.+."..String.Position:.".+.stri
17c00 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2b 20 22 20 53 74 72 69 6e 67 20 53 65 ngPositionInternal.+.".String.Se
17c20 6c 65 63 74 20 50 6f 73 69 74 69 6f 6e 3a 20 22 20 2b 20 73 74 72 69 6e 67 53 65 6c 65 63 74 50 lect.Position:.".+.stringSelectP
17c40 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 23 ositionInternal);..............#
17c60 65 6e 64 69 66 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 endif..........}............priv
17c80 61 74 65 20 76 6f 69 64 20 4d 6f 76 65 55 70 28 62 6f 6f 6c 20 73 68 69 66 74 29 0d 0a 20 20 20 ate.void.MoveUp(bool.shift).....
17ca0 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 4d 6f 76 65 55 70 28 73 68 69 66 74 .....{..............MoveUp(shift
17cc0 2c 20 74 72 75 65 29 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 ,.true);..........}.............
17ce0 20 70 72 69 76 61 74 65 20 76 6f 69 64 20 4d 6f 76 65 55 70 28 62 6f 6f 6c 20 73 68 69 66 74 2c .private.void.MoveUp(bool.shift,
17d00 20 62 6f 6f 6c 20 67 6f 54 6f 46 69 72 73 74 43 68 61 72 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d .bool.goToFirstChar)..........{.
17d20 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 68 61 73 53 65 6c 65 63 74 69 6f 6e 20 26 26 .............if.(hasSelection.&&
17d40 20 21 73 68 69 66 74 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 .!shift)..............{.........
17d60 20 20 20 20 20 20 20 20 20 2f 2f 20 49 66 20 77 65 20 68 61 76 65 20 61 20 73 65 6c 65 63 74 69 .........//.If.we.have.a.selecti
17d80 6f 6e 20 61 6e 64 20 70 72 65 73 73 20 75 70 20 77 69 74 68 6f 75 74 20 73 68 69 66 74 2c 0d 0a on.and.press.up.without.shift,..
17da0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 73 65 74 20 63 61 72 65 74 20 70 6f 73 ................//.set.caret.pos
17dc0 69 74 69 6f 6e 20 74 6f 20 73 74 61 72 74 20 6f 66 20 73 65 6c 65 63 74 69 6f 6e 20 62 65 66 6f ition.to.start.of.selection.befo
17de0 72 65 20 77 65 20 6d 6f 76 65 20 69 74 20 75 70 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 re.we.move.it.up................
17e00 20 20 20 63 61 72 65 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 63 61 72 65 74 ...caretPositionInternal.=.caret
17e20 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 4d 61 74 68 66 2e 4d SelectPositionInternal.=.Mathf.M
17e40 69 6e 28 63 61 72 65 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 2c 20 63 61 72 65 74 53 in(caretPositionInternal,.caretS
17e60 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 29 3b 0d 0a 20 20 20 20 20 20 20 electPositionInternal);.........
17e80 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 20 70 6f 73 69 74 69 .....}................int.positi
17ea0 6f 6e 20 3d 20 6d 75 6c 74 69 4c 69 6e 65 20 3f 20 4c 69 6e 65 55 70 43 68 61 72 61 63 74 65 72 on.=.multiLine.?.LineUpCharacter
17ec0 50 6f 73 69 74 69 6f 6e 28 63 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 Position(caretSelectPositionInte
17ee0 72 6e 61 6c 2c 20 67 6f 54 6f 46 69 72 73 74 43 68 61 72 29 20 3a 20 30 3b 0d 0a 0d 0a 20 20 20 rnal,.goToFirstChar).:.0;.......
17f00 20 20 20 20 20 20 20 20 20 69 66 20 28 73 68 69 66 74 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 .........if.(shift).............
17f20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 72 65 74 53 65 6c 65 63 74 50 .{..................caretSelectP
17f40 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 70 6f 73 69 74 69 6f 6e 3b 0d 0a 20 20 20 ositionInternal.=.position;.....
17f60 20 20 20 20 20 20 20 20 20 20 20 20 20 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f .............stringSelectPositio
17f80 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 47 65 74 53 74 72 69 6e 67 49 6e 64 65 78 46 72 6f 6d 43 61 nInternal.=.GetStringIndexFromCa
17fa0 72 65 74 50 6f 73 69 74 69 6f 6e 28 63 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 retPosition(caretSelectPositionI
17fc0 6e 74 65 72 6e 61 6c 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 nternal);..............}........
17fe0 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 20 20 20 20 20 ......else..............{.......
18000 20 20 20 20 20 20 20 20 20 20 20 63 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e ...........caretSelectPositionIn
18020 74 65 72 6e 61 6c 20 3d 20 63 61 72 65 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d ternal.=.caretPositionInternal.=
18040 20 70 6f 73 69 74 69 6f 6e 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 74 72 69 .position;..................stri
18060 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 73 74 72 69 6e ngSelectPositionInternal.=.strin
18080 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 47 65 74 53 74 72 69 6e 67 49 6e 64 gPositionInternal.=.GetStringInd
180a0 65 78 46 72 6f 6d 43 61 72 65 74 50 6f 73 69 74 69 6f 6e 28 63 61 72 65 74 53 65 6c 65 63 74 50 exFromCaretPosition(caretSelectP
180c0 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d ositionInternal);..............}
180e0 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 23 69 66 20 54 4d 50 5f 44 45 42 55 47 5f 4d 4f ................#if.TMP_DEBUG_MO
18100 44 45 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 44 65 62 75 67 2e 4c 6f 67 28 22 43 DE..................Debug.Log("C
18120 61 72 65 74 20 50 6f 73 69 74 69 6f 6e 3a 20 22 20 2b 20 63 61 72 65 74 50 6f 73 69 74 69 6f 6e aret.Position:.".+.caretPosition
18140 49 6e 74 65 72 6e 61 6c 20 2b 20 22 20 53 65 6c 65 63 74 69 6f 6e 20 50 6f 73 69 74 69 6f 6e 3a Internal.+.".Selection.Position:
18160 20 22 20 2b 20 63 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c .".+.caretSelectPositionInternal
18180 20 2b 20 22 20 20 53 74 72 69 6e 67 20 50 6f 73 69 74 69 6f 6e 3a 20 22 20 2b 20 73 74 72 69 6e .+."..String.Position:.".+.strin
181a0 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2b 20 22 20 53 74 72 69 6e 67 20 53 65 6c gPositionInternal.+.".String.Sel
181c0 65 63 74 20 50 6f 73 69 74 69 6f 6e 3a 20 22 20 2b 20 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f ect.Position:.".+.stringSelectPo
181e0 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 23 65 sitionInternal);..............#e
18200 6e 64 69 66 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 70 72 69 ndif..........}..............pri
18220 76 61 74 65 20 76 6f 69 64 20 4d 6f 76 65 50 61 67 65 55 70 28 62 6f 6f 6c 20 73 68 69 66 74 29 vate.void.MovePageUp(bool.shift)
18240 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 4d 6f 76 65 50 61 67 ..........{..............MovePag
18260 65 55 70 28 73 68 69 66 74 2c 20 74 72 75 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a eUp(shift,.true);..........}....
18280 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 76 6f 69 64 20 4d 6f 76 65 50 61 67 65 55 70 28 ........private.void.MovePageUp(
182a0 62 6f 6f 6c 20 73 68 69 66 74 2c 20 62 6f 6f 6c 20 67 6f 54 6f 46 69 72 73 74 43 68 61 72 29 0d bool.shift,.bool.goToFirstChar).
182c0 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 66 20 28 68 61 73 53 .........{..............if.(hasS
182e0 65 6c 65 63 74 69 6f 6e 20 26 26 20 21 73 68 69 66 74 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 election.&&.!shift).............
18300 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 66 20 77 65 20 68 61 76 .{..................//.If.we.hav
18320 65 20 61 20 73 65 6c 65 63 74 69 6f 6e 20 61 6e 64 20 70 72 65 73 73 20 75 70 20 77 69 74 68 6f e.a.selection.and.press.up.witho
18340 75 74 20 73 68 69 66 74 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 73 65 ut.shift,..................//.se
18360 74 20 63 61 72 65 74 20 70 6f 73 69 74 69 6f 6e 20 74 6f 20 73 74 61 72 74 20 6f 66 20 73 65 6c t.caret.position.to.start.of.sel
18380 65 63 74 69 6f 6e 20 62 65 66 6f 72 65 20 77 65 20 6d 6f 76 65 20 69 74 20 75 70 2e 0d 0a 20 20 ection.before.we.move.it.up.....
183a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 72 65 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 ..............caretPositionInter
183c0 6e 61 6c 20 3d 20 63 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 nal.=.caretSelectPositionInterna
183e0 6c 20 3d 20 4d 61 74 68 66 2e 4d 69 6e 28 63 61 72 65 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 l.=.Mathf.Min(caretPositionInter
18400 6e 61 6c 2c 20 63 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c nal,.caretSelectPositionInternal
18420 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 20 20 20 );..............}...............
18440 20 69 6e 74 20 70 6f 73 69 74 69 6f 6e 20 3d 20 6d 75 6c 74 69 4c 69 6e 65 20 3f 20 50 61 67 65 .int.position.=.multiLine.?.Page
18460 55 70 43 68 61 72 61 63 74 65 72 50 6f 73 69 74 69 6f 6e 28 63 61 72 65 74 53 65 6c 65 63 74 50 UpCharacterPosition(caretSelectP
18480 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 2c 20 67 6f 54 6f 46 69 72 73 74 43 68 61 72 29 20 ositionInternal,.goToFirstChar).
184a0 3a 20 30 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 68 69 66 74 29 0d 0a :.0;................if.(shift)..
184c0 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 63 ............{..................c
184e0 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 70 6f 73 aretSelectPositionInternal.=.pos
18500 69 74 69 6f 6e 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 74 72 69 6e 67 53 65 ition;..................stringSe
18520 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 47 65 74 53 74 72 69 6e 67 lectPositionInternal.=.GetString
18540 49 6e 64 65 78 46 72 6f 6d 43 61 72 65 74 50 6f 73 69 74 69 6f 6e 28 63 61 72 65 74 53 65 6c 65 IndexFromCaretPosition(caretSele
18560 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 ctPositionInternal);............
18580 20 20 7d 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 20 20 20 20 ..}..............else...........
185a0 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 72 65 74 53 65 6c 65 63 ...{..................caretSelec
185c0 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 63 61 72 65 74 50 6f 73 69 74 69 6f tPositionInternal.=.caretPositio
185e0 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 70 6f 73 69 74 69 6f 6e 3b 0d 0a 20 20 20 20 20 20 20 20 20 nInternal.=.position;...........
18600 20 20 20 20 20 20 20 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 .......stringSelectPositionInter
18620 6e 61 6c 20 3d 20 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 47 nal.=.stringPositionInternal.=.G
18640 65 74 53 74 72 69 6e 67 49 6e 64 65 78 46 72 6f 6d 43 61 72 65 74 50 6f 73 69 74 69 6f 6e 28 63 etStringIndexFromCaretPosition(c
18660 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 29 3b 0d 0a 20 20 aretSelectPositionInternal);....
18680 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 ..........}..................//.
186a0 53 63 72 6f 6c 6c 20 74 6f 20 74 6f 70 20 6f 66 20 76 69 65 77 70 6f 72 74 0d 0a 20 20 20 20 20 Scroll.to.top.of.viewport.......
186c0 20 20 20 20 20 20 20 2f 2f 69 6e 74 20 63 75 72 72 65 6e 74 4c 69 6e 65 20 3d 20 6d 5f 54 65 78 .......//int.currentLine.=.m_Tex
186e0 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 66 tComponent.textInfo.characterInf
18700 6f 5b 70 6f 73 69 74 69 6f 6e 5d 2e 6c 69 6e 65 4e 75 6d 62 65 72 3b 0d 0a 20 20 20 20 20 20 20 o[position].lineNumber;.........
18720 20 20 20 20 20 2f 2f 66 6c 6f 61 74 20 6c 69 6e 65 41 73 63 65 6e 64 65 72 20 3d 20 6d 5f 54 65 .....//float.lineAscender.=.m_Te
18740 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 65 78 74 49 6e 66 6f 2e 6c 69 6e 65 49 6e 66 6f 5b 63 75 xtComponent.textInfo.lineInfo[cu
18760 72 72 65 6e 74 4c 69 6e 65 5d 2e 61 73 63 65 6e 64 65 72 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 rrentLine].ascender;............
18780 20 20 20 20 2f 2f 20 41 64 6a 75 73 74 20 74 65 78 74 20 61 72 65 61 20 75 70 20 6f 72 20 64 6f ....//.Adjust.text.area.up.or.do
187a0 77 6e 20 69 66 20 6e 6f 74 20 69 6e 20 73 69 6e 67 6c 65 20 6c 69 6e 65 20 6d 6f 64 65 2e 0d 0a wn.if.not.in.single.line.mode...
187c0 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 4c 69 6e 65 54 79 70 65 20 21 3d 20 4c 69 ............if.(m_LineType.!=.Li
187e0 6e 65 54 79 70 65 2e 53 69 6e 67 6c 65 4c 69 6e 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 neType.SingleLine)..............
18800 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 6f 66 66 73 65 74 20 {..................float.offset.
18820 3d 20 6d 5f 54 65 78 74 56 69 65 77 70 6f 72 74 2e 72 65 63 74 2e 68 65 69 67 68 74 3b 20 2f 2f =.m_TextViewport.rect.height;.//
18840 20 6d 5f 54 65 78 74 56 69 65 77 70 6f 72 74 2e 72 65 63 74 2e 79 4d 61 78 20 2d 20 28 6d 5f 54 .m_TextViewport.rect.yMax.-.(m_T
18860 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 2e 61 6e 63 68 6f extComponent.rectTransform.ancho
18880 72 65 64 50 6f 73 69 74 69 6f 6e 2e 79 20 2b 20 6c 69 6e 65 41 73 63 65 6e 64 65 72 29 3b 0d 0a redPosition.y.+.lineAscender);..
188a0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 74 6f 70 54 65 78 74 42 ..................float.topTextB
188c0 6f 75 6e 64 73 20 3d 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 72 65 63 74 54 72 61 6e ounds.=.m_TextComponent.rectTran
188e0 73 66 6f 72 6d 2e 70 6f 73 69 74 69 6f 6e 2e 79 20 2b 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 sform.position.y.+.m_TextCompone
18900 6e 74 2e 74 65 78 74 42 6f 75 6e 64 73 2e 6d 61 78 2e 79 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 nt.textBounds.max.y;............
18920 20 20 20 20 20 20 66 6c 6f 61 74 20 74 6f 70 56 69 65 77 70 6f 72 74 42 6f 75 6e 64 73 20 3d 20 ......float.topViewportBounds.=.
18940 6d 5f 54 65 78 74 56 69 65 77 70 6f 72 74 2e 70 6f 73 69 74 69 6f 6e 2e 79 20 2b 20 6d 5f 54 65 m_TextViewport.position.y.+.m_Te
18960 78 74 56 69 65 77 70 6f 72 74 2e 72 65 63 74 2e 79 4d 61 78 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 xtViewport.rect.yMax;...........
18980 20 20 20 20 20 20 20 20 20 6f 66 66 73 65 74 20 3d 20 74 6f 70 56 69 65 77 70 6f 72 74 42 6f 75 .........offset.=.topViewportBou
189a0 6e 64 73 20 3e 20 74 6f 70 54 65 78 74 42 6f 75 6e 64 73 20 2b 20 6f 66 66 73 65 74 20 3f 20 6f nds.>.topTextBounds.+.offset.?.o
189c0 66 66 73 65 74 20 3a 20 74 6f 70 56 69 65 77 70 6f 72 74 42 6f 75 6e 64 73 20 2d 20 74 6f 70 54 ffset.:.topViewportBounds.-.topT
189e0 65 78 74 42 6f 75 6e 64 73 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f extBounds;....................m_
18a00 54 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 2e 61 6e 63 68 TextComponent.rectTransform.anch
18a20 6f 72 65 64 50 6f 73 69 74 69 6f 6e 20 2b 3d 20 6e 65 77 20 56 65 63 74 6f 72 32 28 30 2c 20 6f oredPosition.+=.new.Vector2(0,.o
18a40 66 66 73 65 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 41 73 73 69 67 6e 50 ffset);..................AssignP
18a60 6f 73 69 74 69 6f 6e 69 6e 67 49 66 4e 65 65 64 65 64 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 ositioningIfNeeded();...........
18a80 20 20 20 20 20 20 20 6d 5f 49 73 53 63 72 6f 6c 6c 62 61 72 55 70 64 61 74 65 52 65 71 75 69 72 .......m_IsScrollbarUpdateRequir
18aa0 65 64 20 3d 20 74 72 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 ed.=.true;..............}.......
18ac0 20 20 20 20 20 20 20 20 20 23 69 66 20 54 4d 50 5f 44 45 42 55 47 5f 4d 4f 44 45 0d 0a 20 20 20 .........#if.TMP_DEBUG_MODE.....
18ae0 20 20 20 20 20 20 20 20 20 20 20 20 20 44 65 62 75 67 2e 4c 6f 67 28 22 43 61 72 65 74 20 50 6f .............Debug.Log("Caret.Po
18b00 73 69 74 69 6f 6e 3a 20 22 20 2b 20 63 61 72 65 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 sition:.".+.caretPositionInterna
18b20 6c 20 2b 20 22 20 53 65 6c 65 63 74 69 6f 6e 20 50 6f 73 69 74 69 6f 6e 3a 20 22 20 2b 20 63 61 l.+.".Selection.Position:.".+.ca
18b40 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2b 20 22 20 20 53 retSelectPositionInternal.+."..S
18b60 74 72 69 6e 67 20 50 6f 73 69 74 69 6f 6e 3a 20 22 20 2b 20 73 74 72 69 6e 67 50 6f 73 69 74 69 tring.Position:.".+.stringPositi
18b80 6f 6e 49 6e 74 65 72 6e 61 6c 20 2b 20 22 20 53 74 72 69 6e 67 20 53 65 6c 65 63 74 20 50 6f 73 onInternal.+.".String.Select.Pos
18ba0 69 74 69 6f 6e 3a 20 22 20 2b 20 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 ition:.".+.stringSelectPositionI
18bc0 6e 74 65 72 6e 61 6c 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 23 65 6e 64 69 66 0d 0a 0d nternal);..............#endif...
18be0 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 .........}..............private.
18c00 76 6f 69 64 20 4d 6f 76 65 50 61 67 65 44 6f 77 6e 28 62 6f 6f 6c 20 73 68 69 66 74 29 0d 0a 20 void.MovePageDown(bool.shift)...
18c20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 4d 6f 76 65 50 61 67 65 44 6f .......{..............MovePageDo
18c40 77 6e 28 73 68 69 66 74 2c 20 74 72 75 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 wn(shift,.true);..........}.....
18c60 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 76 6f 69 64 20 4d 6f 76 65 50 61 67 65 44 6f 77 6e .......private.void.MovePageDown
18c80 28 62 6f 6f 6c 20 73 68 69 66 74 2c 20 62 6f 6f 6c 20 67 6f 54 6f 4c 61 73 74 43 68 61 72 29 0d (bool.shift,.bool.goToLastChar).
18ca0 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 68 61 73 .........{...............if.(has
18cc0 53 65 6c 65 63 74 69 6f 6e 20 26 26 20 21 73 68 69 66 74 29 0d 0a 20 20 20 20 20 20 20 20 20 20 Selection.&&.!shift)............
18ce0 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 66 20 77 65 20 68 61 ..{..................//.If.we.ha
18d00 76 65 20 61 20 73 65 6c 65 63 74 69 6f 6e 20 61 6e 64 20 70 72 65 73 73 20 64 6f 77 6e 20 77 69 ve.a.selection.and.press.down.wi
18d20 74 68 6f 75 74 20 73 68 69 66 74 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f thout.shift,..................//
18d40 20 73 65 74 20 63 61 72 65 74 20 74 6f 20 65 6e 64 20 6f 66 20 73 65 6c 65 63 74 69 6f 6e 20 62 .set.caret.to.end.of.selection.b
18d60 65 66 6f 72 65 20 77 65 20 6d 6f 76 65 20 69 74 20 64 6f 77 6e 2e 0d 0a 20 20 20 20 20 20 20 20 efore.we.move.it.down...........
18d80 20 20 20 20 20 20 20 20 63 61 72 65 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 ........caretPositionInternal.=.
18da0 63 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 4d 61 caretSelectPositionInternal.=.Ma
18dc0 74 68 66 2e 4d 61 78 28 63 61 72 65 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 2c 20 63 thf.Max(caretPositionInternal,.c
18de0 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 29 3b 0d 0a 20 20 aretSelectPositionInternal);....
18e00 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 69 6e 74 20 70 ..........}................int.p
18e20 6f 73 69 74 69 6f 6e 20 3d 20 6d 75 6c 74 69 4c 69 6e 65 20 3f 20 50 61 67 65 44 6f 77 6e 43 68 osition.=.multiLine.?.PageDownCh
18e40 61 72 61 63 74 65 72 50 6f 73 69 74 69 6f 6e 28 63 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 aracterPosition(caretSelectPosit
18e60 69 6f 6e 49 6e 74 65 72 6e 61 6c 2c 20 67 6f 54 6f 4c 61 73 74 43 68 61 72 29 20 3a 20 6d 5f 54 ionInternal,.goToLastChar).:.m_T
18e80 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 74 65 72 43 extComponent.textInfo.characterC
18ea0 6f 75 6e 74 20 2d 20 31 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 68 69 ount.-.1;................if.(shi
18ec0 66 74 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 ft)..............{..............
18ee0 20 20 20 20 63 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 ....caretSelectPositionInternal.
18f00 3d 20 70 6f 73 69 74 69 6f 6e 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 74 72 =.position;..................str
18f20 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 47 65 74 53 ingSelectPositionInternal.=.GetS
18f40 74 72 69 6e 67 49 6e 64 65 78 46 72 6f 6d 43 61 72 65 74 50 6f 73 69 74 69 6f 6e 28 63 61 72 65 tringIndexFromCaretPosition(care
18f60 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 29 3b 0d 0a 20 20 20 20 20 tSelectPositionInternal);.......
18f80 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 0d 0a 20 20 20 20 .......}..............else......
18fa0 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 63 61 72 65 74 ........{..................caret
18fc0 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 63 61 72 65 74 50 6f SelectPositionInternal.=.caretPo
18fe0 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 70 6f 73 69 74 69 6f 6e 3b 0d 0a 20 20 20 20 sitionInternal.=.position;......
19000 20 20 20 20 20 20 20 20 20 20 20 20 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e ............stringSelectPosition
19020 49 6e 74 65 72 6e 61 6c 20 3d 20 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 Internal.=.stringPositionInterna
19040 6c 20 3d 20 47 65 74 53 74 72 69 6e 67 49 6e 64 65 78 46 72 6f 6d 43 61 72 65 74 50 6f 73 69 74 l.=.GetStringIndexFromCaretPosit
19060 69 6f 6e 28 63 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 29 ion(caretSelectPositionInternal)
19080 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 20 20 20 20 ;..............}................
190a0 2f 2f 20 53 63 72 6f 6c 6c 20 74 6f 20 74 6f 70 20 6f 66 20 76 69 65 77 70 6f 72 74 0d 0a 20 20 //.Scroll.to.top.of.viewport....
190c0 20 20 20 20 20 20 20 20 20 20 2f 2f 69 6e 74 20 63 75 72 72 65 6e 74 4c 69 6e 65 20 3d 20 6d 5f ..........//int.currentLine.=.m_
190e0 54 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 74 65 72 TextComponent.textInfo.character
19100 49 6e 66 6f 5b 70 6f 73 69 74 69 6f 6e 5d 2e 6c 69 6e 65 4e 75 6d 62 65 72 3b 0d 0a 20 20 20 20 Info[position].lineNumber;......
19120 20 20 20 20 20 20 20 20 2f 2f 66 6c 6f 61 74 20 6c 69 6e 65 41 73 63 65 6e 64 65 72 20 3d 20 6d ........//float.lineAscender.=.m
19140 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 65 78 74 49 6e 66 6f 2e 6c 69 6e 65 49 6e 66 6f _TextComponent.textInfo.lineInfo
19160 5b 63 75 72 72 65 6e 74 4c 69 6e 65 5d 2e 61 73 63 65 6e 64 65 72 3b 0d 0a 0d 0a 20 20 20 20 20 [currentLine].ascender;.........
19180 20 20 20 20 20 20 20 2f 2f 20 41 64 6a 75 73 74 20 74 65 78 74 20 61 72 65 61 20 75 70 20 6f 72 .......//.Adjust.text.area.up.or
191a0 20 64 6f 77 6e 20 69 66 20 6e 6f 74 20 69 6e 20 73 69 6e 67 6c 65 20 6c 69 6e 65 20 6d 6f 64 65 .down.if.not.in.single.line.mode
191c0 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 4c 69 6e 65 54 79 70 65 20 21 3d ...............if.(m_LineType.!=
191e0 20 4c 69 6e 65 54 79 70 65 2e 53 69 6e 67 6c 65 4c 69 6e 65 29 0d 0a 20 20 20 20 20 20 20 20 20 .LineType.SingleLine)...........
19200 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 6f 66 66 73 ...{..................float.offs
19220 65 74 20 3d 20 6d 5f 54 65 78 74 56 69 65 77 70 6f 72 74 2e 72 65 63 74 2e 68 65 69 67 68 74 3b et.=.m_TextViewport.rect.height;
19240 20 2f 2f 20 6d 5f 54 65 78 74 56 69 65 77 70 6f 72 74 2e 72 65 63 74 2e 79 4d 61 78 20 2d 20 28 .//.m_TextViewport.rect.yMax.-.(
19260 6d 5f 54 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 2e 61 6e m_TextComponent.rectTransform.an
19280 63 68 6f 72 65 64 50 6f 73 69 74 69 6f 6e 2e 79 20 2b 20 6c 69 6e 65 41 73 63 65 6e 64 65 72 29 choredPosition.y.+.lineAscender)
192a0 3b 0d 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 62 6f 74 74 6f ;....................float.botto
192c0 6d 54 65 78 74 42 6f 75 6e 64 73 20 3d 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 72 65 mTextBounds.=.m_TextComponent.re
192e0 63 74 54 72 61 6e 73 66 6f 72 6d 2e 70 6f 73 69 74 69 6f 6e 2e 79 20 2b 20 6d 5f 54 65 78 74 43 ctTransform.position.y.+.m_TextC
19300 6f 6d 70 6f 6e 65 6e 74 2e 74 65 78 74 42 6f 75 6e 64 73 2e 6d 69 6e 2e 79 3b 0d 0a 20 20 20 20 omponent.textBounds.min.y;......
19320 20 20 20 20 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 62 6f 74 74 6f 6d 56 69 65 77 70 6f 72 74 ............float.bottomViewport
19340 42 6f 75 6e 64 73 20 3d 20 6d 5f 54 65 78 74 56 69 65 77 70 6f 72 74 2e 70 6f 73 69 74 69 6f 6e Bounds.=.m_TextViewport.position
19360 2e 79 20 2b 20 6d 5f 54 65 78 74 56 69 65 77 70 6f 72 74 2e 72 65 63 74 2e 79 4d 69 6e 3b 0d 0a .y.+.m_TextViewport.rect.yMin;..
19380 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6f 66 66 73 65 74 20 3d 20 62 6f 74 74 6f ..................offset.=.botto
193a0 6d 56 69 65 77 70 6f 72 74 42 6f 75 6e 64 73 20 3e 20 62 6f 74 74 6f 6d 54 65 78 74 42 6f 75 6e mViewportBounds.>.bottomTextBoun
193c0 64 73 20 2b 20 6f 66 66 73 65 74 20 3f 20 6f 66 66 73 65 74 20 3a 20 62 6f 74 74 6f 6d 56 69 65 ds.+.offset.?.offset.:.bottomVie
193e0 77 70 6f 72 74 42 6f 75 6e 64 73 20 2d 20 62 6f 74 74 6f 6d 54 65 78 74 42 6f 75 6e 64 73 3b 0d wportBounds.-.bottomTextBounds;.
19400 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 ...................m_TextCompone
19420 6e 74 2e 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 61 6e 63 68 6f 72 65 64 50 6f 73 69 74 69 6f nt.rectTransform.anchoredPositio
19440 6e 20 2b 3d 20 6e 65 77 20 56 65 63 74 6f 72 32 28 30 2c 20 6f 66 66 73 65 74 29 3b 0d 0a 20 20 n.+=.new.Vector2(0,.offset);....
19460 20 20 20 20 20 20 20 20 20 20 20 20 20 20 41 73 73 69 67 6e 50 6f 73 69 74 69 6f 6e 69 6e 67 49 ..............AssignPositioningI
19480 66 4e 65 65 64 65 64 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 49 73 fNeeded();..................m_Is
194a0 53 63 72 6f 6c 6c 62 61 72 55 70 64 61 74 65 52 65 71 75 69 72 65 64 20 3d 20 74 72 75 65 3b 0d ScrollbarUpdateRequired.=.true;.
194c0 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 20 20 20 20 23 69 .............}................#i
194e0 66 20 54 4d 50 5f 44 45 42 55 47 5f 4d 4f 44 45 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 f.TMP_DEBUG_MODE................
19500 20 20 44 65 62 75 67 2e 4c 6f 67 28 22 43 61 72 65 74 20 50 6f 73 69 74 69 6f 6e 3a 20 22 20 2b ..Debug.Log("Caret.Position:.".+
19520 20 63 61 72 65 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2b 20 22 20 53 65 6c 65 63 .caretPositionInternal.+.".Selec
19540 74 69 6f 6e 20 50 6f 73 69 74 69 6f 6e 3a 20 22 20 2b 20 63 61 72 65 74 53 65 6c 65 63 74 50 6f tion.Position:.".+.caretSelectPo
19560 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2b 20 22 20 20 53 74 72 69 6e 67 20 50 6f 73 69 74 sitionInternal.+."..String.Posit
19580 69 6f 6e 3a 20 22 20 2b 20 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 ion:.".+.stringPositionInternal.
195a0 2b 20 22 20 53 74 72 69 6e 67 20 53 65 6c 65 63 74 20 50 6f 73 69 74 69 6f 6e 3a 20 22 20 2b 20 +.".String.Select.Position:.".+.
195c0 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 29 3b 0d 0a stringSelectPositionInternal);..
195e0 20 20 20 20 20 20 20 20 20 20 20 20 23 65 6e 64 69 66 0d 0a 0d 0a 20 20 20 20 20 20 20 20 7d 0d ............#endif............}.
19600 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 76 6f 69 64 20 44 65 6c 65 74 65 28 29 ...........private.void.Delete()
19620 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 66 20 28 6d 5f 52 ..........{..............if.(m_R
19640 65 61 64 4f 6e 6c 79 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 eadOnly)..................return
19660 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 74 72 69 6e 67 50 6f 73 69 74 ;................if.(stringPosit
19680 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 3d 20 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 ionInternal.==.stringSelectPosit
196a0 69 6f 6e 49 6e 74 65 72 6e 61 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 ionInternal)..................re
196c0 74 75 72 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 69 73 52 69 63 turn;................if.(m_isRic
196e0 68 54 65 78 74 45 64 69 74 69 6e 67 41 6c 6c 6f 77 65 64 20 7c 7c 20 6d 5f 69 73 53 65 6c 65 63 hTextEditingAllowed.||.m_isSelec
19700 74 41 6c 6c 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 tAll)..............{............
19720 20 20 20 20 20 20 2f 2f 20 48 61 6e 64 6c 69 6e 67 20 6f 66 20 44 65 6c 65 74 65 20 77 68 65 6e ......//.Handling.of.Delete.when
19740 20 52 69 63 68 20 54 65 78 74 20 69 73 20 61 6c 6c 6f 77 65 64 2e 0d 0a 20 20 20 20 20 20 20 20 .Rich.Text.is.allowed...........
19760 20 20 20 20 20 20 20 20 69 66 20 28 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e ........if.(stringPositionIntern
19780 61 6c 20 3c 20 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 al.<.stringSelectPositionInterna
197a0 6c 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 20 20 20 20 20 l)..................{...........
197c0 20 20 20 20 20 20 20 20 20 20 20 6d 5f 54 65 78 74 20 3d 20 74 65 78 74 2e 52 65 6d 6f 76 65 28 ...........m_Text.=.text.Remove(
197e0 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 2c 20 73 74 72 69 6e 67 53 65 stringPositionInternal,.stringSe
19800 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2d 20 73 74 72 69 6e 67 50 6f 73 lectPositionInternal.-.stringPos
19820 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 itionInternal);.................
19840 20 20 20 20 20 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 .....stringSelectPositionInterna
19860 6c 20 3d 20 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 3b 0d 0a 20 20 20 l.=.stringPositionInternal;.....
19880 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 .............}..................
198a0 65 6c 73 65 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 else..................{.........
198c0 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 54 65 78 74 20 3d 20 74 65 78 74 2e 52 65 6d 6f 76 .............m_Text.=.text.Remov
198e0 65 28 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 2c 20 e(stringSelectPositionInternal,.
19900 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2d 20 73 74 72 69 6e 67 53 stringPositionInternal.-.stringS
19920 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 29 3b 0d 0a 20 20 20 20 20 20 20 electPositionInternal);.........
19940 20 20 20 20 20 20 20 20 20 20 20 20 20 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 .............stringPositionInter
19960 6e 61 6c 20 3d 20 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e nal.=.stringSelectPositionIntern
19980 61 6c 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 20 20 al;..................}..........
199a0 20 20 20 20 20 20 20 20 20 20 6d 5f 69 73 53 65 6c 65 63 74 41 6c 6c 20 3d 20 66 61 6c 73 65 3b ..........m_isSelectAll.=.false;
199c0 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 20 20 20 20 65 6c 73 ..............}..............els
199e0 65 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 e..............{................
19a00 20 20 69 66 20 28 63 61 72 65 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3c 20 63 61 ..if.(caretPositionInternal.<.ca
19a20 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 29 0d 0a 20 20 20 20 retSelectPositionInternal)......
19a40 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 ............{...................
19a60 20 20 20 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 6d 5f 54 65 ...stringPositionInternal.=.m_Te
19a80 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
19aa0 66 6f 5b 63 61 72 65 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 5d 2e 69 6e 64 65 78 3b fo[caretPositionInternal].index;
19ac0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 74 72 69 6e 67 53 65 6c 65 ......................stringSele
19ae0 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 6d 5f 54 65 78 74 43 6f 6d 70 6f ctPositionInternal.=.m_TextCompo
19b00 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 66 6f 5b 63 61 72 65 nent.textInfo.characterInfo[care
19b20 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2d 20 31 5d 2e 69 6e 64 tSelectPositionInternal.-.1].ind
19b40 65 78 20 2b 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 65 78 74 49 6e 66 6f 2e 63 68 ex.+.m_TextComponent.textInfo.ch
19b60 61 72 61 63 74 65 72 49 6e 66 6f 5b 63 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 aracterInfo[caretSelectPositionI
19b80 6e 74 65 72 6e 61 6c 20 2d 20 31 5d 2e 73 74 72 69 6e 67 4c 65 6e 67 74 68 3b 0d 0a 0d 0a 20 20 nternal.-.1].stringLength;......
19ba0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 54 65 78 74 20 3d 20 74 65 78 74 2e ..................m_Text.=.text.
19bc0 52 65 6d 6f 76 65 28 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 2c 20 73 Remove(stringPositionInternal,.s
19be0 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2d 20 73 74 tringSelectPositionInternal.-.st
19c00 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 ringPositionInternal);..........
19c20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 ..............stringSelectPositi
19c40 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 onInternal.=.stringPositionInter
19c60 6e 61 6c 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 72 65 74 53 nal;......................caretS
19c80 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 63 61 72 65 74 50 6f 73 electPositionInternal.=.caretPos
19ca0 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 itionInternal;..................
19cc0 7d 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 20 }..................else.........
19ce0 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 20 .........{......................
19d00 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 6d 5f 54 65 78 74 43 stringPositionInternal.=.m_TextC
19d20 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 66 6f 5b omponent.textInfo.characterInfo[
19d40 63 61 72 65 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2d 20 31 5d 2e 69 6e 64 65 78 caretPositionInternal.-.1].index
19d60 20 2b 20 6d 5f 54 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 .+.m_TextComponent.textInfo.char
19d80 61 63 74 65 72 49 6e 66 6f 5b 63 61 72 65 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 acterInfo[caretPositionInternal.
19da0 2d 20 31 5d 2e 73 74 72 69 6e 67 4c 65 6e 67 74 68 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 -.1].stringLength;..............
19dc0 20 20 20 20 20 20 20 20 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 ........stringSelectPositionInte
19de0 72 6e 61 6c 20 3d 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 65 78 74 49 6e 66 6f 2e rnal.=.m_TextComponent.textInfo.
19e00 63 68 61 72 61 63 74 65 72 49 6e 66 6f 5b 63 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f characterInfo[caretSelectPositio
19e20 6e 49 6e 74 65 72 6e 61 6c 5d 2e 69 6e 64 65 78 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 nInternal].index;...............
19e40 20 20 20 20 20 20 20 20 20 6d 5f 54 65 78 74 20 3d 20 74 65 78 74 2e 52 65 6d 6f 76 65 28 73 74 .........m_Text.=.text.Remove(st
19e60 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 2c 20 73 74 72 69 ringSelectPositionInternal,.stri
19e80 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2d 20 73 74 72 69 6e 67 53 65 6c 65 63 ngPositionInternal.-.stringSelec
19ea0 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 tPositionInternal);.............
19ec0 20 20 20 20 20 20 20 20 20 20 20 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 ...........stringPositionInterna
19ee0 6c 20 3d 20 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c l.=.stringSelectPositionInternal
19f00 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 72 65 74 50 6f 73 69 ;......................caretPosi
19f20 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 63 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 tionInternal.=.caretSelectPositi
19f40 6f 6e 49 6e 74 65 72 6e 61 6c 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a onInternal;..................}..
19f60 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 23 69 66 ............}................#if
19f80 20 54 4d 50 5f 44 45 42 55 47 5f 4d 4f 44 45 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .TMP_DEBUG_MODE.................
19fa0 20 44 65 62 75 67 2e 4c 6f 67 28 22 43 61 72 65 74 20 50 6f 73 69 74 69 6f 6e 3a 20 22 20 2b 20 .Debug.Log("Caret.Position:.".+.
19fc0 63 61 72 65 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2b 20 22 20 53 65 6c 65 63 74 caretPositionInternal.+.".Select
19fe0 69 6f 6e 20 50 6f 73 69 74 69 6f 6e 3a 20 22 20 2b 20 63 61 72 65 74 53 65 6c 65 63 74 50 6f 73 ion.Position:.".+.caretSelectPos
1a000 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2b 20 22 20 20 53 74 72 69 6e 67 20 50 6f 73 69 74 69 itionInternal.+."..String.Positi
1a020 6f 6e 3a 20 22 20 2b 20 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2b on:.".+.stringPositionInternal.+
1a040 20 22 20 53 74 72 69 6e 67 20 53 65 6c 65 63 74 20 50 6f 73 69 74 69 6f 6e 3a 20 22 20 2b 20 73 .".String.Select.Position:.".+.s
1a060 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 29 3b 0d 0a 20 tringSelectPositionInternal);...
1a080 20 20 20 20 20 20 20 20 20 20 20 23 65 6e 64 69 66 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a ...........#endif..........}....
1a0a0 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>........../
1a0c0 2f 2f 20 48 61 6e 64 6c 69 6e 67 20 6f 66 20 44 45 4c 20 6b 65 79 0d 0a 20 20 20 20 20 20 20 20 //.Handling.of.DEL.key..........
1a0e0 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 72 69 76 61 74 65 20 ///.</summary>..........private.
1a100 76 6f 69 64 20 44 65 6c 65 74 65 4b 65 79 28 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 void.DeleteKey()..........{.....
1a120 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 52 65 61 64 4f 6e 6c 79 29 0d 0a 20 20 20 20 20 20 .........if.(m_ReadOnly)........
1a140 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ..........return;...............
1a160 20 69 66 20 28 68 61 73 53 65 6c 65 63 74 69 6f 6e 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 .if.(hasSelection)..............
1a180 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 44 65 6c 65 74 65 28 29 3b 0d 0a 20 20 {..................Delete();....
1a1a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 55 70 64 61 74 65 54 6f 75 63 68 4b 65 79 62 6f 61 72 ..............UpdateTouchKeyboar
1a1c0 64 46 72 6f 6d 45 64 69 74 43 68 61 6e 67 65 73 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 dFromEditChanges();.............
1a1e0 20 20 20 20 20 53 65 6e 64 4f 6e 56 61 6c 75 65 43 68 61 6e 67 65 64 41 6e 64 55 70 64 61 74 65 .....SendOnValueChangedAndUpdate
1a200 4c 61 62 65 6c 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 Label();..............}.........
1a220 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 20 20 20 20 20 20 .....else..............{........
1a240 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 69 73 52 69 63 68 54 65 78 74 45 64 69 74 69 6e ..........if.(m_isRichTextEditin
1a260 67 41 6c 6c 6f 77 65 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 gAllowed)..................{....
1a280 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 74 72 69 6e 67 50 6f 73 69 ..................if.(stringPosi
1a2a0 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3c 20 74 65 78 74 2e 4c 65 6e 67 74 68 29 0d 0a 20 20 20 tionInternal.<.text.Length).....
1a2c0 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 20 .................{..............
1a2e0 20 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 ............//.Special.handling.
1a300 66 6f 72 20 53 75 72 72 6f 67 61 74 65 20 50 61 69 72 73 0d 0a 20 20 20 20 20 20 20 20 20 20 20 for.Surrogate.Pairs.............
1a320 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 68 61 72 2e 49 73 48 69 67 68 53 75 72 72 .............if.(char.IsHighSurr
1a340 6f 67 61 74 65 28 74 65 78 74 5b 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 ogate(text[stringPositionInterna
1a360 6c 5d 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 l]))............................
1a380 20 20 6d 5f 54 65 78 74 20 3d 20 74 65 78 74 2e 52 65 6d 6f 76 65 28 73 74 72 69 6e 67 50 6f 73 ..m_Text.=.text.Remove(stringPos
1a3a0 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 2c 20 32 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 itionInternal,.2);..............
1a3c0 20 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 20 20 ............else................
1a3e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 54 65 78 74 20 3d 20 74 65 78 74 2e 52 65 6d 6f ..............m_Text.=.text.Remo
1a400 76 65 28 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 2c 20 31 29 3b 0d 0a ve(stringPositionInternal,.1);..
1a420 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 55 70 64 61 74 65 ..........................Update
1a440 54 6f 75 63 68 4b 65 79 62 6f 61 72 64 46 72 6f 6d 45 64 69 74 43 68 61 6e 67 65 73 28 29 3b 0d TouchKeyboardFromEditChanges();.
1a460 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 53 65 6e 64 4f 6e 56 .........................SendOnV
1a480 61 6c 75 65 43 68 61 6e 67 65 64 41 6e 64 55 70 64 61 74 65 4c 61 62 65 6c 28 29 3b 0d 0a 20 20 alueChangedAndUpdateLabel();....
1a4a0 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 ..................}.............
1a4c0 20 20 20 20 20 7d 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 .....}..................else....
1a4e0 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 20 20 ..............{.................
1a500 20 20 20 20 20 69 66 20 28 63 61 72 65 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3c .....if.(caretPositionInternal.<
1a520 20 6d 5f 54 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 .m_TextComponent.textInfo.charac
1a540 74 65 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 terCount.-.1)...................
1a560 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 6e ...{..........................in
1a580 74 20 6e 75 6d 62 65 72 4f 66 43 68 61 72 61 63 74 65 72 73 54 6f 52 65 6d 6f 76 65 20 3d 20 6d t.numberOfCharactersToRemove.=.m
1a5a0 5f 54 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 74 65 _TextComponent.textInfo.characte
1a5c0 72 49 6e 66 6f 5b 63 61 72 65 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 5d 2e 73 74 72 rInfo[caretPositionInternal].str
1a5e0 69 6e 67 4c 65 6e 67 74 68 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ingLength;......................
1a600 20 20 20 20 20 20 2f 2f 20 41 64 6a 75 73 74 20 73 74 72 69 6e 67 20 70 6f 73 69 74 69 6f 6e 20 ......//.Adjust.string.position.
1a620 74 6f 20 73 6b 69 70 20 61 6e 79 20 70 6f 74 65 6e 74 69 61 6c 20 72 69 63 68 20 74 65 78 74 20 to.skip.any.potential.rich.text.
1a640 74 61 67 73 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 69 tags...........................i
1a660 6e 74 20 6e 65 78 74 43 68 61 72 61 63 74 65 72 53 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 20 3d nt.nextCharacterStringPosition.=
1a680 20 6d 5f 54 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 .m_TextComponent.textInfo.charac
1a6a0 74 65 72 49 6e 66 6f 5b 63 61 72 65 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 5d 2e 69 terInfo[caretPositionInternal].i
1a6c0 6e 64 65 78 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 ndex;...........................
1a6e0 20 6d 5f 54 65 78 74 20 3d 20 74 65 78 74 2e 52 65 6d 6f 76 65 28 6e 65 78 74 43 68 61 72 61 63 .m_Text.=.text.Remove(nextCharac
1a700 74 65 72 53 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 2c 20 6e 75 6d 62 65 72 4f 66 43 68 61 72 61 terStringPosition,.numberOfChara
1a720 63 74 65 72 73 54 6f 52 65 6d 6f 76 65 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 ctersToRemove);.................
1a740 20 20 20 20 20 20 20 20 20 20 20 53 65 6e 64 4f 6e 56 61 6c 75 65 43 68 61 6e 67 65 64 41 6e 64 ...........SendOnValueChangedAnd
1a760 55 70 64 61 74 65 4c 61 62 65 6c 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 UpdateLabel();..................
1a780 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 20 20 20 20 20 20 ....}..................}........
1a7a0 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 23 69 66 20 54 4d 50 5f 44 ......}................#if.TMP_D
1a7c0 45 42 55 47 5f 4d 4f 44 45 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 44 65 62 75 67 EBUG_MODE..................Debug
1a7e0 2e 4c 6f 67 28 22 43 61 72 65 74 20 50 6f 73 69 74 69 6f 6e 3a 20 22 20 2b 20 63 61 72 65 74 50 .Log("Caret.Position:.".+.caretP
1a800 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2b 20 22 20 53 65 6c 65 63 74 69 6f 6e 20 50 6f ositionInternal.+.".Selection.Po
1a820 73 69 74 69 6f 6e 3a 20 22 20 2b 20 63 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 sition:.".+.caretSelectPositionI
1a840 6e 74 65 72 6e 61 6c 20 2b 20 22 20 20 53 74 72 69 6e 67 20 50 6f 73 69 74 69 6f 6e 3a 20 22 20 nternal.+."..String.Position:.".
1a860 2b 20 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2b 20 22 20 53 74 72 +.stringPositionInternal.+.".Str
1a880 69 6e 67 20 53 65 6c 65 63 74 20 50 6f 73 69 74 69 6f 6e 3a 20 22 20 2b 20 73 74 72 69 6e 67 53 ing.Select.Position:.".+.stringS
1a8a0 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 29 3b 0d 0a 20 20 20 20 20 20 20 electPositionInternal);.........
1a8c0 20 20 20 20 20 23 65 6e 64 69 66 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 .....#endif..........}..........
1a8e0 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 48 61 6e ..///.<summary>..........///.Han
1a900 64 6c 69 6e 67 20 6f 66 20 42 61 63 6b 73 70 61 63 65 20 6b 65 79 0d 0a 20 20 20 20 20 20 20 20 dling.of.Backspace.key..........
1a920 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 72 69 76 61 74 65 20 ///.</summary>..........private.
1a940 76 6f 69 64 20 42 61 63 6b 73 70 61 63 65 28 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 void.Backspace()..........{.....
1a960 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 52 65 61 64 4f 6e 6c 79 29 0d 0a 20 20 20 20 20 20 .........if.(m_ReadOnly)........
1a980 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ..........return;...............
1a9a0 20 69 66 20 28 68 61 73 53 65 6c 65 63 74 69 6f 6e 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 .if.(hasSelection)..............
1a9c0 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 44 65 6c 65 74 65 28 29 3b 0d 0a 20 20 {..................Delete();....
1a9e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 55 70 64 61 74 65 54 6f 75 63 68 4b 65 79 62 6f 61 72 ..............UpdateTouchKeyboar
1aa00 64 46 72 6f 6d 45 64 69 74 43 68 61 6e 67 65 73 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 dFromEditChanges();.............
1aa20 20 20 20 20 20 53 65 6e 64 4f 6e 56 61 6c 75 65 43 68 61 6e 67 65 64 41 6e 64 55 70 64 61 74 65 .....SendOnValueChangedAndUpdate
1aa40 4c 61 62 65 6c 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 Label();..............}.........
1aa60 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 20 20 20 20 20 20 .....else..............{........
1aa80 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 69 73 52 69 63 68 54 65 78 74 45 64 69 74 69 6e ..........if.(m_isRichTextEditin
1aaa0 67 41 6c 6c 6f 77 65 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 gAllowed)..................{....
1aac0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 74 72 69 6e 67 50 6f 73 69 ..................if.(stringPosi
1aae0 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3e 20 30 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 tionInternal.>.0)...............
1ab00 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 20 .......{........................
1ab20 20 20 69 6e 74 20 6e 75 6d 62 65 72 4f 66 43 68 61 72 61 63 74 65 72 73 54 6f 52 65 6d 6f 76 65 ..int.numberOfCharactersToRemove
1ab40 20 3d 20 31 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 .=.1;...........................
1ab60 20 2f 2f 20 53 70 65 63 69 61 6c 20 68 61 6e 64 6c 69 6e 67 20 66 6f 72 20 53 75 72 72 6f 67 61 .//.Special.handling.for.Surroga
1ab80 74 65 20 70 61 69 72 73 20 61 6e 64 20 44 69 61 63 72 69 74 69 63 61 6c 20 6d 61 72 6b 73 0d 0a te.pairs.and.Diacritical.marks..
1aba0 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 63 68 61 72 ........................if.(char
1abc0 2e 49 73 4c 6f 77 53 75 72 72 6f 67 61 74 65 28 74 65 78 74 5b 73 74 72 69 6e 67 50 6f 73 69 74 .IsLowSurrogate(text[stringPosit
1abe0 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2d 20 31 5d 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 ionInternal.-.1]))..............
1ac00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6e 75 6d 62 65 72 4f 66 43 68 61 72 61 63 74 65 ................numberOfCharacte
1ac20 72 73 54 6f 52 65 6d 6f 76 65 20 3d 20 32 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 rsToRemove.=.2;.................
1ac40 20 20 20 20 20 20 20 20 20 20 20 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 ...........stringSelectPositionI
1ac60 6e 74 65 72 6e 61 6c 20 3d 20 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c nternal.=.stringPositionInternal
1ac80 20 3d 20 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2d 20 6e 75 6d 62 .=.stringPositionInternal.-.numb
1aca0 65 72 4f 66 43 68 61 72 61 63 74 65 72 73 54 6f 52 65 6d 6f 76 65 3b 0d 0a 0d 0a 20 20 20 20 20 erOfCharactersToRemove;.........
1acc0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 54 65 78 74 20 3d 20 74 65 78 74 ...................m_Text.=.text
1ace0 2e 52 65 6d 6f 76 65 28 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 2c 20 .Remove(stringPositionInternal,.
1ad00 6e 75 6d 62 65 72 4f 66 43 68 61 72 61 63 74 65 72 73 54 6f 52 65 6d 6f 76 65 29 3b 0d 0a 0d 0a numberOfCharactersToRemove);....
1ad20 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 61 72 65 74 53 65 6c ........................caretSel
1ad40 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 63 61 72 65 74 50 6f 73 69 74 ectPositionInternal.=.caretPosit
1ad60 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 63 61 72 65 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 ionInternal.=.caretPositionInter
1ad80 6e 61 6c 20 2d 20 31 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 nal.-.1;........................
1ada0 20 20 20 20 6d 5f 69 73 4c 61 73 74 4b 65 79 42 61 63 6b 73 70 61 63 65 20 3d 20 74 72 75 65 3b ....m_isLastKeyBackspace.=.true;
1adc0 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 55 70 64 61 ............................Upda
1ade0 74 65 54 6f 75 63 68 4b 65 79 62 6f 61 72 64 46 72 6f 6d 45 64 69 74 43 68 61 6e 67 65 73 28 29 teTouchKeyboardFromEditChanges()
1ae00 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 53 65 6e 64 4f ;..........................SendO
1ae20 6e 56 61 6c 75 65 43 68 61 6e 67 65 64 41 6e 64 55 70 64 61 74 65 4c 61 62 65 6c 28 29 3b 0d 0a nValueChangedAndUpdateLabel();..
1ae40 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 20 20 20 20 20 ....................}...........
1ae60 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 65 6c 73 65 0d 0a .......}..................else..
1ae80 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 ................{...............
1aea0 20 20 20 20 20 20 20 69 66 20 28 63 61 72 65 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c .......if.(caretPositionInternal
1aec0 20 3e 20 30 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 .>.0)......................{....
1aee0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 20 6e 75 6d 62 65 72 ......................int.number
1af00 4f 66 43 68 61 72 61 63 74 65 72 73 54 6f 52 65 6d 6f 76 65 20 3d 20 6d 5f 54 65 78 74 43 6f 6d OfCharactersToRemove.=.m_TextCom
1af20 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 66 6f 5b 63 61 ponent.textInfo.characterInfo[ca
1af40 72 65 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2d 20 31 5d 2e 73 74 72 69 6e 67 4c retPositionInternal.-.1].stringL
1af60 65 6e 67 74 68 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 ength;..........................
1af80 20 20 2f 2f 20 44 65 6c 65 74 65 20 74 68 65 20 70 72 65 76 69 6f 75 73 20 63 68 61 72 61 63 74 ..//.Delete.the.previous.charact
1afa0 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 20 20 20 6d 5f 54 65 er..........................m_Te
1afc0 78 74 20 3d 20 74 65 78 74 2e 52 65 6d 6f 76 65 28 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 xt.=.text.Remove(m_TextComponent
1afe0 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 61 72 65 74 50 6f 73 .textInfo.characterInfo[caretPos
1b000 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2d 20 31 5d 2e 69 6e 64 65 78 2c 20 6e 75 6d 62 65 72 itionInternal.-.1].index,.number
1b020 4f 66 43 68 61 72 61 63 74 65 72 73 54 6f 52 65 6d 6f 76 65 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 OfCharactersToRemove);..........
1b040 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 47 65 74 20 6e 65 77 20 61 64 6a ..................//.Get.new.adj
1b060 75 73 74 65 64 20 73 74 72 69 6e 67 20 70 6f 73 69 74 69 6f 6e 0d 0a 20 20 20 20 20 20 20 20 20 usted.string.position...........
1b080 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 ...............stringSelectPosit
1b0a0 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 ionInternal.=.stringPositionInte
1b0c0 72 6e 61 6c 20 3d 20 63 61 72 65 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3c 20 32 rnal.=.caretPositionInternal.<.2
1b0e0 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 3f 20 ..............................?.
1b100 6d 5f 54 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 74 m_TextComponent.textInfo.charact
1b120 65 72 49 6e 66 6f 5b 30 5d 2e 69 6e 64 65 78 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 erInfo[0].index.................
1b140 20 20 20 20 20 20 20 20 20 20 20 20 20 3a 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 .............:.m_TextComponent.t
1b160 65 78 74 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 49 6e 66 6f 5b 63 61 72 65 74 50 6f 73 69 74 extInfo.characterInfo[caretPosit
1b180 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2d 20 32 5d 2e 69 6e 64 65 78 20 2b 20 6d 5f 54 65 78 74 43 ionInternal.-.2].index.+.m_TextC
1b1a0 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 66 6f 5b omponent.textInfo.characterInfo[
1b1c0 63 61 72 65 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2d 20 32 5d 2e 73 74 72 69 6e caretPositionInternal.-.2].strin
1b1e0 67 4c 65 6e 67 74 68 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 gLength;........................
1b200 20 20 20 20 63 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 ....caretSelectPositionInternal.
1b220 3d 20 63 61 72 65 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 63 61 72 65 74 50 =.caretPositionInternal.=.caretP
1b240 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2d 20 31 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 ositionInternal.-.1;............
1b260 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 20 20 ..........}.....................
1b280 20 20 20 6d 5f 69 73 4c 61 73 74 4b 65 79 42 61 63 6b 73 70 61 63 65 20 3d 20 74 72 75 65 3b 0d ...m_isLastKeyBackspace.=.true;.
1b2a0 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 55 70 64 61 74 65 54 6f 75 .......................UpdateTou
1b2c0 63 68 4b 65 79 62 6f 61 72 64 46 72 6f 6d 45 64 69 74 43 68 61 6e 67 65 73 28 29 3b 0d 0a 20 20 chKeyboardFromEditChanges();....
1b2e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 53 65 6e 64 4f 6e 56 61 6c 75 65 43 68 61 ..................SendOnValueCha
1b300 6e 67 65 64 41 6e 64 55 70 64 61 74 65 4c 61 62 65 6c 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 ngedAndUpdateLabel();...........
1b320 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 .......}................}.......
1b340 20 20 20 20 20 20 20 20 20 23 69 66 20 54 4d 50 5f 44 45 42 55 47 5f 4d 4f 44 45 0d 0a 20 20 20 .........#if.TMP_DEBUG_MODE.....
1b360 20 20 20 20 20 20 20 20 20 20 20 20 20 44 65 62 75 67 2e 4c 6f 67 28 22 43 61 72 65 74 20 50 6f .............Debug.Log("Caret.Po
1b380 73 69 74 69 6f 6e 3a 20 22 20 2b 20 63 61 72 65 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 sition:.".+.caretPositionInterna
1b3a0 6c 20 2b 20 22 20 53 65 6c 65 63 74 69 6f 6e 20 50 6f 73 69 74 69 6f 6e 3a 20 22 20 2b 20 63 61 l.+.".Selection.Position:.".+.ca
1b3c0 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2b 20 22 20 20 53 retSelectPositionInternal.+."..S
1b3e0 74 72 69 6e 67 20 50 6f 73 69 74 69 6f 6e 3a 20 22 20 2b 20 73 74 72 69 6e 67 50 6f 73 69 74 69 tring.Position:.".+.stringPositi
1b400 6f 6e 49 6e 74 65 72 6e 61 6c 20 2b 20 22 20 53 74 72 69 6e 67 20 53 65 6c 65 63 74 20 50 6f 73 onInternal.+.".String.Select.Pos
1b420 69 74 69 6f 6e 3a 20 22 20 2b 20 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 ition:.".+.stringSelectPositionI
1b440 6e 74 65 72 6e 61 6c 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 23 65 6e 64 69 66 0d 0a 20 nternal);..............#endif...
1b460 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 61 .......}..............///.<summa
1b480 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 41 70 70 65 6e 64 20 74 68 65 20 73 70 65 63 ry>..........///.Append.the.spec
1b4a0 69 66 69 65 64 20 74 65 78 74 20 74 6f 20 74 68 65 20 65 6e 64 20 6f 66 20 74 68 65 20 63 75 72 ified.text.to.the.end.of.the.cur
1b4c0 72 65 6e 74 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 rent...........///.</summary>...
1b4e0 20 20 20 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 76 69 72 74 75 61 6c 20 76 6f 69 64 20 41 70 .......protected.virtual.void.Ap
1b500 70 65 6e 64 28 73 74 72 69 6e 67 20 69 6e 70 75 74 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 pend(string.input)..........{...
1b520 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 52 65 61 64 4f 6e 6c 79 29 0d 0a 20 20 20 20 ...........if.(m_ReadOnly)......
1b540 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 ............return;.............
1b560 20 20 20 69 66 20 28 49 6e 50 6c 61 63 65 45 64 69 74 69 6e 67 28 29 20 3d 3d 20 66 61 6c 73 65 ...if.(InPlaceEditing().==.false
1b580 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 3b 0d 0a 0d 0a 20 20 )..................return;......
1b5a0 20 20 20 20 20 20 20 20 20 20 66 6f 72 20 28 69 6e 74 20 69 20 3d 20 30 2c 20 69 6d 61 78 20 3d ..........for.(int.i.=.0,.imax.=
1b5c0 20 69 6e 70 75 74 2e 4c 65 6e 67 74 68 3b 20 69 20 3c 20 69 6d 61 78 3b 20 2b 2b 69 29 0d 0a 20 .input.Length;.i.<.imax;.++i)...
1b5e0 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 63 68 ...........{..................ch
1b600 61 72 20 63 20 3d 20 69 6e 70 75 74 5b 69 5d 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 ar.c.=.input[i];................
1b620 20 20 20 20 69 66 20 28 63 20 3e 3d 20 27 20 27 20 7c 7c 20 63 20 3d 3d 20 27 5c 74 27 20 7c 7c ....if.(c.>=.'.'.||.c.==.'\t'.||
1b640 20 63 20 3d 3d 20 27 5c 72 27 20 7c 7c 20 63 20 3d 3d 20 31 30 20 7c 7c 20 63 20 3d 3d 20 27 5c .c.==.'\r'.||.c.==.10.||.c.==.'\
1b660 6e 27 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 20 20 20 20 n')..................{..........
1b680 20 20 20 20 20 20 20 20 20 20 20 20 41 70 70 65 6e 64 28 63 29 3b 0d 0a 20 20 20 20 20 20 20 20 ............Append(c);..........
1b6a0 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 ........}..............}........
1b6c0 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 76 69 72 74 75 61 6c ..}............protected.virtual
1b6e0 20 76 6f 69 64 20 41 70 70 65 6e 64 28 63 68 61 72 20 69 6e 70 75 74 29 0d 0a 20 20 20 20 20 20 .void.Append(char.input)........
1b700 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 52 65 61 64 4f 6e 6c 79 29 ..{..............if.(m_ReadOnly)
1b720 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 3b 0d 0a 0d 0a 20 20 20 ..................return;.......
1b740 20 20 20 20 20 20 20 20 20 69 66 20 28 49 6e 50 6c 61 63 65 45 64 69 74 69 6e 67 28 29 20 3d 3d .........if.(InPlaceEditing().==
1b760 20 66 61 6c 73 65 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 3b .false)..................return;
1b780 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 66 20 77 65 20 68 61 76 65 20 61 6e ................//.If.we.have.an
1b7a0 20 69 6e 70 75 74 20 76 61 6c 69 64 61 74 6f 72 2c 20 76 61 6c 69 64 61 74 65 20 74 68 65 20 69 .input.validator,.validate.the.i
1b7c0 6e 70 75 74 20 66 69 72 73 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6f 6e 56 61 nput.first..............if.(onVa
1b7e0 6c 69 64 61 74 65 49 6e 70 75 74 20 21 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 lidateInput.!=.null)............
1b800 20 20 20 20 20 20 69 6e 70 75 74 20 3d 20 6f 6e 56 61 6c 69 64 61 74 65 49 6e 70 75 74 28 74 65 ......input.=.onValidateInput(te
1b820 78 74 2c 20 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 2c 20 69 6e 70 75 xt,.stringPositionInternal,.inpu
1b840 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 20 69 66 20 28 63 68 61 72 61 63 t);..............else.if.(charac
1b860 74 65 72 56 61 6c 69 64 61 74 69 6f 6e 20 3d 3d 20 43 68 61 72 61 63 74 65 72 56 61 6c 69 64 61 terValidation.==.CharacterValida
1b880 74 69 6f 6e 2e 43 75 73 74 6f 6d 56 61 6c 69 64 61 74 6f 72 29 0d 0a 20 20 20 20 20 20 20 20 20 tion.CustomValidator)...........
1b8a0 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 70 75 74 20 3d 20 56 61 ...{..................input.=.Va
1b8c0 6c 69 64 61 74 65 28 74 65 78 74 2c 20 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 lidate(text,.stringPositionInter
1b8e0 6e 61 6c 2c 20 69 6e 70 75 74 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 nal,.input);....................
1b900 69 66 20 28 69 6e 70 75 74 20 3d 3d 20 30 29 20 72 65 74 75 72 6e 3b 0d 0a 0d 0a 20 20 20 20 20 if.(input.==.0).return;.........
1b920 20 20 20 20 20 20 20 20 20 20 20 53 65 6e 64 4f 6e 56 61 6c 75 65 43 68 61 6e 67 65 64 28 29 3b ...........SendOnValueChanged();
1b940 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 55 70 64 61 74 65 4c 61 62 65 6c 28 29 3b ..................UpdateLabel();
1b960 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 3b 0d 0a 20 20 20 ....................return;.....
1b980 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 20 69 66 20 .........}..............else.if.
1b9a0 28 63 68 61 72 61 63 74 65 72 56 61 6c 69 64 61 74 69 6f 6e 20 21 3d 20 43 68 61 72 61 63 74 65 (characterValidation.!=.Characte
1b9c0 72 56 61 6c 69 64 61 74 69 6f 6e 2e 4e 6f 6e 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 rValidation.None)...............
1b9e0 20 20 20 69 6e 70 75 74 20 3d 20 56 61 6c 69 64 61 74 65 28 74 65 78 74 2c 20 73 74 72 69 6e 67 ...input.=.Validate(text,.string
1ba00 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 2c 20 69 6e 70 75 74 29 3b 0d 0a 0d 0a 20 20 20 PositionInternal,.input);.......
1ba20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 66 20 74 68 65 20 69 6e 70 75 74 20 69 73 20 69 6e 76 61 .........//.If.the.input.is.inva
1ba40 6c 69 64 2c 20 73 6b 69 70 20 69 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 69 6e lid,.skip.it..............if.(in
1ba60 70 75 74 20 3d 3d 20 30 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 put.==.0)..................retur
1ba80 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 41 70 70 65 6e 64 20 74 68 65 20 n;................//.Append.the.
1baa0 63 68 61 72 61 63 74 65 72 20 61 6e 64 20 75 70 64 61 74 65 20 74 68 65 20 6c 61 62 65 6c 0d 0a character.and.update.the.label..
1bac0 20 20 20 20 20 20 20 20 20 20 20 20 49 6e 73 65 72 74 28 69 6e 70 75 74 29 3b 0d 0a 20 20 20 20 ............Insert(input);......
1bae0 20 20 20 20 7d 0d 0a 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 49 6e 73 65 72 74 20 74 68 65 ....}..............//.Insert.the
1bb00 20 63 68 61 72 61 63 74 65 72 20 61 6e 64 20 75 70 64 61 74 65 20 74 68 65 20 6c 61 62 65 6c 2e .character.and.update.the.label.
1bb20 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 76 6f 69 64 20 49 6e 73 65 72 74 28 63 68 ..........private.void.Insert(ch
1bb40 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 69 66 ar.c)..........{..............if
1bb60 20 28 6d 5f 52 65 61 64 4f 6e 6c 79 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 .(m_ReadOnly)..................r
1bb80 65 74 75 72 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 74 72 69 6e 67 20 72 65 70 eturn;................string.rep
1bba0 6c 61 63 65 53 74 72 69 6e 67 20 3d 20 63 2e 54 6f 53 74 72 69 6e 67 28 29 3b 0d 0a 20 20 20 20 laceString.=.c.ToString();......
1bbc0 20 20 20 20 20 20 20 20 44 65 6c 65 74 65 28 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ........Delete();...............
1bbe0 20 2f 2f 20 43 61 6e 27 74 20 67 6f 20 70 61 73 74 20 74 68 65 20 63 68 61 72 61 63 74 65 72 20 .//.Can't.go.past.the.character.
1bc00 6c 69 6d 69 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 68 61 72 61 63 74 65 72 limit..............if.(character
1bc20 4c 69 6d 69 74 20 3e 20 30 20 26 26 20 74 65 78 74 2e 4c 65 6e 67 74 68 20 3e 3d 20 63 68 61 72 Limit.>.0.&&.text.Length.>=.char
1bc40 61 63 74 65 72 4c 69 6d 69 74 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 acterLimit)..................ret
1bc60 75 72 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 54 65 78 74 20 3d 20 74 65 78 urn;................m_Text.=.tex
1bc80 74 2e 49 6e 73 65 72 74 28 6d 5f 53 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 2c 20 72 65 70 6c 61 t.Insert(m_StringPosition,.repla
1bca0 63 65 53 74 72 69 6e 67 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 63 ceString);................if.(!c
1bcc0 68 61 72 2e 49 73 48 69 67 68 53 75 72 72 6f 67 61 74 65 28 63 29 29 0d 0a 20 20 20 20 20 20 20 har.IsHighSurrogate(c)).........
1bce0 20 20 20 20 20 20 20 20 20 63 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 .........caretSelectPositionInte
1bd00 72 6e 61 6c 20 3d 20 63 61 72 65 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2b 3d 20 rnal.=.caretPositionInternal.+=.
1bd20 31 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 1;................stringSelectPo
1bd40 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 sitionInternal.=.stringPositionI
1bd60 6e 74 65 72 6e 61 6c 20 2b 3d 20 31 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 55 70 64 nternal.+=.1;................Upd
1bd80 61 74 65 54 6f 75 63 68 4b 65 79 62 6f 61 72 64 46 72 6f 6d 45 64 69 74 43 68 61 6e 67 65 73 28 ateTouchKeyboardFromEditChanges(
1bda0 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 53 65 6e 64 4f 6e 56 61 6c 75 65 43 68 61 6e 67 );..............SendOnValueChang
1bdc0 65 64 28 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 23 69 66 20 54 4d 50 5f 44 45 42 ed();................#if.TMP_DEB
1bde0 55 47 5f 4d 4f 44 45 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 44 65 62 75 67 2e 4c UG_MODE..................Debug.L
1be00 6f 67 28 22 43 61 72 65 74 20 50 6f 73 69 74 69 6f 6e 3a 20 22 20 2b 20 63 61 72 65 74 50 6f 73 og("Caret.Position:.".+.caretPos
1be20 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2b 20 22 20 53 65 6c 65 63 74 69 6f 6e 20 50 6f 73 69 itionInternal.+.".Selection.Posi
1be40 74 69 6f 6e 3a 20 22 20 2b 20 63 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 tion:.".+.caretSelectPositionInt
1be60 65 72 6e 61 6c 20 2b 20 22 20 20 53 74 72 69 6e 67 20 50 6f 73 69 74 69 6f 6e 3a 20 22 20 2b 20 ernal.+."..String.Position:.".+.
1be80 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2b 20 22 20 53 74 72 69 6e stringPositionInternal.+.".Strin
1bea0 67 20 53 65 6c 65 63 74 20 50 6f 73 69 74 69 6f 6e 3a 20 22 20 2b 20 73 74 72 69 6e 67 53 65 6c g.Select.Position:.".+.stringSel
1bec0 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 ectPositionInternal);...........
1bee0 20 20 20 23 65 6e 64 69 66 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 ...#endif..........}............
1bf00 70 72 69 76 61 74 65 20 76 6f 69 64 20 55 70 64 61 74 65 54 6f 75 63 68 4b 65 79 62 6f 61 72 64 private.void.UpdateTouchKeyboard
1bf20 46 72 6f 6d 45 64 69 74 43 68 61 6e 67 65 73 28 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 FromEditChanges()..........{....
1bf40 20 20 20 20 20 20 20 20 20 20 2f 2f 20 55 70 64 61 74 65 20 74 68 65 20 54 6f 75 63 68 4b 65 79 ..........//.Update.the.TouchKey
1bf60 62 6f 61 72 64 27 73 20 74 65 78 74 20 66 72 6f 6d 20 65 64 69 74 20 63 68 61 6e 67 65 73 0d 0a board's.text.from.edit.changes..
1bf80 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 69 66 20 69 6e 2d 70 6c 61 63 65 20 65 64 69 74 69 ............//.if.in-place.editi
1bfa0 6e 67 20 69 73 20 61 6c 6c 6f 77 65 64 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d ng.is.allowed..............if.(m
1bfc0 5f 53 6f 66 74 4b 65 79 62 6f 61 72 64 20 21 3d 20 6e 75 6c 6c 20 26 26 20 49 6e 50 6c 61 63 65 _SoftKeyboard.!=.null.&&.InPlace
1bfe0 45 64 69 74 69 6e 67 28 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 Editing())..............{.......
1c000 20 20 20 20 20 20 20 20 20 20 20 6d 5f 53 6f 66 74 4b 65 79 62 6f 61 72 64 2e 74 65 78 74 20 3d ...........m_SoftKeyboard.text.=
1c020 20 6d 5f 54 65 78 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 .m_Text;..............}.........
1c040 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 76 6f 69 64 20 53 65 6e 64 4f .}............private.void.SendO
1c060 6e 56 61 6c 75 65 43 68 61 6e 67 65 64 41 6e 64 55 70 64 61 74 65 4c 61 62 65 6c 28 29 0d 0a 20 nValueChangedAndUpdateLabel()...
1c080 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 55 70 64 61 74 65 4c 61 62 65 .......{..............UpdateLabe
1c0a0 6c 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 53 65 6e 64 4f 6e 56 61 6c 75 65 43 68 61 l();..............SendOnValueCha
1c0c0 6e 67 65 64 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 nged();..........}............pr
1c0e0 69 76 61 74 65 20 76 6f 69 64 20 53 65 6e 64 4f 6e 56 61 6c 75 65 43 68 61 6e 67 65 64 28 29 0d ivate.void.SendOnValueChanged().
1c100 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 66 20 28 6f 6e 56 61 .........{..............if.(onVa
1c120 6c 75 65 43 68 61 6e 67 65 64 20 21 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 lueChanged.!=.null).............
1c140 20 20 20 20 20 6f 6e 56 61 6c 75 65 43 68 61 6e 67 65 64 2e 49 6e 76 6f 6b 65 28 74 65 78 74 29 .....onValueChanged.Invoke(text)
1c160 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 6d ;..........}............///.<sum
1c180 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 53 75 62 6d 69 74 20 74 68 65 20 69 6e mary>..........///.Submit.the.in
1c1a0 70 75 74 20 66 69 65 6c 64 27 73 20 74 65 78 74 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c put.field's.text...........///.<
1c1c0 2f 73 75 6d 6d 61 72 79 3e 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 76 /summary>............protected.v
1c1e0 6f 69 64 20 53 65 6e 64 4f 6e 45 6e 64 45 64 69 74 28 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a oid.SendOnEndEdit()..........{..
1c200 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6f 6e 45 6e 64 45 64 69 74 20 21 3d 20 6e 75 6c ............if.(onEndEdit.!=.nul
1c220 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6f 6e 45 6e 64 45 64 69 74 2e 49 6e l)..................onEndEdit.In
1c240 76 6f 6b 65 28 6d 5f 54 65 78 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 voke(m_Text);..........}........
1c260 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 76 6f 69 64 20 53 65 6e 64 4f 6e 53 75 62 6d 69 74 28 ....protected.void.SendOnSubmit(
1c280 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 66 20 28 6f 6e )..........{..............if.(on
1c2a0 53 75 62 6d 69 74 20 21 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 Submit.!=.null).................
1c2c0 20 6f 6e 53 75 62 6d 69 74 2e 49 6e 76 6f 6b 65 28 6d 5f 54 65 78 74 29 3b 0d 0a 20 20 20 20 20 .onSubmit.Invoke(m_Text);.......
1c2e0 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 76 6f 69 64 20 53 ...}............protected.void.S
1c300 65 6e 64 4f 6e 46 6f 63 75 73 28 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 endOnFocus()..........{.........
1c320 20 20 20 20 20 69 66 20 28 6f 6e 53 65 6c 65 63 74 20 21 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 .....if.(onSelect.!=.null)......
1c340 20 20 20 20 20 20 20 20 20 20 20 20 6f 6e 53 65 6c 65 63 74 2e 49 6e 76 6f 6b 65 28 6d 5f 54 65 ............onSelect.Invoke(m_Te
1c360 78 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 6f 74 65 xt);..........}............prote
1c380 63 74 65 64 20 76 6f 69 64 20 53 65 6e 64 4f 6e 46 6f 63 75 73 4c 6f 73 74 28 29 0d 0a 20 20 20 cted.void.SendOnFocusLost().....
1c3a0 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6f 6e 44 65 73 65 6c 65 .....{..............if.(onDesele
1c3c0 63 74 20 21 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6f 6e 44 ct.!=.null)..................onD
1c3e0 65 73 65 6c 65 63 74 2e 49 6e 76 6f 6b 65 28 6d 5f 54 65 78 74 29 3b 0d 0a 20 20 20 20 20 20 20 eselect.Invoke(m_Text);.........
1c400 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 76 6f 69 64 20 53 65 6e .}............protected.void.Sen
1c420 64 4f 6e 54 65 78 74 53 65 6c 65 63 74 69 6f 6e 28 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 dOnTextSelection()..........{...
1c440 20 20 20 20 20 20 20 20 20 20 20 6d 5f 69 73 53 65 6c 65 63 74 65 64 20 3d 20 74 72 75 65 3b 0d ...........m_isSelected.=.true;.
1c460 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6f 6e 54 65 78 74 53 65 6c 65 63 74 69 ...............if.(onTextSelecti
1c480 6f 6e 20 21 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6f 6e 54 on.!=.null)..................onT
1c4a0 65 78 74 53 65 6c 65 63 74 69 6f 6e 2e 49 6e 76 6f 6b 65 28 6d 5f 54 65 78 74 2c 20 73 74 72 69 extSelection.Invoke(m_Text,.stri
1c4c0 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 2c 20 73 74 72 69 6e 67 53 65 6c 65 63 74 ngPositionInternal,.stringSelect
1c4e0 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d PositionInternal);..........}...
1c500 0a 20 20 20 20 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 76 6f 69 64 20 53 65 6e 64 4f 6e 45 6e .........protected.void.SendOnEn
1c520 64 54 65 78 74 53 65 6c 65 63 74 69 6f 6e 28 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 dTextSelection()..........{.....
1c540 20 20 20 20 20 20 20 20 20 69 66 20 28 21 6d 5f 69 73 53 65 6c 65 63 74 65 64 29 20 72 65 74 75 .........if.(!m_isSelected).retu
1c560 72 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6f 6e 45 6e 64 54 65 78 74 rn;................if.(onEndText
1c580 53 65 6c 65 63 74 69 6f 6e 20 21 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 Selection.!=.null)..............
1c5a0 20 20 20 20 6f 6e 45 6e 64 54 65 78 74 53 65 6c 65 63 74 69 6f 6e 2e 49 6e 76 6f 6b 65 28 6d 5f ....onEndTextSelection.Invoke(m_
1c5c0 54 65 78 74 2c 20 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 2c 20 73 74 Text,.stringPositionInternal,.st
1c5e0 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 29 3b 0d 0a 0d 0a ringSelectPositionInternal);....
1c600 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 69 73 53 65 6c 65 63 74 65 64 20 3d 20 66 61 6c 73 65 ............m_isSelected.=.false
1c620 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 6f 74 65 63 74 65 ;..........}............protecte
1c640 64 20 76 6f 69 64 20 53 65 6e 64 54 6f 75 63 68 53 63 72 65 65 6e 4b 65 79 62 6f 61 72 64 53 74 d.void.SendTouchScreenKeyboardSt
1c660 61 74 75 73 43 68 61 6e 67 65 64 28 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 atusChanged()..........{........
1c680 20 20 20 20 20 20 69 66 20 28 6f 6e 54 6f 75 63 68 53 63 72 65 65 6e 4b 65 79 62 6f 61 72 64 53 ......if.(onTouchScreenKeyboardS
1c6a0 74 61 74 75 73 43 68 61 6e 67 65 64 20 21 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 tatusChanged.!=.null)...........
1c6c0 20 20 20 20 20 20 20 6f 6e 54 6f 75 63 68 53 63 72 65 65 6e 4b 65 79 62 6f 61 72 64 53 74 61 74 .......onTouchScreenKeyboardStat
1c6e0 75 73 43 68 61 6e 67 65 64 2e 49 6e 76 6f 6b 65 28 6d 5f 53 6f 66 74 4b 65 79 62 6f 61 72 64 2e usChanged.Invoke(m_SoftKeyboard.
1c700 73 74 61 74 75 73 29 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 status);..........}.............
1c720 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 55 70 64 61 .///.<summary>..........///.Upda
1c740 74 65 20 74 68 65 20 76 69 73 75 61 6c 20 74 65 78 74 20 54 65 78 74 2e 0d 0a 20 20 20 20 20 20 te.the.visual.text.Text.........
1c760 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 6f 74 ..///.</summary>............prot
1c780 65 63 74 65 64 20 76 6f 69 64 20 55 70 64 61 74 65 4c 61 62 65 6c 28 29 0d 0a 20 20 20 20 20 20 ected.void.UpdateLabel()........
1c7a0 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 54 65 78 74 43 6f 6d 70 6f ..{..............if.(m_TextCompo
1c7c0 6e 65 6e 74 20 21 3d 20 6e 75 6c 6c 20 26 26 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e nent.!=.null.&&.m_TextComponent.
1c7e0 66 6f 6e 74 20 21 3d 20 6e 75 6c 6c 20 26 26 20 6d 5f 50 72 65 76 65 6e 74 43 61 6c 6c 62 61 63 font.!=.null.&&.m_PreventCallbac
1c800 6b 20 3d 3d 20 66 61 6c 73 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 k.==.false)..............{......
1c820 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 50 72 65 76 65 6e 74 20 63 61 6c 6c 62 61 63 6b 20 ............//.Prevent.callback.
1c840 66 72 6f 6d 20 74 68 65 20 74 65 78 74 20 63 6f 6d 70 6f 6e 65 6e 74 20 61 73 20 77 65 20 61 73 from.the.text.component.as.we.as
1c860 73 69 67 6e 20 6e 65 77 20 74 65 78 74 2e 20 54 68 69 73 20 69 73 20 74 6f 20 70 72 65 76 65 6e sign.new.text..This.is.to.preven
1c880 74 20 61 20 72 65 63 75 72 73 69 76 65 20 63 61 6c 6c 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 t.a.recursive.call..............
1c8a0 20 20 20 20 20 6d 5f 50 72 65 76 65 6e 74 43 61 6c 6c 62 61 63 6b 20 3d 20 74 72 75 65 3b 0d 0a .....m_PreventCallback.=.true;..
1c8c0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 74 72 69 6e 67 20 66 75 6c 6c 54 65 78 ..................string.fullTex
1c8e0 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 6f 6d 70 6f 73 69 74 t;..................if.(composit
1c900 69 6f 6e 53 74 72 69 6e 67 2e 4c 65 6e 67 74 68 20 3e 20 30 29 0d 0a 20 20 20 20 20 20 20 20 20 ionString.Length.>.0)...........
1c920 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 66 75 .......{......................fu
1c940 6c 6c 54 65 78 74 20 3d 20 74 65 78 74 2e 53 75 62 73 74 72 69 6e 67 28 30 2c 20 6d 5f 53 74 72 llText.=.text.Substring(0,.m_Str
1c960 69 6e 67 50 6f 73 69 74 69 6f 6e 29 20 2b 20 63 6f 6d 70 6f 73 69 74 69 6f 6e 53 74 72 69 6e 67 ingPosition).+.compositionString
1c980 20 2b 20 74 65 78 74 2e 53 75 62 73 74 72 69 6e 67 28 6d 5f 53 74 72 69 6e 67 50 6f 73 69 74 69 .+.text.Substring(m_StringPositi
1c9a0 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 0d 0a 20 20 20 20 on);............................
1c9c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 53 68 6f 75 6c 64 20 61 64 6a 75 73 74 ................//.Should.adjust
1c9e0 20 63 61 72 65 74 20 70 6f 73 69 74 69 6f 6e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .caret.position.................
1ca00 20 20 20 20 20 2f 2f 44 65 62 75 67 2e 4c 6f 67 28 22 48 61 6e 64 6c 69 6e 67 20 49 4d 45 20 49 .....//Debug.Log("Handling.IME.I
1ca20 6e 70 75 74 2e 2e 2e 20 5b 22 20 2b 20 63 6f 6d 70 6f 73 69 74 69 6f 6e 53 74 72 69 6e 67 20 2b nput....[".+.compositionString.+
1ca40 20 22 5d 20 6f 66 20 6c 65 6e 67 74 68 20 5b 22 20 2b 20 63 6f 6d 70 6f 73 69 74 69 6f 6e 53 74 ."].of.length.[".+.compositionSt
1ca60 72 69 6e 67 2e 4c 65 6e 67 74 68 20 2b 20 22 5d 20 61 74 20 53 74 72 69 6e 67 50 6f 73 69 74 69 ring.Length.+."].at.StringPositi
1ca80 6f 6e 20 5b 22 20 2b 20 6d 5f 53 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 20 2b 20 22 5d 22 29 3b on.[".+.m_StringPosition.+."]");
1caa0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 66 6f 72 20 28 69 6e 74 ......................//for.(int
1cac0 20 69 20 3d 20 30 3b 20 69 20 3c 20 63 6f 6d 70 6f 73 69 74 69 6f 6e 53 74 72 69 6e 67 2e 4c 65 .i.=.0;.i.<.compositionString.Le
1cae0 6e 67 74 68 3b 20 69 2b 2b 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ngth;.i++)......................
1cb00 2f 2f 20 20 20 20 44 65 62 75 67 2e 4c 6f 67 28 28 75 69 6e 74 29 63 6f 6d 70 6f 73 69 74 69 6f //....Debug.Log((uint)compositio
1cb20 6e 53 74 72 69 6e 67 5b 69 5d 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d nString[i]);..................}.
1cb40 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 20 20 20 .................else...........
1cb60 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 66 75 .......{......................fu
1cb80 6c 6c 54 65 78 74 20 3d 20 74 65 78 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 llText.=.text;..................
1cba0 20 20 20 20 2f 2f 44 65 62 75 67 2e 4c 6f 67 28 22 48 61 6e 64 6c 69 6e 67 20 49 6e 70 75 74 2e ....//Debug.Log("Handling.Input.
1cbc0 2e 2e 20 5b 22 20 2b 20 74 65 78 74 20 2b 20 22 5d 22 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 ...[".+.text.+."]");............
1cbe0 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 20 73 74 72 69 6e ......}....................strin
1cc00 67 20 70 72 6f 63 65 73 73 65 64 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 g.processed;..................if
1cc20 20 28 69 6e 70 75 74 54 79 70 65 20 3d 3d 20 49 6e 70 75 74 54 79 70 65 2e 50 61 73 73 77 6f 72 .(inputType.==.InputType.Passwor
1cc40 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 70 72 6f 63 65 73 73 65 d)......................processe
1cc60 64 20 3d 20 6e 65 77 20 73 74 72 69 6e 67 28 61 73 74 65 72 69 73 6b 43 68 61 72 2c 20 66 75 6c d.=.new.string(asteriskChar,.ful
1cc80 6c 54 65 78 74 2e 4c 65 6e 67 74 68 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 lText.Length);..................
1cca0 65 6c 73 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 70 72 6f 63 65 73 else......................proces
1ccc0 73 65 64 20 3d 20 66 75 6c 6c 54 65 78 74 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 sed.=.fullText;.................
1cce0 20 20 20 62 6f 6f 6c 20 69 73 45 6d 70 74 79 20 3d 20 73 74 72 69 6e 67 2e 49 73 4e 75 6c 6c 4f ...bool.isEmpty.=.string.IsNullO
1cd00 72 45 6d 70 74 79 28 66 75 6c 6c 54 65 78 74 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 rEmpty(fullText);...............
1cd20 20 20 20 20 20 69 66 20 28 6d 5f 50 6c 61 63 65 68 6f 6c 64 65 72 20 21 3d 20 6e 75 6c 6c 29 0d .....if.(m_Placeholder.!=.null).
1cd40 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 50 6c 61 63 65 68 6f 6c 64 .....................m_Placehold
1cd60 65 72 2e 65 6e 61 62 6c 65 64 20 3d 20 69 73 45 6d 70 74 79 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 er.enabled.=.isEmpty;...........
1cd80 20 20 20 20 20 20 20 20 20 69 66 20 28 21 69 73 45 6d 70 74 79 29 0d 0a 20 20 20 20 20 20 20 20 .........if.(!isEmpty)..........
1cda0 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 53 ........{......................S
1cdc0 65 74 43 61 72 65 74 56 69 73 69 62 6c 65 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 etCaretVisible();...............
1cde0 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 54 65 78 74 43 6f ...}....................m_TextCo
1ce00 6d 70 6f 6e 65 6e 74 2e 74 65 78 74 20 3d 20 70 72 6f 63 65 73 73 65 64 20 2b 20 22 5c 75 32 30 mponent.text.=.processed.+."\u20
1ce20 30 42 22 3b 20 2f 2f 20 45 78 74 72 61 20 73 70 61 63 65 20 69 73 20 61 64 64 65 64 20 66 6f 72 0B";.//.Extra.space.is.added.for
1ce40 20 43 61 72 65 74 20 74 72 61 63 6b 69 6e 67 2e 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 .Caret.tracking.................
1ce60 20 20 20 20 2f 2f 20 53 70 65 63 69 61 6c 20 68 61 6e 64 6c 69 6e 67 20 74 6f 20 6c 69 6d 69 74 ....//.Special.handling.to.limit
1ce80 20 74 68 65 20 6e 75 6d 62 65 72 20 6f 66 20 6c 69 6e 65 73 20 6f 66 20 74 65 78 74 20 69 6e 20 .the.number.of.lines.of.text.in.
1cea0 74 68 65 20 49 6e 70 75 74 20 46 69 65 6c 64 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 the.Input.Field.................
1cec0 20 20 69 66 20 28 6d 5f 4c 69 6e 65 4c 69 6d 69 74 20 3e 20 30 29 0d 0a 20 20 20 20 20 20 20 20 ..if.(m_LineLimit.>.0)..........
1cee0 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 6d ........{......................m
1cf00 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 46 6f 72 63 65 4d 65 73 68 55 70 64 61 74 65 28 29 _TextComponent.ForceMeshUpdate()
1cf20 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 2f 2f 20 43 68 65 63 ;........................//.Chec
1cf40 6b 20 69 66 20 74 65 78 74 20 65 78 63 65 65 64 73 20 6d 61 78 69 6d 75 6d 20 6e 75 6d 62 65 72 k.if.text.exceeds.maximum.number
1cf60 20 6f 66 20 6c 69 6e 65 73 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .of.lines.......................
1cf80 69 66 20 28 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 65 78 74 49 6e 66 6f 2e 6c 69 6e if.(m_TextComponent.textInfo.lin
1cfa0 65 43 6f 75 6e 74 20 3e 20 6d 5f 4c 69 6e 65 4c 69 6d 69 74 29 0d 0a 20 20 20 20 20 20 20 20 20 eCount.>.m_LineLimit)...........
1cfc0 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 ...........{....................
1cfe0 20 20 20 20 20 20 69 6e 74 20 6c 61 73 74 56 61 6c 69 64 43 68 61 72 61 63 74 65 72 49 6e 64 65 ......int.lastValidCharacterInde
1d000 78 20 3d 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 65 78 74 49 6e 66 6f 2e 6c 69 6e x.=.m_TextComponent.textInfo.lin
1d020 65 49 6e 66 6f 5b 6d 5f 4c 69 6e 65 4c 69 6d 69 74 20 2d 20 31 5d 2e 6c 61 73 74 43 68 61 72 61 eInfo[m_LineLimit.-.1].lastChara
1d040 63 74 65 72 49 6e 64 65 78 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 cterIndex;......................
1d060 20 20 20 20 69 6e 74 20 63 68 61 72 61 63 74 65 72 53 74 72 69 6e 67 49 6e 64 65 78 20 3d 20 6d ....int.characterStringIndex.=.m
1d080 5f 54 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 74 65 _TextComponent.textInfo.characte
1d0a0 72 49 6e 66 6f 5b 6c 61 73 74 56 61 6c 69 64 43 68 61 72 61 63 74 65 72 49 6e 64 65 78 5d 2e 69 rInfo[lastValidCharacterIndex].i
1d0c0 6e 64 65 78 20 2b 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 65 78 74 49 6e 66 6f 2e ndex.+.m_TextComponent.textInfo.
1d0e0 63 68 61 72 61 63 74 65 72 49 6e 66 6f 5b 6c 61 73 74 56 61 6c 69 64 43 68 61 72 61 63 74 65 72 characterInfo[lastValidCharacter
1d100 49 6e 64 65 78 5d 2e 73 74 72 69 6e 67 4c 65 6e 67 74 68 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 Index].stringLength;............
1d120 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 65 78 74 20 3d 20 70 72 6f 63 65 73 73 65 64 2e 52 ..............text.=.processed.R
1d140 65 6d 6f 76 65 28 63 68 61 72 61 63 74 65 72 53 74 72 69 6e 67 49 6e 64 65 78 2c 20 70 72 6f 63 emove(characterStringIndex,.proc
1d160 65 73 73 65 64 2e 4c 65 6e 67 74 68 20 2d 20 63 68 61 72 61 63 74 65 72 53 74 72 69 6e 67 49 6e essed.Length.-.characterStringIn
1d180 64 65 78 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 6d dex);..........................m
1d1a0 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 65 78 74 20 3d 20 74 65 78 74 20 2b 20 22 5c 75 _TextComponent.text.=.text.+."\u
1d1c0 32 30 30 42 22 3b 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 200B";......................}...
1d1e0 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 ...............}................
1d200 20 20 20 20 69 66 20 28 6d 5f 49 73 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 55 70 64 61 74 65 52 ....if.(m_IsTextComponentUpdateR
1d220 65 71 75 69 72 65 64 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 equired)..................{.....
1d240 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 49 73 54 65 78 74 43 6f 6d 70 6f 6e 65 .................m_IsTextCompone
1d260 6e 74 55 70 64 61 74 65 52 65 71 75 69 72 65 64 20 3d 20 66 61 6c 73 65 3b 0d 0a 20 20 20 20 20 ntUpdateRequired.=.false;.......
1d280 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 46 ...............m_TextComponent.F
1d2a0 6f 72 63 65 4d 65 73 68 55 70 64 61 74 65 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 orceMeshUpdate();...............
1d2c0 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4d 61 72 6b 47 65 6f 6d ...}....................MarkGeom
1d2e0 65 74 72 79 41 73 44 69 72 74 79 28 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 etryAsDirty();..................
1d300 20 20 2f 2f 20 53 63 72 6f 6c 6c 62 61 72 20 73 68 6f 75 6c 64 20 62 65 20 75 70 64 61 74 65 64 ..//.Scrollbar.should.be.updated
1d320 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 49 73 53 63 72 6f 6c 6c 62 61 72 ...................m_IsScrollbar
1d340 55 70 64 61 74 65 52 65 71 75 69 72 65 64 20 3d 20 74 72 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 UpdateRequired.=.true;..........
1d360 20 20 20 20 20 20 20 20 20 20 6d 5f 50 72 65 76 65 6e 74 43 61 6c 6c 62 61 63 6b 20 3d 20 66 61 ..........m_PreventCallback.=.fa
1d380 6c 73 65 3b 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 lse;..............}..........}..
1d3a0 0d 0a 20 20 20 20 20 20 20 20 76 6f 69 64 20 55 70 64 61 74 65 53 63 72 6f 6c 6c 62 61 72 28 29 ..........void.UpdateScrollbar()
1d3c0 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 2f 2f 20 55 70 64 61 ..........{..............//.Upda
1d3e0 74 65 20 53 63 72 6f 6c 6c 62 61 72 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f te.Scrollbar..............if.(m_
1d400 56 65 72 74 69 63 61 6c 53 63 72 6f 6c 6c 62 61 72 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 VerticalScrollbar)..............
1d420 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 73 69 7a 65 20 3d 20 {..................float.size.=.
1d440 6d 5f 54 65 78 74 56 69 65 77 70 6f 72 74 2e 72 65 63 74 2e 68 65 69 67 68 74 20 2f 20 6d 5f 54 m_TextViewport.rect.height./.m_T
1d460 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 70 72 65 66 65 72 72 65 64 48 65 69 67 68 74 3b 0d 0a 0d extComponent.preferredHeight;...
1d480 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 49 73 55 70 64 61 74 69 6e 67 53 63 72 .................m_IsUpdatingScr
1d4a0 6f 6c 6c 62 61 72 56 61 6c 75 65 73 20 3d 20 74 72 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 ollbarValues.=.true;............
1d4c0 20 20 20 20 20 20 20 20 6d 5f 56 65 72 74 69 63 61 6c 53 63 72 6f 6c 6c 62 61 72 2e 73 69 7a 65 ........m_VerticalScrollbar.size
1d4e0 20 3d 20 73 69 7a 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 53 63 .=.size;....................m_Sc
1d500 72 6f 6c 6c 50 6f 73 69 74 69 6f 6e 20 3d 20 6d 5f 56 65 72 74 69 63 61 6c 53 63 72 6f 6c 6c 62 rollPosition.=.m_VerticalScrollb
1d520 61 72 2e 76 61 6c 75 65 20 3d 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 72 65 63 74 54 ar.value.=.m_TextComponent.rectT
1d540 72 61 6e 73 66 6f 72 6d 2e 61 6e 63 68 6f 72 65 64 50 6f 73 69 74 69 6f 6e 2e 79 20 2f 20 28 6d ransform.anchoredPosition.y./.(m
1d560 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 70 72 65 66 65 72 72 65 64 48 65 69 67 68 74 20 2d _TextComponent.preferredHeight.-
1d580 20 6d 5f 54 65 78 74 56 69 65 77 70 6f 72 74 2e 72 65 63 74 2e 68 65 69 67 68 74 29 3b 0d 0a 0d .m_TextViewport.rect.height);...
1d5a0 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 6d 5f 56 65 72 74 69 63 61 6c 53 63 72 .................//m_VerticalScr
1d5c0 6f 6c 6c 62 61 72 2e 6e 75 6d 62 65 72 4f 66 53 74 65 70 73 20 3d 20 28 69 6e 74 29 28 6d 5f 54 ollbar.numberOfSteps.=.(int)(m_T
1d5e0 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 65 78 74 49 6e 66 6f 2e 6c 69 6e 65 43 6f 75 6e 74 20 extComponent.textInfo.lineCount.
1d600 2f 20 30 2e 32 35 66 29 3b 20 2f 2f 20 52 65 70 6c 61 63 65 20 62 79 20 73 63 72 6f 6c 6c 20 73 /.0.25f);.//.Replace.by.scroll.s
1d620 65 6e 73 69 74 69 76 69 74 79 2e 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f ensitivity...................../
1d640 2f 44 65 62 75 67 2e 4c 6f 67 28 22 55 70 64 61 74 69 6e 67 20 53 63 72 6f 6c 6c 62 61 72 2e 2e /Debug.Log("Updating.Scrollbar..
1d660 2e 20 56 61 6c 75 65 3a 20 22 20 2b 20 6d 5f 56 65 72 74 69 63 61 6c 53 63 72 6f 6c 6c 62 61 72 ..Value:.".+.m_VerticalScrollbar
1d680 2e 76 61 6c 75 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 .value);..............}.........
1d6a0 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>...
1d6c0 20 20 20 20 20 20 20 2f 2f 2f 20 46 75 6e 63 74 69 6f 6e 20 74 6f 20 75 70 64 61 74 65 20 74 68 .......///.Function.to.update.th
1d6e0 65 20 76 65 72 74 69 63 61 6c 20 70 6f 73 69 74 69 6f 6e 20 6f 66 20 74 68 65 20 74 65 78 74 20 e.vertical.position.of.the.text.
1d700 63 6f 6e 74 61 69 6e 65 72 20 77 68 65 6e 20 4f 6e 56 61 6c 75 65 43 68 61 6e 67 65 64 20 65 76 container.when.OnValueChanged.ev
1d720 65 6e 74 20 69 73 20 72 65 63 65 69 76 65 64 20 66 72 6f 6d 20 74 68 65 20 53 63 72 6f 6c 6c 62 ent.is.received.from.the.Scrollb
1d740 61 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 20 20 20 ar...........///.</summary>.....
1d760 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 76 61 6c 75 65 22 3e 3c 2f 70 .....///.<param.name="value"></p
1d780 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 76 6f 69 64 20 4f 6e 53 63 72 6f 6c 6c 62 61 72 56 aram>..........void.OnScrollbarV
1d7a0 61 6c 75 65 43 68 61 6e 67 65 28 66 6c 6f 61 74 20 76 61 6c 75 65 29 0d 0a 20 20 20 20 20 20 20 alueChange(float.value).........
1d7c0 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 49 73 55 70 64 61 74 69 6e 67 .{..............if.(m_IsUpdating
1d7e0 53 63 72 6f 6c 6c 62 61 72 56 61 6c 75 65 73 29 20 7b 20 6d 5f 49 73 55 70 64 61 74 69 6e 67 53 ScrollbarValues).{.m_IsUpdatingS
1d800 63 72 6f 6c 6c 62 61 72 56 61 6c 75 65 73 20 3d 20 66 61 6c 73 65 3b 20 72 65 74 75 72 6e 3b 20 crollbarValues.=.false;.return;.
1d820 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 76 61 6c 75 65 20 3c 20 30 20 7c }................if.(value.<.0.|
1d840 7c 20 76 61 6c 75 65 20 3e 20 31 29 20 72 65 74 75 72 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 |.value.>.1).return;............
1d860 20 20 20 20 41 64 6a 75 73 74 54 65 78 74 50 6f 73 69 74 69 6f 6e 52 65 6c 61 74 69 76 65 54 6f ....AdjustTextPositionRelativeTo
1d880 56 69 65 77 70 6f 72 74 28 76 61 6c 75 65 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 Viewport(value);................
1d8a0 6d 5f 53 63 72 6f 6c 6c 50 6f 73 69 74 69 6f 6e 20 3d 20 76 61 6c 75 65 3b 0d 0a 0d 0a 20 20 20 m_ScrollPosition.=.value;.......
1d8c0 20 20 20 20 20 20 20 20 20 2f 2f 44 65 62 75 67 2e 4c 6f 67 28 22 53 63 72 6f 6c 6c 62 61 72 20 .........//Debug.Log("Scrollbar.
1d8e0 76 61 6c 75 65 20 69 73 3a 20 22 20 2b 20 76 61 6c 75 65 20 2b 20 22 20 20 54 72 61 6e 73 66 6f value.is:.".+.value.+."..Transfo
1d900 72 6d 20 50 4f 53 3a 20 22 20 2b 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 72 65 63 74 rm.POS:.".+.m_TextComponent.rect
1d920 54 72 61 6e 73 66 6f 72 6d 2e 61 6e 63 68 6f 72 65 64 50 6f 73 69 74 69 6f 6e 29 3b 0d 0a 20 20 Transform.anchoredPosition);....
1d940 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 72 79 3e ......}............///.<summary>
1d960 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 41 64 6a 75 73 74 73 20 74 68 65 20 72 65 6c 61 74 69 ..........///.Adjusts.the.relati
1d980 76 65 20 70 6f 73 69 74 69 6f 6e 20 6f 66 20 74 68 65 20 62 6f 64 79 20 6f 66 20 74 68 65 20 74 ve.position.of.the.body.of.the.t
1d9a0 65 78 74 20 72 65 6c 61 74 69 76 65 20 74 6f 20 74 68 65 20 76 69 65 77 70 6f 72 74 2e 0d 0a 20 ext.relative.to.the.viewport....
1d9c0 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>........../
1d9e0 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 72 65 6c 61 74 69 76 65 50 6f 73 69 74 69 6f 6e //.<param.name="relativePosition
1da00 22 3e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 76 6f 69 64 20 41 64 6a 75 73 74 54 "></param>..........void.AdjustT
1da20 65 78 74 50 6f 73 69 74 69 6f 6e 52 65 6c 61 74 69 76 65 54 6f 56 69 65 77 70 6f 72 74 20 28 66 extPositionRelativeToViewport.(f
1da40 6c 6f 61 74 20 72 65 6c 61 74 69 76 65 50 6f 73 69 74 69 6f 6e 29 0d 0a 20 20 20 20 20 20 20 20 loat.relativePosition)..........
1da60 7b 0d 0a 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 2d 20 41 64 {..............//Debug.Log("-.Ad
1da80 6a 75 73 74 69 6e 67 20 76 65 72 74 69 63 61 6c 20 74 65 78 74 20 70 6f 73 69 74 69 6f 6e 20 74 justing.vertical.text.position.t
1daa0 6f 20 22 20 2b 20 72 65 6c 61 74 69 76 65 50 6f 73 69 74 69 6f 6e 29 3b 0d 0a 20 20 20 20 20 20 o.".+.relativePosition);........
1dac0 20 20 20 20 20 20 69 66 20 28 6d 5f 54 65 78 74 56 69 65 77 70 6f 72 74 20 3d 3d 20 6e 75 6c 6c ......if.(m_TextViewport.==.null
1dae0 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 3b 0d 0a 0d 0a 20 20 )..................return;......
1db00 20 20 20 20 20 20 20 20 20 20 54 4d 50 5f 54 65 78 74 49 6e 66 6f 20 74 65 78 74 49 6e 66 6f 20 ..........TMP_TextInfo.textInfo.
1db20 3d 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 65 78 74 49 6e 66 6f 3b 0d 0a 0d 0a 20 =.m_TextComponent.textInfo;.....
1db40 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 68 65 63 6b 20 74 6f 20 6d 61 6b 65 20 73 75 72 65 ...........//.Check.to.make.sure
1db60 20 77 65 20 68 61 76 65 20 76 61 6c 69 64 20 64 61 74 61 20 61 6e 64 20 6c 69 6e 65 73 20 74 6f .we.have.valid.data.and.lines.to
1db80 20 71 75 65 72 79 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 74 65 78 74 49 6e 66 .query...............if.(textInf
1dba0 6f 20 3d 3d 20 6e 75 6c 6c 20 7c 7c 20 74 65 78 74 49 6e 66 6f 2e 6c 69 6e 65 49 6e 66 6f 20 3d o.==.null.||.textInfo.lineInfo.=
1dbc0 3d 20 6e 75 6c 6c 20 7c 7c 20 74 65 78 74 49 6e 66 6f 2e 6c 69 6e 65 43 6f 75 6e 74 20 3d 3d 20 =.null.||.textInfo.lineCount.==.
1dbe0 30 20 7c 7c 20 74 65 78 74 49 6e 66 6f 2e 6c 69 6e 65 43 6f 75 6e 74 20 3e 20 74 65 78 74 49 6e 0.||.textInfo.lineCount.>.textIn
1dc00 66 6f 2e 6c 69 6e 65 49 6e 66 6f 2e 4c 65 6e 67 74 68 29 20 72 65 74 75 72 6e 3b 0d 0a 0d 0a 20 fo.lineInfo.Length).return;.....
1dc20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 72 65 63 ...........//m_TextComponent.rec
1dc40 74 54 72 61 6e 73 66 6f 72 6d 2e 61 6e 63 68 6f 72 65 64 50 6f 73 69 74 69 6f 6e 20 3d 20 6e 65 tTransform.anchoredPosition.=.ne
1dc60 77 20 56 65 63 74 6f 72 32 28 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 72 65 63 74 54 72 w.Vector2(m_TextComponent.rectTr
1dc80 61 6e 73 66 6f 72 6d 2e 61 6e 63 68 6f 72 65 64 50 6f 73 69 74 69 6f 6e 2e 78 2c 20 28 74 65 78 ansform.anchoredPosition.x,.(tex
1dca0 74 48 65 69 67 68 74 20 2d 20 76 69 65 77 70 6f 72 74 48 65 69 67 68 74 29 20 2a 20 72 65 6c 61 tHeight.-.viewportHeight).*.rela
1dcc0 74 69 76 65 50 6f 73 69 74 69 6f 6e 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 54 65 tivePosition);..............m_Te
1dce0 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 2e 61 6e 63 68 6f 72 xtComponent.rectTransform.anchor
1dd00 65 64 50 6f 73 69 74 69 6f 6e 20 3d 20 6e 65 77 20 56 65 63 74 6f 72 32 28 6d 5f 54 65 78 74 43 edPosition.=.new.Vector2(m_TextC
1dd20 6f 6d 70 6f 6e 65 6e 74 2e 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 61 6e 63 68 6f 72 65 64 50 omponent.rectTransform.anchoredP
1dd40 6f 73 69 74 69 6f 6e 2e 78 2c 20 28 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 70 72 65 66 osition.x,.(m_TextComponent.pref
1dd60 65 72 72 65 64 48 65 69 67 68 74 20 2d 20 6d 5f 54 65 78 74 56 69 65 77 70 6f 72 74 2e 72 65 63 erredHeight.-.m_TextViewport.rec
1dd80 74 2e 68 65 69 67 68 74 29 20 2a 20 72 65 6c 61 74 69 76 65 50 6f 73 69 74 69 6f 6e 29 3b 0d 0a t.height).*.relativePosition);..
1dda0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 41 73 73 69 67 6e 50 6f 73 69 74 69 6f 6e 69 6e 67 49 ..............AssignPositioningI
1ddc0 66 4e 65 65 64 65 64 28 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 44 65 62 75 fNeeded();................//Debu
1dde0 67 2e 4c 6f 67 28 22 54 65 78 74 20 68 65 69 67 68 74 3a 20 22 20 2b 20 6d 5f 54 65 78 74 43 6f g.Log("Text.height:.".+.m_TextCo
1de00 6d 70 6f 6e 65 6e 74 2e 70 72 65 66 65 72 72 65 64 48 65 69 67 68 74 20 2b 20 22 20 20 56 69 65 mponent.preferredHeight.+."..Vie
1de20 77 70 6f 72 74 20 68 65 69 67 68 74 3a 20 22 20 2b 20 6d 5f 54 65 78 74 56 69 65 77 70 6f 72 74 wport.height:.".+.m_TextViewport
1de40 2e 72 65 63 74 2e 68 65 69 67 68 74 20 2b 20 22 20 20 41 64 6a 75 73 74 65 64 20 52 65 63 74 54 .rect.height.+."..Adjusted.RectT
1de60 72 61 6e 73 66 6f 72 6d 20 61 6e 63 68 6f 72 64 65 64 50 6f 73 69 74 69 6f 6e 3a 22 20 2b 20 6d ransform.anchordedPosition:".+.m
1de80 5f 54 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 2e 61 6e 63 _TextComponent.rectTransform.anc
1dea0 68 6f 72 65 64 50 6f 73 69 74 69 6f 6e 20 2b 20 22 20 20 54 65 78 74 20 42 6f 75 6e 64 73 3a 20 horedPosition.+."..Text.Bounds:.
1dec0 22 20 2b 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 62 6f 75 6e 64 73 2e 54 6f 53 74 72 ".+.m_TextComponent.bounds.ToStr
1dee0 69 6e 67 28 22 66 33 22 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 0d 0a 20 20 20 20 ing("f3"));..........}..........
1df00 20 20 20 20 70 72 69 76 61 74 65 20 69 6e 74 20 47 65 74 43 61 72 65 74 50 6f 73 69 74 69 6f 6e ....private.int.GetCaretPosition
1df20 46 72 6f 6d 53 74 72 69 6e 67 49 6e 64 65 78 28 69 6e 74 20 73 74 72 69 6e 67 49 6e 64 65 78 29 FromStringIndex(int.stringIndex)
1df40 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 63 6f 75 ..........{..............int.cou
1df60 6e 74 20 3d 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 65 78 74 49 6e 66 6f 2e 63 68 nt.=.m_TextComponent.textInfo.ch
1df80 61 72 61 63 74 65 72 43 6f 75 6e 74 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 aracterCount;................for
1dfa0 20 28 69 6e 74 20 69 20 3d 20 30 3b 20 69 20 3c 20 63 6f 75 6e 74 3b 20 69 2b 2b 29 0d 0a 20 20 .(int.i.=.0;.i.<.count;.i++)....
1dfc0 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 69 66 20 ..........{..................if.
1dfe0 28 6d 5f 54 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 (m_TextComponent.textInfo.charac
1e000 74 65 72 49 6e 66 6f 5b 69 5d 2e 69 6e 64 65 78 20 3e 3d 20 73 74 72 69 6e 67 49 6e 64 65 78 29 terInfo[i].index.>=.stringIndex)
1e020 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 69 3b 0d ......................return.i;.
1e040 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 20 20 20 20 72 65 .............}................re
1e060 74 75 72 6e 20 63 6f 75 6e 74 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 turn.count;..........}..........
1e080 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 52 65 74 ..///.<summary>..........///.Ret
1e0a0 75 72 6e 73 20 2f 20 70 6c 61 63 65 73 20 74 68 65 20 63 61 72 65 74 20 62 65 66 6f 72 65 20 74 urns./.places.the.caret.before.t
1e0c0 68 65 20 67 69 76 65 6e 20 63 68 61 72 61 63 74 65 72 20 61 74 20 74 68 65 20 73 74 72 69 6e 67 he.given.character.at.the.string
1e0e0 20 69 6e 64 65 78 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 .index...........///.</summary>.
1e100 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 73 74 72 69 6e 67 .........///.<param.name="string
1e120 49 6e 64 65 78 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 72 65 Index"></param>..........///.<re
1e140 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 72 69 76 61 74 turns></returns>..........privat
1e160 65 20 69 6e 74 20 47 65 74 4d 69 6e 43 61 72 65 74 50 6f 73 69 74 69 6f 6e 46 72 6f 6d 53 74 72 e.int.GetMinCaretPositionFromStr
1e180 69 6e 67 49 6e 64 65 78 28 69 6e 74 20 73 74 72 69 6e 67 49 6e 64 65 78 29 0d 0a 20 20 20 20 20 ingIndex(int.stringIndex).......
1e1a0 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 20 63 6f 75 6e 74 20 3d 20 6d 5f ...{..............int.count.=.m_
1e1c0 54 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 74 65 72 TextComponent.textInfo.character
1e1e0 43 6f 75 6e 74 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 Count;................for.(int.i
1e200 20 3d 20 30 3b 20 69 20 3c 20 63 6f 75 6e 74 3b 20 69 2b 2b 29 0d 0a 20 20 20 20 20 20 20 20 20 .=.0;.i.<.count;.i++)...........
1e220 20 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 73 74 72 69 6e 67 ...{..................if.(string
1e240 49 6e 64 65 78 20 3c 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 65 78 74 49 6e 66 6f Index.<.m_TextComponent.textInfo
1e260 2e 63 68 61 72 61 63 74 65 72 49 6e 66 6f 5b 69 5d 2e 69 6e 64 65 78 20 2b 20 6d 5f 54 65 78 74 .characterInfo[i].index.+.m_Text
1e280 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 66 6f Component.textInfo.characterInfo
1e2a0 5b 69 5d 2e 73 74 72 69 6e 67 4c 65 6e 67 74 68 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 [i].stringLength)...............
1e2c0 20 20 20 20 20 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 7d 0d .......return.i;..............}.
1e2e0 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 63 6f 75 6e 74 3b 0d 0a 20 20 ...............return.count;....
1e300 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 72 79 3e ......}............///.<summary>
1e320 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 52 65 74 75 72 6e 73 20 2f 20 70 6c 61 63 65 73 20 74 ..........///.Returns./.places.t
1e340 68 65 20 63 61 72 65 74 20 61 66 74 65 72 20 74 68 65 20 67 69 76 65 6e 20 63 68 61 72 61 63 74 he.caret.after.the.given.charact
1e360 65 72 20 61 74 20 74 68 65 20 73 74 72 69 6e 67 20 69 6e 64 65 78 2e 0d 0a 20 20 20 20 20 20 20 er.at.the.string.index..........
1e380 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
1e3a0 72 61 6d 20 6e 61 6d 65 3d 22 73 74 72 69 6e 67 49 6e 64 65 78 22 3e 3c 2f 70 61 72 61 6d 3e 0d ram.name="stringIndex"></param>.
1e3c0 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 3e .........///.<returns></returns>
1e3e0 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 69 6e 74 20 47 65 74 4d 61 78 43 61 72 65 ..........private.int.GetMaxCare
1e400 74 50 6f 73 69 74 69 6f 6e 46 72 6f 6d 53 74 72 69 6e 67 49 6e 64 65 78 28 69 6e 74 20 73 74 72 tPositionFromStringIndex(int.str
1e420 69 6e 67 49 6e 64 65 78 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 ingIndex)..........{............
1e440 20 20 69 6e 74 20 63 6f 75 6e 74 20 3d 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 65 ..int.count.=.m_TextComponent.te
1e460 78 74 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 43 6f 75 6e 74 3b 0d 0a 0d 0a 20 20 20 20 20 20 xtInfo.characterCount;..........
1e480 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 63 6f 75 6e 74 3b ......for.(int.i.=.0;.i.<.count;
1e4a0 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 20 .i++)..............{............
1e4c0 20 20 20 20 20 20 69 66 20 28 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 65 78 74 49 6e ......if.(m_TextComponent.textIn
1e4e0 66 6f 2e 63 68 61 72 61 63 74 65 72 49 6e 66 6f 5b 69 5d 2e 69 6e 64 65 78 20 3e 3d 20 73 74 72 fo.characterInfo[i].index.>=.str
1e500 69 6e 67 49 6e 64 65 78 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 ingIndex)......................r
1e520 65 74 75 72 6e 20 69 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 eturn.i;..............}.........
1e540 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 63 6f 75 6e 74 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d .......return.count;..........}.
1e560 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 69 6e 74 20 47 65 74 53 74 72 69 6e 67 ...........private.int.GetString
1e580 49 6e 64 65 78 46 72 6f 6d 43 61 72 65 74 50 6f 73 69 74 69 6f 6e 28 69 6e 74 20 63 61 72 65 74 IndexFromCaretPosition(int.caret
1e5a0 50 6f 73 69 74 69 6f 6e 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 Position)..........{............
1e5c0 20 20 2f 2f 20 43 6c 61 6d 70 20 76 61 6c 75 65 73 20 62 65 74 77 65 65 6e 20 30 20 61 6e 64 20 ..//.Clamp.values.between.0.and.
1e5e0 63 68 61 72 61 63 74 65 72 20 63 6f 75 6e 74 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 43 6c character.count...............Cl
1e600 61 6d 70 43 61 72 65 74 50 6f 73 28 72 65 66 20 63 61 72 65 74 50 6f 73 69 74 69 6f 6e 29 3b 0d ampCaretPos(ref.caretPosition);.
1e620 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 6d 5f 54 65 78 74 43 6f 6d 70 ...............return.m_TextComp
1e640 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 66 6f 5b 63 61 72 onent.textInfo.characterInfo[car
1e660 65 74 50 6f 73 69 74 69 6f 6e 5d 2e 69 6e 64 65 78 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d etPosition].index;..........}...
1e680 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 76 6f 69 64 20 46 6f 72 63 65 4c 61 62 65 ...........public.void.ForceLabe
1e6a0 6c 55 70 64 61 74 65 28 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 lUpdate()..........{............
1e6c0 20 20 55 70 64 61 74 65 4c 61 62 65 6c 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 ..UpdateLabel();..........}.....
1e6e0 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 76 6f 69 64 20 4d 61 72 6b 47 65 6f 6d 65 74 72 79 .......private.void.MarkGeometry
1e700 41 73 44 69 72 74 79 28 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 AsDirty()..........{............
1e720 20 20 23 69 66 20 55 4e 49 54 59 5f 45 44 49 54 4f 52 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 ..#if.UNITY_EDITOR..............
1e740 20 20 20 20 23 69 66 20 55 4e 49 54 59 5f 32 30 31 38 5f 33 5f 4f 52 5f 4e 45 57 45 52 0d 0a 20 ....#if.UNITY_2018_3_OR_NEWER...
1e760 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 41 70 70 6c 69 63 61 74 69 6f 6e 2e ...............if.(!Application.
1e780 69 73 50 6c 61 79 69 6e 67 20 7c 7c 20 55 6e 69 74 79 45 64 69 74 6f 72 2e 50 72 65 66 61 62 55 isPlaying.||.UnityEditor.PrefabU
1e7a0 74 69 6c 69 74 79 2e 49 73 50 61 72 74 4f 66 50 72 65 66 61 62 41 73 73 65 74 28 74 68 69 73 29 tility.IsPartOfPrefabAsset(this)
1e7c0 29 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 3b 0d 0a )......................return;..
1e7e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 23 65 6c 73 65 0d 0a 20 20 20 20 20 20 20 20 20 ................#else...........
1e800 20 20 20 20 20 20 20 69 66 20 28 21 41 70 70 6c 69 63 61 74 69 6f 6e 2e 69 73 50 6c 61 79 69 6e .......if.(!Application.isPlayin
1e820 67 20 7c 7c 20 55 6e 69 74 79 45 64 69 74 6f 72 2e 50 72 65 66 61 62 55 74 69 6c 69 74 79 2e 47 g.||.UnityEditor.PrefabUtility.G
1e840 65 74 50 72 65 66 61 62 4f 62 6a 65 63 74 28 67 61 6d 65 4f 62 6a 65 63 74 29 20 21 3d 20 6e 75 etPrefabObject(gameObject).!=.nu
1e860 6c 6c 29 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 3b ll)......................return;
1e880 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 23 65 6e 64 69 66 0d 0a 20 20 20 20 20 20 ..................#endif........
1e8a0 20 20 20 20 20 20 23 65 6e 64 69 66 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 43 61 6e 76 ......#endif................Canv
1e8c0 61 73 55 70 64 61 74 65 52 65 67 69 73 74 72 79 2e 52 65 67 69 73 74 65 72 43 61 6e 76 61 73 45 asUpdateRegistry.RegisterCanvasE
1e8e0 6c 65 6d 65 6e 74 46 6f 72 47 72 61 70 68 69 63 52 65 62 75 69 6c 64 28 74 68 69 73 29 3b 0d 0a lementForGraphicRebuild(this);..
1e900 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 76 69 72 74 ........}............public.virt
1e920 75 61 6c 20 76 6f 69 64 20 52 65 62 75 69 6c 64 28 43 61 6e 76 61 73 55 70 64 61 74 65 20 75 70 ual.void.Rebuild(CanvasUpdate.up
1e940 64 61 74 65 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 73 77 date)..........{..............sw
1e960 69 74 63 68 20 28 75 70 64 61 74 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 itch.(update)..............{....
1e980 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 73 65 20 43 61 6e 76 61 73 55 70 64 61 74 65 2e ..............case.CanvasUpdate.
1e9a0 4c 61 74 65 50 72 65 52 65 6e 64 65 72 3a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 LatePreRender:..................
1e9c0 20 20 20 20 55 70 64 61 74 65 47 65 6f 6d 65 74 72 79 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 ....UpdateGeometry();...........
1e9e0 20 20 20 20 20 20 20 20 20 20 20 62 72 65 61 6b 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d ...........break;..............}
1ea00 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 76 69 ..........}............public.vi
1ea20 72 74 75 61 6c 20 76 6f 69 64 20 4c 61 79 6f 75 74 43 6f 6d 70 6c 65 74 65 28 29 0d 0a 20 20 20 rtual.void.LayoutComplete().....
1ea40 20 20 20 20 20 7b 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 76 69 72 74 75 .....{.}............public.virtu
1ea60 61 6c 20 76 6f 69 64 20 47 72 61 70 68 69 63 55 70 64 61 74 65 43 6f 6d 70 6c 65 74 65 28 29 0d al.void.GraphicUpdateComplete().
1ea80 0a 20 20 20 20 20 20 20 20 7b 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 .........{.}............private.
1eaa0 76 6f 69 64 20 55 70 64 61 74 65 47 65 6f 6d 65 74 72 79 28 29 0d 0a 20 20 20 20 20 20 20 20 7b void.UpdateGeometry()..........{
1eac0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 23 69 66 20 55 4e 49 54 59 5f 45 44 49 54 4f 52 0d 0a ..............#if.UNITY_EDITOR..
1eae0 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 41 70 70 6c 69 63 61 74 69 6f 6e 2e 69 73 50 ............if.(!Application.isP
1eb00 6c 61 79 69 6e 67 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 3b laying)..................return;
1eb20 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 23 65 6e 64 69 66 0d 0a 0d 0a 20 20 20 20 20 20 20 20 ..............#endif............
1eb40 20 20 20 20 2f 2f 20 4e 6f 20 6e 65 65 64 20 74 6f 20 64 72 61 77 20 61 20 63 75 72 73 6f 72 20 ....//.No.need.to.draw.a.cursor.
1eb60 6f 6e 20 6d 6f 62 69 6c 65 20 61 73 20 69 74 73 20 68 61 6e 64 6c 65 64 20 62 79 20 74 68 65 20 on.mobile.as.its.handled.by.the.
1eb80 64 65 76 69 63 65 73 20 6b 65 79 62 6f 61 72 64 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 devices.keyboard...............i
1eba0 66 20 28 49 6e 50 6c 61 63 65 45 64 69 74 69 6e 67 28 29 20 3d 3d 20 66 61 6c 73 65 29 0d 0a 20 f.(InPlaceEditing().==.false)...
1ebc0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 ...............return;..........
1ebe0 20 20 20 20 20 20 69 66 20 28 6d 5f 43 61 63 68 65 64 49 6e 70 75 74 52 65 6e 64 65 72 65 72 20 ......if.(m_CachedInputRenderer.
1ec00 3d 3d 20 6e 75 6c 6c 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 ==.null)..................return
1ec20 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 4f 6e 46 69 6c 6c 56 42 4f 28 6d 65 73 68 29 ;................OnFillVBO(mesh)
1ec40 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 43 61 63 68 65 64 49 6e 70 75 74 52 65 ;................m_CachedInputRe
1ec60 6e 64 65 72 65 72 2e 53 65 74 4d 65 73 68 28 6d 65 73 68 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d nderer.SetMesh(mesh);..........}
1ec80 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>.....
1eca0 20 20 20 20 20 2f 2f 2f 20 4d 65 74 68 6f 64 20 74 6f 20 6b 65 65 70 20 74 68 65 20 43 61 72 65 .....///.Method.to.keep.the.Care
1ecc0 74 20 52 65 63 74 54 72 61 6e 73 66 6f 72 6d 20 70 72 6f 70 65 72 74 69 65 73 20 69 6e 20 73 79 t.RectTransform.properties.in.sy
1ece0 6e 63 20 77 69 74 68 20 74 68 65 20 74 65 78 74 20 6f 62 6a 65 63 74 27 73 20 52 65 63 74 54 72 nc.with.the.text.object's.RectTr
1ed00 61 6e 73 66 6f 72 6d 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 ansform..........///.</summary>.
1ed20 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 76 6f 69 64 20 41 73 73 69 67 6e 50 6f 73 69 .........private.void.AssignPosi
1ed40 74 69 6f 6e 69 6e 67 49 66 4e 65 65 64 65 64 28 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 tioningIfNeeded()..........{....
1ed60 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 20 21 3d ..........if.(m_TextComponent.!=
1ed80 20 6e 75 6c 6c 20 26 26 20 63 61 72 65 74 52 65 63 74 54 72 61 6e 73 20 21 3d 20 6e 75 6c 6c 20 .null.&&.caretRectTrans.!=.null.
1eda0 26 26 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 28 63 61 72 65 74 52 65 63 74 54 72 &&..................(caretRectTr
1edc0 61 6e 73 2e 6c 6f 63 61 6c 50 6f 73 69 74 69 6f 6e 20 21 3d 20 6d 5f 54 65 78 74 43 6f 6d 70 6f ans.localPosition.!=.m_TextCompo
1ede0 6e 65 6e 74 2e 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 6c 6f 63 61 6c 50 6f 73 69 74 69 6f 6e nent.rectTransform.localPosition
1ee00 20 7c 7c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 72 65 74 52 65 63 74 54 .||...................caretRectT
1ee20 72 61 6e 73 2e 6c 6f 63 61 6c 52 6f 74 61 74 69 6f 6e 20 21 3d 20 6d 5f 54 65 78 74 43 6f 6d 70 rans.localRotation.!=.m_TextComp
1ee40 6f 6e 65 6e 74 2e 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 6c 6f 63 61 6c 52 6f 74 61 74 69 6f onent.rectTransform.localRotatio
1ee60 6e 20 7c 7c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 72 65 74 52 65 63 74 n.||...................caretRect
1ee80 54 72 61 6e 73 2e 6c 6f 63 61 6c 53 63 61 6c 65 20 21 3d 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e Trans.localScale.!=.m_TextCompon
1eea0 65 6e 74 2e 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 6c 6f 63 61 6c 53 63 61 6c 65 20 7c 7c 0d ent.rectTransform.localScale.||.
1eec0 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 72 65 74 52 65 63 74 54 72 61 6e 73 ..................caretRectTrans
1eee0 2e 61 6e 63 68 6f 72 4d 69 6e 20 21 3d 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 72 65 .anchorMin.!=.m_TextComponent.re
1ef00 63 74 54 72 61 6e 73 66 6f 72 6d 2e 61 6e 63 68 6f 72 4d 69 6e 20 7c 7c 0d 0a 20 20 20 20 20 20 ctTransform.anchorMin.||........
1ef20 20 20 20 20 20 20 20 20 20 20 20 63 61 72 65 74 52 65 63 74 54 72 61 6e 73 2e 61 6e 63 68 6f 72 ...........caretRectTrans.anchor
1ef40 4d 61 78 20 21 3d 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 72 65 63 74 54 72 61 6e 73 Max.!=.m_TextComponent.rectTrans
1ef60 66 6f 72 6d 2e 61 6e 63 68 6f 72 4d 61 78 20 7c 7c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 form.anchorMax.||...............
1ef80 20 20 20 20 63 61 72 65 74 52 65 63 74 54 72 61 6e 73 2e 61 6e 63 68 6f 72 65 64 50 6f 73 69 74 ....caretRectTrans.anchoredPosit
1efa0 69 6f 6e 20 21 3d 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 72 65 63 74 54 72 61 6e 73 ion.!=.m_TextComponent.rectTrans
1efc0 66 6f 72 6d 2e 61 6e 63 68 6f 72 65 64 50 6f 73 69 74 69 6f 6e 20 7c 7c 0d 0a 20 20 20 20 20 20 form.anchoredPosition.||........
1efe0 20 20 20 20 20 20 20 20 20 20 20 63 61 72 65 74 52 65 63 74 54 72 61 6e 73 2e 73 69 7a 65 44 65 ...........caretRectTrans.sizeDe
1f000 6c 74 61 20 21 3d 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 72 65 63 74 54 72 61 6e 73 lta.!=.m_TextComponent.rectTrans
1f020 66 6f 72 6d 2e 73 69 7a 65 44 65 6c 74 61 20 7c 7c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 form.sizeDelta.||...............
1f040 20 20 20 20 63 61 72 65 74 52 65 63 74 54 72 61 6e 73 2e 70 69 76 6f 74 20 21 3d 20 6d 5f 54 65 ....caretRectTrans.pivot.!=.m_Te
1f060 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 2e 70 69 76 6f 74 29 xtComponent.rectTransform.pivot)
1f080 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 )..............{................
1f0a0 20 20 63 61 72 65 74 52 65 63 74 54 72 61 6e 73 2e 6c 6f 63 61 6c 50 6f 73 69 74 69 6f 6e 20 3d ..caretRectTrans.localPosition.=
1f0c0 20 6d 5f 54 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 2e 6c .m_TextComponent.rectTransform.l
1f0e0 6f 63 61 6c 50 6f 73 69 74 69 6f 6e 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 ocalPosition;..................c
1f100 61 72 65 74 52 65 63 74 54 72 61 6e 73 2e 6c 6f 63 61 6c 52 6f 74 61 74 69 6f 6e 20 3d 20 6d 5f aretRectTrans.localRotation.=.m_
1f120 54 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 2e 6c 6f 63 61 TextComponent.rectTransform.loca
1f140 6c 52 6f 74 61 74 69 6f 6e 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 72 65 lRotation;..................care
1f160 74 52 65 63 74 54 72 61 6e 73 2e 6c 6f 63 61 6c 53 63 61 6c 65 20 3d 20 6d 5f 54 65 78 74 43 6f tRectTrans.localScale.=.m_TextCo
1f180 6d 70 6f 6e 65 6e 74 2e 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 6c 6f 63 61 6c 53 63 61 6c 65 mponent.rectTransform.localScale
1f1a0 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 72 65 74 52 65 63 74 54 72 61 6e ;..................caretRectTran
1f1c0 73 2e 61 6e 63 68 6f 72 4d 69 6e 20 3d 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 72 65 s.anchorMin.=.m_TextComponent.re
1f1e0 63 74 54 72 61 6e 73 66 6f 72 6d 2e 61 6e 63 68 6f 72 4d 69 6e 3b 0d 0a 20 20 20 20 20 20 20 20 ctTransform.anchorMin;..........
1f200 20 20 20 20 20 20 20 20 63 61 72 65 74 52 65 63 74 54 72 61 6e 73 2e 61 6e 63 68 6f 72 4d 61 78 ........caretRectTrans.anchorMax
1f220 20 3d 20 6d 5f 54 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 .=.m_TextComponent.rectTransform
1f240 2e 61 6e 63 68 6f 72 4d 61 78 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 72 .anchorMax;..................car
1f260 65 74 52 65 63 74 54 72 61 6e 73 2e 61 6e 63 68 6f 72 65 64 50 6f 73 69 74 69 6f 6e 20 3d 20 6d etRectTrans.anchoredPosition.=.m
1f280 5f 54 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 2e 61 6e 63 _TextComponent.rectTransform.anc
1f2a0 68 6f 72 65 64 50 6f 73 69 74 69 6f 6e 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 horedPosition;..................
1f2c0 63 61 72 65 74 52 65 63 74 54 72 61 6e 73 2e 73 69 7a 65 44 65 6c 74 61 20 3d 20 6d 5f 54 65 78 caretRectTrans.sizeDelta.=.m_Tex
1f2e0 74 43 6f 6d 70 6f 6e 65 6e 74 2e 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 73 69 7a 65 44 65 6c tComponent.rectTransform.sizeDel
1f300 74 61 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 72 65 74 52 65 63 74 54 72 ta;..................caretRectTr
1f320 61 6e 73 2e 70 69 76 6f 74 20 3d 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 72 65 63 74 ans.pivot.=.m_TextComponent.rect
1f340 54 72 61 6e 73 66 6f 72 6d 2e 70 69 76 6f 74 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 Transform.pivot;................
1f360 20 20 20 20 2f 2f 20 47 65 74 20 75 70 64 61 74 65 64 20 77 6f 72 6c 64 20 63 6f 72 6e 65 72 73 ....//.Get.updated.world.corners
1f380 20 6f 66 20 76 69 65 77 70 6f 72 74 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f .of.viewport.................../
1f3a0 2f 6d 5f 54 65 78 74 56 69 65 77 70 6f 72 74 2e 47 65 74 4c 6f 63 61 6c 43 6f 72 6e 65 72 73 28 /m_TextViewport.GetLocalCorners(
1f3c0 6d 5f 56 69 65 77 70 6f 72 74 43 6f 72 6e 65 72 73 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 m_ViewportCorners);.............
1f3e0 20 7d 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 70 72 69 76 61 .}..........}..............priva
1f400 74 65 20 76 6f 69 64 20 4f 6e 46 69 6c 6c 56 42 4f 28 4d 65 73 68 20 76 62 6f 29 0d 0a 20 20 20 te.void.OnFillVBO(Mesh.vbo).....
1f420 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 75 73 69 6e 67 20 28 76 61 72 20 68 .....{..............using.(var.h
1f440 65 6c 70 65 72 20 3d 20 6e 65 77 20 56 65 72 74 65 78 48 65 6c 70 65 72 28 29 29 0d 0a 20 20 20 elper.=.new.VertexHelper()).....
1f460 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 69 66 20 28 .........{..................if.(
1f480 21 69 73 46 6f 63 75 73 65 64 20 26 26 20 21 6d 5f 53 65 6c 65 63 74 69 6f 6e 53 74 69 6c 6c 41 !isFocused.&&.!m_SelectionStillA
1f4a0 63 74 69 76 65 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 20 ctive)..................{.......
1f4c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 68 65 6c 70 65 72 2e 46 69 6c 6c 4d 65 73 68 28 76 ...............helper.FillMesh(v
1f4e0 62 6f 29 3b 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 bo);......................return
1f500 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 20 20 20 20 ;..................}............
1f520 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 49 73 53 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 44 69 ........if.(m_IsStringPositionDi
1f540 72 74 79 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 20 20 20 rty)..................{.........
1f560 20 20 20 20 20 20 20 20 20 20 20 20 20 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 .............stringPositionInter
1f580 6e 61 6c 20 3d 20 47 65 74 53 74 72 69 6e 67 49 6e 64 65 78 46 72 6f 6d 43 61 72 65 74 50 6f 73 nal.=.GetStringIndexFromCaretPos
1f5a0 69 74 69 6f 6e 28 6d 5f 43 61 72 65 74 50 6f 73 69 74 69 6f 6e 29 3b 0d 0a 20 20 20 20 20 20 20 ition(m_CaretPosition);.........
1f5c0 20 20 20 20 20 20 20 20 20 20 20 20 20 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f .............stringSelectPositio
1f5e0 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 47 65 74 53 74 72 69 6e 67 49 6e 64 65 78 46 72 6f 6d 43 61 nInternal.=.GetStringIndexFromCa
1f600 72 65 74 50 6f 73 69 74 69 6f 6e 28 6d 5f 43 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f retPosition(m_CaretSelectPositio
1f620 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 6d 5f 49 73 53 74 72 n);......................m_IsStr
1f640 69 6e 67 50 6f 73 69 74 69 6f 6e 44 69 72 74 79 20 3d 20 66 61 6c 73 65 3b 0d 0a 20 20 20 20 20 ingPositionDirty.=.false;.......
1f660 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 20 ...........}....................
1f680 69 66 20 28 6d 5f 49 73 43 61 72 65 74 50 6f 73 69 74 69 6f 6e 44 69 72 74 79 29 0d 0a 20 20 20 if.(m_IsCaretPositionDirty).....
1f6a0 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 .............{..................
1f6c0 20 20 20 20 63 61 72 65 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 47 65 74 43 ....caretPositionInternal.=.GetC
1f6e0 61 72 65 74 50 6f 73 69 74 69 6f 6e 46 72 6f 6d 53 74 72 69 6e 67 49 6e 64 65 78 28 73 74 72 69 aretPositionFromStringIndex(stri
1f700 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 ngPositionInternal);............
1f720 20 20 20 20 20 20 20 20 20 20 63 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 ..........caretSelectPositionInt
1f740 65 72 6e 61 6c 20 3d 20 47 65 74 43 61 72 65 74 50 6f 73 69 74 69 6f 6e 46 72 6f 6d 53 74 72 69 ernal.=.GetCaretPositionFromStri
1f760 6e 67 49 6e 64 65 78 28 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 ngIndex(stringSelectPositionInte
1f780 72 6e 61 6c 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 49 73 rnal);......................m_Is
1f7a0 43 61 72 65 74 50 6f 73 69 74 69 6f 6e 44 69 72 74 79 20 3d 20 66 61 6c 73 65 3b 0d 0a 20 20 20 CaretPositionDirty.=.false;.....
1f7c0 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 20 20 .............}..................
1f7e0 20 20 69 66 20 28 21 68 61 73 53 65 6c 65 63 74 69 6f 6e 20 26 26 20 21 6d 5f 52 65 61 64 4f 6e ..if.(!hasSelection.&&.!m_ReadOn
1f800 6c 79 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 20 20 20 20 ly)..................{..........
1f820 20 20 20 20 20 20 20 20 20 20 20 20 47 65 6e 65 72 61 74 65 43 61 72 65 74 28 68 65 6c 70 65 72 ............GenerateCaret(helper
1f840 2c 20 56 65 63 74 6f 72 32 2e 7a 65 72 6f 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ,.Vector2.zero);................
1f860 20 20 20 20 20 20 53 65 6e 64 4f 6e 45 6e 64 54 65 78 74 53 65 6c 65 63 74 69 6f 6e 28 29 3b 0d ......SendOnEndTextSelection();.
1f880 0a 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 20 .................}..............
1f8a0 20 20 20 20 65 6c 73 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 ....else..................{.....
1f8c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 47 65 6e 65 72 61 74 65 48 69 67 68 74 6c 69 .................GenerateHightli
1f8e0 67 68 74 28 68 65 6c 70 65 72 2c 20 56 65 63 74 6f 72 32 2e 7a 65 72 6f 29 3b 0d 0a 20 20 20 20 ght(helper,.Vector2.zero);......
1f900 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 53 65 6e 64 4f 6e 54 65 78 74 53 65 6c 65 63 74 ................SendOnTextSelect
1f920 69 6f 6e 28 29 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 ion();..................}.......
1f940 20 20 20 20 20 20 20 20 20 20 20 20 20 68 65 6c 70 65 72 2e 46 69 6c 6c 4d 65 73 68 28 76 62 6f .............helper.FillMesh(vbo
1f960 29 3b 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 );..............}..........}....
1f980 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 76 6f 69 64 20 47 65 6e 65 72 61 74 65 43 ..........private.void.GenerateC
1f9a0 61 72 65 74 28 56 65 72 74 65 78 48 65 6c 70 65 72 20 76 62 6f 2c 20 56 65 63 74 6f 72 32 20 72 aret(VertexHelper.vbo,.Vector2.r
1f9c0 6f 75 6e 64 69 6e 67 4f 66 66 73 65 74 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 oundingOffset)..........{.......
1f9e0 20 20 20 20 20 20 20 69 66 20 28 21 6d 5f 43 61 72 65 74 56 69 73 69 62 6c 65 29 0d 0a 20 20 20 .......if.(!m_CaretVisible).....
1fa00 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 .............return;............
1fa20 20 20 20 20 69 66 20 28 6d 5f 43 75 72 73 6f 72 56 65 72 74 73 20 3d 3d 20 6e 75 6c 6c 29 0d 0a ....if.(m_CursorVerts.==.null)..
1fa40 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 43 ............{..................C
1fa60 72 65 61 74 65 43 75 72 73 6f 72 56 65 72 74 73 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 reateCursorVerts();.............
1fa80 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 77 69 64 74 68 20 3d 20 .}................float.width.=.
1faa0 6d 5f 43 61 72 65 74 57 69 64 74 68 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 m_CaretWidth;................//.
1fac0 54 4f 44 4f 3a 20 4f 70 74 69 6d 69 7a 65 20 74 6f 20 6f 6e 6c 79 20 75 70 64 61 74 65 20 74 68 TODO:.Optimize.to.only.update.th
1fae0 65 20 63 61 72 65 74 20 70 6f 73 69 74 69 6f 6e 20 77 68 65 6e 20 6e 65 65 64 65 64 2e 0d 0a 0d e.caret.position.when.needed....
1fb00 0a 20 20 20 20 20 20 20 20 20 20 20 20 56 65 63 74 6f 72 32 20 73 74 61 72 74 50 6f 73 69 74 69 .............Vector2.startPositi
1fb20 6f 6e 20 3d 20 56 65 63 74 6f 72 32 2e 7a 65 72 6f 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 on.=.Vector2.zero;..............
1fb40 66 6c 6f 61 74 20 68 65 69 67 68 74 20 3d 20 30 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 54 float.height.=.0;..............T
1fb60 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 72 61 63 74 65 MP_CharacterInfo.currentCharacte
1fb80 72 3b 0d 0a 0d 0a 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 r;................int.currentLin
1fba0 65 20 3d 20 6d 5f 54 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 e.=.m_TextComponent.textInfo.cha
1fbc0 72 61 63 74 65 72 49 6e 66 6f 5b 63 61 72 65 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c racterInfo[caretPositionInternal
1fbe0 5d 2e 6c 69 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 2f 2f 20 ].lineNumber;................//.
1fc00 43 61 72 65 74 20 69 73 20 70 6f 73 69 74 69 6f 6e 65 64 20 61 74 20 74 68 65 20 6f 72 69 67 69 Caret.is.positioned.at.the.origi
1fc20 6e 20 66 6f 72 20 74 68 65 20 66 69 72 73 74 20 63 68 61 72 61 63 74 65 72 20 6f 66 20 65 61 63 n.for.the.first.character.of.eac
1fc40 68 20 6c 69 6e 65 73 20 61 6e 64 20 61 74 20 74 68 65 20 61 64 76 61 6e 63 65 20 66 6f 72 20 73 h.lines.and.at.the.advance.for.s
1fc60 75 62 73 65 71 75 65 6e 74 20 63 68 61 72 61 63 74 65 72 73 2e 0d 0a 20 20 20 20 20 20 20 20 20 ubsequent.characters............
1fc80 20 20 20 69 66 20 28 63 61 72 65 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 3d 20 ...if.(caretPositionInternal.==.
1fca0 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 65 78 74 49 6e 66 6f 2e 6c 69 6e 65 49 6e 66 m_TextComponent.textInfo.lineInf
1fcc0 6f 5b 63 75 72 72 65 6e 74 4c 69 6e 65 5d 2e 66 69 72 73 74 43 68 61 72 61 63 74 65 72 49 6e 64 o[currentLine].firstCharacterInd
1fce0 65 78 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 ex)..............{..............
1fd00 20 20 20 20 63 75 72 72 65 6e 74 43 68 61 72 61 63 74 65 72 20 3d 20 6d 5f 54 65 78 74 43 6f 6d ....currentCharacter.=.m_TextCom
1fd20 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 66 6f 5b 63 61 ponent.textInfo.characterInfo[ca
1fd40 72 65 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 5d 3b 0d 0a 20 20 20 20 20 20 20 20 20 retPositionInternal];...........
1fd60 20 20 20 20 20 20 20 73 74 61 72 74 50 6f 73 69 74 69 6f 6e 20 3d 20 6e 65 77 20 56 65 63 74 6f .......startPosition.=.new.Vecto
1fd80 72 32 28 63 75 72 72 65 6e 74 43 68 61 72 61 63 74 65 72 2e 6f 72 69 67 69 6e 2c 20 63 75 72 72 r2(currentCharacter.origin,.curr
1fda0 65 6e 74 43 68 61 72 61 63 74 65 72 2e 64 65 73 63 65 6e 64 65 72 29 3b 0d 0a 20 20 20 20 20 20 entCharacter.descender);........
1fdc0 20 20 20 20 20 20 20 20 20 20 68 65 69 67 68 74 20 3d 20 63 75 72 72 65 6e 74 43 68 61 72 61 63 ..........height.=.currentCharac
1fde0 74 65 72 2e 61 73 63 65 6e 64 65 72 20 2d 20 63 75 72 72 65 6e 74 43 68 61 72 61 63 74 65 72 2e ter.ascender.-.currentCharacter.
1fe00 64 65 73 63 65 6e 64 65 72 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 descender;..............}.......
1fe20 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 20 20 20 20 .......else..............{......
1fe40 20 20 20 20 20 20 20 20 20 20 20 20 63 75 72 72 65 6e 74 43 68 61 72 61 63 74 65 72 20 3d 20 6d ............currentCharacter.=.m
1fe60 5f 54 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 74 65 _TextComponent.textInfo.characte
1fe80 72 49 6e 66 6f 5b 63 61 72 65 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2d 20 31 5d rInfo[caretPositionInternal.-.1]
1fea0 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 74 61 72 74 50 6f 73 69 74 69 6f 6e ;..................startPosition
1fec0 20 3d 20 6e 65 77 20 56 65 63 74 6f 72 32 28 63 75 72 72 65 6e 74 43 68 61 72 61 63 74 65 72 2e .=.new.Vector2(currentCharacter.
1fee0 78 41 64 76 61 6e 63 65 2c 20 63 75 72 72 65 6e 74 43 68 61 72 61 63 74 65 72 2e 64 65 73 63 65 xAdvance,.currentCharacter.desce
1ff00 6e 64 65 72 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 68 65 69 67 68 74 20 3d nder);..................height.=
1ff20 20 63 75 72 72 65 6e 74 43 68 61 72 61 63 74 65 72 2e 61 73 63 65 6e 64 65 72 20 2d 20 63 75 72 .currentCharacter.ascender.-.cur
1ff40 72 65 6e 74 43 68 61 72 61 63 74 65 72 2e 64 65 73 63 65 6e 64 65 72 3b 0d 0a 20 20 20 20 20 20 rentCharacter.descender;........
1ff60 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 53 6f 66 ......}................if.(m_Sof
1ff80 74 4b 65 79 62 6f 61 72 64 20 21 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 tKeyboard.!=.null)..............
1ffa0 20 20 20 20 6d 5f 53 6f 66 74 4b 65 79 62 6f 61 72 64 2e 73 65 6c 65 63 74 69 6f 6e 20 3d 20 6e ....m_SoftKeyboard.selection.=.n
1ffc0 65 77 20 52 61 6e 67 65 49 6e 74 28 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e ew.RangeInt(stringPositionIntern
1ffe0 61 6c 2c 20 30 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 41 64 6a 75 73 74 al,.0);................//.Adjust
20000 20 74 68 65 20 70 6f 73 69 74 69 6f 6e 20 6f 66 20 74 68 65 20 52 65 63 74 54 72 61 6e 73 66 6f .the.position.of.the.RectTransfo
20020 72 6d 20 62 61 73 65 64 20 6f 6e 20 74 68 65 20 63 61 72 65 74 20 70 6f 73 69 74 69 6f 6e 20 69 rm.based.on.the.caret.position.i
20040 6e 20 74 68 65 20 76 69 65 77 70 6f 72 74 20 28 6f 6e 6c 79 20 69 66 20 77 65 20 68 61 76 65 20 n.the.viewport.(only.if.we.have.
20060 66 6f 63 75 73 29 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 69 73 46 6f 63 75 73 focus)...............if.(isFocus
20080 65 64 20 26 26 20 73 74 61 72 74 50 6f 73 69 74 69 6f 6e 20 21 3d 20 6d 5f 4c 61 73 74 50 6f 73 ed.&&.startPosition.!=.m_LastPos
200a0 69 74 69 6f 6e 20 7c 7c 20 6d 5f 66 6f 72 63 65 52 65 63 74 54 72 61 6e 73 66 6f 72 6d 41 64 6a ition.||.m_forceRectTransformAdj
200c0 75 73 74 6d 65 6e 74 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 41 64 6a 75 73 74 ustment)..................Adjust
200e0 52 65 63 74 54 72 61 6e 73 66 6f 72 6d 52 65 6c 61 74 69 76 65 54 6f 56 69 65 77 70 6f 72 74 28 RectTransformRelativeToViewport(
20100 73 74 61 72 74 50 6f 73 69 74 69 6f 6e 2c 20 68 65 69 67 68 74 2c 20 63 75 72 72 65 6e 74 43 68 startPosition,.height,.currentCh
20120 61 72 61 63 74 65 72 2e 69 73 56 69 73 69 62 6c 65 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 aracter.isVisible);.............
20140 20 20 20 6d 5f 4c 61 73 74 50 6f 73 69 74 69 6f 6e 20 3d 20 73 74 61 72 74 50 6f 73 69 74 69 6f ...m_LastPosition.=.startPositio
20160 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 6c 61 6d 70 20 43 61 72 65 74 n;................//.Clamp.Caret
20180 20 68 65 69 67 68 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 74 6f 70 20 3d .height..............float.top.=
201a0 20 73 74 61 72 74 50 6f 73 69 74 69 6f 6e 2e 79 20 2b 20 68 65 69 67 68 74 3b 0d 0a 20 20 20 20 .startPosition.y.+.height;......
201c0 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 62 6f 74 74 6f 6d 20 3d 20 74 6f 70 20 2d 20 68 65 69 ........float.bottom.=.top.-.hei
201e0 67 68 74 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4d 69 6e 6f 72 20 74 77 65 ght;................//.Minor.twe
20200 61 6b 20 74 6f 20 61 64 64 72 65 73 73 20 63 61 72 65 74 20 70 6f 74 65 6e 74 69 61 6c 6c 79 20 ak.to.address.caret.potentially.
20220 62 65 69 6e 67 20 74 6f 6f 20 74 68 69 6e 20 62 61 73 65 64 20 6f 6e 20 63 61 6e 76 61 73 20 73 being.too.thin.based.on.canvas.s
20240 63 61 6c 65 72 20 76 61 6c 75 65 73 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 6c 6f 61 74 caler.values...............float
20260 20 73 63 61 6c 65 20 3d 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 63 61 6e 76 61 73 2e .scale.=.m_TextComponent.canvas.
20280 73 63 61 6c 65 46 61 63 74 6f 72 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 43 75 scaleFactor;................m_Cu
202a0 72 73 6f 72 56 65 72 74 73 5b 30 5d 2e 70 6f 73 69 74 69 6f 6e 20 3d 20 6e 65 77 20 56 65 63 74 rsorVerts[0].position.=.new.Vect
202c0 6f 72 33 28 73 74 61 72 74 50 6f 73 69 74 69 6f 6e 2e 78 2c 20 62 6f 74 74 6f 6d 2c 20 30 2e 30 or3(startPosition.x,.bottom,.0.0
202e0 66 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 43 75 72 73 6f 72 56 65 72 74 73 5b 31 f);..............m_CursorVerts[1
20300 5d 2e 70 6f 73 69 74 69 6f 6e 20 3d 20 6e 65 77 20 56 65 63 74 6f 72 33 28 73 74 61 72 74 50 6f ].position.=.new.Vector3(startPo
20320 73 69 74 69 6f 6e 2e 78 2c 20 74 6f 70 2c 20 30 2e 30 66 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 sition.x,.top,.0.0f);...........
20340 20 20 20 6d 5f 43 75 72 73 6f 72 56 65 72 74 73 5b 32 5d 2e 70 6f 73 69 74 69 6f 6e 20 3d 20 6e ...m_CursorVerts[2].position.=.n
20360 65 77 20 56 65 63 74 6f 72 33 28 73 74 61 72 74 50 6f 73 69 74 69 6f 6e 2e 78 20 2b 20 28 77 69 ew.Vector3(startPosition.x.+.(wi
20380 64 74 68 20 2b 20 31 29 20 2f 20 73 63 61 6c 65 2c 20 74 6f 70 2c 20 30 2e 30 66 29 3b 0d 0a 20 dth.+.1)./.scale,.top,.0.0f);...
203a0 20 20 20 20 20 20 20 20 20 20 20 6d 5f 43 75 72 73 6f 72 56 65 72 74 73 5b 33 5d 2e 70 6f 73 69 ...........m_CursorVerts[3].posi
203c0 74 69 6f 6e 20 3d 20 6e 65 77 20 56 65 63 74 6f 72 33 28 73 74 61 72 74 50 6f 73 69 74 69 6f 6e tion.=.new.Vector3(startPosition
203e0 2e 78 20 2b 20 28 77 69 64 74 68 20 2b 20 31 29 20 2f 20 73 63 61 6c 65 2c 20 62 6f 74 74 6f 6d .x.+.(width.+.1)./.scale,.bottom
20400 2c 20 30 2e 30 66 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 53 65 74 20 56 ,.0.0f);................//.Set.V
20420 65 72 74 65 78 20 43 6f 6c 6f 72 20 66 6f 72 20 74 68 65 20 63 61 72 65 74 20 63 6f 6c 6f 72 2e ertex.Color.for.the.caret.color.
20440 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 43 75 72 73 6f 72 56 65 72 74 73 5b 30 5d 2e 63 ..............m_CursorVerts[0].c
20460 6f 6c 6f 72 20 3d 20 63 61 72 65 74 43 6f 6c 6f 72 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 olor.=.caretColor;..............
20480 6d 5f 43 75 72 73 6f 72 56 65 72 74 73 5b 31 5d 2e 63 6f 6c 6f 72 20 3d 20 63 61 72 65 74 43 6f m_CursorVerts[1].color.=.caretCo
204a0 6c 6f 72 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 43 75 72 73 6f 72 56 65 72 74 73 5b lor;..............m_CursorVerts[
204c0 32 5d 2e 63 6f 6c 6f 72 20 3d 20 63 61 72 65 74 43 6f 6c 6f 72 3b 0d 0a 20 20 20 20 20 20 20 20 2].color.=.caretColor;..........
204e0 20 20 20 20 6d 5f 43 75 72 73 6f 72 56 65 72 74 73 5b 33 5d 2e 63 6f 6c 6f 72 20 3d 20 63 61 72 ....m_CursorVerts[3].color.=.car
20500 65 74 43 6f 6c 6f 72 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 62 6f 2e 41 64 64 55 etColor;................vbo.AddU
20520 49 56 65 72 74 65 78 51 75 61 64 28 6d 5f 43 75 72 73 6f 72 56 65 72 74 73 29 3b 0d 0a 0d 0a 20 IVertexQuad(m_CursorVerts);.....
20540 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 20 73 63 72 65 65 6e 48 65 69 67 68 74 20 3d 20 53 63 ...........int.screenHeight.=.Sc
20560 72 65 65 6e 2e 68 65 69 67 68 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 52 65 6d reen.height;..............//.Rem
20580 6f 76 65 64 20 6d 75 6c 74 69 70 6c 65 20 64 69 73 70 6c 61 79 20 73 75 70 70 6f 72 74 20 75 6e oved.multiple.display.support.un
205a0 74 69 6c 20 69 74 20 73 75 70 70 6f 72 74 73 20 6e 6f 6e 65 20 6e 61 74 69 76 65 20 72 65 73 6f til.it.supports.none.native.reso
205c0 6c 75 74 69 6f 6e 73 28 63 61 73 65 20 37 34 31 37 35 31 29 0d 0a 20 20 20 20 20 20 20 20 20 20 lutions(case.741751)............
205e0 20 20 2f 2f 69 6e 74 20 64 69 73 70 6c 61 79 49 6e 64 65 78 20 3d 20 6d 5f 54 65 78 74 43 6f 6d ..//int.displayIndex.=.m_TextCom
20600 70 6f 6e 65 6e 74 2e 63 61 6e 76 61 73 2e 74 61 72 67 65 74 44 69 73 70 6c 61 79 3b 0d 0a 20 20 ponent.canvas.targetDisplay;....
20620 20 20 20 20 20 20 20 20 20 20 2f 2f 69 66 20 28 53 63 72 65 65 6e 2e 66 75 6c 6c 53 63 72 65 65 ..........//if.(Screen.fullScree
20640 6e 20 26 26 20 64 69 73 70 6c 61 79 49 6e 64 65 78 20 3c 20 44 69 73 70 6c 61 79 2e 64 69 73 70 n.&&.displayIndex.<.Display.disp
20660 6c 61 79 73 2e 4c 65 6e 67 74 68 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 lays.Length)..............//....
20680 73 63 72 65 65 6e 48 65 69 67 68 74 20 3d 20 44 69 73 70 6c 61 79 2e 64 69 73 70 6c 61 79 73 5b screenHeight.=.Display.displays[
206a0 64 69 73 70 6c 61 79 49 6e 64 65 78 5d 2e 72 65 6e 64 65 72 69 6e 67 48 65 69 67 68 74 3b 0d 0a displayIndex].renderingHeight;..
206c0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 74 61 72 74 50 6f 73 69 74 69 6f 6e 2e 79 20 3d 20 ..............startPosition.y.=.
206e0 73 63 72 65 65 6e 48 65 69 67 68 74 20 2d 20 73 74 61 72 74 50 6f 73 69 74 69 6f 6e 2e 79 3b 0d screenHeight.-.startPosition.y;.
20700 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 70 75 74 53 79 73 74 65 6d 2e 63 6f 6d 70 6f 73 69 .............inputSystem.composi
20720 74 69 6f 6e 43 75 72 73 6f 72 50 6f 73 20 3d 20 73 74 61 72 74 50 6f 73 69 74 69 6f 6e 3b 0d 0a tionCursorPos.=.startPosition;..
20740 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 23 69 66 20 54 4d 50 5f 44 45 42 55 47 5f 4d 4f ..............//#if.TMP_DEBUG_MO
20760 44 45 0d 0a 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 43 61 72 DE..............//Debug.Log("Car
20780 65 74 20 70 6f 73 69 74 69 6f 6e 20 75 70 64 61 74 65 64 20 61 74 20 66 72 61 6d 65 3a 20 22 20 et.position.updated.at.frame:.".
207a0 2b 20 54 69 6d 65 2e 66 72 61 6d 65 43 6f 75 6e 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 +.Time.frameCount);.............
207c0 20 2f 2f 23 65 6e 64 69 66 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 0d 0a 20 20 20 20 20 20 .//#endif..........}............
207e0 20 20 70 72 69 76 61 74 65 20 76 6f 69 64 20 43 72 65 61 74 65 43 75 72 73 6f 72 56 65 72 74 73 ..private.void.CreateCursorVerts
20800 28 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 6d 5f 43 75 72 ()..........{..............m_Cur
20820 73 6f 72 56 65 72 74 73 20 3d 20 6e 65 77 20 55 49 56 65 72 74 65 78 5b 34 5d 3b 0d 0a 0d 0a 20 sorVerts.=.new.UIVertex[4];.....
20840 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 20 6d ...........for.(int.i.=.0;.i.<.m
20860 5f 43 75 72 73 6f 72 56 65 72 74 73 2e 4c 65 6e 67 74 68 3b 20 69 2b 2b 29 0d 0a 20 20 20 20 20 _CursorVerts.Length;.i++).......
20880 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 6d 5f 43 75 72 73 .......{..................m_Curs
208a0 6f 72 56 65 72 74 73 5b 69 5d 20 3d 20 55 49 56 65 72 74 65 78 2e 73 69 6d 70 6c 65 56 65 72 74 orVerts[i].=.UIVertex.simpleVert
208c0 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 43 75 72 73 6f 72 56 65 72 74 73 ;..................m_CursorVerts
208e0 5b 69 5d 2e 75 76 30 20 3d 20 56 65 63 74 6f 72 32 2e 7a 65 72 6f 3b 0d 0a 20 20 20 20 20 20 20 [i].uv0.=.Vector2.zero;.........
20900 20 20 20 20 20 7d 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 70 .....}..........}..............p
20920 72 69 76 61 74 65 20 76 6f 69 64 20 47 65 6e 65 72 61 74 65 48 69 67 68 74 6c 69 67 68 74 28 56 rivate.void.GenerateHightlight(V
20940 65 72 74 65 78 48 65 6c 70 65 72 20 76 62 6f 2c 20 56 65 63 74 6f 72 32 20 72 6f 75 6e 64 69 6e ertexHelper.vbo,.Vector2.roundin
20960 67 4f 66 66 73 65 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 20 gOffset)..........{.............
20980 20 54 4d 50 5f 54 65 78 74 49 6e 66 6f 20 74 65 78 74 49 6e 66 6f 20 3d 20 6d 5f 54 65 78 74 43 .TMP_TextInfo.textInfo.=.m_TextC
209a0 6f 6d 70 6f 6e 65 6e 74 2e 74 65 78 74 49 6e 66 6f 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 omponent.textInfo;..............
209c0 20 20 63 61 72 65 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 6d 5f 43 61 72 65 ..caretPositionInternal.=.m_Care
209e0 74 50 6f 73 69 74 69 6f 6e 20 3d 20 47 65 74 43 61 72 65 74 50 6f 73 69 74 69 6f 6e 46 72 6f 6d tPosition.=.GetCaretPositionFrom
20a00 53 74 72 69 6e 67 49 6e 64 65 78 28 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e StringIndex(stringPositionIntern
20a20 61 6c 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 63 61 72 65 74 53 65 6c 65 63 74 50 6f 73 al);..............caretSelectPos
20a40 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 6d 5f 43 61 72 65 74 53 65 6c 65 63 74 50 6f 73 itionInternal.=.m_CaretSelectPos
20a60 69 74 69 6f 6e 20 3d 20 47 65 74 43 61 72 65 74 50 6f 73 69 74 69 6f 6e 46 72 6f 6d 53 74 72 69 ition.=.GetCaretPositionFromStri
20a80 6e 67 49 6e 64 65 78 28 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 ngIndex(stringSelectPositionInte
20aa0 72 6e 61 6c 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 53 6f 66 74 rnal);................if.(m_Soft
20ac0 4b 65 79 62 6f 61 72 64 20 21 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b Keyboard.!=.null)..............{
20ae0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 20 73 74 72 69 6e 67 50 6f 73 69 ..................int.stringPosi
20b00 74 69 6f 6e 20 3d 20 63 61 72 65 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3c 20 63 tion.=.caretPositionInternal.<.c
20b20 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3f 20 74 65 78 aretSelectPositionInternal.?.tex
20b40 74 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 49 6e 66 6f 5b 63 61 72 65 74 50 6f 73 69 74 69 6f tInfo.characterInfo[caretPositio
20b60 6e 49 6e 74 65 72 6e 61 6c 5d 2e 69 6e 64 65 78 20 3a 20 74 65 78 74 49 6e 66 6f 2e 63 68 61 72 nInternal].index.:.textInfo.char
20b80 61 63 74 65 72 49 6e 66 6f 5b 63 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 acterInfo[caretSelectPositionInt
20ba0 65 72 6e 61 6c 5d 2e 69 6e 64 65 78 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 ernal].index;..................i
20bc0 6e 74 20 6c 65 6e 67 74 68 20 3d 20 63 61 72 65 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 nt.length.=.caretPositionInterna
20be0 6c 20 3c 20 63 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 l.<.caretSelectPositionInternal.
20c00 3f 20 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2d ?.stringSelectPositionInternal.-
20c20 20 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 20 3a 20 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e .stringPosition.:.stringPosition
20c40 49 6e 74 65 72 6e 61 6c 20 2d 20 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 3b 0d 0a 20 20 20 20 Internal.-.stringPosition;......
20c60 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 53 6f 66 74 4b 65 79 62 6f 61 72 64 2e 73 65 6c 65 63 ............m_SoftKeyboard.selec
20c80 74 69 6f 6e 20 3d 20 6e 65 77 20 52 61 6e 67 65 49 6e 74 28 73 74 72 69 6e 67 50 6f 73 69 74 69 tion.=.new.RangeInt(stringPositi
20ca0 6f 6e 2c 20 6c 65 6e 67 74 68 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 on,.length);..............}.....
20cc0 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 41 64 6a 75 73 74 20 74 65 78 74 20 52 65 63 74 54 72 ...........//.Adjust.text.RectTr
20ce0 61 6e 66 6f 72 6d 20 70 6f 73 69 74 69 6f 6e 20 74 6f 20 6d 61 6b 65 20 73 75 72 65 20 69 74 20 anform.position.to.make.sure.it.
20d00 69 73 20 76 69 73 69 62 6c 65 20 69 6e 20 76 69 65 77 70 6f 72 74 2e 0d 0a 20 20 20 20 20 20 20 is.visible.in.viewport..........
20d20 20 20 20 20 20 56 65 63 74 6f 72 32 20 63 61 72 65 74 50 6f 73 69 74 69 6f 6e 3b 0d 0a 20 20 20 .....Vector2.caretPosition;.....
20d40 20 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 68 65 69 67 68 74 20 3d 20 30 3b 0d 0a 20 20 20 20 .........float.height.=.0;......
20d60 20 20 20 20 20 20 20 20 69 66 20 28 63 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 ........if.(caretSelectPositionI
20d80 6e 74 65 72 6e 61 6c 20 3c 20 74 65 78 74 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 43 6f 75 6e nternal.<.textInfo.characterCoun
20da0 74 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 t)..............{...............
20dc0 20 20 20 63 61 72 65 74 50 6f 73 69 74 69 6f 6e 20 3d 20 6e 65 77 20 56 65 63 74 6f 72 32 28 74 ...caretPosition.=.new.Vector2(t
20de0 65 78 74 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 49 6e 66 6f 5b 63 61 72 65 74 53 65 6c 65 63 extInfo.characterInfo[caretSelec
20e00 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 5d 2e 6f 72 69 67 69 6e 2c 20 74 65 78 74 49 tPositionInternal].origin,.textI
20e20 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 49 6e 66 6f 5b 63 61 72 65 74 53 65 6c 65 63 74 50 6f 73 nfo.characterInfo[caretSelectPos
20e40 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 5d 2e 64 65 73 63 65 6e 64 65 72 29 3b 0d 0a 20 20 20 20 itionInternal].descender);......
20e60 20 20 20 20 20 20 20 20 20 20 20 20 68 65 69 67 68 74 20 3d 20 74 65 78 74 49 6e 66 6f 2e 63 68 ............height.=.textInfo.ch
20e80 61 72 61 63 74 65 72 49 6e 66 6f 5b 63 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 aracterInfo[caretSelectPositionI
20ea0 6e 74 65 72 6e 61 6c 5d 2e 61 73 63 65 6e 64 65 72 20 2d 20 74 65 78 74 49 6e 66 6f 2e 63 68 61 nternal].ascender.-.textInfo.cha
20ec0 72 61 63 74 65 72 49 6e 66 6f 5b 63 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e racterInfo[caretSelectPositionIn
20ee0 74 65 72 6e 61 6c 5d 2e 64 65 73 63 65 6e 64 65 72 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 ternal].descender;..............
20f00 7d 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 20 20 20 20 20 20 }..............else.............
20f20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 72 65 74 50 6f 73 69 74 69 6f .{..................caretPositio
20f40 6e 20 3d 20 6e 65 77 20 56 65 63 74 6f 72 32 28 74 65 78 74 49 6e 66 6f 2e 63 68 61 72 61 63 74 n.=.new.Vector2(textInfo.charact
20f60 65 72 49 6e 66 6f 5b 63 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e erInfo[caretSelectPositionIntern
20f80 61 6c 20 2d 20 31 5d 2e 78 41 64 76 61 6e 63 65 2c 20 74 65 78 74 49 6e 66 6f 2e 63 68 61 72 61 al.-.1].xAdvance,.textInfo.chara
20fa0 63 74 65 72 49 6e 66 6f 5b 63 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 cterInfo[caretSelectPositionInte
20fc0 72 6e 61 6c 20 2d 20 31 5d 2e 64 65 73 63 65 6e 64 65 72 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 rnal.-.1].descender);...........
20fe0 20 20 20 20 20 20 20 68 65 69 67 68 74 20 3d 20 74 65 78 74 49 6e 66 6f 2e 63 68 61 72 61 63 74 .......height.=.textInfo.charact
21000 65 72 49 6e 66 6f 5b 63 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e erInfo[caretSelectPositionIntern
21020 61 6c 20 2d 20 31 5d 2e 61 73 63 65 6e 64 65 72 20 2d 20 74 65 78 74 49 6e 66 6f 2e 63 68 61 72 al.-.1].ascender.-.textInfo.char
21040 61 63 74 65 72 49 6e 66 6f 5b 63 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 acterInfo[caretSelectPositionInt
21060 65 72 6e 61 6c 20 2d 20 31 5d 2e 64 65 73 63 65 6e 64 65 72 3b 0d 0a 20 20 20 20 20 20 20 20 20 ernal.-.1].descender;...........
21080 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 54 4f 44 4f 3a 20 44 6f 6e ...}................//.TODO:.Don
210a0 27 74 20 61 64 6a 75 73 74 20 74 68 65 20 70 6f 73 69 74 69 6f 6e 20 6f 66 20 74 68 65 20 52 65 't.adjust.the.position.of.the.Re
210c0 63 74 54 72 61 6e 73 66 6f 72 6d 20 69 66 20 52 65 73 65 74 20 4f 6e 20 44 65 61 63 74 69 76 61 ctTransform.if.Reset.On.Deactiva
210e0 74 69 6f 6e 20 69 73 20 64 69 73 61 62 6c 65 64 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f tion.is.disabled..............//
21100 20 61 6e 64 20 77 65 20 6a 75 73 74 20 73 65 6c 65 63 74 65 64 20 74 68 65 20 49 6e 70 75 74 20 .and.we.just.selected.the.Input.
21120 46 69 65 6c 64 20 61 67 61 69 6e 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 41 64 6a 75 73 74 Field.again...............Adjust
21140 52 65 63 74 54 72 61 6e 73 66 6f 72 6d 52 65 6c 61 74 69 76 65 54 6f 56 69 65 77 70 6f 72 74 28 RectTransformRelativeToViewport(
21160 63 61 72 65 74 50 6f 73 69 74 69 6f 6e 2c 20 68 65 69 67 68 74 2c 20 74 72 75 65 29 3b 0d 0a 0d caretPosition,.height,.true);...
21180 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 20 73 74 61 72 74 43 68 61 72 20 3d 20 4d 61 74 .............int.startChar.=.Mat
211a0 68 66 2e 4d 61 78 28 30 2c 20 63 61 72 65 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 29 hf.Max(0,.caretPositionInternal)
211c0 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 20 65 6e 64 43 68 61 72 20 3d 20 4d 61 74 ;..............int.endChar.=.Mat
211e0 68 66 2e 4d 61 78 28 30 2c 20 63 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 hf.Max(0,.caretSelectPositionInt
21200 65 72 6e 61 6c 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 45 6e 73 75 72 65 ernal);................//.Ensure
21220 20 70 6f 73 20 69 73 20 61 6c 77 61 79 73 20 6c 65 73 73 20 74 68 65 6e 20 73 65 6c 50 6f 73 20 .pos.is.always.less.then.selPos.
21240 74 6f 20 6d 61 6b 65 20 74 68 65 20 63 6f 64 65 20 73 69 6d 70 6c 65 72 0d 0a 20 20 20 20 20 20 to.make.the.code.simpler........
21260 20 20 20 20 20 20 69 66 20 28 73 74 61 72 74 43 68 61 72 20 3e 20 65 6e 64 43 68 61 72 29 0d 0a ......if.(startChar.>.endChar)..
21280 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 69 ............{..................i
212a0 6e 74 20 74 65 6d 70 20 3d 20 73 74 61 72 74 43 68 61 72 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 nt.temp.=.startChar;............
212c0 20 20 20 20 20 20 73 74 61 72 74 43 68 61 72 20 3d 20 65 6e 64 43 68 61 72 3b 0d 0a 20 20 20 20 ......startChar.=.endChar;......
212e0 20 20 20 20 20 20 20 20 20 20 20 20 65 6e 64 43 68 61 72 20 3d 20 74 65 6d 70 3b 0d 0a 20 20 20 ............endChar.=.temp;.....
21300 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 65 6e 64 43 68 61 .........}................endCha
21320 72 20 2d 3d 20 31 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 44 65 62 75 67 2e 4c r.-=.1;................//Debug.L
21340 6f 67 28 22 55 70 64 61 74 69 6e 67 20 48 69 67 68 6c 69 67 68 74 2e 2e 2e 20 43 61 72 65 74 20 og("Updating.Highlight....Caret.
21360 50 6f 73 69 74 69 6f 6e 3a 20 22 20 2b 20 73 74 61 72 74 43 68 61 72 20 2b 20 22 20 43 61 72 65 Position:.".+.startChar.+.".Care
21380 74 20 53 65 6c 65 63 74 20 50 4f 53 3a 20 22 20 2b 20 65 6e 64 43 68 61 72 29 3b 0d 0a 0d 0a 0d t.Select.POS:.".+.endChar);.....
213a0 0a 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 49 6e 64 65 .............int.currentLineInde
213c0 78 20 3d 20 74 65 78 74 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 49 6e 66 6f 5b 73 74 61 72 74 x.=.textInfo.characterInfo[start
213e0 43 68 61 72 5d 2e 6c 69 6e 65 4e 75 6d 62 65 72 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 Char].lineNumber;..............i
21400 6e 74 20 6e 65 78 74 4c 69 6e 65 53 74 61 72 74 49 64 78 20 3d 20 74 65 78 74 49 6e 66 6f 2e 6c nt.nextLineStartIdx.=.textInfo.l
21420 69 6e 65 49 6e 66 6f 5b 63 75 72 72 65 6e 74 4c 69 6e 65 49 6e 64 65 78 5d 2e 6c 61 73 74 43 68 ineInfo[currentLineIndex].lastCh
21440 61 72 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 55 49 56 aracterIndex;................UIV
21460 65 72 74 65 78 20 76 65 72 74 20 3d 20 55 49 56 65 72 74 65 78 2e 73 69 6d 70 6c 65 56 65 72 74 ertex.vert.=.UIVertex.simpleVert
21480 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 65 72 74 2e 75 76 30 20 3d 20 56 65 63 74 6f 72 ;..............vert.uv0.=.Vector
214a0 32 2e 7a 65 72 6f 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 65 72 74 2e 63 6f 6c 6f 72 20 2.zero;..............vert.color.
214c0 3d 20 73 65 6c 65 63 74 69 6f 6e 43 6f 6c 6f 72 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 =.selectionColor;...............
214e0 20 69 6e 74 20 63 75 72 72 65 6e 74 43 68 61 72 20 3d 20 73 74 61 72 74 43 68 61 72 3b 0d 0a 20 .int.currentChar.=.startChar;...
21500 20 20 20 20 20 20 20 20 20 20 20 77 68 69 6c 65 20 28 63 75 72 72 65 6e 74 43 68 61 72 20 3c 3d ...........while.(currentChar.<=
21520 20 65 6e 64 43 68 61 72 20 26 26 20 63 75 72 72 65 6e 74 43 68 61 72 20 3c 20 74 65 78 74 49 6e .endChar.&&.currentChar.<.textIn
21540 66 6f 2e 63 68 61 72 61 63 74 65 72 43 6f 75 6e 74 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 fo.characterCount)..............
21560 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 75 72 72 65 6e 74 43 68 {..................if.(currentCh
21580 61 72 20 3d 3d 20 6e 65 78 74 4c 69 6e 65 53 74 61 72 74 49 64 78 20 7c 7c 20 63 75 72 72 65 6e ar.==.nextLineStartIdx.||.curren
215a0 74 43 68 61 72 20 3d 3d 20 65 6e 64 43 68 61 72 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 tChar.==.endChar)...............
215c0 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 54 4d 50 5f 43 68 ...{......................TMP_Ch
215e0 61 72 61 63 74 65 72 49 6e 66 6f 20 73 74 61 72 74 43 68 61 72 49 6e 66 6f 20 3d 20 74 65 78 74 aracterInfo.startCharInfo.=.text
21600 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 49 6e 66 6f 5b 73 74 61 72 74 43 68 61 72 5d 3b 0d 0a Info.characterInfo[startChar];..
21620 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 74 65 ....................TMP_Characte
21640 72 49 6e 66 6f 20 65 6e 64 43 68 61 72 49 6e 66 6f 20 3d 20 74 65 78 74 49 6e 66 6f 2e 63 68 61 rInfo.endCharInfo.=.textInfo.cha
21660 72 61 63 74 65 72 49 6e 66 6f 5b 63 75 72 72 65 6e 74 43 68 61 72 5d 3b 0d 0a 0d 0a 20 20 20 20 racterInfo[currentChar];........
21680 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 45 78 74 72 61 20 63 68 65 63 6b 20 74 ................//.Extra.check.t
216a0 6f 20 68 61 6e 64 6c 65 20 43 61 72 72 69 61 67 65 20 52 65 74 75 72 6e 0d 0a 20 20 20 20 20 20 o.handle.Carriage.Return........
216c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 75 72 72 65 6e 74 43 68 61 72 20 3e 20 ..............if.(currentChar.>.
216e0 30 20 26 26 20 65 6e 64 43 68 61 72 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 20 3d 3d 20 31 30 0.&&.endCharInfo.character.==.10
21700 20 26 26 20 74 65 78 74 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 49 6e 66 6f 5b 63 75 72 72 65 .&&.textInfo.characterInfo[curre
21720 6e 74 43 68 61 72 20 2d 20 31 5d 2e 63 68 61 72 61 63 74 65 72 20 3d 3d 20 31 33 29 0d 0a 20 20 ntChar.-.1].character.==.13)....
21740 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 65 6e 64 43 68 61 72 49 6e 66 ......................endCharInf
21760 6f 20 3d 20 74 65 78 74 49 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 49 6e 66 6f 5b 63 75 72 72 65 o.=.textInfo.characterInfo[curre
21780 6e 74 43 68 61 72 20 2d 20 31 5d 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ntChar.-.1];....................
217a0 20 20 20 20 56 65 63 74 6f 72 32 20 73 74 61 72 74 50 6f 73 69 74 69 6f 6e 20 3d 20 6e 65 77 20 ....Vector2.startPosition.=.new.
217c0 56 65 63 74 6f 72 32 28 73 74 61 72 74 43 68 61 72 49 6e 66 6f 2e 6f 72 69 67 69 6e 2c 20 74 65 Vector2(startCharInfo.origin,.te
217e0 78 74 49 6e 66 6f 2e 6c 69 6e 65 49 6e 66 6f 5b 63 75 72 72 65 6e 74 4c 69 6e 65 49 6e 64 65 78 xtInfo.lineInfo[currentLineIndex
21800 5d 2e 61 73 63 65 6e 64 65 72 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ].ascender);....................
21820 20 20 56 65 63 74 6f 72 32 20 65 6e 64 50 6f 73 69 74 69 6f 6e 20 3d 20 6e 65 77 20 56 65 63 74 ..Vector2.endPosition.=.new.Vect
21840 6f 72 32 28 65 6e 64 43 68 61 72 49 6e 66 6f 2e 78 41 64 76 61 6e 63 65 2c 20 74 65 78 74 49 6e or2(endCharInfo.xAdvance,.textIn
21860 66 6f 2e 6c 69 6e 65 49 6e 66 6f 5b 63 75 72 72 65 6e 74 4c 69 6e 65 49 6e 64 65 78 5d 2e 64 65 fo.lineInfo[currentLineIndex].de
21880 73 63 65 6e 64 65 72 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 scender);.......................
218a0 20 76 61 72 20 73 74 61 72 74 49 6e 64 65 78 20 3d 20 76 62 6f 2e 63 75 72 72 65 6e 74 56 65 72 .var.startIndex.=.vbo.currentVer
218c0 74 43 6f 75 6e 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 65 72 tCount;......................ver
218e0 74 2e 70 6f 73 69 74 69 6f 6e 20 3d 20 6e 65 77 20 56 65 63 74 6f 72 33 28 73 74 61 72 74 50 6f t.position.=.new.Vector3(startPo
21900 73 69 74 69 6f 6e 2e 78 2c 20 65 6e 64 50 6f 73 69 74 69 6f 6e 2e 79 2c 20 30 2e 30 66 29 3b 0d sition.x,.endPosition.y,.0.0f);.
21920 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 62 6f 2e 41 64 64 56 65 72 74 .....................vbo.AddVert
21940 28 76 65 72 74 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 76 (vert);........................v
21960 65 72 74 2e 70 6f 73 69 74 69 6f 6e 20 3d 20 6e 65 77 20 56 65 63 74 6f 72 33 28 65 6e 64 50 6f ert.position.=.new.Vector3(endPo
21980 73 69 74 69 6f 6e 2e 78 2c 20 65 6e 64 50 6f 73 69 74 69 6f 6e 2e 79 2c 20 30 2e 30 66 29 3b 0d sition.x,.endPosition.y,.0.0f);.
219a0 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 62 6f 2e 41 64 64 56 65 72 74 .....................vbo.AddVert
219c0 28 76 65 72 74 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 76 (vert);........................v
219e0 65 72 74 2e 70 6f 73 69 74 69 6f 6e 20 3d 20 6e 65 77 20 56 65 63 74 6f 72 33 28 65 6e 64 50 6f ert.position.=.new.Vector3(endPo
21a00 73 69 74 69 6f 6e 2e 78 2c 20 73 74 61 72 74 50 6f 73 69 74 69 6f 6e 2e 79 2c 20 30 2e 30 66 29 sition.x,.startPosition.y,.0.0f)
21a20 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 62 6f 2e 41 64 64 56 65 ;......................vbo.AddVe
21a40 72 74 28 76 65 72 74 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 rt(vert);.......................
21a60 20 76 65 72 74 2e 70 6f 73 69 74 69 6f 6e 20 3d 20 6e 65 77 20 56 65 63 74 6f 72 33 28 73 74 61 .vert.position.=.new.Vector3(sta
21a80 72 74 50 6f 73 69 74 69 6f 6e 2e 78 2c 20 73 74 61 72 74 50 6f 73 69 74 69 6f 6e 2e 79 2c 20 30 rtPosition.x,.startPosition.y,.0
21aa0 2e 30 66 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 62 6f 2e 41 .0f);......................vbo.A
21ac0 64 64 56 65 72 74 28 76 65 72 74 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ddVert(vert);...................
21ae0 20 20 20 20 20 76 62 6f 2e 41 64 64 54 72 69 61 6e 67 6c 65 28 73 74 61 72 74 49 6e 64 65 78 2c .....vbo.AddTriangle(startIndex,
21b00 20 73 74 61 72 74 49 6e 64 65 78 20 2b 20 31 2c 20 73 74 61 72 74 49 6e 64 65 78 20 2b 20 32 29 .startIndex.+.1,.startIndex.+.2)
21b20 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 62 6f 2e 41 64 64 54 72 ;......................vbo.AddTr
21b40 69 61 6e 67 6c 65 28 73 74 61 72 74 49 6e 64 65 78 20 2b 20 32 2c 20 73 74 61 72 74 49 6e 64 65 iangle(startIndex.+.2,.startInde
21b60 78 20 2b 20 33 2c 20 73 74 61 72 74 49 6e 64 65 78 20 2b 20 30 29 3b 0d 0a 0d 0a 20 20 20 20 20 x.+.3,.startIndex.+.0);.........
21b80 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 74 61 72 74 43 68 61 72 20 3d 20 63 75 72 72 65 ...............startChar.=.curre
21ba0 6e 74 43 68 61 72 20 2b 20 31 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ntChar.+.1;.....................
21bc0 20 63 75 72 72 65 6e 74 4c 69 6e 65 49 6e 64 65 78 2b 2b 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 .currentLineIndex++;............
21be0 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 75 72 72 65 6e 74 4c 69 6e 65 49 6e 64 65 78 ............if.(currentLineIndex
21c00 20 3c 20 74 65 78 74 49 6e 66 6f 2e 6c 69 6e 65 43 6f 75 6e 74 29 0d 0a 20 20 20 20 20 20 20 20 .<.textInfo.lineCount)..........
21c20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6e 65 78 74 4c 69 6e 65 53 74 61 72 74 49 64 78 ................nextLineStartIdx
21c40 20 3d 20 74 65 78 74 49 6e 66 6f 2e 6c 69 6e 65 49 6e 66 6f 5b 63 75 72 72 65 6e 74 4c 69 6e 65 .=.textInfo.lineInfo[currentLine
21c60 49 6e 64 65 78 5d 2e 6c 61 73 74 43 68 61 72 61 63 74 65 72 49 6e 64 65 78 3b 0d 0a 20 20 20 20 Index].lastCharacterIndex;......
21c80 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 63 ............}..................c
21ca0 75 72 72 65 6e 74 43 68 61 72 2b 2b 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a urrentChar++;..............}....
21cc0 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 53 63 72 6f 6c 6c 62 61 72 20 73 68 6f 75 6c 64 20 ............//.Scrollbar.should.
21ce0 62 65 20 75 70 64 61 74 65 64 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 49 73 53 63 72 be.updated...............m_IsScr
21d00 6f 6c 6c 62 61 72 55 70 64 61 74 65 52 65 71 75 69 72 65 64 20 3d 20 74 72 75 65 3b 0d 0a 0d 0a ollbarUpdateRequired.=.true;....
21d20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 23 69 66 20 54 4d 50 5f 44 45 42 55 47 5f 4d 4f 44 45 ............//#if.TMP_DEBUG_MODE
21d40 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 44 65 62 75 67 2e 4c 6f 67 28 22 54 ..............//....Debug.Log("T
21d60 65 78 74 20 73 65 6c 65 63 74 69 6f 6e 20 75 70 64 61 74 65 64 20 61 74 20 66 72 61 6d 65 3a 20 ext.selection.updated.at.frame:.
21d80 22 20 2b 20 54 69 6d 65 2e 66 72 61 6d 65 43 6f 75 6e 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 ".+.Time.frameCount);...........
21da0 20 20 20 2f 2f 23 65 6e 64 69 66 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 0d 0a 20 20 20 20 ...//#endif..........}..........
21dc0 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 0d ....///.<summary>..........///..
21de0 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>.........
21e00 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 73 74 61 72 74 50 6f 73 69 74 69 6f 6e 22 .///.<param.name="startPosition"
21e20 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 20 6e 61 ></param>..........///.<param.na
21e40 6d 65 3d 22 68 65 69 67 68 74 22 3e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f me="height"></param>..........//
21e60 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 69 73 43 68 61 72 56 69 73 69 62 6c 65 22 3e 3c 2f /.<param.name="isCharVisible"></
21e80 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 76 6f 69 64 20 41 64 6a param>..........private.void.Adj
21ea0 75 73 74 52 65 63 74 54 72 61 6e 73 66 6f 72 6d 52 65 6c 61 74 69 76 65 54 6f 56 69 65 77 70 6f ustRectTransformRelativeToViewpo
21ec0 72 74 28 56 65 63 74 6f 72 32 20 73 74 61 72 74 50 6f 73 69 74 69 6f 6e 2c 20 66 6c 6f 61 74 20 rt(Vector2.startPosition,.float.
21ee0 68 65 69 67 68 74 2c 20 62 6f 6f 6c 20 69 73 43 68 61 72 56 69 73 69 62 6c 65 29 0d 0a 20 20 20 height,.bool.isCharVisible).....
21f00 20 20 20 20 20 7b 0d 0a 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(
21f20 22 41 64 6a 75 73 74 69 6e 67 20 74 72 61 6e 73 66 6f 72 6d 20 70 6f 73 69 74 69 6f 6e 20 72 65 "Adjusting.transform.position.re
21f40 6c 61 74 69 76 65 20 74 6f 20 76 69 65 77 70 6f 72 74 2e 22 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 lative.to.viewport.");..........
21f60 20 20 20 20 20 20 69 66 20 28 6d 5f 54 65 78 74 56 69 65 77 70 6f 72 74 20 3d 3d 20 6e 75 6c 6c ......if.(m_TextViewport.==.null
21f80 20 7c 7c 20 6d 5f 49 73 44 72 69 76 65 6e 42 79 4c 61 79 6f 75 74 43 6f 6d 70 6f 6e 65 6e 74 73 .||.m_IsDrivenByLayoutComponents
21fa0 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 3b 0d 0a 0d 0a 20 20 )..................return;......
21fc0 20 20 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 76 69 65 77 70 6f 72 74 4d 69 6e 20 3d 20 6d 5f ..........float.viewportMin.=.m_
21fe0 54 65 78 74 56 69 65 77 70 6f 72 74 2e 72 65 63 74 2e 78 4d 69 6e 3b 0d 0a 20 20 20 20 20 20 20 TextViewport.rect.xMin;.........
22000 20 20 20 20 20 66 6c 6f 61 74 20 76 69 65 77 70 6f 72 74 4d 61 78 20 3d 20 6d 5f 54 65 78 74 56 .....float.viewportMax.=.m_TextV
22020 69 65 77 70 6f 72 74 2e 72 65 63 74 2e 78 4d 61 78 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 iewport.rect.xMax;..............
22040 20 20 2f 2f 44 65 62 75 67 2e 4c 6f 67 28 22 56 69 65 77 70 6f 72 74 20 52 65 63 74 3a 20 22 20 ..//Debug.Log("Viewport.Rect:.".
22060 2b 20 76 69 65 77 70 6f 72 74 4d 61 78 20 2b 20 22 20 20 53 74 61 72 74 20 50 6f 73 69 74 69 6f +.viewportMax.+."..Start.Positio
22080 6e 3a 20 22 20 2b 20 73 74 61 72 74 50 6f 73 69 74 69 6f 6e 29 3b 0d 0a 20 20 20 20 20 20 20 20 n:.".+.startPosition);..........
220a0 20 20 20 20 2f 2f 20 41 64 6a 75 73 74 20 74 68 65 20 70 6f 73 69 74 69 6f 6e 20 6f 66 20 74 68 ....//.Adjust.the.position.of.th
220c0 65 20 52 65 63 74 54 72 61 6e 73 66 6f 72 6d 20 62 61 73 65 64 20 6f 6e 20 74 68 65 20 63 61 72 e.RectTransform.based.on.the.car
220e0 65 74 20 70 6f 73 69 74 69 6f 6e 20 69 6e 20 74 68 65 20 76 69 65 77 70 6f 72 74 2e 0d 0a 20 20 et.position.in.the.viewport.....
22100 20 20 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 72 69 67 68 74 4f 66 66 73 65 74 20 3d 20 76 69 ..........float.rightOffset.=.vi
22120 65 77 70 6f 72 74 4d 61 78 20 2d 20 28 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 72 65 63 ewportMax.-.(m_TextComponent.rec
22140 74 54 72 61 6e 73 66 6f 72 6d 2e 61 6e 63 68 6f 72 65 64 50 6f 73 69 74 69 6f 6e 2e 78 20 2b 20 tTransform.anchoredPosition.x.+.
22160 73 74 61 72 74 50 6f 73 69 74 69 6f 6e 2e 78 20 2b 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e startPosition.x.+.m_TextComponen
22180 74 2e 6d 61 72 67 69 6e 2e 7a 20 2b 20 6d 5f 43 61 72 65 74 57 69 64 74 68 29 3b 0d 0a 20 20 20 t.margin.z.+.m_CaretWidth);.....
221a0 20 20 20 20 20 20 20 20 20 69 66 20 28 72 69 67 68 74 4f 66 66 73 65 74 20 3c 20 30 66 29 0d 0a .........if.(rightOffset.<.0f)..
221c0 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 69 ............{..................i
221e0 66 20 28 21 6d 75 6c 74 69 4c 69 6e 65 20 7c 7c 20 28 6d 75 6c 74 69 4c 69 6e 65 20 26 26 20 69 f.(!multiLine.||.(multiLine.&&.i
22200 73 43 68 61 72 56 69 73 69 62 6c 65 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 sCharVisible))..................
22220 7b 0d 0a 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
22240 6f 67 28 22 53 68 69 66 74 69 6e 67 20 74 65 78 74 20 74 6f 20 74 68 65 20 72 69 67 68 74 20 62 og("Shifting.text.to.the.right.b
22260 79 20 22 20 2b 20 72 69 67 68 74 4f 66 66 73 65 74 2e 54 6f 53 74 72 69 6e 67 28 22 66 33 22 29 y.".+.rightOffset.ToString("f3")
22280 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 54 65 78 74 43 6f );......................m_TextCo
222a0 6d 70 6f 6e 65 6e 74 2e 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 61 6e 63 68 6f 72 65 64 50 6f mponent.rectTransform.anchoredPo
222c0 73 69 74 69 6f 6e 20 2b 3d 20 6e 65 77 20 56 65 63 74 6f 72 32 28 72 69 67 68 74 4f 66 66 73 65 sition.+=.new.Vector2(rightOffse
222e0 74 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 41 73 t,.0);........................As
22300 73 69 67 6e 50 6f 73 69 74 69 6f 6e 69 6e 67 49 66 4e 65 65 64 65 64 28 29 3b 0d 0a 20 20 20 20 signPositioningIfNeeded();......
22320 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 7d 0d 0a 0d 0a ............}..............}....
22340 20 20 20 20 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 6c 65 66 74 4f 66 66 73 65 74 20 3d 20 28 ............float.leftOffset.=.(
22360 6d 5f 54 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 2e 61 6e m_TextComponent.rectTransform.an
22380 63 68 6f 72 65 64 50 6f 73 69 74 69 6f 6e 2e 78 20 2b 20 73 74 61 72 74 50 6f 73 69 74 69 6f 6e choredPosition.x.+.startPosition
223a0 2e 78 20 2d 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 6d 61 72 67 69 6e 2e 78 29 20 2d .x.-.m_TextComponent.margin.x).-
223c0 20 76 69 65 77 70 6f 72 74 4d 69 6e 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6c .viewportMin;..............if.(l
223e0 65 66 74 4f 66 66 73 65 74 20 3c 20 30 66 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a eftOffset.<.0f)..............{..
22400 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 68 69 ................//Debug.Log("Shi
22420 66 74 69 6e 67 20 74 65 78 74 20 74 6f 20 74 68 65 20 6c 65 66 74 20 62 79 20 22 20 2b 20 6c 65 fting.text.to.the.left.by.".+.le
22440 66 74 4f 66 66 73 65 74 2e 54 6f 53 74 72 69 6e 67 28 22 66 33 22 29 29 3b 0d 0a 20 20 20 20 20 ftOffset.ToString("f3"));.......
22460 20 20 20 20 20 20 20 20 20 20 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 72 65 63 74 54 ...........m_TextComponent.rectT
22480 72 61 6e 73 66 6f 72 6d 2e 61 6e 63 68 6f 72 65 64 50 6f 73 69 74 69 6f 6e 20 2b 3d 20 6e 65 77 ransform.anchoredPosition.+=.new
224a0 20 56 65 63 74 6f 72 32 28 2d 6c 65 66 74 4f 66 66 73 65 74 2c 20 30 29 3b 0d 0a 20 20 20 20 20 .Vector2(-leftOffset,.0);.......
224c0 20 20 20 20 20 20 20 20 20 20 20 41 73 73 69 67 6e 50 6f 73 69 74 69 6f 6e 69 6e 67 49 66 4e 65 ...........AssignPositioningIfNe
224e0 65 64 65 64 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 0d 0a 20 20 20 20 eded();..............}..........
22500 20 20 20 20 20 20 20 20 2f 2f 20 41 64 6a 75 73 74 20 74 65 78 74 20 61 72 65 61 20 75 70 20 6f ........//.Adjust.text.area.up.o
22520 72 20 64 6f 77 6e 20 69 66 20 6e 6f 74 20 69 6e 20 73 69 6e 67 6c 65 20 6c 69 6e 65 20 6d 6f 64 r.down.if.not.in.single.line.mod
22540 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 4c 69 6e 65 54 79 70 65 20 21 e...............if.(m_LineType.!
22560 3d 20 4c 69 6e 65 54 79 70 65 2e 53 69 6e 67 6c 65 4c 69 6e 65 29 0d 0a 20 20 20 20 20 20 20 20 =.LineType.SingleLine)..........
22580 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 74 6f 70 ....{..................float.top
225a0 4f 66 66 73 65 74 20 3d 20 6d 5f 54 65 78 74 56 69 65 77 70 6f 72 74 2e 72 65 63 74 2e 79 4d 61 Offset.=.m_TextViewport.rect.yMa
225c0 78 20 2d 20 28 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 72 65 63 74 54 72 61 6e 73 66 6f x.-.(m_TextComponent.rectTransfo
225e0 72 6d 2e 61 6e 63 68 6f 72 65 64 50 6f 73 69 74 69 6f 6e 2e 79 20 2b 20 73 74 61 72 74 50 6f 73 rm.anchoredPosition.y.+.startPos
22600 69 74 69 6f 6e 2e 79 20 2b 20 68 65 69 67 68 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 ition.y.+.height);..............
22620 20 20 20 20 69 66 20 28 74 6f 70 4f 66 66 73 65 74 20 3c 20 2d 30 2e 30 30 30 31 66 29 0d 0a 20 ....if.(topOffset.<.-0.0001f)...
22640 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 20 ...............{................
22660 20 20 20 20 20 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 72 65 63 74 54 72 61 6e 73 66 ......m_TextComponent.rectTransf
22680 6f 72 6d 2e 61 6e 63 68 6f 72 65 64 50 6f 73 69 74 69 6f 6e 20 2b 3d 20 6e 65 77 20 56 65 63 74 orm.anchoredPosition.+=.new.Vect
226a0 6f 72 32 28 30 2c 20 74 6f 70 4f 66 66 73 65 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 or2(0,.topOffset);..............
226c0 20 20 20 20 20 20 20 20 41 73 73 69 67 6e 50 6f 73 69 74 69 6f 6e 69 6e 67 49 66 4e 65 65 64 65 ........AssignPositioningIfNeede
226e0 64 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 49 73 53 63 d();......................m_IsSc
22700 72 6f 6c 6c 62 61 72 55 70 64 61 74 65 52 65 71 75 69 72 65 64 20 3d 20 74 72 75 65 3b 0d 0a 20 rollbarUpdateRequired.=.true;...
22720 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 ...............}................
22740 20 20 20 20 66 6c 6f 61 74 20 62 6f 74 74 6f 6d 4f 66 66 73 65 74 20 3d 20 28 6d 5f 54 65 78 74 ....float.bottomOffset.=.(m_Text
22760 43 6f 6d 70 6f 6e 65 6e 74 2e 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 61 6e 63 68 6f 72 65 64 Component.rectTransform.anchored
22780 50 6f 73 69 74 69 6f 6e 2e 79 20 2b 20 73 74 61 72 74 50 6f 73 69 74 69 6f 6e 2e 79 29 20 2d 20 Position.y.+.startPosition.y).-.
227a0 6d 5f 54 65 78 74 56 69 65 77 70 6f 72 74 2e 72 65 63 74 2e 79 4d 69 6e 3b 0d 0a 20 20 20 20 20 m_TextViewport.rect.yMin;.......
227c0 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 62 6f 74 74 6f 6d 4f 66 66 73 65 74 20 3c 20 30 66 ...........if.(bottomOffset.<.0f
227e0 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 20 20 20 20 20 20 )..................{............
22800 20 20 20 20 20 20 20 20 20 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 72 65 63 74 54 72 ..........m_TextComponent.rectTr
22820 61 6e 73 66 6f 72 6d 2e 61 6e 63 68 6f 72 65 64 50 6f 73 69 74 69 6f 6e 20 2d 3d 20 6e 65 77 20 ansform.anchoredPosition.-=.new.
22840 56 65 63 74 6f 72 32 28 30 2c 20 62 6f 74 74 6f 6d 4f 66 66 73 65 74 29 3b 0d 0a 20 20 20 20 20 Vector2(0,.bottomOffset);.......
22860 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 41 73 73 69 67 6e 50 6f 73 69 74 69 6f 6e 69 6e 67 ...............AssignPositioning
22880 49 66 4e 65 65 64 65 64 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 IfNeeded();.....................
228a0 20 6d 5f 49 73 53 63 72 6f 6c 6c 62 61 72 55 70 64 61 74 65 52 65 71 75 69 72 65 64 20 3d 20 74 .m_IsScrollbarUpdateRequired.=.t
228c0 72 75 65 3b 0d 0a 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 rue;..................}.........
228e0 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 53 70 65 63 69 61 6c .....}................//.Special
22900 20 68 61 6e 64 6c 69 6e 67 20 6f 66 20 62 61 63 6b 73 70 61 63 65 0d 0a 20 20 20 20 20 20 20 20 .handling.of.backspace..........
22920 20 20 20 20 69 66 20 28 6d 5f 69 73 4c 61 73 74 4b 65 79 42 61 63 6b 73 70 61 63 65 29 0d 0a 20 ....if.(m_isLastKeyBackspace)...
22940 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 66 6c ...........{..................fl
22960 6f 61 74 20 66 69 72 73 74 43 68 61 72 50 6f 73 69 74 69 6f 6e 20 3d 20 6d 5f 54 65 78 74 43 6f oat.firstCharPosition.=.m_TextCo
22980 6d 70 6f 6e 65 6e 74 2e 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 61 6e 63 68 6f 72 65 64 50 6f mponent.rectTransform.anchoredPo
229a0 73 69 74 69 6f 6e 2e 78 20 2b 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 74 65 78 74 49 sition.x.+.m_TextComponent.textI
229c0 6e 66 6f 2e 63 68 61 72 61 63 74 65 72 49 6e 66 6f 5b 30 5d 2e 6f 72 69 67 69 6e 20 2d 20 6d 5f nfo.characterInfo[0].origin.-.m_
229e0 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 6d 61 72 67 69 6e 2e 78 3b 0d 0a 20 20 20 20 20 20 20 TextComponent.margin.x;.........
22a00 20 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 6c 61 73 74 43 68 61 72 50 6f 73 69 74 69 6f 6e 20 .........float.lastCharPosition.
22a20 3d 20 6d 5f 54 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 2e =.m_TextComponent.rectTransform.
22a40 61 6e 63 68 6f 72 65 64 50 6f 73 69 74 69 6f 6e 2e 78 20 2b 20 6d 5f 54 65 78 74 43 6f 6d 70 6f anchoredPosition.x.+.m_TextCompo
22a60 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 66 6f 5b 6d 5f 54 65 nent.textInfo.characterInfo[m_Te
22a80 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 43 6f xtComponent.textInfo.characterCo
22aa0 75 6e 74 20 2d 20 31 5d 2e 6f 72 69 67 69 6e 20 2b 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e unt.-.1].origin.+.m_TextComponen
22ac0 74 2e 6d 61 72 67 69 6e 2e 7a 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f t.margin.z;..................../
22ae0 2f 20 43 68 65 63 6b 20 69 66 20 63 61 72 65 74 20 69 73 20 61 74 20 74 68 65 20 6c 65 66 74 20 /.Check.if.caret.is.at.the.left.
22b00 6d 6f 73 74 20 70 6f 73 69 74 69 6f 6e 20 6f 66 20 74 68 65 20 76 69 65 77 70 6f 72 74 0d 0a 20 most.position.of.the.viewport...
22b20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 ...............if.(m_TextCompone
22b40 6e 74 2e 72 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 61 6e 63 68 6f 72 65 64 50 6f 73 69 74 69 6f nt.rectTransform.anchoredPositio
22b60 6e 2e 78 20 2b 20 73 74 61 72 74 50 6f 73 69 74 69 6f 6e 2e 78 20 3c 3d 20 76 69 65 77 70 6f 72 n.x.+.startPosition.x.<=.viewpor
22b80 74 4d 69 6e 20 2b 20 30 2e 30 30 30 31 66 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 tMin.+.0.0001f).................
22ba0 20 7b 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 66 69 72 73 .{......................if.(firs
22bc0 74 43 68 61 72 50 6f 73 69 74 69 6f 6e 20 3c 20 76 69 65 77 70 6f 72 74 4d 69 6e 29 0d 0a 20 20 tCharPosition.<.viewportMin)....
22be0 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 ..................{.............
22c00 20 20 20 20 20 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 6f 66 66 73 65 74 20 3d 20 4d 61 74 68 .............float.offset.=.Math
22c20 66 2e 4d 69 6e 28 28 76 69 65 77 70 6f 72 74 4d 61 78 20 2d 20 76 69 65 77 70 6f 72 74 4d 69 6e f.Min((viewportMax.-.viewportMin
22c40 29 20 2f 20 32 2c 20 76 69 65 77 70 6f 72 74 4d 69 6e 20 2d 20 66 69 72 73 74 43 68 61 72 50 6f )./.2,.viewportMin.-.firstCharPo
22c60 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 20 20 20 sition);........................
22c80 20 20 6d 5f 54 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 2e ..m_TextComponent.rectTransform.
22ca0 61 6e 63 68 6f 72 65 64 50 6f 73 69 74 69 6f 6e 20 2b 3d 20 6e 65 77 20 56 65 63 74 6f 72 32 28 anchoredPosition.+=.new.Vector2(
22cc0 6f 66 66 73 65 74 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 20 offset,.0);.....................
22ce0 20 20 20 20 20 41 73 73 69 67 6e 50 6f 73 69 74 69 6f 6e 69 6e 67 49 66 4e 65 65 64 65 64 28 29 .....AssignPositioningIfNeeded()
22d00 3b 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 20 20 20 ;......................}........
22d20 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 65 6c 73 ..........}..................els
22d40 65 20 69 66 20 28 6c 61 73 74 43 68 61 72 50 6f 73 69 74 69 6f 6e 20 3c 20 76 69 65 77 70 6f 72 e.if.(lastCharPosition.<.viewpor
22d60 74 4d 61 78 20 26 26 20 66 69 72 73 74 43 68 61 72 50 6f 73 69 74 69 6f 6e 20 3c 20 76 69 65 77 tMax.&&.firstCharPosition.<.view
22d80 70 6f 72 74 4d 69 6e 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 portMin)..................{.....
22da0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 6c 6f 61 74 20 6f 66 66 73 65 74 20 3d 20 .................float.offset.=.
22dc0 4d 61 74 68 66 2e 4d 69 6e 28 76 69 65 77 70 6f 72 74 4d 61 78 20 2d 20 6c 61 73 74 43 68 61 72 Mathf.Min(viewportMax.-.lastChar
22de0 50 6f 73 69 74 69 6f 6e 2c 20 76 69 65 77 70 6f 72 74 4d 69 6e 20 2d 20 66 69 72 73 74 43 68 61 Position,.viewportMin.-.firstCha
22e00 72 50 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 rPosition);.....................
22e20 20 20 20 6d 5f 54 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 ...m_TextComponent.rectTransform
22e40 2e 61 6e 63 68 6f 72 65 64 50 6f 73 69 74 69 6f 6e 20 2b 3d 20 6e 65 77 20 56 65 63 74 6f 72 32 .anchoredPosition.+=.new.Vector2
22e60 28 6f 66 66 73 65 74 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 (offset,.0);....................
22e80 20 20 41 73 73 69 67 6e 50 6f 73 69 74 69 6f 6e 69 6e 67 49 66 4e 65 65 64 65 64 28 29 3b 0d 0a ..AssignPositioningIfNeeded();..
22ea0 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 ................}...............
22ec0 20 20 20 20 20 6d 5f 69 73 4c 61 73 74 4b 65 79 42 61 63 6b 73 70 61 63 65 20 3d 20 66 61 6c 73 .....m_isLastKeyBackspace.=.fals
22ee0 65 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 20 20 20 e;..............}...............
22f00 20 6d 5f 66 6f 72 63 65 52 65 63 74 54 72 61 6e 73 66 6f 72 6d 41 64 6a 75 73 74 6d 65 6e 74 20 .m_forceRectTransformAdjustment.
22f20 3d 20 66 61 6c 73 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 =.false;..........}............/
22f40 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 56 61 6c 69 64 61 //.<summary>..........///.Valida
22f60 74 65 20 74 68 65 20 73 70 65 63 69 66 69 65 64 20 69 6e 70 75 74 2e 0d 0a 20 20 20 20 20 20 20 te.the.specified.input..........
22f80 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 70 72 6f 74 65 63 74 .///.</summary>..........protect
22fa0 65 64 20 63 68 61 72 20 56 61 6c 69 64 61 74 65 28 73 74 72 69 6e 67 20 74 65 78 74 2c 20 69 6e ed.char.Validate(string.text,.in
22fc0 74 20 70 6f 73 2c 20 63 68 61 72 20 63 68 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 t.pos,.char.ch)..........{......
22fe0 20 20 20 20 20 20 20 20 2f 2f 20 56 61 6c 69 64 61 74 69 6f 6e 20 69 73 20 64 69 73 61 62 6c 65 ........//.Validation.is.disable
23000 64 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 68 61 72 61 63 74 65 72 56 61 6c 69 d..............if.(characterVali
23020 64 61 74 69 6f 6e 20 3d 3d 20 43 68 61 72 61 63 74 65 72 56 61 6c 69 64 61 74 69 6f 6e 2e 4e 6f dation.==.CharacterValidation.No
23040 6e 65 20 7c 7c 20 21 65 6e 61 62 6c 65 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ne.||.!enabled).................
23060 20 72 65 74 75 72 6e 20 63 68 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 .return.ch;................if.(c
23080 68 61 72 61 63 74 65 72 56 61 6c 69 64 61 74 69 6f 6e 20 3d 3d 20 43 68 61 72 61 63 74 65 72 56 haracterValidation.==.CharacterV
230a0 61 6c 69 64 61 74 69 6f 6e 2e 49 6e 74 65 67 65 72 20 7c 7c 20 63 68 61 72 61 63 74 65 72 56 61 alidation.Integer.||.characterVa
230c0 6c 69 64 61 74 69 6f 6e 20 3d 3d 20 43 68 61 72 61 63 74 65 72 56 61 6c 69 64 61 74 69 6f 6e 2e lidation.==.CharacterValidation.
230e0 44 65 63 69 6d 61 6c 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 Decimal)..............{.........
23100 20 20 20 20 20 20 20 20 20 2f 2f 20 49 6e 74 65 67 65 72 20 61 6e 64 20 64 65 63 69 6d 61 6c 0d .........//.Integer.and.decimal.
23120 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 6f 6f 6c 20 63 75 72 73 6f 72 42 65 66 6f .................bool.cursorBefo
23140 72 65 44 61 73 68 20 3d 20 28 70 6f 73 20 3d 3d 20 30 20 26 26 20 74 65 78 74 2e 4c 65 6e 67 74 reDash.=.(pos.==.0.&&.text.Lengt
23160 68 20 3e 20 30 20 26 26 20 74 65 78 74 5b 30 5d 20 3d 3d 20 27 2d 27 29 3b 0d 0a 20 20 20 20 20 h.>.0.&&.text[0].==.'-');.......
23180 20 20 20 20 20 20 20 20 20 20 20 62 6f 6f 6c 20 73 65 6c 65 63 74 69 6f 6e 41 74 53 74 61 72 74 ...........bool.selectionAtStart
231a0 20 3d 20 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 3d 20 30 20 7c .=.stringPositionInternal.==.0.|
231c0 7c 20 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d |.stringSelectPositionInternal.=
231e0 3d 20 30 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 63 75 72 73 6f =.0;..................if.(!curso
23200 72 42 65 66 6f 72 65 44 61 73 68 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d rBeforeDash)..................{.
23220 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 63 68 20 3e 3d 20 27 .....................if.(ch.>=.'
23240 30 27 20 26 26 20 63 68 20 3c 3d 20 27 39 27 29 20 72 65 74 75 72 6e 20 63 68 3b 0d 0a 20 20 20 0'.&&.ch.<=.'9').return.ch;.....
23260 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 68 20 3d 3d 20 27 2d 27 20 26 .................if.(ch.==.'-'.&
23280 26 20 28 70 6f 73 20 3d 3d 20 30 20 7c 7c 20 73 65 6c 65 63 74 69 6f 6e 41 74 53 74 61 72 74 29 &.(pos.==.0.||.selectionAtStart)
232a0 29 20 72 65 74 75 72 6e 20 63 68 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ).return.ch;....................
232c0 20 20 69 66 20 28 63 68 20 3d 3d 20 27 2e 27 20 26 26 20 63 68 61 72 61 63 74 65 72 56 61 6c 69 ..if.(ch.==.'.'.&&.characterVali
232e0 64 61 74 69 6f 6e 20 3d 3d 20 43 68 61 72 61 63 74 65 72 56 61 6c 69 64 61 74 69 6f 6e 2e 44 65 dation.==.CharacterValidation.De
23300 63 69 6d 61 6c 20 26 26 20 21 74 65 78 74 2e 43 6f 6e 74 61 69 6e 73 28 22 2e 22 29 29 20 72 65 cimal.&&.!text.Contains(".")).re
23320 74 75 72 6e 20 63 68 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 turn.ch;..................}.....
23340 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 20 69 66 20 .........}..............else.if.
23360 28 63 68 61 72 61 63 74 65 72 56 61 6c 69 64 61 74 69 6f 6e 20 3d 3d 20 43 68 61 72 61 63 74 65 (characterValidation.==.Characte
23380 72 56 61 6c 69 64 61 74 69 6f 6e 2e 44 69 67 69 74 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 rValidation.Digit)..............
233a0 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 68 20 3e 3d 20 27 30 27 {..................if.(ch.>=.'0'
233c0 20 26 26 20 63 68 20 3c 3d 20 27 39 27 29 20 72 65 74 75 72 6e 20 63 68 3b 0d 0a 20 20 20 20 20 .&&.ch.<=.'9').return.ch;.......
233e0 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 20 69 66 20 28 63 .......}..............else.if.(c
23400 68 61 72 61 63 74 65 72 56 61 6c 69 64 61 74 69 6f 6e 20 3d 3d 20 43 68 61 72 61 63 74 65 72 56 haracterValidation.==.CharacterV
23420 61 6c 69 64 61 74 69 6f 6e 2e 41 6c 70 68 61 6e 75 6d 65 72 69 63 29 0d 0a 20 20 20 20 20 20 20 alidation.Alphanumeric).........
23440 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 41 6c 6c 20 61 .....{..................//.All.a
23460 6c 70 68 61 6e 75 6d 65 72 69 63 20 63 68 61 72 61 63 74 65 72 73 0d 0a 20 20 20 20 20 20 20 20 lphanumeric.characters..........
23480 20 20 20 20 20 20 20 20 69 66 20 28 63 68 20 3e 3d 20 27 41 27 20 26 26 20 63 68 20 3c 3d 20 27 ........if.(ch.>=.'A'.&&.ch.<=.'
234a0 5a 27 29 20 72 65 74 75 72 6e 20 63 68 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 Z').return.ch;..................
234c0 69 66 20 28 63 68 20 3e 3d 20 27 61 27 20 26 26 20 63 68 20 3c 3d 20 27 7a 27 29 20 72 65 74 75 if.(ch.>=.'a'.&&.ch.<=.'z').retu
234e0 72 6e 20 63 68 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 68 20 3e rn.ch;..................if.(ch.>
23500 3d 20 27 30 27 20 26 26 20 63 68 20 3c 3d 20 27 39 27 29 20 72 65 74 75 72 6e 20 63 68 3b 0d 0a =.'0'.&&.ch.<=.'9').return.ch;..
23520 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 65 6c 73 65 20 ............}..............else.
23540 69 66 20 28 63 68 61 72 61 63 74 65 72 56 61 6c 69 64 61 74 69 6f 6e 20 3d 3d 20 43 68 61 72 61 if.(characterValidation.==.Chara
23560 63 74 65 72 56 61 6c 69 64 61 74 69 6f 6e 2e 4e 61 6d 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 cterValidation.Name)............
23580 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 68 61 72 20 6c 61 73 74 43 68 ..{..................char.lastCh
235a0 61 72 20 3d 20 28 74 65 78 74 2e 4c 65 6e 67 74 68 20 3e 20 30 29 20 3f 20 74 65 78 74 5b 4d 61 ar.=.(text.Length.>.0).?.text[Ma
235c0 74 68 66 2e 43 6c 61 6d 70 28 70 6f 73 2c 20 30 2c 20 74 65 78 74 2e 4c 65 6e 67 74 68 20 2d 20 thf.Clamp(pos,.0,.text.Length.-.
235e0 31 29 5d 20 3a 20 27 20 27 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 68 61 72 1)].:.'.';..................char
23600 20 6e 65 78 74 43 68 61 72 20 3d 20 28 74 65 78 74 2e 4c 65 6e 67 74 68 20 3e 20 30 29 20 3f 20 .nextChar.=.(text.Length.>.0).?.
23620 74 65 78 74 5b 4d 61 74 68 66 2e 43 6c 61 6d 70 28 70 6f 73 20 2b 20 31 2c 20 30 2c 20 74 65 78 text[Mathf.Clamp(pos.+.1,.0,.tex
23640 74 2e 4c 65 6e 67 74 68 20 2d 20 31 29 5d 20 3a 20 27 5c 6e 27 3b 0d 0a 0d 0a 20 20 20 20 20 20 t.Length.-.1)].:.'\n';..........
23660 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 68 61 72 2e 49 73 4c 65 74 74 65 72 28 63 68 29 29 ..........if.(char.IsLetter(ch))
23680 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 ..................{.............
236a0 20 20 20 20 20 20 20 20 20 2f 2f 20 53 70 61 63 65 20 66 6f 6c 6c 6f 77 65 64 20 62 79 20 61 20 .........//.Space.followed.by.a.
236c0 6c 65 74 74 65 72 20 2d 2d 20 6d 61 6b 65 20 73 75 72 65 20 69 74 27 73 20 63 61 70 69 74 61 6c letter.--.make.sure.it's.capital
236e0 69 7a 65 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 63 68 ized......................if.(ch
23700 61 72 2e 49 73 4c 6f 77 65 72 28 63 68 29 20 26 26 20 6c 61 73 74 43 68 61 72 20 3d 3d 20 27 20 ar.IsLower(ch).&&.lastChar.==.'.
23720 27 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 72 65 74 75 ')..........................retu
23740 72 6e 20 63 68 61 72 2e 54 6f 55 70 70 65 72 28 63 68 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 rn.char.ToUpper(ch);............
23760 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 55 70 70 65 72 63 61 73 65 20 6c 65 74 74 65 72 73 ............//.Uppercase.letters
23780 20 61 72 65 20 6f 6e 6c 79 20 61 6c 6c 6f 77 65 64 20 61 66 74 65 72 20 73 70 61 63 65 73 20 28 .are.only.allowed.after.spaces.(
237a0 61 6e 64 20 61 70 6f 73 74 72 6f 70 68 65 73 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 and.apostrophes)................
237c0 20 20 20 20 20 20 69 66 20 28 63 68 61 72 2e 49 73 55 70 70 65 72 28 63 68 29 20 26 26 20 6c 61 ......if.(char.IsUpper(ch).&&.la
237e0 73 74 43 68 61 72 20 21 3d 20 27 20 27 20 26 26 20 6c 61 73 74 43 68 61 72 20 21 3d 20 27 5c 27 stChar.!=.'.'.&&.lastChar.!=.'\'
23800 27 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 72 65 74 75 ')..........................retu
23820 72 6e 20 63 68 61 72 2e 54 6f 4c 6f 77 65 72 28 63 68 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 rn.char.ToLower(ch);............
23840 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 66 20 63 68 61 72 61 63 74 65 72 20 77 61 73 20 ............//.If.character.was.
23860 61 6c 72 65 61 64 79 20 69 6e 20 63 6f 72 72 65 63 74 20 63 61 73 65 2c 20 72 65 74 75 72 6e 20 already.in.correct.case,.return.
23880 69 74 20 61 73 2d 69 73 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f it.as-is......................./
238a0 2f 20 41 6c 73 6f 2c 20 6c 65 74 74 65 72 73 20 74 68 61 74 20 61 72 65 20 6e 65 69 74 68 65 72 /.Also,.letters.that.are.neither
238c0 20 75 70 70 65 72 20 6e 6f 72 20 6c 6f 77 65 72 20 63 61 73 65 20 61 72 65 20 61 6c 77 61 79 73 .upper.nor.lower.case.are.always
238e0 20 61 6c 6c 6f 77 65 64 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 .allowed.......................r
23900 65 74 75 72 6e 20 63 68 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 eturn.ch;..................}....
23920 20 20 20 20 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 20 69 66 20 28 63 68 20 3d 3d 20 27 5c 27 ..............else.if.(ch.==.'\'
23940 27 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 20 20 20 20 20 ')..................{...........
23960 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 44 6f 6e 27 74 20 61 6c 6c 6f 77 20 6d 6f 72 65 20 74 ...........//.Don't.allow.more.t
23980 68 61 6e 20 6f 6e 65 20 61 70 6f 73 74 72 6f 70 68 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 han.one.apostrophe..............
239a0 20 20 20 20 20 20 20 20 69 66 20 28 6c 61 73 74 43 68 61 72 20 21 3d 20 27 20 27 20 26 26 20 6c ........if.(lastChar.!=.'.'.&&.l
239c0 61 73 74 43 68 61 72 20 21 3d 20 27 5c 27 27 20 26 26 20 6e 65 78 74 43 68 61 72 20 21 3d 20 27 astChar.!=.'\''.&&.nextChar.!=.'
239e0 5c 27 27 20 26 26 20 21 74 65 78 74 2e 43 6f 6e 74 61 69 6e 73 28 22 27 22 29 29 0d 0a 20 20 20 \''.&&.!text.Contains("'")).....
23a00 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 63 68 3b 0d .....................return.ch;.
23a20 0a 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 20 .................}..............
23a40 20 20 20 20 65 6c 73 65 20 69 66 20 28 63 68 20 3d 3d 20 27 20 27 29 0d 0a 20 20 20 20 20 20 20 ....else.if.(ch.==.'.').........
23a60 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 20 .........{......................
23a80 2f 2f 20 44 6f 6e 27 74 20 61 6c 6c 6f 77 20 6d 6f 72 65 20 74 68 61 6e 20 6f 6e 65 20 73 70 61 //.Don't.allow.more.than.one.spa
23aa0 63 65 20 69 6e 20 61 20 72 6f 77 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ce.in.a.row.....................
23ac0 20 69 66 20 28 6c 61 73 74 43 68 61 72 20 21 3d 20 27 20 27 20 26 26 20 6c 61 73 74 43 68 61 72 .if.(lastChar.!=.'.'.&&.lastChar
23ae0 20 21 3d 20 27 5c 27 27 20 26 26 20 6e 65 78 74 43 68 61 72 20 21 3d 20 27 20 27 20 26 26 20 6e .!=.'\''.&&.nextChar.!=.'.'.&&.n
23b00 65 78 74 43 68 61 72 20 21 3d 20 27 5c 27 27 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 extChar.!=.'\'')................
23b20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 63 68 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 ..........return.ch;............
23b40 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 20 20 ......}..............}..........
23b60 20 20 20 20 65 6c 73 65 20 69 66 20 28 63 68 61 72 61 63 74 65 72 56 61 6c 69 64 61 74 69 6f 6e ....else.if.(characterValidation
23b80 20 3d 3d 20 43 68 61 72 61 63 74 65 72 56 61 6c 69 64 61 74 69 6f 6e 2e 45 6d 61 69 6c 41 64 64 .==.CharacterValidation.EmailAdd
23ba0 72 65 73 73 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 ress)..............{............
23bc0 20 20 20 20 20 20 2f 2f 20 46 72 6f 6d 20 53 74 61 63 6b 4f 76 65 72 66 6c 6f 77 20 61 62 6f 75 ......//.From.StackOverflow.abou
23be0 74 20 61 6c 6c 6f 77 65 64 20 63 68 61 72 61 63 74 65 72 73 20 69 6e 20 65 6d 61 69 6c 20 61 64 t.allowed.characters.in.email.ad
23c00 64 72 65 73 73 65 73 3a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 55 70 70 dresses:..................//.Upp
23c20 65 72 63 61 73 65 20 61 6e 64 20 6c 6f 77 65 72 63 61 73 65 20 45 6e 67 6c 69 73 68 20 6c 65 74 ercase.and.lowercase.English.let
23c40 74 65 72 73 20 28 61 2d 7a 2c 20 41 2d 5a 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ters.(a-z,.A-Z).................
23c60 20 2f 2f 20 44 69 67 69 74 73 20 30 20 74 6f 20 39 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 .//.Digits.0.to.9...............
23c80 20 20 20 2f 2f 20 43 68 61 72 61 63 74 65 72 73 20 21 20 23 20 24 20 25 20 26 20 27 20 2a 20 2b ...//.Characters.!.#.$.%.&.'.*.+
23ca0 20 2d 20 2f 20 3d 20 3f 20 5e 20 5f 20 60 20 7b 20 7c 20 7d 20 7e 0d 0a 20 20 20 20 20 20 20 20 .-./.=.?.^._.`.{.|.}.~..........
23cc0 20 20 20 20 20 20 20 20 2f 2f 20 43 68 61 72 61 63 74 65 72 20 2e 20 28 64 6f 74 2c 20 70 65 72 ........//.Character...(dot,.per
23ce0 69 6f 64 2c 20 66 75 6c 6c 20 73 74 6f 70 29 20 70 72 6f 76 69 64 65 64 20 74 68 61 74 20 69 74 iod,.full.stop).provided.that.it
23d00 20 69 73 20 6e 6f 74 20 74 68 65 20 66 69 72 73 74 20 6f 72 20 6c 61 73 74 20 63 68 61 72 61 63 .is.not.the.first.or.last.charac
23d20 74 65 72 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 61 6e 64 20 70 72 6f ter,..................//.and.pro
23d40 76 69 64 65 64 20 61 6c 73 6f 20 74 68 61 74 20 69 74 20 64 6f 65 73 20 6e 6f 74 20 61 70 70 65 vided.also.that.it.does.not.appe
23d60 61 72 20 74 77 6f 20 6f 72 20 6d 6f 72 65 20 74 69 6d 65 73 20 63 6f 6e 73 65 63 75 74 69 76 65 ar.two.or.more.times.consecutive
23d80 6c 79 2e 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 68 20 3e 3d ly.....................if.(ch.>=
23da0 20 27 41 27 20 26 26 20 63 68 20 3c 3d 20 27 5a 27 29 20 72 65 74 75 72 6e 20 63 68 3b 0d 0a 20 .'A'.&&.ch.<=.'Z').return.ch;...
23dc0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 68 20 3e 3d 20 27 61 27 20 26 26 20 ...............if.(ch.>=.'a'.&&.
23de0 63 68 20 3c 3d 20 27 7a 27 29 20 72 65 74 75 72 6e 20 63 68 3b 0d 0a 20 20 20 20 20 20 20 20 20 ch.<=.'z').return.ch;...........
23e00 20 20 20 20 20 20 20 69 66 20 28 63 68 20 3e 3d 20 27 30 27 20 26 26 20 63 68 20 3c 3d 20 27 39 .......if.(ch.>=.'0'.&&.ch.<=.'9
23e20 27 29 20 72 65 74 75 72 6e 20 63 68 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 ').return.ch;..................i
23e40 66 20 28 63 68 20 3d 3d 20 27 40 27 20 26 26 20 74 65 78 74 2e 49 6e 64 65 78 4f 66 28 27 40 27 f.(ch.==.'@'.&&.text.IndexOf('@'
23e60 29 20 3d 3d 20 2d 31 29 20 72 65 74 75 72 6e 20 63 68 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ).==.-1).return.ch;.............
23e80 20 20 20 20 20 69 66 20 28 6b 45 6d 61 69 6c 53 70 65 63 69 61 6c 43 68 61 72 61 63 74 65 72 73 .....if.(kEmailSpecialCharacters
23ea0 2e 49 6e 64 65 78 4f 66 28 63 68 29 20 21 3d 20 2d 31 29 20 72 65 74 75 72 6e 20 63 68 3b 0d 0a .IndexOf(ch).!=.-1).return.ch;..
23ec0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 68 20 3d 3d 20 27 2e 27 29 0d 0a ................if.(ch.==.'.')..
23ee0 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 ................{...............
23f00 20 20 20 20 20 20 20 63 68 61 72 20 6c 61 73 74 43 68 61 72 20 3d 20 28 74 65 78 74 2e 4c 65 6e .......char.lastChar.=.(text.Len
23f20 67 74 68 20 3e 20 30 29 20 3f 20 74 65 78 74 5b 4d 61 74 68 66 2e 43 6c 61 6d 70 28 70 6f 73 2c gth.>.0).?.text[Mathf.Clamp(pos,
23f40 20 30 2c 20 74 65 78 74 2e 4c 65 6e 67 74 68 20 2d 20 31 29 5d 20 3a 20 27 20 27 3b 0d 0a 20 20 .0,.text.Length.-.1)].:.'.';....
23f60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 68 61 72 20 6e 65 78 74 43 68 61 72 20 ..................char.nextChar.
23f80 3d 20 28 74 65 78 74 2e 4c 65 6e 67 74 68 20 3e 20 30 29 20 3f 20 74 65 78 74 5b 4d 61 74 68 66 =.(text.Length.>.0).?.text[Mathf
23fa0 2e 43 6c 61 6d 70 28 70 6f 73 20 2b 20 31 2c 20 30 2c 20 74 65 78 74 2e 4c 65 6e 67 74 68 20 2d .Clamp(pos.+.1,.0,.text.Length.-
23fc0 20 31 29 5d 20 3a 20 27 5c 6e 27 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .1)].:.'\n';....................
23fe0 20 20 69 66 20 28 6c 61 73 74 43 68 61 72 20 21 3d 20 27 2e 27 20 26 26 20 6e 65 78 74 43 68 61 ..if.(lastChar.!=.'.'.&&.nextCha
24000 72 20 21 3d 20 27 2e 27 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 r.!=.'.').......................
24020 20 20 20 72 65 74 75 72 6e 20 63 68 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d ...return.ch;..................}
24040 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 20 20 20 20 65 6c 73 ..............}..............els
24060 65 20 69 66 20 28 63 68 61 72 61 63 74 65 72 56 61 6c 69 64 61 74 69 6f 6e 20 3d 3d 20 43 68 61 e.if.(characterValidation.==.Cha
24080 72 61 63 74 65 72 56 61 6c 69 64 61 74 69 6f 6e 2e 52 65 67 65 78 29 0d 0a 20 20 20 20 20 20 20 racterValidation.Regex).........
240a0 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 52 65 67 65 78 .....{..................//.Regex
240c0 20 65 78 70 72 65 73 73 69 6f 6e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 .expression..................if.
240e0 28 52 65 67 65 78 2e 49 73 4d 61 74 63 68 28 63 68 2e 54 6f 53 74 72 69 6e 67 28 29 2c 20 6d 5f (Regex.IsMatch(ch.ToString(),.m_
24100 52 65 67 65 78 56 61 6c 75 65 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d RegexValue))..................{.
24120 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 63 68 3b 0d .....................return.ch;.
24140 0a 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 20 .................}..............
24160 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 20 69 66 20 28 63 68 61 72 61 63 74 65 }..............else.if.(characte
24180 72 56 61 6c 69 64 61 74 69 6f 6e 20 3d 3d 20 43 68 61 72 61 63 74 65 72 56 61 6c 69 64 61 74 69 rValidation.==.CharacterValidati
241a0 6f 6e 2e 43 75 73 74 6f 6d 56 61 6c 69 64 61 74 6f 72 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 on.CustomValidator).............
241c0 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 49 6e 70 75 74 56 .{..................if.(m_InputV
241e0 61 6c 69 64 61 74 6f 72 20 21 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 alidator.!=.null)...............
24200 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 68 61 72 20 63 ...{......................char.c
24220 20 3d 20 6d 5f 49 6e 70 75 74 56 61 6c 69 64 61 74 6f 72 2e 56 61 6c 69 64 61 74 65 28 72 65 66 .=.m_InputValidator.Validate(ref
24240 20 74 65 78 74 2c 20 72 65 66 20 70 6f 73 2c 20 63 68 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 .text,.ref.pos,.ch);............
24260 20 20 20 20 20 20 20 20 20 20 6d 5f 54 65 78 74 20 3d 20 74 65 78 74 3b 0d 0a 20 20 20 20 20 20 ..........m_Text.=.text;........
24280 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 ..............stringSelectPositi
242a0 6f 6e 49 6e 74 65 72 6e 61 6c 20 3d 20 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 onInternal.=.stringPositionInter
242c0 6e 61 6c 20 3d 20 70 6f 73 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 nal.=.pos;......................
242e0 72 65 74 75 72 6e 20 63 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 return.c;..................}....
24300 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 72 65 74 75 72 6e 20 ..........}..............return.
24320 28 63 68 61 72 29 30 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 (char)0;..........}............p
24340 75 62 6c 69 63 20 76 6f 69 64 20 41 63 74 69 76 61 74 65 49 6e 70 75 74 46 69 65 6c 64 28 29 0d ublic.void.ActivateInputField().
24360 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 66 20 28 6d 5f 54 65 .........{..............if.(m_Te
24380 78 74 43 6f 6d 70 6f 6e 65 6e 74 20 3d 3d 20 6e 75 6c 6c 20 7c 7c 20 6d 5f 54 65 78 74 43 6f 6d xtComponent.==.null.||.m_TextCom
243a0 70 6f 6e 65 6e 74 2e 66 6f 6e 74 20 3d 3d 20 6e 75 6c 6c 20 7c 7c 20 21 49 73 41 63 74 69 76 65 ponent.font.==.null.||.!IsActive
243c0 28 29 20 7c 7c 20 21 49 73 49 6e 74 65 72 61 63 74 61 62 6c 65 28 29 29 0d 0a 20 20 20 20 20 20 ().||.!IsInteractable())........
243e0 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ..........return;...............
24400 20 69 66 20 28 69 73 46 6f 63 75 73 65 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a .if.(isFocused)..............{..
24420 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 53 6f 66 74 4b 65 79 62 6f 61 ................if.(m_SoftKeyboa
24440 72 64 20 21 3d 20 6e 75 6c 6c 20 26 26 20 21 6d 5f 53 6f 66 74 4b 65 79 62 6f 61 72 64 2e 61 63 rd.!=.null.&&.!m_SoftKeyboard.ac
24460 74 69 76 65 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 20 20 tive)..................{........
24480 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 53 6f 66 74 4b 65 79 62 6f 61 72 64 2e 61 63 74 ..............m_SoftKeyboard.act
244a0 69 76 65 20 3d 20 74 72 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ive.=.true;.....................
244c0 20 6d 5f 53 6f 66 74 4b 65 79 62 6f 61 72 64 2e 74 65 78 74 20 3d 20 6d 5f 54 65 78 74 3b 0d 0a .m_SoftKeyboard.text.=.m_Text;..
244e0 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 20 7d ................}..............}
24500 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 53 68 6f 75 6c 64 41 63 74 69 76 61 74 65 ................m_ShouldActivate
24520 4e 65 78 74 55 70 64 61 74 65 20 3d 20 74 72 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d NextUpdate.=.true;..........}...
24540 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 76 6f 69 64 20 41 63 74 69 76 61 74 65 49 6e .........private.void.ActivateIn
24560 70 75 74 46 69 65 6c 64 49 6e 74 65 72 6e 61 6c 28 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 putFieldInternal()..........{...
24580 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 45 76 65 6e 74 53 79 73 74 65 6d 2e 63 75 72 72 65 ...........if.(EventSystem.curre
245a0 6e 74 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 nt.==.null)..................ret
245c0 75 72 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 45 76 65 6e 74 53 79 73 urn;................if.(EventSys
245e0 74 65 6d 2e 63 75 72 72 65 6e 74 2e 63 75 72 72 65 6e 74 53 65 6c 65 63 74 65 64 47 61 6d 65 4f tem.current.currentSelectedGameO
24600 62 6a 65 63 74 20 21 3d 20 67 61 6d 65 4f 62 6a 65 63 74 29 0d 0a 20 20 20 20 20 20 20 20 20 20 bject.!=.gameObject)............
24620 20 20 20 20 20 20 45 76 65 6e 74 53 79 73 74 65 6d 2e 63 75 72 72 65 6e 74 2e 53 65 74 53 65 6c ......EventSystem.current.SetSel
24640 65 63 74 65 64 47 61 6d 65 4f 62 6a 65 63 74 28 67 61 6d 65 4f 62 6a 65 63 74 29 3b 0d 0a 0d 0a ectedGameObject(gameObject);....
24660 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 54 6f 75 63 68 53 63 72 65 65 6e 4b 65 79 62 6f ............if.(TouchScreenKeybo
24680 61 72 64 2e 69 73 53 75 70 70 6f 72 74 65 64 20 26 26 20 73 68 6f 75 6c 64 48 69 64 65 53 6f 66 ard.isSupported.&&.shouldHideSof
246a0 74 4b 65 79 62 6f 61 72 64 20 3d 3d 20 66 61 6c 73 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 tKeyboard.==.false).............
246c0 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 69 6e 70 75 74 53 79 73 .{..................if.(inputSys
246e0 74 65 6d 2e 74 6f 75 63 68 53 75 70 70 6f 72 74 65 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 tem.touchSupported).............
24700 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 54 6f 75 63 .....{......................Touc
24720 68 53 63 72 65 65 6e 4b 65 79 62 6f 61 72 64 2e 68 69 64 65 49 6e 70 75 74 20 3d 20 73 68 6f 75 hScreenKeyboard.hideInput.=.shou
24740 6c 64 48 69 64 65 4d 6f 62 69 6c 65 49 6e 70 75 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 ldHideMobileInput;..............
24760 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 69 66 20 28 73 68 6f ....}....................if.(sho
24780 75 6c 64 48 69 64 65 53 6f 66 74 4b 65 79 62 6f 61 72 64 20 3d 3d 20 66 61 6c 73 65 20 26 26 20 uldHideSoftKeyboard.==.false.&&.
247a0 6d 5f 52 65 61 64 4f 6e 6c 79 20 3d 3d 20 66 61 6c 73 65 20 26 26 20 63 6f 6e 74 65 6e 74 54 79 m_ReadOnly.==.false.&&.contentTy
247c0 70 65 20 21 3d 20 43 6f 6e 74 65 6e 74 54 79 70 65 2e 43 75 73 74 6f 6d 29 0d 0a 20 20 20 20 20 pe.!=.ContentType.Custom).......
247e0 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 ...........{....................
24800 20 20 6d 5f 53 6f 66 74 4b 65 79 62 6f 61 72 64 20 3d 20 28 69 6e 70 75 74 54 79 70 65 20 3d 3d ..m_SoftKeyboard.=.(inputType.==
24820 20 49 6e 70 75 74 54 79 70 65 2e 50 61 73 73 77 6f 72 64 29 20 3f 0d 0a 20 20 20 20 20 20 20 20 .InputType.Password).?..........
24840 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 54 6f 75 63 68 53 63 72 65 65 6e 4b 65 79 62 6f ................TouchScreenKeybo
24860 61 72 64 2e 4f 70 65 6e 28 6d 5f 54 65 78 74 2c 20 6b 65 79 62 6f 61 72 64 54 79 70 65 2c 20 66 ard.Open(m_Text,.keyboardType,.f
24880 61 6c 73 65 2c 20 6d 75 6c 74 69 4c 69 6e 65 2c 20 74 72 75 65 2c 20 66 61 6c 73 65 2c 20 22 22 alse,.multiLine,.true,.false,.""
248a0 2c 20 63 68 61 72 61 63 74 65 72 4c 69 6d 69 74 29 20 3a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ,.characterLimit).:.............
248c0 20 20 20 20 20 20 20 20 20 20 20 20 20 54 6f 75 63 68 53 63 72 65 65 6e 4b 65 79 62 6f 61 72 64 .............TouchScreenKeyboard
248e0 2e 4f 70 65 6e 28 6d 5f 54 65 78 74 2c 20 6b 65 79 62 6f 61 72 64 54 79 70 65 2c 20 69 6e 70 75 .Open(m_Text,.keyboardType,.inpu
24900 74 54 79 70 65 20 3d 3d 20 49 6e 70 75 74 54 79 70 65 2e 41 75 74 6f 43 6f 72 72 65 63 74 2c 20 tType.==.InputType.AutoCorrect,.
24920 6d 75 6c 74 69 4c 69 6e 65 2c 20 66 61 6c 73 65 2c 20 66 61 6c 73 65 2c 20 22 22 2c 20 63 68 61 multiLine,.false,.false,."",.cha
24940 72 61 63 74 65 72 4c 69 6d 69 74 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 racterLimit);...................
24960 20 20 20 20 20 69 66 20 28 73 68 6f 75 6c 64 48 69 64 65 4d 6f 62 69 6c 65 49 6e 70 75 74 20 3d .....if.(shouldHideMobileInput.=
24980 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 20 20 20 20 20 7b 0d =.false)......................{.
249a0 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 4d 6f 76 65 54 65 78 .........................MoveTex
249c0 74 45 6e 64 28 66 61 6c 73 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 tEnd(false);....................
249e0 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 65 6c 73 65 0d 0a 20 ..}......................else...
24a00 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 ...................{............
24a20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4f 6e 46 6f 63 75 73 28 29 3b 0d 0a 0d 0a 20 20 20 20 ..............OnFocus();........
24a40 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4f 70 65 6e 69 6e 67 20 74 ....................//.Opening.t
24a60 68 65 20 73 6f 66 74 20 6b 65 79 62 6f 61 72 64 20 73 65 74 73 20 69 74 73 20 73 65 6c 65 63 74 he.soft.keyboard.sets.its.select
24a80 69 6f 6e 20 74 6f 20 74 68 65 20 65 6e 64 20 6f 66 20 74 68 65 20 74 65 78 74 2e 20 0d 0a 20 20 ion.to.the.end.of.the.text......
24aa0 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 41 73 20 73 75 63 68 ......................//.As.such
24ac0 2c 20 77 65 20 73 65 74 20 74 68 65 20 73 65 6c 65 63 74 69 6f 6e 20 74 6f 20 6d 61 74 63 68 20 ,.we.set.the.selection.to.match.
24ae0 74 68 65 20 49 6e 70 75 74 20 46 69 65 6c 64 27 73 20 69 6e 74 65 72 6e 61 6c 20 73 65 6c 65 63 the.Input.Field's.internal.selec
24b00 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 20 69 tion...........................i
24b20 66 20 28 6d 5f 53 6f 66 74 4b 65 79 62 6f 61 72 64 20 21 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 f.(m_SoftKeyboard.!=.null)......
24b40 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 20 ....................{...........
24b60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 20 6c 65 6e 67 74 68 20 3d 20 ...................int.length.=.
24b80 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3c 20 73 74 72 69 6e 67 53 stringPositionInternal.<.stringS
24ba0 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3f 20 73 74 72 69 6e 67 53 65 electPositionInternal.?.stringSe
24bc0 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 2d 20 73 74 72 69 6e 67 50 6f 73 lectPositionInternal.-.stringPos
24be0 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3a 20 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e itionInternal.:.stringPositionIn
24c00 74 65 72 6e 61 6c 20 2d 20 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 ternal.-.stringSelectPositionInt
24c20 65 72 6e 61 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 ernal;..........................
24c40 20 20 20 20 6d 5f 53 6f 66 74 4b 65 79 62 6f 61 72 64 2e 73 65 6c 65 63 74 69 6f 6e 20 3d 20 6e ....m_SoftKeyboard.selection.=.n
24c60 65 77 20 52 61 6e 67 65 49 6e 74 28 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e ew.RangeInt(stringPositionIntern
24c80 61 6c 20 3c 20 73 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 al.<.stringSelectPositionInterna
24ca0 6c 20 3f 20 73 74 72 69 6e 67 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 20 3a 20 73 74 72 l.?.stringPositionInternal.:.str
24cc0 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 49 6e 74 65 72 6e 61 6c 2c 20 6c 65 6e 67 74 ingSelectPositionInternal,.lengt
24ce0 68 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 7d 0d 0a h);..........................}..
24d00 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 20 20 20 20 20 ....................}...........
24d20 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 20 2f 2f 20 43 .......}....................//.C
24d40 61 63 68 65 20 74 68 65 20 76 61 6c 75 65 20 6f 66 20 69 73 49 6e 50 6c 61 63 65 45 64 69 74 69 ache.the.value.of.isInPlaceEditi
24d60 6e 67 41 6c 6c 6f 77 65 64 2c 20 62 65 63 61 75 73 65 20 6f 6e 20 55 57 50 20 74 68 69 73 20 69 ngAllowed,.because.on.UWP.this.i
24d80 6e 76 6f 6c 76 65 73 20 63 61 6c 6c 69 6e 67 20 69 6e 74 6f 20 6e 61 74 69 76 65 20 63 6f 64 65 nvolves.calling.into.native.code
24da0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 54 68 65 20 76 61 6c 75 65 20 6f ..................//.The.value.o
24dc0 6e 6c 79 20 6e 65 65 64 73 20 74 6f 20 62 65 20 75 70 64 61 74 65 64 20 6f 6e 63 65 20 77 68 65 nly.needs.to.be.updated.once.whe
24de0 6e 20 74 68 65 20 54 6f 75 63 68 4b 65 79 62 6f 61 72 64 20 69 73 20 6f 70 65 6e 65 64 2e 0d 0a n.the.TouchKeyboard.is.opened...
24e00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 23 69 66 20 55 4e 49 54 59 5f 32 30 31 39 5f 31 ................#if.UNITY_2019_1
24e20 5f 4f 52 5f 4e 45 57 45 52 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 54 6f 75 _OR_NEWER..................m_Tou
24e40 63 68 4b 65 79 62 6f 61 72 64 41 6c 6c 6f 77 73 49 6e 50 6c 61 63 65 45 64 69 74 69 6e 67 20 3d chKeyboardAllowsInPlaceEditing.=
24e60 20 54 6f 75 63 68 53 63 72 65 65 6e 4b 65 79 62 6f 61 72 64 2e 69 73 49 6e 50 6c 61 63 65 45 64 .TouchScreenKeyboard.isInPlaceEd
24e80 69 74 69 6e 67 41 6c 6c 6f 77 65 64 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 23 itingAllowed;..................#
24ea0 65 6e 64 69 66 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 20 20 endif..............}............
24ec0 20 20 65 6c 73 65 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 ..else..............{...........
24ee0 20 20 20 20 20 20 20 69 66 20 28 21 54 6f 75 63 68 53 63 72 65 65 6e 4b 65 79 62 6f 61 72 64 2e .......if.(!TouchScreenKeyboard.
24f00 69 73 53 75 70 70 6f 72 74 65 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 isSupported)....................
24f20 20 20 69 6e 70 75 74 53 79 73 74 65 6d 2e 69 6d 65 43 6f 6d 70 6f 73 69 74 69 6f 6e 4d 6f 64 65 ..inputSystem.imeCompositionMode
24f40 20 3d 20 49 4d 45 43 6f 6d 70 6f 73 69 74 69 6f 6e 4d 6f 64 65 2e 4f 6e 3b 0d 0a 0d 0a 20 20 20 .=.IMECompositionMode.On;.......
24f60 20 20 20 20 20 20 20 20 20 20 20 20 20 4f 6e 46 6f 63 75 73 28 29 3b 0d 0a 20 20 20 20 20 20 20 .............OnFocus();.........
24f80 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 41 6c 6c 6f 77 49 6e 70 .....}................m_AllowInp
24fa0 75 74 20 3d 20 74 72 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 4f 72 69 67 69 6e ut.=.true;..............m_Origin
24fc0 61 6c 54 65 78 74 20 3d 20 74 65 78 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 57 61 alText.=.text;..............m_Wa
24fe0 73 43 61 6e 63 65 6c 65 64 20 3d 20 66 61 6c 73 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 sCanceled.=.false;..............
25000 53 65 74 43 61 72 65 74 56 69 73 69 62 6c 65 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 SetCaretVisible();..............
25020 55 70 64 61 74 65 4c 61 62 65 6c 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 UpdateLabel();..........}.......
25040 20 20 20 20 20 70 75 62 6c 69 63 20 6f 76 65 72 72 69 64 65 20 76 6f 69 64 20 4f 6e 53 65 6c 65 .....public.override.void.OnSele
25060 63 74 28 42 61 73 65 45 76 65 6e 74 44 61 74 61 20 65 76 65 6e 74 44 61 74 61 29 0d 0a 20 20 20 ct(BaseEventData.eventData).....
25080 20 20 20 20 20 7b 0d 0a 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(
250a0 22 4f 6e 53 65 6c 65 63 74 28 29 22 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 62 61 "OnSelect()");................ba
250c0 73 65 2e 4f 6e 53 65 6c 65 63 74 28 65 76 65 6e 74 44 61 74 61 29 3b 0d 0a 20 20 20 20 20 20 20 se.OnSelect(eventData);.........
250e0 20 20 20 20 20 53 65 6e 64 4f 6e 46 6f 63 75 73 28 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 .....SendOnFocus();.............
25100 20 20 20 41 63 74 69 76 61 74 65 49 6e 70 75 74 46 69 65 6c 64 28 29 3b 0d 0a 20 20 20 20 20 20 ...ActivateInputField();........
25120 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 76 69 72 74 75 61 6c 20 76 6f ..}............public.virtual.vo
25140 69 64 20 4f 6e 50 6f 69 6e 74 65 72 43 6c 69 63 6b 28 50 6f 69 6e 74 65 72 45 76 65 6e 74 44 61 id.OnPointerClick(PointerEventDa
25160 74 61 20 65 76 65 6e 74 44 61 74 61 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 ta.eventData)..........{........
25180 20 20 20 20 20 20 2f 2f 44 65 62 75 67 2e 4c 6f 67 28 22 50 6f 69 6e 74 65 72 20 43 6c 69 63 6b ......//Debug.Log("Pointer.Click
251a0 20 45 76 65 6e 74 2e 2e 2e 22 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 .Event...");................if.(
251c0 65 76 65 6e 74 44 61 74 61 2e 62 75 74 74 6f 6e 20 21 3d 20 50 6f 69 6e 74 65 72 45 76 65 6e 74 eventData.button.!=.PointerEvent
251e0 44 61 74 61 2e 49 6e 70 75 74 42 75 74 74 6f 6e 2e 4c 65 66 74 29 0d 0a 20 20 20 20 20 20 20 20 Data.InputButton.Left)..........
25200 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 41 ........return;................A
25220 63 74 69 76 61 74 65 49 6e 70 75 74 46 69 65 6c 64 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d ctivateInputField();..........}.
25240 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 76 6f 69 64 20 4f 6e 43 6f 6e 74 72 6f 6c ...........public.void.OnControl
25260 43 6c 69 63 6b 28 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 Click()..........{..............
25280 2f 2f 44 65 62 75 67 2e 4c 6f 67 28 22 49 6e 70 75 74 20 46 69 65 6c 64 20 63 6f 6e 74 72 6f 6c //Debug.Log("Input.Field.control
252a0 20 63 6c 69 63 6b 2e 2e 2e 22 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 .click...");..........}.........
252c0 20 20 20 70 75 62 6c 69 63 20 76 6f 69 64 20 52 65 6c 65 61 73 65 53 65 6c 65 63 74 69 6f 6e 28 ...public.void.ReleaseSelection(
252e0 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 6d 5f 53 65 6c 65 )..........{..............m_Sele
25300 63 74 69 6f 6e 53 74 69 6c 6c 41 63 74 69 76 65 20 3d 20 66 61 6c 73 65 3b 0d 0a 20 20 20 20 20 ctionStillActive.=.false;.......
25320 20 20 20 20 20 20 20 4d 61 72 6b 47 65 6f 6d 65 74 72 79 41 73 44 69 72 74 79 28 29 3b 0d 0a 20 .......MarkGeometryAsDirty();...
25340 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 76 6f 69 64 20 .......}............public.void.
25360 44 65 61 63 74 69 76 61 74 65 49 6e 70 75 74 46 69 65 6c 64 28 62 6f 6f 6c 20 63 6c 65 61 72 53 DeactivateInputField(bool.clearS
25380 65 6c 65 63 74 69 6f 6e 20 3d 20 66 61 6c 73 65 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 election.=.false)..........{....
253a0 20 20 20 20 20 20 20 20 20 20 2f 2f 44 65 62 75 67 2e 4c 6f 67 28 22 44 65 61 63 74 69 76 61 74 ..........//Debug.Log("Deactivat
253c0 65 20 49 6e 70 75 74 20 46 69 65 6c 64 2e 2e 2e 22 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 e.Input.Field...");.............
253e0 20 20 20 2f 2f 20 4e 6f 74 20 61 63 74 69 76 61 74 65 64 20 64 6f 20 6e 6f 74 68 69 6e 67 2e 0d ...//.Not.activated.do.nothing..
25400 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 6d 5f 41 6c 6c 6f 77 49 6e 70 75 74 29 0d .............if.(!m_AllowInput).
25420 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 3b 0d 0a 0d 0a 20 20 20 20 .................return;........
25440 20 20 20 20 20 20 20 20 6d 5f 48 61 73 44 6f 6e 65 46 6f 63 75 73 54 72 61 6e 73 69 74 69 6f 6e ........m_HasDoneFocusTransition
25460 20 3d 20 66 61 6c 73 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 41 6c 6c 6f 77 49 6e .=.false;..............m_AllowIn
25480 70 75 74 20 3d 20 66 61 6c 73 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 put.=.false;................if.(
254a0 6d 5f 50 6c 61 63 65 68 6f 6c 64 65 72 20 21 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 m_Placeholder.!=.null)..........
254c0 20 20 20 20 20 20 20 20 6d 5f 50 6c 61 63 65 68 6f 6c 64 65 72 2e 65 6e 61 62 6c 65 64 20 3d 20 ........m_Placeholder.enabled.=.
254e0 73 74 72 69 6e 67 2e 49 73 4e 75 6c 6c 4f 72 45 6d 70 74 79 28 6d 5f 54 65 78 74 29 3b 0d 0a 0d string.IsNullOrEmpty(m_Text);...
25500 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 .............if.(m_TextComponent
25520 20 21 3d 20 6e 75 6c 6c 20 26 26 20 49 73 49 6e 74 65 72 61 63 74 61 62 6c 65 28 29 29 0d 0a 20 .!=.null.&&.IsInteractable())...
25540 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 69 66 ...........{..................if
25560 20 28 6d 5f 57 61 73 43 61 6e 63 65 6c 65 64 20 26 26 20 6d 5f 52 65 73 74 6f 72 65 4f 72 69 67 .(m_WasCanceled.&&.m_RestoreOrig
25580 69 6e 61 6c 54 65 78 74 4f 6e 45 73 63 61 70 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 inalTextOnEscape)...............
255a0 20 20 20 20 20 20 20 74 65 78 74 20 3d 20 6d 5f 4f 72 69 67 69 6e 61 6c 54 65 78 74 3b 0d 0a 0d .......text.=.m_OriginalText;...
255c0 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 53 6f 66 74 4b 65 79 62 6f .................if.(m_SoftKeybo
255e0 61 72 64 20 21 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d ard.!=.null)..................{.
25600 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 53 6f 66 74 4b 65 79 62 6f .....................m_SoftKeybo
25620 61 72 64 2e 61 63 74 69 76 65 20 3d 20 66 61 6c 73 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ard.active.=.false;.............
25640 20 20 20 20 20 20 20 20 20 6d 5f 53 6f 66 74 4b 65 79 62 6f 61 72 64 20 3d 20 6e 75 6c 6c 3b 0d .........m_SoftKeyboard.=.null;.
25660 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 20 20 .................}..............
25680 20 20 20 20 20 20 6d 5f 53 65 6c 65 63 74 69 6f 6e 53 74 69 6c 6c 41 63 74 69 76 65 20 3d 20 74 ......m_SelectionStillActive.=.t
256a0 72 75 65 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 6d 5f 52 65 rue;....................if.(m_Re
256c0 73 65 74 4f 6e 44 65 41 63 74 69 76 61 74 69 6f 6e 20 7c 7c 20 6d 5f 52 65 6c 65 61 73 65 53 65 setOnDeActivation.||.m_ReleaseSe
256e0 6c 65 63 74 69 6f 6e 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 lection)..................{.....
25700 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 6d 5f 53 74 72 69 6e 67 50 6f 73 69 74 .................//m_StringPosit
25720 69 6f 6e 20 3d 20 6d 5f 53 74 72 69 6e 67 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e 20 3d 20 30 ion.=.m_StringSelectPosition.=.0
25740 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 6d 5f 43 61 72 65 74 ;......................//m_Caret
25760 50 6f 73 69 74 69 6f 6e 20 3d 20 6d 5f 43 61 72 65 74 53 65 6c 65 63 74 50 6f 73 69 74 69 6f 6e Position.=.m_CaretSelectPosition
25780 20 3d 20 30 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 6d 5f 54 .=.0;......................//m_T
257a0 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 2e 6c 6f 63 61 6c extComponent.rectTransform.local
257c0 50 6f 73 69 74 69 6f 6e 20 3d 20 6d 5f 44 65 66 61 75 6c 74 54 72 61 6e 73 66 6f 72 6d 50 6f 73 Position.=.m_DefaultTransformPos
257e0 69 74 69 6f 6e 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 2f 2f ition;........................//
25800 69 66 20 28 63 61 72 65 74 52 65 63 74 54 72 61 6e 73 20 21 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 if.(caretRectTrans.!=.null).....
25820 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 63 61 72 65 74 52 65 63 74 .................//....caretRect
25840 54 72 61 6e 73 2e 6c 6f 63 61 6c 50 6f 73 69 74 69 6f 6e 20 3d 20 56 65 63 74 6f 72 33 2e 7a 65 Trans.localPosition.=.Vector3.ze
25860 72 6f 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 6d 5f 53 65 6c ro;........................m_Sel
25880 65 63 74 69 6f 6e 53 74 69 6c 6c 41 63 74 69 76 65 20 3d 20 66 61 6c 73 65 3b 0d 0a 20 20 20 20 ectionStillActive.=.false;......
258a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 52 65 6c 65 61 73 65 53 65 6c 65 63 74 69 ................m_ReleaseSelecti
258c0 6f 6e 20 3d 20 66 61 6c 73 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 on.=.false;.....................
258e0 20 6d 5f 53 65 6c 65 63 74 65 64 4f 62 6a 65 63 74 20 3d 20 6e 75 6c 6c 3b 0d 0a 20 20 20 20 20 .m_SelectedObject.=.null;.......
25900 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 20 ...........}....................
25920 53 65 6e 64 4f 6e 45 6e 64 45 64 69 74 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 SendOnEndEdit();................
25940 20 20 53 65 6e 64 4f 6e 45 6e 64 54 65 78 74 53 65 6c 65 63 74 69 6f 6e 28 29 3b 0d 0a 0d 0a 20 ..SendOnEndTextSelection();.....
25960 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 70 75 74 53 79 73 74 65 6d 2e 69 6d 65 43 6f ...............inputSystem.imeCo
25980 6d 70 6f 73 69 74 69 6f 6e 4d 6f 64 65 20 3d 20 49 4d 45 43 6f 6d 70 6f 73 69 74 69 6f 6e 4d 6f mpositionMode.=.IMECompositionMo
259a0 64 65 2e 41 75 74 6f 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 de.Auto;..............}.........
259c0 20 20 20 20 20 20 20 4d 61 72 6b 47 65 6f 6d 65 74 72 79 41 73 44 69 72 74 79 28 29 3b 0d 0a 0d .......MarkGeometryAsDirty();...
259e0 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 53 63 72 6f 6c 6c 62 61 72 20 73 68 6f 75 6c 64 .............//.Scrollbar.should
25a00 20 62 65 20 75 70 64 61 74 65 64 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 49 73 53 63 .be.updated...............m_IsSc
25a20 72 6f 6c 6c 62 61 72 55 70 64 61 74 65 52 65 71 75 69 72 65 64 20 3d 20 74 72 75 65 3b 0d 0a 20 rollbarUpdateRequired.=.true;...
25a40 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 6f 76 65 72 72 .......}............public.overr
25a60 69 64 65 20 76 6f 69 64 20 4f 6e 44 65 73 65 6c 65 63 74 28 42 61 73 65 45 76 65 6e 74 44 61 74 ide.void.OnDeselect(BaseEventDat
25a80 61 20 65 76 65 6e 74 44 61 74 61 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 a.eventData)..........{.........
25aa0 20 20 20 20 20 44 65 61 63 74 69 76 61 74 65 49 6e 70 75 74 46 69 65 6c 64 28 29 3b 0d 0a 0d 0a .....DeactivateInputField();....
25ac0 20 20 20 20 20 20 20 20 20 20 20 20 62 61 73 65 2e 4f 6e 44 65 73 65 6c 65 63 74 28 65 76 65 6e ............base.OnDeselect(even
25ae0 74 44 61 74 61 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 53 65 6e 64 4f 6e 46 6f 63 75 73 tData);..............SendOnFocus
25b00 4c 6f 73 74 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 Lost();..........}............pu
25b20 62 6c 69 63 20 76 69 72 74 75 61 6c 20 76 6f 69 64 20 4f 6e 53 75 62 6d 69 74 28 42 61 73 65 45 blic.virtual.void.OnSubmit(BaseE
25b40 76 65 6e 74 44 61 74 61 20 65 76 65 6e 74 44 61 74 61 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a ventData.eventData)..........{..
25b60 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 4f 6e 53 75 62 6d 69 ............//Debug.Log("OnSubmi
25b80 74 28 29 22 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 49 73 41 63 74 t()");................if.(!IsAct
25ba0 69 76 65 28 29 20 7c 7c 20 21 49 73 49 6e 74 65 72 61 63 74 61 62 6c 65 28 29 29 0d 0a 20 20 20 ive().||.!IsInteractable()).....
25bc0 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 .............return;............
25be0 20 20 20 20 69 66 20 28 21 69 73 46 6f 63 75 73 65 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ....if.(!isFocused).............
25c00 20 20 20 20 20 6d 5f 53 68 6f 75 6c 64 41 63 74 69 76 61 74 65 4e 65 78 74 55 70 64 61 74 65 20 .....m_ShouldActivateNextUpdate.
25c20 3d 20 74 72 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 53 65 6e 64 4f 6e 53 75 62 =.true;................SendOnSub
25c40 6d 69 74 28 29 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 70 mit();..........}............//p
25c60 75 62 6c 69 63 20 76 69 72 74 75 61 6c 20 76 6f 69 64 20 4f 6e 4c 6f 73 74 46 6f 63 75 73 28 42 ublic.virtual.void.OnLostFocus(B
25c80 61 73 65 45 76 65 6e 74 44 61 74 61 20 65 76 65 6e 74 44 61 74 61 29 0d 0a 20 20 20 20 20 20 20 aseEventData.eventData).........
25ca0 20 2f 2f 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 69 66 20 28 21 49 73 41 63 74 69 76 .//{..........//....if.(!IsActiv
25cc0 65 28 29 20 7c 7c 20 21 49 73 49 6e 74 65 72 61 63 74 61 62 6c 65 28 29 29 0d 0a 20 20 20 20 20 e().||.!IsInteractable()).......
25ce0 20 20 20 2f 2f 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f ...//........return;..........//
25d00 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 76 6f 69 64 20 45 6e 66 6f 72 63 }............private.void.Enforc
25d20 65 43 6f 6e 74 65 6e 74 54 79 70 65 28 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 eContentType()..........{.......
25d40 20 20 20 20 20 20 20 73 77 69 74 63 68 20 28 63 6f 6e 74 65 6e 74 54 79 70 65 29 0d 0a 20 20 20 .......switch.(contentType).....
25d60 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 63 61 73 65 .........{..................case
25d80 20 43 6f 6e 74 65 6e 74 54 79 70 65 2e 53 74 61 6e 64 61 72 64 3a 0d 0a 20 20 20 20 20 20 20 20 .ContentType.Standard:..........
25da0 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 ............{...................
25dc0 20 20 20 20 20 20 20 2f 2f 20 44 6f 6e 27 74 20 65 6e 66 6f 72 63 65 20 6c 69 6e 65 20 74 79 70 .......//.Don't.enforce.line.typ
25de0 65 20 66 6f 72 20 74 68 69 73 20 63 6f 6e 74 65 6e 74 20 74 79 70 65 2e 0d 0a 20 20 20 20 20 20 e.for.this.content.type.........
25e00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 49 6e 70 75 74 54 79 70 65 20 3d 20 ..................m_InputType.=.
25e20 49 6e 70 75 74 54 79 70 65 2e 53 74 61 6e 64 61 72 64 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 InputType.Standard;.............
25e40 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 4b 65 79 62 6f 61 72 64 54 79 70 65 20 3d 20 54 6f .............m_KeyboardType.=.To
25e60 75 63 68 53 63 72 65 65 6e 4b 65 79 62 6f 61 72 64 54 79 70 65 2e 44 65 66 61 75 6c 74 3b 0d 0a uchScreenKeyboardType.Default;..
25e80 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 43 68 61 72 61 63 ........................m_Charac
25ea0 74 65 72 56 61 6c 69 64 61 74 69 6f 6e 20 3d 20 43 68 61 72 61 63 74 65 72 56 61 6c 69 64 61 74 terValidation.=.CharacterValidat
25ec0 69 6f 6e 2e 4e 6f 6e 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ion.None;.......................
25ee0 20 20 20 62 72 65 61 6b 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d ...break;......................}
25f00 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 73 65 20 43 6f 6e 74 65 6e 74 54 79 ..................case.ContentTy
25f20 70 65 2e 41 75 74 6f 63 6f 72 72 65 63 74 65 64 3a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 pe.Autocorrected:...............
25f40 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 20 .......{........................
25f60 20 20 2f 2f 20 44 6f 6e 27 74 20 65 6e 66 6f 72 63 65 20 6c 69 6e 65 20 74 79 70 65 20 66 6f 72 ..//.Don't.enforce.line.type.for
25f80 20 74 68 69 73 20 63 6f 6e 74 65 6e 74 20 74 79 70 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 .this.content.type..............
25fa0 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 49 6e 70 75 74 54 79 70 65 20 3d 20 49 6e 70 75 74 .............m_InputType.=.Input
25fc0 54 79 70 65 2e 41 75 74 6f 43 6f 72 72 65 63 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 Type.AutoCorrect;...............
25fe0 20 20 20 20 20 20 20 20 20 20 20 6d 5f 4b 65 79 62 6f 61 72 64 54 79 70 65 20 3d 20 54 6f 75 63 ...........m_KeyboardType.=.Touc
26000 68 53 63 72 65 65 6e 4b 65 79 62 6f 61 72 64 54 79 70 65 2e 44 65 66 61 75 6c 74 3b 0d 0a 20 20 hScreenKeyboardType.Default;....
26020 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 43 68 61 72 61 63 74 65 ......................m_Characte
26040 72 56 61 6c 69 64 61 74 69 6f 6e 20 3d 20 43 68 61 72 61 63 74 65 72 56 61 6c 69 64 61 74 69 6f rValidation.=.CharacterValidatio
26060 6e 2e 4e 6f 6e 65 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 n.None;.........................
26080 20 62 72 65 61 6b 3b 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 .break;......................}..
260a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 73 65 20 43 6f 6e 74 65 6e 74 54 79 70 65 ................case.ContentType
260c0 2e 49 6e 74 65 67 65 72 4e 75 6d 62 65 72 3a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .IntegerNumber:.................
260e0 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 .....{..........................
26100 6d 5f 4c 69 6e 65 54 79 70 65 20 3d 20 4c 69 6e 65 54 79 70 65 2e 53 69 6e 67 6c 65 4c 69 6e 65 m_LineType.=.LineType.SingleLine
26120 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 6d 5f 49 6e 70 ;..........................m_Inp
26140 75 74 54 79 70 65 20 3d 20 49 6e 70 75 74 54 79 70 65 2e 53 74 61 6e 64 61 72 64 3b 0d 0a 20 20 utType.=.InputType.Standard;....
26160 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 4b 65 79 62 6f 61 72 64 ......................m_Keyboard
26180 54 79 70 65 20 3d 20 54 6f 75 63 68 53 63 72 65 65 6e 4b 65 79 62 6f 61 72 64 54 79 70 65 2e 4e Type.=.TouchScreenKeyboardType.N
261a0 75 6d 62 65 72 50 61 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 umberPad;.......................
261c0 20 20 20 6d 5f 43 68 61 72 61 63 74 65 72 56 61 6c 69 64 61 74 69 6f 6e 20 3d 20 43 68 61 72 61 ...m_CharacterValidation.=.Chara
261e0 63 74 65 72 56 61 6c 69 64 61 74 69 6f 6e 2e 49 6e 74 65 67 65 72 3b 0d 0a 20 20 20 20 20 20 20 cterValidation.Integer;.........
26200 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 72 65 61 6b 3b 0d 0a 20 20 20 20 20 20 20 .................break;.........
26220 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 .............}..................
26240 63 61 73 65 20 43 6f 6e 74 65 6e 74 54 79 70 65 2e 44 65 63 69 6d 61 6c 4e 75 6d 62 65 72 3a 0d case.ContentType.DecimalNumber:.
26260 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 .....................{..........
26280 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 4c 69 6e 65 54 79 70 65 20 3d 20 4c 69 6e ................m_LineType.=.Lin
262a0 65 54 79 70 65 2e 53 69 6e 67 6c 65 4c 69 6e 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 eType.SingleLine;...............
262c0 20 20 20 20 20 20 20 20 20 20 20 6d 5f 49 6e 70 75 74 54 79 70 65 20 3d 20 49 6e 70 75 74 54 79 ...........m_InputType.=.InputTy
262e0 70 65 2e 53 74 61 6e 64 61 72 64 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 pe.Standard;....................
26300 20 20 20 20 20 20 6d 5f 4b 65 79 62 6f 61 72 64 54 79 70 65 20 3d 20 54 6f 75 63 68 53 63 72 65 ......m_KeyboardType.=.TouchScre
26320 65 6e 4b 65 79 62 6f 61 72 64 54 79 70 65 2e 4e 75 6d 62 65 72 73 41 6e 64 50 75 6e 63 74 75 61 enKeyboardType.NumbersAndPunctua
26340 74 69 6f 6e 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 6d tion;..........................m
26360 5f 43 68 61 72 61 63 74 65 72 56 61 6c 69 64 61 74 69 6f 6e 20 3d 20 43 68 61 72 61 63 74 65 72 _CharacterValidation.=.Character
26380 56 61 6c 69 64 61 74 69 6f 6e 2e 44 65 63 69 6d 61 6c 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 Validation.Decimal;.............
263a0 20 20 20 20 20 20 20 20 20 20 20 20 20 62 72 65 61 6b 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 .............break;.............
263c0 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 63 61 73 65 .........}..................case
263e0 20 43 6f 6e 74 65 6e 74 54 79 70 65 2e 41 6c 70 68 61 6e 75 6d 65 72 69 63 3a 0d 0a 20 20 20 20 .ContentType.Alphanumeric:......
26400 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 ................{...............
26420 20 20 20 20 20 20 20 20 20 20 20 6d 5f 4c 69 6e 65 54 79 70 65 20 3d 20 4c 69 6e 65 54 79 70 65 ...........m_LineType.=.LineType
26440 2e 53 69 6e 67 6c 65 4c 69 6e 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .SingleLine;....................
26460 20 20 20 20 20 20 6d 5f 49 6e 70 75 74 54 79 70 65 20 3d 20 49 6e 70 75 74 54 79 70 65 2e 53 74 ......m_InputType.=.InputType.St
26480 61 6e 64 61 72 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 andard;.........................
264a0 20 6d 5f 4b 65 79 62 6f 61 72 64 54 79 70 65 20 3d 20 54 6f 75 63 68 53 63 72 65 65 6e 4b 65 79 .m_KeyboardType.=.TouchScreenKey
264c0 62 6f 61 72 64 54 79 70 65 2e 41 53 43 49 49 43 61 70 61 62 6c 65 3b 0d 0a 20 20 20 20 20 20 20 boardType.ASCIICapable;.........
264e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 43 68 61 72 61 63 74 65 72 56 61 6c 69 .................m_CharacterVali
26500 64 61 74 69 6f 6e 20 3d 20 43 68 61 72 61 63 74 65 72 56 61 6c 69 64 61 74 69 6f 6e 2e 41 6c 70 dation.=.CharacterValidation.Alp
26520 68 61 6e 75 6d 65 72 69 63 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 hanumeric;......................
26540 20 20 20 20 62 72 65 61 6b 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ....break;......................
26560 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 73 65 20 43 6f 6e 74 65 6e 74 54 }..................case.ContentT
26580 79 70 65 2e 4e 61 6d 65 3a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b ype.Name:......................{
265a0 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 6d 5f 4c 69 6e 65 ..........................m_Line
265c0 54 79 70 65 20 3d 20 4c 69 6e 65 54 79 70 65 2e 53 69 6e 67 6c 65 4c 69 6e 65 3b 0d 0a 20 20 20 Type.=.LineType.SingleLine;.....
265e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 49 6e 70 75 74 54 79 70 65 .....................m_InputType
26600 20 3d 20 49 6e 70 75 74 54 79 70 65 2e 53 74 61 6e 64 61 72 64 3b 0d 0a 20 20 20 20 20 20 20 20 .=.InputType.Standard;..........
26620 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 4b 65 79 62 6f 61 72 64 54 79 70 65 20 3d ................m_KeyboardType.=
26640 20 54 6f 75 63 68 53 63 72 65 65 6e 4b 65 79 62 6f 61 72 64 54 79 70 65 2e 44 65 66 61 75 6c 74 .TouchScreenKeyboardType.Default
26660 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 6d 5f 43 68 61 ;..........................m_Cha
26680 72 61 63 74 65 72 56 61 6c 69 64 61 74 69 6f 6e 20 3d 20 43 68 61 72 61 63 74 65 72 56 61 6c 69 racterValidation.=.CharacterVali
266a0 64 61 74 69 6f 6e 2e 4e 61 6d 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 dation.Name;....................
266c0 20 20 20 20 20 20 62 72 65 61 6b 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ......break;....................
266e0 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 73 65 20 43 6f 6e 74 65 6e ..}..................case.Conten
26700 74 54 79 70 65 2e 45 6d 61 69 6c 41 64 64 72 65 73 73 3a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 tType.EmailAddress:.............
26720 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 20 .........{......................
26740 20 20 20 20 6d 5f 4c 69 6e 65 54 79 70 65 20 3d 20 4c 69 6e 65 54 79 70 65 2e 53 69 6e 67 6c 65 ....m_LineType.=.LineType.Single
26760 4c 69 6e 65 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 6d Line;..........................m
26780 5f 49 6e 70 75 74 54 79 70 65 20 3d 20 49 6e 70 75 74 54 79 70 65 2e 53 74 61 6e 64 61 72 64 3b _InputType.=.InputType.Standard;
267a0 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 6d 5f 4b 65 79 62 ..........................m_Keyb
267c0 6f 61 72 64 54 79 70 65 20 3d 20 54 6f 75 63 68 53 63 72 65 65 6e 4b 65 79 62 6f 61 72 64 54 79 oardType.=.TouchScreenKeyboardTy
267e0 70 65 2e 45 6d 61 69 6c 41 64 64 72 65 73 73 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 pe.EmailAddress;................
26800 20 20 20 20 20 20 20 20 20 20 6d 5f 43 68 61 72 61 63 74 65 72 56 61 6c 69 64 61 74 69 6f 6e 20 ..........m_CharacterValidation.
26820 3d 20 43 68 61 72 61 63 74 65 72 56 61 6c 69 64 61 74 69 6f 6e 2e 45 6d 61 69 6c 41 64 64 72 65 =.CharacterValidation.EmailAddre
26840 73 73 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 62 72 65 ss;..........................bre
26860 61 6b 3b 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 20 ak;......................}......
26880 20 20 20 20 20 20 20 20 20 20 20 20 63 61 73 65 20 43 6f 6e 74 65 6e 74 54 79 70 65 2e 50 61 73 ............case.ContentType.Pas
268a0 73 77 6f 72 64 3a 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 sword:......................{...
268c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 4c 69 6e 65 54 79 70 .......................m_LineTyp
268e0 65 20 3d 20 4c 69 6e 65 54 79 70 65 2e 53 69 6e 67 6c 65 4c 69 6e 65 3b 0d 0a 20 20 20 20 20 20 e.=.LineType.SingleLine;........
26900 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 49 6e 70 75 74 54 79 70 65 20 3d 20 ..................m_InputType.=.
26920 49 6e 70 75 74 54 79 70 65 2e 50 61 73 73 77 6f 72 64 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 InputType.Password;.............
26940 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 4b 65 79 62 6f 61 72 64 54 79 70 65 20 3d 20 54 6f .............m_KeyboardType.=.To
26960 75 63 68 53 63 72 65 65 6e 4b 65 79 62 6f 61 72 64 54 79 70 65 2e 44 65 66 61 75 6c 74 3b 0d 0a uchScreenKeyboardType.Default;..
26980 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 43 68 61 72 61 63 ........................m_Charac
269a0 74 65 72 56 61 6c 69 64 61 74 69 6f 6e 20 3d 20 43 68 61 72 61 63 74 65 72 56 61 6c 69 64 61 74 terValidation.=.CharacterValidat
269c0 69 6f 6e 2e 4e 6f 6e 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ion.None;.......................
269e0 20 20 20 62 72 65 61 6b 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d ...break;......................}
26a00 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 73 65 20 43 6f 6e 74 65 6e 74 54 79 ..................case.ContentTy
26a20 70 65 2e 50 69 6e 3a 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 pe.Pin:......................{..
26a40 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 4c 69 6e 65 54 79 ........................m_LineTy
26a60 70 65 20 3d 20 4c 69 6e 65 54 79 70 65 2e 53 69 6e 67 6c 65 4c 69 6e 65 3b 0d 0a 20 20 20 20 20 pe.=.LineType.SingleLine;.......
26a80 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 49 6e 70 75 74 54 79 70 65 20 3d ...................m_InputType.=
26aa0 20 49 6e 70 75 74 54 79 70 65 2e 50 61 73 73 77 6f 72 64 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 .InputType.Password;............
26ac0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 4b 65 79 62 6f 61 72 64 54 79 70 65 20 3d 20 54 ..............m_KeyboardType.=.T
26ae0 6f 75 63 68 53 63 72 65 65 6e 4b 65 79 62 6f 61 72 64 54 79 70 65 2e 4e 75 6d 62 65 72 50 61 64 ouchScreenKeyboardType.NumberPad
26b00 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 6d 5f 43 68 61 ;..........................m_Cha
26b20 72 61 63 74 65 72 56 61 6c 69 64 61 74 69 6f 6e 20 3d 20 43 68 61 72 61 63 74 65 72 56 61 6c 69 racterValidation.=.CharacterVali
26b40 64 61 74 69 6f 6e 2e 44 69 67 69 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 dation.Digit;...................
26b60 20 20 20 20 20 20 20 62 72 65 61 6b 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .......break;...................
26b80 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 64 65 66 61 75 6c 74 3a 0d 0a ...}..................default:..
26ba0 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 20 ....................{...........
26bc0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 6e 63 6c 75 64 65 73 20 43 75 73 74 6f ...............//.Includes.Custo
26be0 6d 20 74 79 70 65 2e 20 4e 6f 74 68 69 6e 67 20 73 68 6f 75 6c 64 20 62 65 20 65 6e 66 6f 72 63 m.type..Nothing.should.be.enforc
26c00 65 64 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 62 72 65 ed...........................bre
26c20 61 6b 3b 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 20 ak;......................}......
26c40 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 53 65 74 54 65 78 74 ........}................SetText
26c60 43 6f 6d 70 6f 6e 65 6e 74 57 72 61 70 4d 6f 64 65 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d ComponentWrapMode();..........}.
26c80 0a 0d 0a 20 20 20 20 20 20 20 20 76 6f 69 64 20 53 65 74 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 ...........void.SetTextComponent
26ca0 57 72 61 70 4d 6f 64 65 28 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 WrapMode()..........{...........
26cc0 20 20 20 69 66 20 28 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 20 3d 3d 20 6e 75 6c 6c 29 0d ...if.(m_TextComponent.==.null).
26ce0 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 3b 0d 0a 0d 0a 20 20 20 20 .................return;........
26d00 20 20 20 20 20 20 20 20 69 66 20 28 6d 75 6c 74 69 4c 69 6e 65 29 0d 0a 20 20 20 20 20 20 20 20 ........if.(multiLine)..........
26d20 20 20 20 20 20 20 20 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 65 6e 61 62 6c 65 57 6f ........m_TextComponent.enableWo
26d40 72 64 57 72 61 70 70 69 6e 67 20 3d 20 74 72 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 rdWrapping.=.true;..............
26d60 65 6c 73 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 54 65 78 74 43 6f 6d 70 else..................m_TextComp
26d80 6f 6e 65 6e 74 2e 65 6e 61 62 6c 65 57 6f 72 64 57 72 61 70 70 69 6e 67 20 3d 20 66 61 6c 73 65 onent.enableWordWrapping.=.false
26da0 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 20 43 6f 6e 74 72 ;..........}............//.Contr
26dc0 6f 6c 20 52 69 63 68 20 54 65 78 74 20 6f 70 74 69 6f 6e 20 6f 6e 20 74 68 65 20 74 65 78 74 20 ol.Rich.Text.option.on.the.text.
26de0 63 6f 6d 70 6f 6e 65 6e 74 2e 0d 0a 20 20 20 20 20 20 20 20 76 6f 69 64 20 53 65 74 54 65 78 74 component...........void.SetText
26e00 43 6f 6d 70 6f 6e 65 6e 74 52 69 63 68 54 65 78 74 4d 6f 64 65 28 29 0d 0a 20 20 20 20 20 20 20 ComponentRichTextMode().........
26e20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e .{..............if.(m_TextCompon
26e40 65 6e 74 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 ent.==.null)..................re
26e60 74 75 72 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 54 65 78 74 43 6f 6d 70 6f turn;................m_TextCompo
26e80 6e 65 6e 74 2e 72 69 63 68 54 65 78 74 20 3d 20 6d 5f 52 69 63 68 54 65 78 74 3b 0d 0a 20 20 20 nent.richText.=.m_RichText;.....
26ea0 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 76 6f 69 64 20 53 65 74 54 6f 43 75 73 74 .....}............void.SetToCust
26ec0 6f 6d 49 66 43 6f 6e 74 65 6e 74 54 79 70 65 49 73 4e 6f 74 28 70 61 72 61 6d 73 20 43 6f 6e 74 omIfContentTypeIsNot(params.Cont
26ee0 65 6e 74 54 79 70 65 5b 5d 20 61 6c 6c 6f 77 65 64 43 6f 6e 74 65 6e 74 54 79 70 65 73 29 0d 0a entType[].allowedContentTypes)..
26f00 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 6f 6e 74 65 ........{..............if.(conte
26f20 6e 74 54 79 70 65 20 3d 3d 20 43 6f 6e 74 65 6e 74 54 79 70 65 2e 43 75 73 74 6f 6d 29 0d 0a 20 ntType.==.ContentType.Custom)...
26f40 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 ...............return;..........
26f60 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 61 6c 6c 6f 77 65 ......for.(int.i.=.0;.i.<.allowe
26f80 64 43 6f 6e 74 65 6e 74 54 79 70 65 73 2e 4c 65 6e 67 74 68 3b 20 69 2b 2b 29 0d 0a 20 20 20 20 dContentTypes.Length;.i++)......
26fa0 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 6f 6e 74 65 6e 74 54 79 70 65 20 3d 3d 20 61 ............if.(contentType.==.a
26fc0 6c 6c 6f 77 65 64 43 6f 6e 74 65 6e 74 54 79 70 65 73 5b 69 5d 29 0d 0a 20 20 20 20 20 20 20 20 llowedContentTypes[i])..........
26fe0 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 ............return;.............
27000 20 20 20 63 6f 6e 74 65 6e 74 54 79 70 65 20 3d 20 43 6f 6e 74 65 6e 74 54 79 70 65 2e 43 75 73 ...contentType.=.ContentType.Cus
27020 74 6f 6d 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 76 6f 69 64 20 tom;..........}............void.
27040 53 65 74 54 6f 43 75 73 74 6f 6d 28 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 SetToCustom()..........{........
27060 20 20 20 20 20 20 69 66 20 28 63 6f 6e 74 65 6e 74 54 79 70 65 20 3d 3d 20 43 6f 6e 74 65 6e 74 ......if.(contentType.==.Content
27080 54 79 70 65 2e 43 75 73 74 6f 6d 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 Type.Custom)..................re
270a0 74 75 72 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 65 6e 74 54 79 70 65 turn;................contentType
270c0 20 3d 20 43 6f 6e 74 65 6e 74 54 79 70 65 2e 43 75 73 74 6f 6d 3b 0d 0a 20 20 20 20 20 20 20 20 .=.ContentType.Custom;..........
270e0 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 76 6f 69 64 20 53 65 74 54 6f 43 75 73 74 6f 6d 28 43 68 }............void.SetToCustom(Ch
27100 61 72 61 63 74 65 72 56 61 6c 69 64 61 74 69 6f 6e 20 63 68 61 72 61 63 74 65 72 56 61 6c 69 64 aracterValidation.characterValid
27120 61 74 69 6f 6e 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 ation)..........{..............i
27140 66 20 28 63 6f 6e 74 65 6e 74 54 79 70 65 20 3d 3d 20 43 6f 6e 74 65 6e 74 54 79 70 65 2e 43 75 f.(contentType.==.ContentType.Cu
27160 73 74 6f 6d 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 stom)..............{............
27180 20 20 20 20 20 20 63 68 61 72 61 63 74 65 72 56 61 6c 69 64 61 74 69 6f 6e 20 3d 20 43 68 61 72 ......characterValidation.=.Char
271a0 61 63 74 65 72 56 61 6c 69 64 61 74 69 6f 6e 2e 43 75 73 74 6f 6d 56 61 6c 69 64 61 74 6f 72 3b acterValidation.CustomValidator;
271c0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 3b 0d 0a 20 20 20 20 20 ..................return;.......
271e0 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 65 6e 74 54 .......}................contentT
27200 79 70 65 20 3d 20 43 6f 6e 74 65 6e 74 54 79 70 65 2e 43 75 73 74 6f 6d 3b 0d 0a 20 20 20 20 20 ype.=.ContentType.Custom;.......
27220 20 20 20 20 20 20 20 63 68 61 72 61 63 74 65 72 56 61 6c 69 64 61 74 69 6f 6e 20 3d 20 43 68 61 .......characterValidation.=.Cha
27240 72 61 63 74 65 72 56 61 6c 69 64 61 74 69 6f 6e 2e 43 75 73 74 6f 6d 56 61 6c 69 64 61 74 6f 72 racterValidation.CustomValidator
27260 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 70 72 6f 74 65 63 ;..........}..............protec
27280 74 65 64 20 6f 76 65 72 72 69 64 65 20 76 6f 69 64 20 44 6f 53 74 61 74 65 54 72 61 6e 73 69 74 ted.override.void.DoStateTransit
272a0 69 6f 6e 28 53 65 6c 65 63 74 69 6f 6e 53 74 61 74 65 20 73 74 61 74 65 2c 20 62 6f 6f 6c 20 69 ion(SelectionState.state,.bool.i
272c0 6e 73 74 61 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 20 20 nstant)..........{..............
272e0 69 66 20 28 6d 5f 48 61 73 44 6f 6e 65 46 6f 63 75 73 54 72 61 6e 73 69 74 69 6f 6e 29 0d 0a 20 if.(m_HasDoneFocusTransition)...
27300 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 74 61 74 65 20 3d 20 53 65 6c 65 63 74 69 6f 6e ...............state.=.Selection
27320 53 74 61 74 65 2e 48 69 67 68 6c 69 67 68 74 65 64 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 State.Highlighted;..............
27340 65 6c 73 65 20 69 66 20 28 73 74 61 74 65 20 3d 3d 20 53 65 6c 65 63 74 69 6f 6e 53 74 61 74 65 else.if.(state.==.SelectionState
27360 2e 50 72 65 73 73 65 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 5f 48 61 73 .Pressed)..................m_Has
27380 44 6f 6e 65 46 6f 63 75 73 54 72 61 6e 73 69 74 69 6f 6e 20 3d 20 74 72 75 65 3b 0d 0a 0d 0a 20 DoneFocusTransition.=.true;.....
273a0 20 20 20 20 20 20 20 20 20 20 20 62 61 73 65 2e 44 6f 53 74 61 74 65 54 72 61 6e 73 69 74 69 6f ...........base.DoStateTransitio
273c0 6e 28 73 74 61 74 65 2c 20 69 6e 73 74 61 6e 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d n(state,.instant);..........}...
273e0 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>........
27400 20 20 2f 2f 2f 20 53 65 65 20 49 4c 61 79 6f 75 74 45 6c 65 6d 65 6e 74 2e 43 61 6c 63 75 6c 61 ..///.See.ILayoutElement.Calcula
27420 74 65 4c 61 79 6f 75 74 49 6e 70 75 74 48 6f 72 69 7a 6f 6e 74 61 6c 2e 0d 0a 20 20 20 20 20 20 teLayoutInputHorizontal.........
27440 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 70 75 62 6c 69 63 ..///.</summary>..........public
27460 20 76 69 72 74 75 61 6c 20 76 6f 69 64 20 43 61 6c 63 75 6c 61 74 65 4c 61 79 6f 75 74 49 6e 70 .virtual.void.CalculateLayoutInp
27480 75 74 48 6f 72 69 7a 6f 6e 74 61 6c 28 29 0d 0a 20 20 20 20 20 20 20 20 7b 20 7d 0d 0a 0d 0a 20 utHorizontal()..........{.}.....
274a0 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>..........//
274c0 2f 20 53 65 65 20 49 4c 61 79 6f 75 74 45 6c 65 6d 65 6e 74 2e 43 61 6c 63 75 6c 61 74 65 4c 61 /.See.ILayoutElement.CalculateLa
274e0 79 6f 75 74 49 6e 70 75 74 56 65 72 74 69 63 61 6c 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 youtInputVertical...........///.
27500 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 76 69 72 74 75 </summary>..........public.virtu
27520 61 6c 20 76 6f 69 64 20 43 61 6c 63 75 6c 61 74 65 4c 61 79 6f 75 74 49 6e 70 75 74 56 65 72 74 al.void.CalculateLayoutInputVert
27540 69 63 61 6c 28 29 0d 0a 20 20 20 20 20 20 20 20 7b 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f ical()..........{.}............/
27560 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 53 65 65 20 49 4c //.<summary>..........///.See.IL
27580 61 79 6f 75 74 45 6c 65 6d 65 6e 74 2e 6d 69 6e 57 69 64 74 68 2e 0d 0a 20 20 20 20 20 20 20 20 ayoutElement.minWidth...........
275a0 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 76 ///.</summary>..........public.v
275c0 69 72 74 75 61 6c 20 66 6c 6f 61 74 20 6d 69 6e 57 69 64 74 68 20 7b 20 67 65 74 20 7b 20 72 65 irtual.float.minWidth.{.get.{.re
275e0 74 75 72 6e 20 30 3b 20 7d 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d turn.0;.}.}............///.<summ
27600 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 47 65 74 20 74 68 65 20 64 69 73 70 6c 61 ary>..........///.Get.the.displa
27620 79 65 64 20 77 69 74 68 20 6f 66 20 61 6c 6c 20 69 6e 70 75 74 20 63 68 61 72 61 63 74 65 72 73 yed.with.of.all.input.characters
27640 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 20 20 ...........///.</summary>.......
27660 20 20 20 70 75 62 6c 69 63 20 76 69 72 74 75 61 6c 20 66 6c 6f 61 74 20 70 72 65 66 65 72 72 65 ...public.virtual.float.preferre
27680 64 57 69 64 74 68 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 67 dWidth..........{..............g
276a0 65 74 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 et..............{...............
276c0 20 20 20 69 66 20 28 74 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 ...if.(textComponent.==.null)...
276e0 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 30 3b 0d 0a 0d 0a ...................return.0;....
27700 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 6d 5f 54 65 78 74 43 6f 6d ................return.m_TextCom
27720 70 6f 6e 65 6e 74 2e 70 72 65 66 65 72 72 65 64 57 69 64 74 68 20 2b 20 31 36 20 2b 20 6d 5f 43 ponent.preferredWidth.+.16.+.m_C
27740 61 72 65 74 57 69 64 74 68 20 2b 20 31 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 aretWidth.+.1;..............}...
27760 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 72 79 .......}............///.<summary
27780 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 53 65 65 20 49 4c 61 79 6f 75 74 45 6c 65 6d 65 6e >..........///.See.ILayoutElemen
277a0 74 2e 66 6c 65 78 69 62 6c 65 57 69 64 74 68 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f t.flexibleWidth...........///.</
277c0 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 76 69 72 74 75 61 6c summary>..........public.virtual
277e0 20 66 6c 6f 61 74 20 66 6c 65 78 69 62 6c 65 57 69 64 74 68 20 7b 20 67 65 74 20 7b 20 72 65 74 .float.flexibleWidth.{.get.{.ret
27800 75 72 6e 20 2d 31 3b 20 7d 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d urn.-1;.}.}............///.<summ
27820 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 53 65 65 20 49 4c 61 79 6f 75 74 45 6c 65 ary>..........///.See.ILayoutEle
27840 6d 65 6e 74 2e 6d 69 6e 48 65 69 67 68 74 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 ment.minHeight...........///.</s
27860 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 76 69 72 74 75 61 6c 20 ummary>..........public.virtual.
27880 66 6c 6f 61 74 20 6d 69 6e 48 65 69 67 68 74 20 7b 20 67 65 74 20 7b 20 72 65 74 75 72 6e 20 30 float.minHeight.{.get.{.return.0
278a0 3b 20 7d 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 0a ;.}.}............///.<summary>..
278c0 20 20 20 20 20 20 20 20 2f 2f 2f 20 47 65 74 20 74 68 65 20 68 65 69 67 68 74 20 6f 66 20 61 6c ........///.Get.the.height.of.al
278e0 6c 20 74 68 65 20 74 65 78 74 20 69 66 20 63 6f 6e 73 74 72 61 69 6e 65 64 20 74 6f 20 74 68 65 l.the.text.if.constrained.to.the
27900 20 68 65 69 67 68 74 20 6f 66 20 74 68 65 20 52 65 63 74 54 72 61 6e 73 66 6f 72 6d 2e 0d 0a 20 .height.of.the.RectTransform....
27920 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 70 .......///.</summary>..........p
27940 75 62 6c 69 63 20 76 69 72 74 75 61 6c 20 66 6c 6f 61 74 20 70 72 65 66 65 72 72 65 64 48 65 69 ublic.virtual.float.preferredHei
27960 67 68 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 20 67 65 74 0d ght..........{..............get.
27980 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 20 .............{..................
279a0 69 66 20 28 74 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 if.(textComponent.==.null)......
279c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 30 3b 0d 0a 0d 0a 20 20 20 ................return.0;.......
279e0 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 6d 5f 54 65 78 74 43 6f 6d 70 6f 6e .............return.m_TextCompon
27a00 65 6e 74 2e 70 72 65 66 65 72 72 65 64 48 65 69 67 68 74 20 2b 20 31 36 3b 0d 0a 20 20 20 20 20 ent.preferredHeight.+.16;.......
27a20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f .......}..........}............/
27a40 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 53 65 65 20 49 4c //.<summary>..........///.See.IL
27a60 61 79 6f 75 74 45 6c 65 6d 65 6e 74 2e 66 6c 65 78 69 62 6c 65 48 65 69 67 68 74 2e 0d 0a 20 20 ayoutElement.flexibleHeight.....
27a80 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 70 75 ......///.</summary>..........pu
27aa0 62 6c 69 63 20 76 69 72 74 75 61 6c 20 66 6c 6f 61 74 20 66 6c 65 78 69 62 6c 65 48 65 69 67 68 blic.virtual.float.flexibleHeigh
27ac0 74 20 7b 20 67 65 74 20 7b 20 72 65 74 75 72 6e 20 2d 31 3b 20 7d 20 7d 0d 0a 0d 0a 20 20 20 20 t.{.get.{.return.-1;.}.}........
27ae0 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 53 ....///.<summary>..........///.S
27b00 65 65 20 49 4c 61 79 6f 75 74 45 6c 65 6d 65 6e 74 2e 6c 61 79 6f 75 74 50 72 69 6f 72 69 74 79 ee.ILayoutElement.layoutPriority
27b20 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 20 20 ...........///.</summary>.......
27b40 20 20 20 70 75 62 6c 69 63 20 76 69 72 74 75 61 6c 20 69 6e 74 20 6c 61 79 6f 75 74 50 72 69 6f ...public.virtual.int.layoutPrio
27b60 72 69 74 79 20 7b 20 67 65 74 20 7b 20 72 65 74 75 72 6e 20 31 3b 20 7d 20 7d 0d 0a 0d 0a 0d 0a rity.{.get.{.return.1;.}.}......
27b80 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>........../
27ba0 2f 2f 20 46 75 6e 63 74 69 6f 6e 20 74 6f 20 63 6f 6e 76 65 6e 69 65 6e 74 6c 79 20 73 65 74 20 //.Function.to.conveniently.set.
27bc0 74 68 65 20 70 6f 69 6e 74 20 73 69 7a 65 20 6f 66 20 62 6f 74 68 20 50 6c 61 63 65 68 6f 6c 64 the.point.size.of.both.Placehold
27be0 65 72 20 61 6e 64 20 49 6e 70 75 74 20 46 69 65 6c 64 20 74 65 78 74 20 6f 62 6a 65 63 74 2e 0d er.and.Input.Field.text.object..
27c00 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>.........
27c20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 70 6f 69 6e 74 53 69 7a 65 22 3e 3c 2f 70 .///.<param.name="pointSize"></p
27c40 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 76 6f 69 64 20 53 65 74 47 6c aram>..........public.void.SetGl
27c60 6f 62 61 6c 50 6f 69 6e 74 53 69 7a 65 28 66 6c 6f 61 74 20 70 6f 69 6e 74 53 69 7a 65 29 0d 0a obalPointSize(float.pointSize)..
27c80 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 54 4d 50 5f 54 65 78 74 20 ........{..............TMP_Text.
27ca0 70 6c 61 63 65 68 6f 6c 64 65 72 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 20 3d 20 6d 5f 50 6c 61 placeholderTextComponent.=.m_Pla
27cc0 63 65 68 6f 6c 64 65 72 20 61 73 20 54 4d 50 5f 54 65 78 74 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 ceholder.as.TMP_Text;...........
27ce0 20 20 20 20 20 69 66 20 28 70 6c 61 63 65 68 6f 6c 64 65 72 54 65 78 74 43 6f 6d 70 6f 6e 65 6e .....if.(placeholderTextComponen
27d00 74 20 21 3d 20 6e 75 6c 6c 29 20 70 6c 61 63 65 68 6f 6c 64 65 72 54 65 78 74 43 6f 6d 70 6f 6e t.!=.null).placeholderTextCompon
27d20 65 6e 74 2e 66 6f 6e 74 53 69 7a 65 20 3d 20 70 6f 69 6e 74 53 69 7a 65 3b 0d 0a 20 20 20 20 20 ent.fontSize.=.pointSize;.......
27d40 20 20 20 20 20 20 20 74 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 66 6f 6e 74 53 69 7a 65 20 3d 20 .......textComponent.fontSize.=.
27d60 70 6f 69 6e 74 53 69 7a 65 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 pointSize;..........}...........
27d80 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 6e 63 .///.<summary>..........///.Func
27da0 74 69 6f 6e 20 74 6f 20 63 6f 6e 76 65 6e 69 65 6e 74 6c 79 20 73 65 74 20 74 68 65 20 46 6f 6e tion.to.conveniently.set.the.Fon
27dc0 74 20 41 73 73 65 74 20 6f 66 20 62 6f 74 68 20 50 6c 61 63 65 68 6f 6c 64 65 72 20 61 6e 64 20 t.Asset.of.both.Placeholder.and.
27de0 49 6e 70 75 74 20 46 69 65 6c 64 20 74 65 78 74 20 6f 62 6a 65 63 74 2e 0d 0a 20 20 20 20 20 20 Input.Field.text.object.........
27e00 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
27e20 61 72 61 6d 20 6e 61 6d 65 3d 22 66 6f 6e 74 41 73 73 65 74 22 3e 3c 2f 70 61 72 61 6d 3e 0d 0a aram.name="fontAsset"></param>..
27e40 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 76 6f 69 64 20 53 65 74 47 6c 6f 62 61 6c 46 6f 6e ........public.void.SetGlobalFon
27e60 74 41 73 73 65 74 28 54 4d 50 5f 46 6f 6e 74 41 73 73 65 74 20 66 6f 6e 74 41 73 73 65 74 29 0d tAsset(TMP_FontAsset.fontAsset).
27e80 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 4d 50 5f 54 65 78 74 .........{..............TMP_Text
27ea0 20 70 6c 61 63 65 68 6f 6c 64 65 72 54 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 20 3d 20 6d 5f 50 6c .placeholderTextComponent.=.m_Pl
27ec0 61 63 65 68 6f 6c 64 65 72 20 61 73 20 54 4d 50 5f 54 65 78 74 3b 0d 0a 0d 0a 20 20 20 20 20 20 aceholder.as.TMP_Text;..........
27ee0 20 20 20 20 20 20 69 66 20 28 70 6c 61 63 65 68 6f 6c 64 65 72 54 65 78 74 43 6f 6d 70 6f 6e 65 ......if.(placeholderTextCompone
27f00 6e 74 20 21 3d 20 6e 75 6c 6c 29 20 70 6c 61 63 65 68 6f 6c 64 65 72 54 65 78 74 43 6f 6d 70 6f nt.!=.null).placeholderTextCompo
27f20 6e 65 6e 74 2e 66 6f 6e 74 20 3d 20 66 6f 6e 74 41 73 73 65 74 3b 0d 0a 20 20 20 20 20 20 20 20 nent.font.=.fontAsset;..........
27f40 20 20 20 20 74 65 78 74 43 6f 6d 70 6f 6e 65 6e 74 2e 66 6f 6e 74 20 3d 20 66 6f 6e 74 41 73 73 ....textComponent.font.=.fontAss
27f60 65 74 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 7d 0d 0a 0d 0a 0d 0a 20 et;............}........}.......
27f80 20 20 20 73 74 61 74 69 63 20 63 6c 61 73 73 20 53 65 74 50 72 6f 70 65 72 74 79 55 74 69 6c 69 ...static.class.SetPropertyUtili
27fa0 74 79 0d 0a 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 ty......{..........public.static
27fc0 20 62 6f 6f 6c 20 53 65 74 43 6f 6c 6f 72 28 72 65 66 20 43 6f 6c 6f 72 20 63 75 72 72 65 6e 74 .bool.SetColor(ref.Color.current
27fe0 56 61 6c 75 65 2c 20 43 6f 6c 6f 72 20 6e 65 77 56 61 6c 75 65 29 0d 0a 20 20 20 20 20 20 20 20 Value,.Color.newValue)..........
28000 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 75 72 72 65 6e 74 56 61 6c 75 65 2e {..............if.(currentValue.
28020 72 20 3d 3d 20 6e 65 77 56 61 6c 75 65 2e 72 20 26 26 20 63 75 72 72 65 6e 74 56 61 6c 75 65 2e r.==.newValue.r.&&.currentValue.
28040 67 20 3d 3d 20 6e 65 77 56 61 6c 75 65 2e 67 20 26 26 20 63 75 72 72 65 6e 74 56 61 6c 75 65 2e g.==.newValue.g.&&.currentValue.
28060 62 20 3d 3d 20 6e 65 77 56 61 6c 75 65 2e 62 20 26 26 20 63 75 72 72 65 6e 74 56 61 6c 75 65 2e b.==.newValue.b.&&.currentValue.
28080 61 20 3d 3d 20 6e 65 77 56 61 6c 75 65 2e 61 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 a.==.newValue.a)................
280a0 20 20 72 65 74 75 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 63 ..return.false;................c
280c0 75 72 72 65 6e 74 56 61 6c 75 65 20 3d 20 6e 65 77 56 61 6c 75 65 3b 0d 0a 20 20 20 20 20 20 20 urrentValue.=.newValue;.........
280e0 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 0d 0a 0d 0a .....return.true;..........}....
28100 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 53 65 74 45 71 ........public.static.bool.SetEq
28120 75 61 74 61 62 6c 65 53 74 72 75 63 74 3c 54 3e 28 72 65 66 20 54 20 63 75 72 72 65 6e 74 56 61 uatableStruct<T>(ref.T.currentVa
28140 6c 75 65 2c 20 54 20 6e 65 77 56 61 6c 75 65 29 20 77 68 65 72 65 20 54 20 3a 20 49 45 71 75 61 lue,.T.newValue).where.T.:.IEqua
28160 74 61 62 6c 65 3c 54 3e 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 table<T>..........{.............
28180 20 69 66 20 28 63 75 72 72 65 6e 74 56 61 6c 75 65 2e 45 71 75 61 6c 73 28 6e 65 77 56 61 6c 75 .if.(currentValue.Equals(newValu
281a0 65 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 6e 20 66 61 6c 73 e))..................return.fals
281c0 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 63 75 72 72 65 6e 74 56 61 6c 75 65 20 3d e;................currentValue.=
281e0 20 6e 65 77 56 61 6c 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 74 .newValue;..............return.t
28200 72 75 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 70 75 62 6c 69 rue;..........}............publi
28220 63 20 73 74 61 74 69 63 20 62 6f 6f 6c 20 53 65 74 53 74 72 75 63 74 3c 54 3e 28 72 65 66 20 54 c.static.bool.SetStruct<T>(ref.T
28240 20 63 75 72 72 65 6e 74 56 61 6c 75 65 2c 20 54 20 6e 65 77 56 61 6c 75 65 29 20 77 68 65 72 65 .currentValue,.T.newValue).where
28260 20 54 20 3a 20 73 74 72 75 63 74 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 .T.:.struct..........{..........
28280 20 20 20 20 69 66 20 28 63 75 72 72 65 6e 74 56 61 6c 75 65 2e 45 71 75 61 6c 73 28 6e 65 77 56 ....if.(currentValue.Equals(newV
282a0 61 6c 75 65 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 6e 20 66 alue))..................return.f
282c0 61 6c 73 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 63 75 72 72 65 6e 74 56 61 6c 75 alse;................currentValu
282e0 65 20 3d 20 6e 65 77 56 61 6c 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 e.=.newValue;..............retur
28300 6e 20 74 72 75 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 70 75 n.true;..........}............pu
28320 62 6c 69 63 20 73 74 61 74 69 63 20 62 6f 6f 6c 20 53 65 74 43 6c 61 73 73 3c 54 3e 28 72 65 66 blic.static.bool.SetClass<T>(ref
28340 20 54 20 63 75 72 72 65 6e 74 56 61 6c 75 65 2c 20 54 20 6e 65 77 56 61 6c 75 65 29 20 77 68 65 .T.currentValue,.T.newValue).whe
28360 72 65 20 54 20 3a 20 63 6c 61 73 73 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 re.T.:.class..........{.........
28380 20 20 20 20 20 69 66 20 28 28 63 75 72 72 65 6e 74 56 61 6c 75 65 20 3d 3d 20 6e 75 6c 6c 20 26 .....if.((currentValue.==.null.&
283a0 26 20 6e 65 77 56 61 6c 75 65 20 3d 3d 20 6e 75 6c 6c 29 20 7c 7c 20 28 63 75 72 72 65 6e 74 56 &.newValue.==.null).||.(currentV
283c0 61 6c 75 65 20 21 3d 20 6e 75 6c 6c 20 26 26 20 63 75 72 72 65 6e 74 56 61 6c 75 65 2e 45 71 75 alue.!=.null.&&.currentValue.Equ
283e0 61 6c 73 28 6e 65 77 56 61 6c 75 65 29 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 als(newValue))).................
28400 20 72 65 74 75 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 63 75 .return.false;................cu
28420 72 72 65 6e 74 56 61 6c 75 65 20 3d 20 6e 65 77 56 61 6c 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 rrentValue.=.newValue;..........
28440 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 0d 0a 20 20 20 ....return.true;..........}.....
28460 20 7d 0d 0a 7d 00 00 00 00 00 00 00 01 00 00 00 80 b9 2a 00 00 00 00 00 00 00 00 00 0e 00 00 00 .}..}.............*.............
28480 54 4d 50 5f 49 6e 70 75 74 46 69 65 6c 64 00 00 05 00 00 00 54 4d 50 72 6f 00 00 00 TMP_InputField......TMPro...