summaryrefslogtreecommitdiff
path: root/Library/Artifacts/59/59804c4a86859b0be82d2691ede3f8b7
blob: 7afce3ea45814887d4932182c931162e51c2b814 (plain)
ofshex dumpascii
0000 00 00 0f 81 00 02 90 90 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 30 80 02 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0...............................
0fa0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
0fc0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
0fe0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
1000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
1020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 e0 79 af 00 00 00 00 00 00 00 00 00 .....................y..........
1040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
1060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
1080 00 00 00 00 00 00 00 00 0b 00 00 00 49 6e 70 75 74 53 79 73 74 65 6d 00 b1 7f 02 00 75 73 69 6e ............InputSystem.....usin
10a0 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
10c0 6f 6e 73 2e 47 65 6e 65 72 69 63 3b 0d 0a 75 73 69 6e 67 20 53 79 73 74 65 6d 2e 52 65 66 6c 65 ons.Generic;..using.System.Refle
10e0 63 74 69 6f 6e 3b 0d 0a 75 73 69 6e 67 20 55 6e 69 74 79 45 6e 67 69 6e 65 2e 49 6e 70 75 74 53 ction;..using.UnityEngine.InputS
1100 79 73 74 65 6d 2e 48 61 70 74 69 63 73 3b 0d 0a 75 73 69 6e 67 20 55 6e 69 74 79 2e 43 6f 6c 6c ystem.Haptics;..using.Unity.Coll
1120 65 63 74 69 6f 6e 73 2e 4c 6f 77 4c 65 76 65 6c 2e 55 6e 73 61 66 65 3b 0d 0a 75 73 69 6e 67 20 ections.LowLevel.Unsafe;..using.
1140 55 6e 69 74 79 45 6e 67 69 6e 65 2e 49 6e 70 75 74 53 79 73 74 65 6d 2e 4c 61 79 6f 75 74 73 3b UnityEngine.InputSystem.Layouts;
1160 0d 0a 75 73 69 6e 67 20 55 6e 69 74 79 45 6e 67 69 6e 65 2e 49 6e 70 75 74 53 79 73 74 65 6d 2e ..using.UnityEngine.InputSystem.
1180 4c 6f 77 4c 65 76 65 6c 3b 0d 0a 75 73 69 6e 67 20 55 6e 69 74 79 45 6e 67 69 6e 65 2e 49 6e 70 LowLevel;..using.UnityEngine.Inp
11a0 75 74 53 79 73 74 65 6d 2e 44 75 61 6c 53 68 6f 63 6b 3b 0d 0a 75 73 69 6e 67 20 55 6e 69 74 79 utSystem.DualShock;..using.Unity
11c0 45 6e 67 69 6e 65 2e 49 6e 70 75 74 53 79 73 74 65 6d 2e 48 49 44 3b 0d 0a 75 73 69 6e 67 20 55 Engine.InputSystem.HID;..using.U
11e0 6e 69 74 79 45 6e 67 69 6e 65 2e 49 6e 70 75 74 53 79 73 74 65 6d 2e 55 73 65 72 73 3b 0d 0a 75 nityEngine.InputSystem.Users;..u
1200 73 69 6e 67 20 55 6e 69 74 79 45 6e 67 69 6e 65 2e 49 6e 70 75 74 53 79 73 74 65 6d 2e 58 49 6e sing.UnityEngine.InputSystem.XIn
1220 70 75 74 3b 0d 0a 75 73 69 6e 67 20 55 6e 69 74 79 45 6e 67 69 6e 65 2e 49 6e 70 75 74 53 79 73 put;..using.UnityEngine.InputSys
1240 74 65 6d 2e 55 74 69 6c 69 74 69 65 73 3b 0d 0a 23 69 66 20 55 4e 49 54 59 5f 45 44 49 54 4f 52 tem.Utilities;..#if.UNITY_EDITOR
1260 0d 0a 75 73 69 6e 67 20 55 6e 69 74 79 45 64 69 74 6f 72 3b 0d 0a 75 73 69 6e 67 20 55 6e 69 74 ..using.UnityEditor;..using.Unit
1280 79 45 6e 67 69 6e 65 2e 49 6e 70 75 74 53 79 73 74 65 6d 2e 45 64 69 74 6f 72 3b 0d 0a 75 73 69 yEngine.InputSystem.Editor;..usi
12a0 6e 67 20 55 6e 69 74 79 45 64 69 74 6f 72 2e 4e 65 74 77 6f 72 6b 69 6e 67 2e 50 6c 61 79 65 72 ng.UnityEditor.Networking.Player
12c0 43 6f 6e 6e 65 63 74 69 6f 6e 3b 0d 0a 23 65 6c 73 65 0d 0a 75 73 69 6e 67 20 53 79 73 74 65 6d Connection;..#else..using.System
12e0 2e 4c 69 6e 71 3b 0d 0a 75 73 69 6e 67 20 55 6e 69 74 79 45 6e 67 69 6e 65 2e 4e 65 74 77 6f 72 .Linq;..using.UnityEngine.Networ
1300 6b 69 6e 67 2e 50 6c 61 79 65 72 43 6f 6e 6e 65 63 74 69 6f 6e 3b 0d 0a 23 65 6e 64 69 66 0d 0a king.PlayerConnection;..#endif..
1320 0d 0a 2f 2f 2f 2f 54 4f 44 4f 3a 20 61 6c 6c 6f 77 20 61 6c 69 61 73 69 6e 67 20 70 72 6f 63 65 ..////TODO:.allow.aliasing.proce
1340 73 73 6f 72 73 20 65 74 63 0d 0a 0d 0a 2f 2f 2f 2f 52 45 56 49 45 57 3a 20 72 65 6e 61 6d 65 20 ssors.etc....////REVIEW:.rename.
1360 61 6c 6c 20 72 65 66 65 72 65 6e 63 65 73 20 74 6f 20 22 66 72 61 6d 65 22 20 74 6f 20 72 65 66 all.references.to."frame".to.ref
1380 65 72 20 74 6f 20 22 75 70 64 61 74 65 22 20 69 6e 73 74 65 61 64 20 28 65 2e 67 2e 20 77 61 73 er.to."update".instead.(e.g..was
13a0 50 72 65 73 73 65 64 54 68 69 73 55 70 64 61 74 65 29 3f 0d 0a 0d 0a 2f 2f 2f 2f 54 4f 44 4f 3a PressedThisUpdate)?....////TODO:
13c0 20 61 64 64 20 41 50 49 73 20 74 6f 20 67 65 74 20 74 6f 20 74 68 65 20 73 74 61 74 65 20 62 6c .add.APIs.to.get.to.the.state.bl
13e0 6f 63 6b 73 20 28 65 71 75 69 76 61 6c 65 6e 74 20 74 6f 20 77 68 61 74 20 79 6f 75 20 63 75 72 ocks.(equivalent.to.what.you.cur
1400 72 65 6e 74 6c 79 20 67 65 74 20 77 69 74 68 20 65 2e 67 2e 20 49 6e 70 75 74 53 79 73 74 65 6d rently.get.with.e.g..InputSystem
1420 2e 64 65 76 69 63 65 73 5b 30 5d 2e 63 75 72 72 65 6e 74 53 74 61 74 65 50 74 72 29 0d 0a 0d 0a .devices[0].currentStatePtr)....
1440 2f 2f 2f 2f 46 49 58 4d 45 3a 20 6d 6f 64 61 6c 20 64 69 61 6c 6f 67 73 20 28 6f 72 20 61 6e 79 ////FIXME:.modal.dialogs.(or.any
1460 74 68 69 6e 67 20 74 68 61 74 20 69 6e 74 65 72 72 75 70 74 73 20 6e 6f 72 6d 61 6c 20 55 6e 69 thing.that.interrupts.normal.Uni
1480 74 79 20 6f 70 65 72 61 74 69 6f 6e 29 20 61 72 65 20 6c 69 6b 65 6c 79 20 61 20 70 72 6f 62 6c ty.operation).are.likely.a.probl
14a0 65 6d 20 66 6f 72 20 74 68 65 20 73 79 73 74 65 6d 20 61 73 20 69 73 3b 20 74 68 65 72 65 27 73 em.for.the.system.as.is;.there's
14c0 20 61 20 67 6f 6f 64 0d 0a 2f 2f 2f 2f 20 20 20 20 20 20 20 63 68 61 6e 63 65 20 74 68 65 20 65 .a.good..////.......chance.the.e
14e0 76 65 6e 74 20 71 75 65 75 65 20 77 69 6c 6c 20 6a 75 73 74 20 67 65 74 20 73 77 61 6d 70 65 64 vent.queue.will.just.get.swamped
1500 3b 20 73 68 6f 75 6c 64 20 62 65 20 6f 6e 6c 79 20 74 68 65 20 62 61 63 6b 67 72 6f 75 6e 64 20 ;.should.be.only.the.background.
1520 71 75 65 75 65 20 74 68 6f 75 67 68 20 73 6f 20 49 20 67 75 65 73 73 20 6f 6e 63 65 20 69 74 20 queue.though.so.I.guess.once.it.
1540 66 69 6c 6c 73 20 75 70 20 77 65 0d 0a 2f 2f 2f 2f 20 20 20 20 20 20 20 73 69 6d 70 6c 79 20 73 fills.up.we..////.......simply.s
1560 74 61 72 74 20 6c 6f 73 69 6e 67 20 69 6e 70 75 74 20 62 75 74 20 69 74 20 77 6f 6e 27 74 20 67 tart.losing.input.but.it.won't.g
1580 72 6f 77 20 69 6e 66 69 6e 69 74 65 6c 79 0d 0a 0d 0a 2f 2f 2f 2f 52 45 56 49 45 57 3a 20 6d 61 row.infinitely....////REVIEW:.ma
15a0 6b 65 20 6d 6f 72 65 20 41 50 49 73 20 74 68 72 65 61 64 2d 73 61 66 65 3f 0d 0a 0d 0a 2f 2f 2f ke.more.APIs.thread-safe?....///
15c0 2f 52 45 56 49 45 57 3a 20 69 74 27 64 20 62 65 20 67 72 65 61 74 20 74 6f 20 62 65 20 61 62 6c /REVIEW:.it'd.be.great.to.be.abl
15e0 65 20 74 6f 20 73 65 74 20 75 70 20 6d 6f 6e 69 74 6f 72 73 20 66 72 6f 6d 20 63 6f 6e 74 72 6f e.to.set.up.monitors.from.contro
1600 6c 20 70 61 74 68 73 20 28 69 6e 64 65 70 65 6e 64 65 6e 74 6c 79 20 6f 66 20 61 63 74 69 6f 6e l.paths.(independently.of.action
1620 73 3b 20 6f 72 20 73 68 6f 75 6c 64 20 77 65 20 6a 75 73 74 20 75 73 65 20 61 63 74 69 6f 6e 73 s;.or.should.we.just.use.actions
1640 3f 29 0d 0a 0d 0a 2f 2f 2f 2f 52 45 56 49 45 57 3a 20 68 61 76 65 20 49 6e 70 75 74 53 79 73 74 ?)....////REVIEW:.have.InputSyst
1660 65 6d 2e 6f 6e 54 65 78 74 49 6e 70 75 74 20 74 68 61 74 27 73 20 66 69 72 65 64 20 64 69 72 65 em.onTextInput.that's.fired.dire
1680 63 74 6c 79 20 66 72 6f 6d 20 74 68 65 20 65 76 65 6e 74 20 70 72 6f 63 65 73 73 69 6e 67 20 6c ctly.from.the.event.processing.l
16a0 6f 6f 70 3f 0d 0a 2f 2f 2f 2f 20 20 20 20 20 20 20 20 28 61 6e 64 20 61 6c 6c 6f 77 20 74 65 78 oop?..////........(and.allow.tex
16c0 74 20 69 6e 70 75 74 20 65 76 65 6e 74 73 20 74 68 61 74 20 68 61 76 65 20 6e 6f 20 61 73 73 6f t.input.events.that.have.no.asso
16e0 63 69 61 74 65 64 20 74 61 72 67 65 74 20 64 65 76 69 63 65 3f 20 74 68 69 73 20 77 61 79 20 77 ciated.target.device?.this.way.w
1700 65 20 64 6f 6e 27 74 20 6e 65 65 64 20 61 20 6b 65 79 62 6f 61 72 64 20 74 6f 20 67 65 74 20 74 e.don't.need.a.keyboard.to.get.t
1720 65 78 74 20 69 6e 70 75 74 29 0d 0a 0d 0a 2f 2f 2f 2f 52 45 56 49 45 57 3a 20 73 70 6c 69 74 20 ext.input)....////REVIEW:.split.
1740 6c 6f 77 65 72 2d 6c 65 76 65 6c 20 41 50 49 73 20 28 61 6e 79 74 68 69 6e 67 20 6d 65 6e 74 69 lower-level.APIs.(anything.menti
1760 6f 6e 69 6e 67 20 65 76 65 6e 74 73 20 61 6e 64 20 73 74 61 74 65 29 20 6f 66 66 20 69 6e 74 6f oning.events.and.state).off.into
1780 20 49 6e 70 75 74 53 79 73 74 65 6d 4c 6f 77 4c 65 76 65 6c 20 41 50 49 20 74 6f 20 6d 61 6b 65 .InputSystemLowLevel.API.to.make
17a0 20 74 68 69 73 20 41 50 49 20 6d 6f 72 65 20 66 6f 63 75 73 65 64 3f 0d 0a 0d 0a 2f 2f 2f 2f 54 .this.API.more.focused?....////T
17c0 4f 44 4f 3a 20 72 65 6c 65 61 73 65 20 6e 61 74 69 76 65 20 61 6c 6c 6f 63 61 74 69 6f 6e 73 20 ODO:.release.native.allocations.
17e0 77 68 65 6e 20 65 78 69 74 69 6e 67 0d 0a 0d 0a 6e 61 6d 65 73 70 61 63 65 20 55 6e 69 74 79 45 when.exiting....namespace.UnityE
1800 6e 67 69 6e 65 2e 49 6e 70 75 74 53 79 73 74 65 6d 0d 0a 7b 0d 0a 20 20 20 20 2f 2f 2f 20 3c 73 ngine.InputSystem..{......///.<s
1820 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 2f 2f 2f 20 54 68 69 73 20 69 73 20 74 68 65 20 63 65 6e ummary>......///.This.is.the.cen
1840 74 72 61 6c 20 68 75 62 20 66 6f 72 20 74 68 65 20 69 6e 70 75 74 20 73 79 73 74 65 6d 2e 0d 0a tral.hub.for.the.input.system...
1860 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 2f 2f 2f 20 3c 72 65 6d ....///.</summary>......///.<rem
1880 61 72 6b 73 3e 0d 0a 20 20 20 20 2f 2f 2f 20 54 68 69 73 20 63 6c 61 73 73 20 68 61 73 20 74 68 arks>......///.This.class.has.th
18a0 65 20 63 65 6e 74 72 61 6c 20 41 50 49 73 20 66 6f 72 20 77 6f 72 6b 69 6e 67 20 77 69 74 68 20 e.central.APIs.for.working.with.
18c0 74 68 65 20 69 6e 70 75 74 20 73 79 73 74 65 6d 2e 20 59 6f 75 0d 0a 20 20 20 20 2f 2f 2f 20 63 the.input.system..You......///.c
18e0 61 6e 20 6d 61 6e 61 67 65 20 64 65 76 69 63 65 73 20 61 76 61 69 6c 61 62 6c 65 20 69 6e 20 74 an.manage.devices.available.in.t
1900 68 65 20 73 79 73 74 65 6d 20 28 3c 73 65 65 20 63 72 65 66 3d 22 41 64 64 44 65 76 69 63 65 7b he.system.(<see.cref="AddDevice{
1920 54 44 65 76 69 63 65 7d 22 2f 3e 2c 0d 0a 20 20 20 20 2f 2f 2f 20 3c 73 65 65 20 63 72 65 66 3d TDevice}"/>,......///.<see.cref=
1940 22 64 65 76 69 63 65 73 22 2f 3e 2c 20 3c 73 65 65 20 63 72 65 66 3d 22 6f 6e 44 65 76 69 63 65 "devices"/>,.<see.cref="onDevice
1960 43 68 61 6e 67 65 22 2f 3e 20 61 6e 64 20 72 65 6c 61 74 65 64 20 41 50 49 73 29 20 6f 72 20 65 Change"/>.and.related.APIs).or.e
1980 78 74 65 6e 64 0d 0a 20 20 20 20 2f 2f 2f 20 74 68 65 20 69 6e 70 75 74 20 73 79 73 74 65 6d 20 xtend......///.the.input.system.
19a0 77 69 74 68 20 63 75 73 74 6f 6d 20 66 75 6e 63 74 69 6f 6e 61 6c 69 74 79 20 28 3c 73 65 65 20 with.custom.functionality.(<see.
19c0 63 72 65 66 3d 22 52 65 67 69 73 74 65 72 4c 61 79 6f 75 74 7b 54 4c 61 79 6f 75 74 7d 22 2f 3e cref="RegisterLayout{TLayout}"/>
19e0 2c 0d 0a 20 20 20 20 2f 2f 2f 20 3c 73 65 65 20 63 72 65 66 3d 22 52 65 67 69 73 74 65 72 49 6e ,......///.<see.cref="RegisterIn
1a00 74 65 72 61 63 74 69 6f 6e 7b 54 7d 22 2f 3e 2c 20 3c 73 65 65 20 63 72 65 66 3d 22 52 65 67 69 teraction{T}"/>,.<see.cref="Regi
1a20 73 74 65 72 50 72 6f 63 65 73 73 6f 72 7b 54 7d 22 2f 3e 2c 0d 0a 20 20 20 20 2f 2f 2f 20 3c 73 sterProcessor{T}"/>,......///.<s
1a40 65 65 20 63 72 65 66 3d 22 52 65 67 69 73 74 65 72 42 69 6e 64 69 6e 67 43 6f 6d 70 6f 73 69 74 ee.cref="RegisterBindingComposit
1a60 65 7b 54 7d 22 2f 3e 2c 20 61 6e 64 20 72 65 6c 61 74 65 64 20 41 50 49 73 29 2e 0d 0a 20 20 20 e{T}"/>,.and.related.APIs)......
1a80 20 2f 2f 2f 0d 0a 20 20 20 20 2f 2f 2f 20 54 6f 20 63 6f 6e 74 72 6f 6c 20 68 61 70 74 69 63 73 .///......///.To.control.haptics
1aa0 20 67 6c 6f 62 61 6c 6c 79 2c 20 79 6f 75 20 63 61 6e 20 75 73 65 20 3c 73 65 65 20 63 72 65 66 .globally,.you.can.use.<see.cref
1ac0 3d 22 50 61 75 73 65 48 61 70 74 69 63 73 22 2f 3e 2c 20 3c 73 65 65 20 63 72 65 66 3d 22 52 65 ="PauseHaptics"/>,.<see.cref="Re
1ae0 73 75 6d 65 48 61 70 74 69 63 73 22 2f 3e 2c 0d 0a 20 20 20 20 2f 2f 2f 20 61 6e 64 20 3c 73 65 sumeHaptics"/>,......///.and.<se
1b00 65 20 63 72 65 66 3d 22 52 65 73 65 74 48 61 70 74 69 63 73 22 2f 3e 2e 0d 0a 20 20 20 20 2f 2f e.cref="ResetHaptics"/>.......//
1b20 2f 0d 0a 20 20 20 20 2f 2f 2f 20 54 6f 20 65 6e 61 62 6c 65 20 61 6e 64 20 64 69 73 61 62 6c 65 /......///.To.enable.and.disable
1b40 20 69 6e 64 69 76 69 64 75 61 6c 20 64 65 76 69 63 65 73 20 28 73 75 63 68 20 61 73 20 3c 73 65 .individual.devices.(such.as.<se
1b60 65 20 63 72 65 66 3d 22 53 65 6e 73 6f 72 22 2f 3e 20 64 65 76 69 63 65 73 29 2c 0d 0a 20 20 20 e.cref="Sensor"/>.devices),.....
1b80 20 2f 2f 2f 20 79 6f 75 20 63 61 6e 20 75 73 65 20 3c 73 65 65 20 63 72 65 66 3d 22 45 6e 61 62 .///.you.can.use.<see.cref="Enab
1ba0 6c 65 44 65 76 69 63 65 22 2f 3e 20 61 6e 64 20 3c 73 65 65 20 63 72 65 66 3d 22 44 69 73 61 62 leDevice"/>.and.<see.cref="Disab
1bc0 6c 65 44 65 76 69 63 65 22 2f 3e 2e 0d 0a 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 2f 2f 2f 20 54 leDevice"/>.......///......///.T
1be0 68 65 20 69 6e 70 75 74 20 73 79 73 74 65 6d 20 69 73 20 69 6e 69 74 69 61 6c 69 7a 65 64 20 61 he.input.system.is.initialized.a
1c00 73 20 70 61 72 74 20 6f 66 20 55 6e 69 74 79 20 73 74 61 72 74 69 6e 67 20 75 70 2e 20 49 74 20 s.part.of.Unity.starting.up..It.
1c20 69 73 20 67 65 6e 65 72 61 6c 6c 79 20 73 61 66 65 0d 0a 20 20 20 20 2f 2f 2f 20 74 6f 20 63 61 is.generally.safe......///.to.ca
1c40 6c 6c 20 74 68 65 20 41 50 49 73 20 68 65 72 65 20 66 72 6f 6d 20 61 6e 79 20 6f 66 20 55 6e 69 ll.the.APIs.here.from.any.of.Uni
1c60 74 79 27 73 20 73 63 72 69 70 74 20 63 61 6c 6c 62 61 63 6b 73 2e 0d 0a 20 20 20 20 2f 2f 2f 0d ty's.script.callbacks.......///.
1c80 0a 20 20 20 20 2f 2f 2f 20 4e 6f 74 65 20 74 68 61 74 2c 20 6c 69 6b 65 20 6d 6f 73 74 20 55 6e .....///.Note.that,.like.most.Un
1ca0 69 74 79 20 41 50 49 73 2c 20 6d 6f 73 74 20 6f 66 20 74 68 65 20 70 72 6f 70 65 72 74 69 65 73 ity.APIs,.most.of.the.properties
1cc0 20 61 6e 64 20 6d 65 74 68 6f 64 73 20 69 6e 20 74 68 69 73 20 41 50 49 20 63 61 6e 20 6f 6e 6c .and.methods.in.this.API.can.onl
1ce0 79 0d 0a 20 20 20 20 2f 2f 2f 20 62 65 20 63 61 6c 6c 65 64 20 6f 6e 20 74 68 65 20 6d 61 69 6e y......///.be.called.on.the.main
1d00 20 74 68 72 65 61 64 2e 20 48 6f 77 65 76 65 72 2c 20 73 65 6c 65 63 74 20 41 50 49 73 20 6c 69 .thread..However,.select.APIs.li
1d20 6b 65 20 3c 73 65 65 20 63 72 65 66 3d 22 51 75 65 75 65 45 76 65 6e 74 22 2f 3e 20 63 61 6e 20 ke.<see.cref="QueueEvent"/>.can.
1d40 62 65 0d 0a 20 20 20 20 2f 2f 2f 20 63 61 6c 6c 65 64 20 66 72 6f 6d 20 74 68 72 65 61 64 73 2e be......///.called.from.threads.
1d60 20 57 68 65 72 65 20 74 68 69 73 20 69 73 20 74 68 65 20 63 61 73 65 2c 20 69 74 20 69 73 20 73 .Where.this.is.the.case,.it.is.s
1d80 74 61 74 65 64 20 69 6e 20 74 68 65 20 64 6f 63 75 6d 65 6e 74 61 74 69 6f 6e 2e 0d 0a 20 20 20 tated.in.the.documentation......
1da0 20 2f 2f 2f 20 3c 2f 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 5b 53 79 73 74 65 6d 2e 44 69 61 .///.</remarks>......[System.Dia
1dc0 67 6e 6f 73 74 69 63 73 2e 43 6f 64 65 41 6e 61 6c 79 73 69 73 2e 53 75 70 70 72 65 73 73 4d 65 gnostics.CodeAnalysis.SuppressMe
1de0 73 73 61 67 65 28 22 4d 69 63 72 6f 73 6f 66 74 2e 4e 61 6d 69 6e 67 22 2c 20 22 43 41 31 37 32 ssage("Microsoft.Naming",."CA172
1e00 34 3a 54 79 70 65 4e 61 6d 65 73 53 68 6f 75 6c 64 4e 6f 74 4d 61 74 63 68 4e 61 6d 65 73 70 61 4:TypeNamesShouldNotMatchNamespa
1e20 63 65 73 22 2c 20 4a 75 73 74 69 66 69 63 61 74 69 6f 6e 20 3d 20 22 4f 70 74 69 6f 6e 73 20 66 ces",.Justification.=."Options.f
1e40 6f 72 20 6e 61 6d 65 73 70 61 63 65 73 20 61 72 65 20 6c 69 6d 69 74 65 64 20 64 75 65 20 74 6f or.namespaces.are.limited.due.to
1e60 20 74 68 65 20 6c 65 67 61 63 79 20 69 6e 70 75 74 20 63 6c 61 73 73 2e 20 41 67 72 65 65 64 20 .the.legacy.input.class..Agreed.
1e80 6f 6e 20 74 68 69 73 20 61 73 20 74 68 65 20 6c 65 61 73 74 20 62 61 64 20 73 6f 6c 75 74 69 6f on.this.as.the.least.bad.solutio
1ea0 6e 2e 22 29 5d 0d 0a 23 69 66 20 55 4e 49 54 59 5f 45 44 49 54 4f 52 0d 0a 20 20 20 20 5b 49 6e n.")]..#if.UNITY_EDITOR......[In
1ec0 69 74 69 61 6c 69 7a 65 4f 6e 4c 6f 61 64 5d 0d 0a 23 65 6e 64 69 66 0d 0a 20 20 20 20 70 75 62 itializeOnLoad]..#endif......pub
1ee0 6c 69 63 20 73 74 61 74 69 63 20 63 6c 61 73 73 20 49 6e 70 75 74 53 79 73 74 65 6d 0d 0a 20 20 lic.static.class.InputSystem....
1f00 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 23 72 65 67 69 6f 6e 20 4c 61 79 6f 75 74 73 0d 0a 0d 0a ..{..........#region.Layouts....
1f20 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>........../
1f40 2f 2f 20 45 76 65 6e 74 20 74 68 61 74 20 69 73 20 73 69 67 6e 61 6c 6c 65 64 20 77 68 65 6e 20 //.Event.that.is.signalled.when.
1f60 74 68 65 20 6c 61 79 6f 75 74 20 73 65 74 75 70 20 69 6e 20 74 68 65 20 73 79 73 74 65 6d 20 63 the.layout.setup.in.the.system.c
1f80 68 61 6e 67 65 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 hanges...........///.</summary>.
1fa0 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 .........///.<remarks>..........
1fc0 2f 2f 2f 20 46 69 72 73 74 20 70 61 72 61 6d 65 74 65 72 20 69 73 20 74 68 65 20 6e 61 6d 65 20 ///.First.parameter.is.the.name.
1fe0 6f 66 20 74 68 65 20 6c 61 79 6f 75 74 20 74 68 61 74 20 68 61 73 20 63 68 61 6e 67 65 64 20 61 of.the.layout.that.has.changed.a
2000 6e 64 20 73 65 63 6f 6e 64 20 70 61 72 61 6d 65 74 65 72 20 69 73 20 74 68 65 0d 0a 20 20 20 20 nd.second.parameter.is.the......
2020 20 20 20 20 2f 2f 2f 20 74 79 70 65 20 6f 66 20 63 68 61 6e 67 65 20 74 68 61 74 20 68 61 73 20 ....///.type.of.change.that.has.
2040 6f 63 63 75 72 72 65 64 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 occurred...........///..........
2060 2f 2f 2f 20 3c 65 78 61 6d 70 6c 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 63 6f 64 65 ///.<example>..........///.<code
2080 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 6e 70 75 74 53 79 73 74 65 6d 2e 6f 6e 4c 61 79 >..........///.InputSystem.onLay
20a0 6f 75 74 43 68 61 6e 67 65 20 2b 3d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 28 6e outChange.+=..........///.....(n
20c0 61 6d 65 2c 20 63 68 61 6e 67 65 29 20 3d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 ame,.change).=>..........///....
20e0 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 73 77 69 74 63 68 20 28 .{..........///.........switch.(
2100 63 68 61 6e 67 65 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 7b 0d 0a change)..........///.........{..
2120 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 73 65 20 49 6e 70 ........///.............case.Inp
2140 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 43 68 61 6e 67 65 2e 41 64 64 65 64 3a 0d 0a 20 20 utControlLayoutChange.Added:....
2160 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 44 65 62 75 67 2e ......///.................Debug.
2180 4c 6f 67 28 24 22 4e 65 77 20 6c 61 79 6f 75 74 20 7b 6e 61 6d 65 7d 20 68 61 73 20 62 65 65 6e Log($"New.layout.{name}.has.been
21a0 20 61 64 64 65 64 22 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 .added");..........///..........
21c0 20 20 20 20 20 20 20 62 72 65 61 6b 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 .......break;..........///......
21e0 20 20 20 20 20 20 20 63 61 73 65 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 43 68 .......case.InputControlLayoutCh
2200 61 6e 67 65 2e 52 65 6d 6f 76 65 64 3a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 ange.Removed:..........///......
2220 20 20 20 20 20 20 20 20 20 20 20 44 65 62 75 67 2e 4c 6f 67 28 24 22 4c 61 79 6f 75 74 20 7b 6e ...........Debug.Log($"Layout.{n
2240 61 6d 65 7d 20 68 61 73 20 62 65 65 6e 20 72 65 6d 6f 76 65 64 22 29 3b 0d 0a 20 20 20 20 20 20 ame}.has.been.removed");........
2260 20 20 2f 2f 2f 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;....
2280 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 73 65 20 49 6e 70 75 74 ......///.............case.Input
22a0 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 43 68 61 6e 67 65 2e 52 65 70 6c 61 63 65 64 3a 0d 0a 20 ControlLayoutChange.Replaced:...
22c0 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 44 65 62 75 67 .......///.................Debug
22e0 2e 4c 6f 67 28 24 22 4c 61 79 6f 75 74 20 7b 6e 61 6d 65 7d 20 68 61 73 20 62 65 65 6e 20 75 70 .Log($"Layout.{name}.has.been.up
2300 64 61 74 65 64 22 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 20 dated");..........///...........
2320 20 20 20 20 20 20 62 72 65 61 6b 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 ......break;..........///.......
2340 20 20 7d 0d 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 ..}..........///.....}..........
2360 2f 2f 2f 20 3c 2f 63 6f 64 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 65 78 61 6d 70 ///.</code>..........///.</examp
2380 6c 65 3e 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 0a 20 20 20 le>..........///.</remarks>.....
23a0 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e .....///.<seealso.cref="InputCon
23c0 74 72 6f 6c 4c 61 79 6f 75 74 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 trolLayout"/>..........public.st
23e0 61 74 69 63 20 65 76 65 6e 74 20 41 63 74 69 6f 6e 3c 73 74 72 69 6e 67 2c 20 49 6e 70 75 74 43 atic.event.Action<string,.InputC
2400 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 43 68 61 6e 67 65 3e 20 6f 6e 4c 61 79 6f 75 74 43 68 61 6e ontrolLayoutChange>.onLayoutChan
2420 67 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 61 64 64 0d 0a ge..........{..............add..
2440 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 6c ............{..................l
2460 6f 63 6b 20 28 73 5f 4d 61 6e 61 67 65 72 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ock.(s_Manager).................
2480 20 20 20 20 20 73 5f 4d 61 6e 61 67 65 72 2e 6f 6e 4c 61 79 6f 75 74 43 68 61 6e 67 65 20 2b 3d .....s_Manager.onLayoutChange.+=
24a0 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 20 .value;..............}..........
24c0 20 20 20 20 72 65 6d 6f 76 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 ....remove..............{.......
24e0 20 20 20 20 20 20 20 20 20 20 20 6c 6f 63 6b 20 28 73 5f 4d 61 6e 61 67 65 72 29 0d 0a 20 20 20 ...........lock.(s_Manager).....
2500 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 4d 61 6e 61 67 65 72 2e 6f 6e 4c 61 79 .................s_Manager.onLay
2520 6f 75 74 43 68 61 6e 67 65 20 2d 3d 20 76 61 6c 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 outChange.-=.value;.............
2540 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 75 .}..........}............///.<su
2560 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 52 65 67 69 73 74 65 72 20 61 20 63 mmary>..........///.Register.a.c
2580 6f 6e 74 72 6f 6c 20 6c 61 79 6f 75 74 20 62 61 73 65 64 20 6f 6e 20 61 20 74 79 70 65 2e 0d 0a ontrol.layout.based.on.a.type...
25a0 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>..........
25c0 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 74 79 70 65 22 3e 54 79 70 65 20 74 6f 20 64 ///.<param.name="type">Type.to.d
25e0 65 72 69 76 65 20 61 20 63 6f 6e 74 72 6f 6c 20 6c 61 79 6f 75 74 20 66 72 6f 6d 2e 20 4d 75 73 erive.a.control.layout.from..Mus
2600 74 20 62 65 20 64 65 72 69 76 65 64 20 66 72 6f 6d 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 t.be.derived.from.<see.cref="Inp
2620 75 74 43 6f 6e 74 72 6f 6c 22 2f 3e 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f utControl"/>.</param>........../
2640 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 6e 61 6d 65 22 3e 4e 61 6d 65 20 74 6f 20 75 73 //.<param.name="name">Name.to.us
2660 65 20 66 6f 72 20 74 68 65 20 6c 61 79 6f 75 74 2e 20 49 66 20 6e 75 6c 6c 20 6f 72 20 65 6d 70 e.for.the.layout..If.null.or.emp
2680 74 79 2c 20 74 68 65 20 73 68 6f 72 74 20 6e 61 6d 65 20 6f 66 20 74 68 65 20 74 79 70 65 20 28 ty,.the.short.name.of.the.type.(
26a0 3c 73 65 65 20 63 72 65 66 3d 22 54 79 70 65 2e 4e 61 6d 65 22 2f 3e 29 20 77 69 6c 6c 20 62 65 <see.cref="Type.Name"/>).will.be
26c0 20 75 73 65 64 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 .used.</param>..........///.<par
26e0 61 6d 20 6e 61 6d 65 3d 22 6d 61 74 63 68 65 73 22 3e 4f 70 74 69 6f 6e 61 6c 20 64 65 76 69 63 am.name="matches">Optional.devic
2700 65 20 6d 61 74 63 68 65 72 2e 20 49 66 20 74 68 69 73 20 69 73 20 73 75 70 70 6c 69 65 64 2c 20 e.matcher..If.this.is.supplied,.
2720 74 68 65 20 6c 61 79 6f 75 74 20 77 69 6c 6c 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c 79 0d 0a 20 the.layout.will.automatically...
2740 20 20 20 20 20 20 20 2f 2f 2f 20 62 65 20 69 6e 73 74 61 6e 74 69 61 74 65 64 20 66 6f 72 20 6e .......///.be.instantiated.for.n
2760 65 77 6c 79 20 64 69 73 63 6f 76 65 72 65 64 20 64 65 76 69 63 65 73 20 74 68 61 74 20 6d 61 74 ewly.discovered.devices.that.mat
2780 63 68 20 74 68 65 20 64 65 73 63 72 69 70 74 69 6f 6e 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 ch.the.description.</param>.....
27a0 20 20 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 .....///.<remarks>..........///.
27c0 57 68 65 6e 20 74 68 65 20 6c 61 79 6f 75 74 20 69 73 20 69 6e 73 74 61 6e 74 69 61 74 65 64 2c When.the.layout.is.instantiated,
27e0 20 74 68 65 20 73 79 73 74 65 6d 20 77 69 6c 6c 20 72 65 66 6c 65 63 74 20 6f 6e 20 61 6c 6c 20 .the.system.will.reflect.on.all.
2800 70 75 62 6c 69 63 20 66 69 65 6c 64 73 20 61 6e 64 20 70 72 6f 70 65 72 74 69 65 73 20 6f 66 20 public.fields.and.properties.of.
2820 74 68 65 20 74 79 70 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 77 68 69 63 68 20 68 61 76 65 the.type..........///.which.have
2840 20 61 20 76 61 6c 75 65 20 74 79 70 65 20 64 65 72 69 76 65 64 20 66 72 6f 6d 20 3c 73 65 65 20 .a.value.type.derived.from.<see.
2860 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 22 2f 3e 20 6f 72 20 77 68 69 63 68 20 61 cref="InputControl"/>.or.which.a
2880 72 65 20 61 6e 6e 6f 74 61 74 65 64 20 77 69 74 68 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 re.annotated.with.<see.cref="Inp
28a0 75 74 43 6f 6e 74 72 6f 6c 41 74 74 72 69 62 75 74 65 22 2f 3e 2e 0d 0a 20 20 20 20 20 20 20 20 utControlAttribute"/>...........
28c0 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 68 65 20 74 79 70 65 20 63 61 6e 20 62 65 ///..........///.The.type.can.be
28e0 20 61 6e 6e 6f 74 61 74 65 64 20 77 69 74 68 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 .annotated.with.<see.cref="Input
2900 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 41 74 74 72 69 62 75 74 65 22 2f 3e 20 66 6f 72 20 61 64 ControlLayoutAttribute"/>.for.ad
2920 64 69 74 69 6f 6e 61 6c 20 6f 70 74 69 6f 6e 73 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 62 75 ditional.options..........///.bu
2940 74 20 74 68 65 20 61 74 74 72 69 62 75 74 65 20 69 73 20 6e 6f 74 20 6e 65 63 65 73 73 61 72 79 t.the.attribute.is.not.necessary
2960 20 66 6f 72 20 61 20 74 79 70 65 20 74 6f 20 62 65 20 75 73 61 62 6c 65 20 61 73 20 61 20 63 6f .for.a.type.to.be.usable.as.a.co
2980 6e 74 72 6f 6c 20 6c 61 79 6f 75 74 2e 20 4e 6f 74 65 20 74 68 61 74 20 69 66 20 74 68 65 20 74 ntrol.layout..Note.that.if.the.t
29a0 79 70 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 64 6f 65 73 20 68 61 76 65 20 3c 73 65 65 20 ype..........///.does.have.<see.
29c0 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 41 74 74 72 69 62 75 74 cref="InputControlLayoutAttribut
29e0 65 22 2f 3e 20 61 6e 64 20 68 61 73 20 73 65 74 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 e"/>.and.has.set.<see.cref="Inpu
2a00 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 41 74 74 72 69 62 75 74 65 2e 73 74 61 74 65 54 79 70 tControlLayoutAttribute.stateTyp
2a20 65 22 2f 3e 2c 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 74 68 65 20 73 79 73 74 65 6d 20 77 69 e"/>,..........///.the.system.wi
2a40 6c 6c 20 3c 65 6d 3e 6e 6f 74 3c 2f 65 6d 3e 20 72 65 66 6c 65 63 74 20 6f 6e 20 70 72 6f 70 65 ll.<em>not</em>.reflect.on.prope
2a60 72 74 69 65 73 20 61 6e 64 20 66 69 65 6c 64 73 20 69 6e 20 74 68 65 20 74 79 70 65 20 62 75 74 rties.and.fields.in.the.type.but
2a80 20 64 6f 20 74 68 61 74 20 6f 6e 20 74 68 65 20 67 69 76 65 6e 0d 0a 20 20 20 20 20 20 20 20 2f .do.that.on.the.given........../
2aa0 2f 2f 20 73 74 61 74 65 20 74 79 70 65 20 69 6e 73 74 65 61 64 2e 0d 0a 20 20 20 20 20 20 20 20 //.state.type.instead...........
2ac0 2f 2f 2f 0d 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 ///..........///.<example>......
2ae0 20 20 20 20 2f 2f 2f 20 3c 63 6f 64 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 2f 2f 20 49 ....///.<code>..........///.//.I
2b00 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 41 74 74 72 69 62 75 74 65 20 61 74 74 72 69 nputControlLayoutAttribute.attri
2b20 62 75 74 65 20 69 73 20 6f 6e 6c 79 20 6e 65 63 65 73 73 61 72 79 20 69 66 20 79 6f 75 20 77 61 bute.is.only.necessary.if.you.wa
2b40 6e 74 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 2f 2f 20 74 6f 20 6f 76 65 72 72 69 64 65 20 64 nt..........///.//.to.override.d
2b60 65 66 61 75 6c 74 20 62 65 68 61 76 69 6f 72 20 74 68 61 74 20 6f 63 63 75 72 73 20 77 68 65 6e efault.behavior.that.occurs.when
2b80 20 72 65 67 69 73 74 65 72 69 6e 67 20 79 6f 75 72 20 64 65 76 69 63 65 0d 0a 20 20 20 20 20 20 .registering.your.device........
2ba0 20 20 2f 2f 2f 20 2f 2f 20 61 73 20 61 20 6c 61 79 6f 75 74 2e 0d 0a 20 20 20 20 20 20 20 20 2f ..///.//.as.a.layout.........../
2bc0 2f 2f 20 2f 2f 20 54 68 65 20 6d 6f 73 74 20 63 6f 6d 6d 6f 6e 20 75 73 65 20 6f 66 20 49 6e 70 //.//.The.most.common.use.of.Inp
2be0 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 41 74 74 72 69 62 75 74 65 20 69 73 20 74 6f 20 64 utControlLayoutAttribute.is.to.d
2c00 69 72 65 63 74 20 74 68 65 20 73 79 73 74 65 6d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 2f 2f irect.the.system..........///.//
2c20 20 74 6f 20 61 20 63 75 73 74 6f 6d 20 22 73 74 61 74 65 20 73 74 72 75 63 74 22 20 74 68 72 6f .to.a.custom."state.struct".thro
2c40 75 67 68 20 74 68 65 20 60 73 74 61 74 65 54 79 70 65 60 20 70 72 6f 70 65 72 74 79 2e 20 53 65 ugh.the.`stateType`.property..Se
2c60 65 20 62 65 6c 6f 77 20 66 6f 72 20 64 65 74 61 69 6c 73 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f e.below.for.details...........//
2c80 2f 20 5b 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 28 64 69 73 70 6c 61 79 4e 61 6d /.[InputControlLayout(displayNam
2ca0 65 20 3d 20 22 4d 79 20 44 65 76 69 63 65 22 2c 20 73 74 61 74 65 54 79 70 65 20 3d 20 74 79 70 e.=."My.Device",.stateType.=.typ
2cc0 65 6f 66 28 4d 79 44 65 76 69 63 65 53 74 61 74 65 29 29 5d 0d 0a 20 20 20 20 20 20 20 20 2f 2f eof(MyDeviceState))]..........//
2ce0 2f 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 2f 20 /.#if.UNITY_EDITOR..........///.
2d00 5b 49 6e 69 74 69 61 6c 69 7a 65 4f 6e 4c 6f 61 64 5d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 [InitializeOnLoad]..........///.
2d20 23 65 6e 64 69 66 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 #endif..........///.public.class
2d40 20 4d 79 44 65 76 69 63 65 20 3a 20 49 6e 70 75 74 44 65 76 69 63 65 0d 0a 20 20 20 20 20 20 20 .MyDevice.:.InputDevice.........
2d60 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 42 .///.{..........///.....public.B
2d80 75 74 74 6f 6e 43 6f 6e 74 72 6f 6c 20 62 75 74 74 6f 6e 20 7b 20 67 65 74 3b 20 70 72 69 76 61 uttonControl.button.{.get;.priva
2da0 74 65 20 73 65 74 3b 20 7d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 70 75 62 6c 69 te.set;.}..........///.....publi
2dc0 63 20 41 78 69 73 43 6f 6e 74 72 6f 6c 20 61 78 69 73 20 7b 20 67 65 74 3b 20 70 72 69 76 61 74 c.AxisControl.axis.{.get;.privat
2de0 65 20 73 65 74 3b 20 7d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f e.set;.}..........///........../
2e00 2f 2f 20 20 20 20 20 2f 2f 20 52 65 67 69 73 74 65 72 20 74 68 65 20 64 65 76 69 63 65 2e 0d 0a //.....//.Register.the.device...
2e20 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 73 74 61 74 69 63 20 4d 79 44 65 76 69 63 65 28 ........///.....static.MyDevice(
2e40 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f )..........///.....{..........//
2e60 2f 20 20 20 20 20 20 20 20 20 2f 2f 20 49 6e 20 63 61 73 65 20 79 6f 75 20 77 61 6e 74 20 69 6e /.........//.In.case.you.want.in
2e80 73 74 61 6e 63 65 20 6f 66 20 79 6f 75 72 20 64 65 76 69 63 65 20 74 6f 20 61 75 74 6f 6d 61 74 stance.of.your.device.to.automat
2ea0 69 63 61 6c 6c 79 20 62 65 20 63 72 65 61 74 65 64 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 ically.be.created..........///..
2ec0 20 20 20 20 20 20 20 2f 2f 20 77 68 65 6e 20 73 70 65 63 69 66 69 63 20 68 61 72 64 77 61 72 65 .......//.when.specific.hardware
2ee0 20 69 73 20 64 65 74 65 63 74 65 64 20 62 79 20 74 68 65 20 55 6e 69 74 79 20 72 75 6e 74 69 6d .is.detected.by.the.Unity.runtim
2f00 65 2c 20 79 6f 75 20 68 61 76 65 20 74 6f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 e,.you.have.to..........///.....
2f20 20 20 20 20 2f 2f 20 61 64 64 20 6f 6e 65 20 6f 72 20 6d 6f 72 65 20 22 64 65 76 69 63 65 20 6d ....//.add.one.or.more."device.m
2f40 61 74 63 68 65 72 73 22 20 28 49 6e 70 75 74 44 65 76 69 63 65 4d 61 74 63 68 65 72 29 20 66 6f atchers".(InputDeviceMatcher).fo
2f60 72 20 74 68 65 20 6c 61 79 6f 75 74 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 r.the.layout...........///......
2f80 20 20 20 2f 2f 20 54 68 65 73 65 20 6d 61 74 63 68 65 72 73 20 61 72 65 20 63 6f 6d 70 61 72 65 ...//.These.matchers.are.compare
2fa0 64 20 74 6f 20 61 6e 20 49 6e 70 75 74 44 65 76 69 63 65 44 65 73 63 72 69 70 74 69 6f 6e 20 72 d.to.an.InputDeviceDescription.r
2fc0 65 63 65 69 76 65 64 20 66 72 6f 6d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 eceived.from..........///.......
2fe0 20 20 2f 2f 20 74 68 65 20 55 6e 69 74 79 20 72 75 6e 74 69 6d 65 20 77 68 65 6e 20 61 20 64 65 ..//.the.Unity.runtime.when.a.de
3000 76 69 63 65 20 69 73 20 63 6f 6e 6e 65 63 74 65 64 2e 20 59 6f 75 20 63 61 6e 20 61 64 64 20 74 vice.is.connected..You.can.add.t
3020 68 65 6d 20 65 69 74 68 65 72 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 hem.either..........///.........
3040 2f 2f 20 75 73 69 6e 67 20 49 6e 70 75 74 53 79 73 74 65 6d 2e 52 65 67 69 73 74 65 72 4c 61 79 //.using.InputSystem.RegisterLay
3060 6f 75 74 4d 61 74 63 68 65 72 28 29 20 6f 72 20 62 79 20 64 69 72 65 63 74 6c 79 20 73 70 65 63 outMatcher().or.by.directly.spec
3080 69 66 79 69 6e 67 20 61 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 2f 2f ifying.a..........///.........//
30a0 20 6d 61 74 63 68 65 72 20 77 68 65 6e 20 72 65 67 69 73 74 65 72 69 6e 67 20 74 68 65 20 6c 61 .matcher.when.registering.the.la
30c0 79 6f 75 74 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 49 6e 70 75 74 yout...........///.........Input
30e0 53 79 73 74 65 6d 2e 52 65 67 69 73 74 65 72 4c 61 79 6f 75 74 26 6c 74 3b 4d 79 44 65 76 69 63 System.RegisterLayout&lt;MyDevic
3100 65 26 67 74 3b 28 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 e&gt;(..........///.............
3120 2f 2f 20 46 6f 72 20 74 68 65 20 73 61 6b 65 20 6f 66 20 64 65 6d 6f 6e 73 74 72 61 74 69 6f 6e //.For.the.sake.of.demonstration
3140 2c 20 6c 65 74 27 73 20 61 73 73 75 6d 65 20 79 6f 75 72 20 64 65 76 69 63 65 20 69 73 20 61 20 ,.let's.assume.your.device.is.a.
3160 48 49 44 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 HID..........///.............//.
3180 61 6e 64 20 79 6f 75 20 77 61 6e 74 20 74 6f 20 6d 61 74 63 68 20 62 79 20 50 49 44 20 61 6e 64 and.you.want.to.match.by.PID.and
31a0 20 56 49 44 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 6d .VID...........///.............m
31c0 61 74 63 68 65 73 3a 20 6e 65 77 20 49 6e 70 75 74 44 65 76 69 63 65 4d 61 74 63 68 65 72 28 29 atches:.new.InputDeviceMatcher()
31e0 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2e 57 ..........///..................W
3200 69 74 68 49 6e 74 65 72 66 61 63 65 28 22 48 49 44 22 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f ithInterface("HID")..........///
3220 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2e 57 69 74 68 43 61 70 61 62 69 6c 69 74 79 ..................WithCapability
3240 28 22 50 49 44 22 2c 20 31 32 33 34 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 ("PID",.1234)..........///......
3260 20 20 20 20 20 20 20 20 20 20 20 2e 57 69 74 68 43 61 70 61 62 69 6c 69 74 79 28 22 56 49 44 22 ............WithCapability("VID"
3280 2c 20 35 36 37 38 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 7d 0d 0a 20 20 ,.5678));..........///.....}....
32a0 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 2f 2f 20 54 68 ......///..........///.....//.Th
32c0 69 73 20 69 73 20 6f 6e 6c 79 20 74 6f 20 74 72 69 67 67 65 72 20 74 68 65 20 73 74 61 74 69 63 is.is.only.to.trigger.the.static
32e0 20 63 6c 61 73 73 20 63 6f 6e 73 74 72 75 63 74 6f 72 20 74 6f 20 61 75 74 6f 6d 61 74 69 63 61 .class.constructor.to.automatica
3300 6c 6c 79 20 72 75 6e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 2f 2f 20 69 6e 20 74 lly.run..........///.....//.in.t
3320 68 65 20 70 6c 61 79 65 72 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 5b 52 75 6e he.player...........///.....[Run
3340 74 69 6d 65 49 6e 69 74 69 61 6c 69 7a 65 4f 6e 4c 6f 61 64 4d 65 74 68 6f 64 5d 0d 0a 20 20 20 timeInitializeOnLoadMethod].....
3360 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 70 72 69 76 61 74 65 20 73 74 61 74 69 63 20 76 6f 69 64 .....///.....private.static.void
3380 20 49 6e 69 74 69 61 6c 69 7a 65 49 6e 50 6c 61 79 65 72 28 29 20 7b 7d 0d 0a 20 20 20 20 20 20 .InitializeInPlayer().{}........
33a0 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 70 72 6f 74 65 63 74 65 64 ..///..........///.....protected
33c0 20 6f 76 65 72 72 69 64 65 20 76 6f 69 64 20 46 69 6e 69 73 68 53 65 74 75 70 28 29 0d 0a 20 20 .override.void.FinishSetup()....
33e0 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 ......///.....{..........///....
3400 20 20 20 20 20 62 61 73 65 2e 46 69 6e 69 73 68 53 65 74 75 70 28 29 3b 0d 0a 20 20 20 20 20 20 .....base.FinishSetup();........
3420 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 62 75 74 74 6f 6e 20 3d 20 47 65 74 43 68 69 6c 64 43 ..///.........button.=.GetChildC
3440 6f 6e 74 72 6f 6c 26 6c 74 3b 42 75 74 74 6f 6e 43 6f 6e 74 72 6f 6c 26 67 74 3b 28 22 62 75 74 ontrol&lt;ButtonControl&gt;("but
3460 74 6f 6e 22 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 61 78 69 73 ton");..........///.........axis
3480 20 3d 20 47 65 74 43 68 69 6c 64 43 6f 6e 74 72 6f 6c 26 6c 74 3b 41 78 69 73 43 6f 6e 74 72 6f .=.GetChildControl&lt;AxisContro
34a0 6c 26 67 74 3b 28 22 61 78 69 73 22 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 l&gt;("axis");..........///.....
34c0 7d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 7d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 }..........///.}..........///...
34e0 20 20 20 20 20 20 20 2f 2f 2f 20 2f 2f 20 41 20 22 73 74 61 74 65 20 73 74 72 75 63 74 22 20 64 .......///.//.A."state.struct".d
3500 65 73 63 72 69 62 65 73 20 74 68 65 20 6d 65 6d 6f 72 79 20 66 6f 72 6d 61 74 20 75 73 65 64 20 escribes.the.memory.format.used.
3520 62 79 20 61 20 64 65 76 69 63 65 2e 20 45 61 63 68 20 64 65 76 69 63 65 20 63 61 6e 0d 0a 20 20 by.a.device..Each.device.can....
3540 20 20 20 20 20 20 2f 2f 2f 20 2f 2f 20 72 65 63 65 69 76 65 20 61 6e 64 20 73 74 6f 72 65 20 6d ......///.//.receive.and.store.m
3560 65 6d 6f 72 79 20 69 6e 20 69 74 73 20 63 75 73 74 6f 6d 20 66 6f 72 6d 61 74 2e 20 49 6e 70 75 emory.in.its.custom.format..Inpu
3580 74 43 6f 6e 74 72 6f 6c 73 20 61 72 65 20 74 68 65 6e 20 63 6f 6e 6e 65 63 74 65 64 0d 0a 20 20 tControls.are.then.connected....
35a0 20 20 20 20 20 20 2f 2f 2f 20 2f 2f 20 74 68 65 20 69 6e 64 69 76 69 64 75 61 6c 20 70 69 65 63 ......///.//.the.individual.piec
35c0 65 73 20 6f 66 20 6d 65 6d 6f 72 79 20 61 6e 64 20 72 65 61 64 20 6f 75 74 20 76 61 6c 75 65 73 es.of.memory.and.read.out.values
35e0 20 66 72 6f 6d 20 74 68 65 6d 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 5b 53 74 72 75 63 74 .from.them...........///.[Struct
3600 4c 61 79 6f 75 74 28 4c 61 79 6f 75 74 4b 69 6e 64 2e 45 78 70 6c 69 63 69 74 2c 20 53 69 7a 65 Layout(LayoutKind.Explicit,.Size
3620 20 3d 20 33 32 29 5d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 70 75 62 6c 69 63 20 73 74 72 75 .=.32)]..........///.public.stru
3640 63 74 20 4d 79 44 65 76 69 63 65 53 74 61 74 65 20 3a 20 49 49 6e 70 75 74 53 74 61 74 65 54 79 ct.MyDeviceState.:.IInputStateTy
3660 70 65 49 6e 66 6f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f peInfo..........///.{........../
3680 2f 2f 20 20 20 20 20 2f 2f 20 49 6e 20 74 68 65 20 63 61 73 65 20 6f 66 20 61 20 48 49 44 20 28 //.....//.In.the.case.of.a.HID.(
36a0 77 68 69 63 68 20 77 65 20 61 73 73 75 6d 65 20 66 6f 72 20 74 68 65 20 73 61 6b 65 20 6f 66 20 which.we.assume.for.the.sake.of.
36c0 74 68 69 73 20 64 65 6d 6f 6e 73 74 72 61 74 69 6f 6e 29 2c 0d 0a 20 20 20 20 20 20 20 20 2f 2f this.demonstration),..........//
36e0 2f 20 20 20 20 20 2f 2f 20 74 68 65 20 66 6f 72 6d 61 74 20 77 69 6c 6c 20 62 65 20 22 48 49 44 /.....//.the.format.will.be."HID
3700 22 2e 20 49 6e 20 70 72 61 63 74 69 63 65 2c 20 74 68 65 20 66 6f 72 6d 61 74 20 77 69 6c 6c 20 "..In.practice,.the.format.will.
3720 64 65 70 65 6e 64 20 6f 6e 20 68 6f 77 20 79 6f 75 72 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 depend.on.how.your..........///.
3740 20 20 20 20 2f 2f 20 70 61 72 74 69 63 75 6c 61 72 20 64 65 76 69 63 65 20 69 73 20 63 6f 6e 6e ....//.particular.device.is.conn
3760 65 63 74 65 64 20 61 6e 64 20 66 65 64 20 69 6e 74 6f 20 74 68 65 20 69 6e 70 75 74 20 73 79 73 ected.and.fed.into.the.input.sys
3780 74 65 6d 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 2f 2f 20 54 68 65 20 66 6f 72 tem...........///.....//.The.for
37a0 6d 61 74 20 69 73 20 61 20 73 69 6d 70 6c 65 20 46 6f 75 72 43 43 20 63 6f 64 65 20 74 68 61 74 mat.is.a.simple.FourCC.code.that
37c0 20 22 74 61 67 73 22 20 73 74 61 74 65 20 6d 65 6d 6f 72 79 20 62 6c 6f 63 6b 73 20 66 6f 72 20 ."tags".state.memory.blocks.for.
37e0 74 68 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 2f 2f 20 64 65 76 69 63 65 20 74 the..........///.....//.device.t
3800 6f 20 67 69 76 65 20 61 20 62 61 73 65 20 6c 65 76 65 6c 20 6f 66 20 73 61 66 65 74 79 20 63 68 o.give.a.base.level.of.safety.ch
3820 65 63 6b 73 20 6f 6e 20 6d 65 6d 6f 72 79 20 6f 70 65 72 61 74 69 6f 6e 73 2e 0d 0a 20 20 20 20 ecks.on.memory.operations.......
3840 20 20 20 20 2f 2f 2f 20 20 20 20 20 70 75 62 6c 69 63 20 46 6f 75 72 43 43 20 66 6f 72 6d 61 74 ....///.....public.FourCC.format
3860 20 3d 3e 20 72 65 74 75 72 6e 20 6e 65 77 20 46 6f 75 72 43 43 28 27 48 27 2c 20 27 49 27 2c 20 .=>.return.new.FourCC('H',.'I',.
3880 27 44 27 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 'D');..........///..........///.
38a0 20 20 20 20 2f 2f 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 41 74 74 72 69 62 75 74 65 73 20 6f 6e ....//.InputControlAttributes.on
38c0 20 66 69 65 6c 64 73 20 74 65 6c 6c 20 74 68 65 20 69 6e 70 75 74 20 73 79 73 74 65 6d 20 74 6f .fields.tell.the.input.system.to
38e0 20 63 72 65 61 74 65 20 63 6f 6e 74 72 6f 6c 73 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 .create.controls..........///...
3900 20 20 2f 2f 20 66 6f 72 20 74 68 65 20 70 75 62 6c 69 63 20 66 69 65 6c 64 73 20 66 6f 75 6e 64 ..//.for.the.public.fields.found
3920 20 69 6e 20 74 68 65 20 73 74 72 75 63 74 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 .in.the.struct...........///....
3940 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 2f 2f 20 41 73 73 75 6d 65 20 61 20 31 36 62 69 74 20 ......///.....//.Assume.a.16bit.
3960 66 69 65 6c 64 20 6f 66 20 62 75 74 74 6f 6e 73 2e 20 43 72 65 61 74 65 20 6f 6e 65 20 62 75 74 field.of.buttons..Create.one.but
3980 74 6f 6e 20 74 68 61 74 20 69 73 20 74 69 65 64 20 74 6f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f ton.that.is.tied.to..........///
39a0 20 20 20 20 20 2f 2f 20 62 69 74 20 23 33 20 28 7a 65 72 6f 2d 62 61 73 65 64 29 2e 20 4e 6f 74 .....//.bit.#3.(zero-based)..Not
39c0 65 20 74 68 61 74 20 62 75 74 74 6f 6e 73 20 64 6f 20 6e 6f 74 20 6e 65 65 64 20 74 6f 20 62 65 e.that.buttons.do.not.need.to.be
39e0 20 73 74 6f 72 65 64 20 61 73 20 62 69 74 73 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 .stored.as.bits...........///...
3a00 20 20 2f 2f 20 54 68 65 79 20 63 61 6e 20 61 6c 73 6f 20 62 65 20 73 74 6f 72 65 64 20 61 73 20 ..//.They.can.also.be.stored.as.
3a20 66 6c 6f 61 74 73 20 6f 72 20 73 68 6f 72 74 73 2c 20 66 6f 72 20 65 78 61 6d 70 6c 65 2e 0d 0a floats.or.shorts,.for.example...
3a40 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 5b 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 28 6e 61 ........///.....[InputControl(na
3a60 6d 65 20 3d 20 22 62 75 74 74 6f 6e 22 2c 20 6c 61 79 6f 75 74 20 3d 20 22 42 75 74 74 6f 6e 22 me.=."button",.layout.=."Button"
3a80 2c 20 62 69 74 20 3d 20 33 29 5d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 70 75 62 ,.bit.=.3)]..........///.....pub
3aa0 6c 69 63 20 75 73 68 6f 72 74 20 62 75 74 74 6f 6e 73 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f lic.ushort.buttons;..........///
3ac0 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 2f 2f 20 43 72 65 61 74 65 20 61 20 66 6c ..........///.....//.Create.a.fl
3ae0 6f 61 74 69 6e 67 2d 70 6f 69 6e 74 20 61 78 69 73 2e 20 54 68 65 20 6e 61 6d 65 2c 20 69 66 20 oating-point.axis..The.name,.if.
3b00 6e 6f 74 20 73 75 70 70 6c 69 65 64 2c 20 69 73 20 74 61 6b 65 6e 20 66 72 6f 6d 0d 0a 20 20 20 not.supplied,.is.taken.from.....
3b20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 2f 2f 20 74 68 65 20 66 69 65 6c 64 2e 0d 0a 20 20 20 20 .....///.....//.the.field.......
3b40 20 20 20 20 2f 2f 2f 20 20 20 20 20 5b 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 28 6c 61 79 6f 75 74 ....///.....[InputControl(layout
3b60 20 3d 20 22 41 78 69 73 22 29 5d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 70 75 62 .=."Axis")]..........///.....pub
3b80 6c 69 63 20 73 68 6f 72 74 20 61 78 69 73 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 7d 0d 0a lic.short.axis;..........///.}..
3ba0 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 2f 2f 2f ........///.</code>..........///
3bc0 20 3c 2f 65 78 61 6d 70 6c 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 .</example>..........///........
3be0 20 20 2f 2f 2f 20 4e 6f 74 65 20 74 68 61 74 20 69 66 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d ..///.Note.that.if.<paramref.nam
3c00 65 3d 22 6d 61 74 63 68 65 73 22 2f 3e 20 69 73 20 73 75 70 70 6c 69 65 64 2c 20 69 74 20 77 69 e="matches"/>.is.supplied,.it.wi
3c20 6c 6c 20 69 6d 6d 65 64 69 61 74 65 6c 79 20 62 65 20 6d 61 74 63 68 65 64 0d 0a 20 20 20 20 20 ll.immediately.be.matched.......
3c40 20 20 20 2f 2f 2f 20 61 67 61 69 6e 73 74 20 74 68 65 20 64 65 73 63 72 69 70 74 69 6f 6e 73 20 ...///.against.the.descriptions.
3c60 28 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 44 65 76 69 63 65 44 65 73 63 72 69 70 74 69 (<see.cref="InputDeviceDescripti
3c80 6f 6e 22 2f 3e 29 20 6f 66 20 61 6c 6c 20 61 76 61 69 6c 61 62 6c 65 20 64 65 76 69 63 65 73 2e on"/>).of.all.available.devices.
3ca0 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 66 20 69 74 20 6d 61 74 63 68 65 73 20 61 6e 79 20 ..........///.If.it.matches.any.
3cc0 64 65 73 63 72 69 70 74 69 6f 6e 20 77 68 65 72 65 20 6e 6f 20 6c 61 79 6f 75 74 20 6d 61 74 63 description.where.no.layout.matc
3ce0 68 65 64 20 62 65 66 6f 72 65 2c 20 61 20 6e 65 77 20 64 65 76 69 63 65 20 77 69 6c 6c 20 69 6d hed.before,.a.new.device.will.im
3d00 6d 65 64 69 61 74 65 6c 79 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 62 65 20 63 72 65 61 74 65 mediately..........///.be.create
3d20 64 20 28 65 78 63 65 70 74 20 69 66 20 73 75 70 70 72 65 73 73 65 64 20 62 79 20 3c 73 65 65 20 d.(except.if.suppressed.by.<see.
3d40 63 72 65 66 3d 22 49 6e 70 75 74 53 65 74 74 69 6e 67 73 2e 73 75 70 70 6f 72 74 65 64 44 65 76 cref="InputSettings.supportedDev
3d60 69 63 65 73 22 2f 3e 29 2e 20 49 66 20 69 74 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 6d 61 74 ices"/>)..If.it..........///.mat
3d80 63 68 65 73 20 61 20 64 65 73 63 72 69 70 74 69 6f 6e 20 62 65 74 74 65 72 20 28 73 65 65 20 3c ches.a.description.better.(see.<
3da0 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 44 65 76 69 63 65 4d 61 74 63 68 65 72 2e 4d 61 74 see.cref="InputDeviceMatcher.Mat
3dc0 63 68 50 65 72 63 65 6e 74 61 67 65 22 2f 3e 29 20 74 68 61 6e 0d 0a 20 20 20 20 20 20 20 20 2f chPercentage"/>).than........../
3de0 2f 2f 20 74 68 65 20 63 75 72 72 65 6e 74 6c 79 20 75 73 65 64 20 6c 61 79 6f 75 74 2c 20 74 68 //.the.currently.used.layout,.th
3e00 65 20 65 78 69 73 74 69 6e 67 20 64 65 76 69 63 65 20 77 69 6c 6c 20 62 65 20 61 20 72 65 6d 6f e.existing.device.will.be.a.remo
3e20 76 65 64 20 61 6e 64 20 61 20 6e 65 77 20 64 65 76 69 63 65 20 77 69 74 68 0d 0a 20 20 20 20 20 ved.and.a.new.device.with.......
3e40 20 20 20 2f 2f 2f 20 74 68 65 20 6e 65 77 6c 79 20 72 65 67 69 73 74 65 72 65 64 20 6c 61 79 6f ...///.the.newly.registered.layo
3e60 75 74 20 77 69 6c 6c 20 62 65 20 63 72 65 61 74 65 64 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f ut.will.be.created...........///
3e80 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 53 65 65 20 3c 73 65 65 20 63 72 65 66 3d 22 43 6f 6e ..........///.See.<see.cref="Con
3ea0 74 72 6f 6c 73 2e 53 74 69 63 6b 43 6f 6e 74 72 6f 6c 22 2f 3e 20 6f 72 20 3c 73 65 65 20 63 72 trols.StickControl"/>.or.<see.cr
3ec0 65 66 3d 22 47 61 6d 65 70 61 64 22 2f 3e 20 66 6f 72 20 65 78 61 6d 70 6c 65 73 20 6f 66 20 6c ef="Gamepad"/>.for.examples.of.l
3ee0 61 79 6f 75 74 73 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 ayouts...........///.</remarks>.
3f00 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f 6e 20 63 72 65 66 3d 22 41 72 .........///.<exception.cref="Ar
3f20 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 22 3e 3c 70 61 72 61 6d 72 65 66 20 6e gumentNullException"><paramref.n
3f40 61 6d 65 3d 22 74 79 70 65 22 2f 3e 20 69 73 20 6e 75 6c 6c 2e 3c 2f 65 78 63 65 70 74 69 6f 6e ame="type"/>.is.null.</exception
3f60 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 49 6e >..........///.<seealso.cref="In
3f80 70 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 putControlLayout"/>..........pub
3fa0 6c 69 63 20 73 74 61 74 69 63 20 76 6f 69 64 20 52 65 67 69 73 74 65 72 4c 61 79 6f 75 74 28 54 lic.static.void.RegisterLayout(T
3fc0 79 70 65 20 74 79 70 65 2c 20 73 74 72 69 6e 67 20 6e 61 6d 65 20 3d 20 6e 75 6c 6c 2c 20 49 6e ype.type,.string.name.=.null,.In
3fe0 70 75 74 44 65 76 69 63 65 4d 61 74 63 68 65 72 3f 20 6d 61 74 63 68 65 73 20 3d 20 6e 75 6c 6c putDeviceMatcher?.matches.=.null
4000 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 74 79 )..........{..............if.(ty
4020 70 65 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 74 68 72 pe.==.null)..................thr
4040 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 28 6e 61 6d ow.new.ArgumentNullException(nam
4060 65 6f 66 28 74 79 70 65 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 eof(type));................if.(s
4080 74 72 69 6e 67 2e 49 73 4e 75 6c 6c 4f 72 45 6d 70 74 79 28 6e 61 6d 65 29 29 0d 0a 20 20 20 20 tring.IsNullOrEmpty(name))......
40a0 20 20 20 20 20 20 20 20 20 20 20 20 6e 61 6d 65 20 3d 20 74 79 70 65 2e 4e 61 6d 65 3b 0d 0a 0d ............name.=.type.Name;...
40c0 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 4d 61 6e 61 67 65 72 2e 52 65 67 69 73 74 65 72 43 .............s_Manager.RegisterC
40e0 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 28 6e 61 6d 65 2c 20 74 79 70 65 29 3b 0d 0a 0d 0a 20 20 20 ontrolLayout(name,.type);.......
4100 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 61 74 63 68 65 73 20 21 3d 20 6e 75 6c 6c 29 0d 0a 20 .........if.(matches.!=.null)...
4120 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 4d 61 6e 61 67 65 72 2e 52 65 67 69 73 74 65 ...............s_Manager.Registe
4140 72 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 4d 61 74 63 68 65 72 28 6e 61 6d 65 2c 20 6d 61 74 63 rControlLayoutMatcher(name,.matc
4160 68 65 73 2e 56 61 6c 75 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 hes.Value);..........}..........
4180 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 67 ..///.<summary>..........///.Reg
41a0 69 73 74 65 72 20 61 20 74 79 70 65 20 61 73 20 61 20 63 6f 6e 74 72 6f 6c 20 6c 61 79 6f 75 74 ister.a.type.as.a.control.layout
41c0 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>.......
41e0 20 20 20 2f 2f 2f 20 3c 74 79 70 65 70 61 72 61 6d 20 6e 61 6d 65 3d 22 54 22 3e 54 79 70 65 20 ...///.<typeparam.name="T">Type.
4200 74 6f 20 64 65 72 69 76 65 20 61 20 63 6f 6e 74 72 6f 6c 20 6c 61 79 6f 75 74 20 66 72 6f 6d 2e to.derive.a.control.layout.from.
4220 3c 2f 74 79 70 65 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 </typeparam>..........///.<param
4240 20 6e 61 6d 65 3d 22 6e 61 6d 65 22 3e 4e 61 6d 65 20 74 6f 20 75 73 65 20 66 6f 72 20 74 68 65 .name="name">Name.to.use.for.the
4260 20 6c 61 79 6f 75 74 2e 20 49 66 20 6e 75 6c 6c 20 6f 72 20 65 6d 70 74 79 2c 20 74 68 65 20 73 .layout..If.null.or.empty,.the.s
4280 68 6f 72 74 20 6e 61 6d 65 20 6f 66 20 74 68 65 20 74 79 70 65 20 77 69 6c 6c 20 62 65 20 75 73 hort.name.of.the.type.will.be.us
42a0 65 64 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 ed.</param>..........///.<param.
42c0 6e 61 6d 65 3d 22 6d 61 74 63 68 65 73 22 3e 4f 70 74 69 6f 6e 61 6c 20 64 65 76 69 63 65 20 6d name="matches">Optional.device.m
42e0 61 74 63 68 65 72 2e 20 49 66 20 74 68 69 73 20 69 73 20 73 75 70 70 6c 69 65 64 2c 20 74 68 65 atcher..If.this.is.supplied,.the
4300 20 6c 61 79 6f 75 74 20 77 69 6c 6c 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c 79 0d 0a 20 20 20 20 .layout.will.automatically......
4320 20 20 20 20 2f 2f 2f 20 62 65 20 69 6e 73 74 61 6e 74 69 61 74 65 64 20 66 6f 72 20 6e 65 77 6c ....///.be.instantiated.for.newl
4340 79 20 64 69 73 63 6f 76 65 72 65 64 20 64 65 76 69 63 65 73 20 74 68 61 74 20 6d 61 74 63 68 20 y.discovered.devices.that.match.
4360 74 68 65 20 64 65 73 63 72 69 70 74 69 6f 6e 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 the.description.</param>........
4380 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 68 69 ..///.<remarks>..........///.Thi
43a0 73 20 6d 65 74 68 6f 64 20 69 73 20 65 71 75 69 76 61 6c 65 6e 74 20 74 6f 20 63 61 6c 6c 69 6e s.method.is.equivalent.to.callin
43c0 67 20 3c 73 65 65 20 63 72 65 66 3d 22 52 65 67 69 73 74 65 72 4c 61 79 6f 75 74 28 54 79 70 65 g.<see.cref="RegisterLayout(Type
43e0 2c 73 74 72 69 6e 67 2c 49 6e 70 75 74 44 65 76 69 63 65 4d 61 74 63 68 65 72 3f 29 22 2f 3e 20 ,string,InputDeviceMatcher?)"/>.
4400 77 69 74 68 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 63 3e 74 79 70 65 6f 66 28 54 29 3c 2f with..........///.<c>typeof(T)</
4420 63 3e 2e 20 53 65 65 20 74 68 61 74 20 6d 65 74 68 6f 64 20 66 6f 72 20 64 65 74 61 69 6c 73 20 c>..See.that.method.for.details.
4440 6f 66 20 74 68 65 20 6c 61 79 6f 75 74 20 72 65 67 69 73 74 72 61 74 69 6f 6e 20 70 72 6f 63 65 of.the.layout.registration.proce
4460 73 73 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 0a 20 20 20 ss...........///.</remarks>.....
4480 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 52 65 67 69 73 74 65 72 .....///.<seealso.cref="Register
44a0 4c 61 79 6f 75 74 28 54 79 70 65 2c 73 74 72 69 6e 67 2c 49 6e 70 75 74 44 65 76 69 63 65 4d 61 Layout(Type,string,InputDeviceMa
44c0 74 63 68 65 72 3f 29 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 tcher?)"/>..........public.stati
44e0 63 20 76 6f 69 64 20 52 65 67 69 73 74 65 72 4c 61 79 6f 75 74 3c 54 3e 28 73 74 72 69 6e 67 20 c.void.RegisterLayout<T>(string.
4500 6e 61 6d 65 20 3d 20 6e 75 6c 6c 2c 20 49 6e 70 75 74 44 65 76 69 63 65 4d 61 74 63 68 65 72 3f name.=.null,.InputDeviceMatcher?
4520 20 6d 61 74 63 68 65 73 20 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 77 68 .matches.=.null)..............wh
4540 65 72 65 20 54 20 3a 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 0d 0a 20 20 20 20 20 20 20 20 7b 0d ere.T.:.InputControl..........{.
4560 0a 20 20 20 20 20 20 20 20 20 20 20 20 52 65 67 69 73 74 65 72 4c 61 79 6f 75 74 28 74 79 70 65 .............RegisterLayout(type
4580 6f 66 28 54 29 2c 20 6e 61 6d 65 2c 20 6d 61 74 63 68 65 73 29 3b 0d 0a 20 20 20 20 20 20 20 20 of(T),.name,.matches);..........
45a0 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>......
45c0 20 20 20 20 2f 2f 2f 20 52 65 67 69 73 74 65 72 20 61 20 6c 61 79 6f 75 74 20 69 6e 20 4a 53 4f ....///.Register.a.layout.in.JSO
45e0 4e 20 66 6f 72 6d 61 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 N.format...........///.</summary
4600 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 6a 73 6f 6e >..........///.<param.name="json
4620 22 3e 4a 53 4f 4e 20 64 61 74 61 20 64 65 73 63 72 69 62 69 6e 67 20 74 68 65 20 6c 61 79 6f 75 ">JSON.data.describing.the.layou
4640 74 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e t.</param>..........///.<param.n
4660 61 6d 65 3d 22 6e 61 6d 65 22 3e 4f 70 74 69 6f 6e 61 6c 20 6e 61 6d 65 20 6f 66 20 74 68 65 20 ame="name">Optional.name.of.the.
4680 6c 61 79 6f 75 74 2e 20 49 66 20 6e 75 6c 6c 20 6f 72 20 65 6d 70 74 79 2c 20 74 68 65 20 6e 61 layout..If.null.or.empty,.the.na
46a0 6d 65 20 69 73 20 74 61 6b 65 6e 20 66 72 6f 6d 20 74 68 65 20 22 6e 61 6d 65 22 0d 0a 20 20 20 me.is.taken.from.the."name".....
46c0 20 20 20 20 20 2f 2f 2f 20 70 72 6f 70 65 72 74 79 20 6f 66 20 74 68 65 20 4a 53 4f 4e 20 64 61 .....///.property.of.the.JSON.da
46e0 74 61 2e 20 49 66 20 69 74 20 69 73 20 73 75 70 70 6c 69 65 64 2c 20 69 74 20 77 69 6c 6c 20 6f ta..If.it.is.supplied,.it.will.o
4700 76 65 72 72 69 64 65 20 74 68 65 20 22 6e 61 6d 65 22 20 70 72 6f 70 65 72 74 79 20 69 66 20 70 verride.the."name".property.if.p
4720 72 65 73 65 6e 74 2e 20 49 66 20 6e 65 69 74 68 65 72 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 resent..If.neither..........///.
4740 69 73 20 73 75 70 70 6c 69 65 64 2c 20 61 6e 20 3c 73 65 65 20 63 72 65 66 3d 22 41 72 67 75 6d is.supplied,.an.<see.cref="Argum
4760 65 6e 74 45 78 63 65 70 74 69 6f 6e 22 2f 3e 20 69 73 20 74 68 72 6f 77 6e 2e 3c 2f 70 61 72 61 entException"/>.is.thrown.</para
4780 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 6d 61 74 m>..........///.<param.name="mat
47a0 63 68 65 73 22 3e 4f 70 74 69 6f 6e 61 6c 20 64 65 76 69 63 65 20 6d 61 74 63 68 65 72 2e 20 49 ches">Optional.device.matcher..I
47c0 66 20 74 68 69 73 20 69 73 20 73 75 70 70 6c 69 65 64 2c 20 74 68 65 20 6c 61 79 6f 75 74 20 77 f.this.is.supplied,.the.layout.w
47e0 69 6c 6c 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c 79 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 62 ill.automatically..........///.b
4800 65 20 69 6e 73 74 61 6e 74 69 61 74 65 64 20 66 6f 72 20 6e 65 77 6c 79 20 64 69 73 63 6f 76 65 e.instantiated.for.newly.discove
4820 72 65 64 20 64 65 76 69 63 65 73 20 74 68 61 74 20 6d 61 74 63 68 20 74 68 65 20 64 65 73 63 72 red.devices.that.match.the.descr
4840 69 70 74 69 6f 6e 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 iption.</param>..........///.<ex
4860 63 65 70 74 69 6f 6e 20 63 72 65 66 3d 22 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 ception.cref="ArgumentNullExcept
4880 69 6f 6e 22 3e 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 6a 73 6f 6e 22 2f 3e 20 69 73 20 ion"><paramref.name="json"/>.is.
48a0 6e 75 6c 6c 20 6f 72 20 65 6d 70 74 79 2e 3c 2f 65 78 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 null.or.empty.</exception>......
48c0 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f 6e 20 63 72 65 66 3d 22 41 72 67 75 6d 65 6e ....///.<exception.cref="Argumen
48e0 74 45 78 63 65 70 74 69 6f 6e 22 3e 4e 6f 20 6e 61 6d 65 20 68 61 73 20 62 65 65 6e 20 73 75 70 tException">No.name.has.been.sup
4900 70 6c 69 65 64 20 65 69 74 68 65 72 20 74 68 72 6f 75 67 68 20 3c 70 61 72 61 6d 72 65 66 20 6e plied.either.through.<paramref.n
4920 61 6d 65 3d 22 6e 61 6d 65 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 6f 72 20 74 68 65 ame="name"/>..........///.or.the
4940 20 22 6e 61 6d 65 22 20 4a 53 4f 4e 20 70 72 6f 70 65 72 74 79 2e 3c 2f 65 78 63 65 70 74 69 6f ."name".JSON.property.</exceptio
4960 6e 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 n>..........///.<remarks>.......
4980 20 20 20 2f 2f 2f 20 54 68 65 20 4a 53 4f 4e 20 66 6f 72 6d 61 74 20 6d 61 6b 65 73 20 69 74 20 ...///.The.JSON.format.makes.it.
49a0 70 6f 73 73 69 62 6c 65 20 74 6f 20 63 72 65 61 74 65 20 6e 65 77 20 64 65 76 69 63 65 20 61 6e possible.to.create.new.device.an
49c0 64 20 63 6f 6e 74 72 6f 6c 20 6c 61 79 6f 75 74 73 20 63 6f 6d 70 6c 65 74 65 6c 79 0d 0a 20 20 d.control.layouts.completely....
49e0 20 20 20 20 20 20 2f 2f 2f 20 69 6e 20 64 61 74 61 2e 20 54 68 65 79 20 68 61 76 65 20 74 6f 20 ......///.in.data..They.have.to.
4a00 75 6c 74 69 6d 61 74 65 6c 79 20 62 65 20 62 61 73 65 64 20 6f 6e 20 61 20 6c 61 79 6f 75 74 20 ultimately.be.based.on.a.layout.
4a20 62 61 63 6b 65 64 20 62 79 20 61 20 43 23 20 74 79 70 65 2c 20 68 6f 77 65 76 65 72 20 28 65 2e backed.by.a.C#.type,.however.(e.
4a40 67 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 20 63 72 65 66 3d 22 47 61 6d 65 70 g...........///.<see.cref="Gamep
4a60 61 64 22 2f 3e 29 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f ad"/>)...........///..........//
4a80 2f 20 4e 6f 74 65 20 74 68 61 74 20 6d 6f 73 74 20 65 72 72 6f 72 73 20 69 6e 20 6c 61 79 6f 75 /.Note.that.most.errors.in.layou
4aa0 74 73 20 77 69 6c 6c 20 6f 6e 6c 79 20 62 65 20 64 65 74 65 63 74 65 64 20 77 68 65 6e 20 69 6e ts.will.only.be.detected.when.in
4ac0 73 74 61 6e 74 69 61 74 65 64 20 28 69 2e 65 2e 20 77 68 65 6e 20 61 20 64 65 76 69 63 65 20 6f stantiated.(i.e..when.a.device.o
4ae0 72 20 63 6f 6e 74 72 6f 6c 20 69 73 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 62 65 69 6e 67 20 r.control.is..........///.being.
4b00 63 72 65 61 74 65 64 20 66 72 6f 6d 20 61 20 6c 61 79 6f 75 74 29 2e 20 54 68 65 20 4a 53 4f 4e created.from.a.layout)..The.JSON
4b20 20 64 61 74 61 20 77 69 6c 6c 2c 20 68 6f 77 65 76 65 72 2c 20 62 65 20 70 61 72 73 65 64 20 6f .data.will,.however,.be.parsed.o
4b40 6e 63 65 20 6f 6e 20 72 65 67 69 73 74 72 61 74 69 6f 6e 20 74 6f 20 63 68 65 63 6b 20 66 6f 72 nce.on.registration.to.check.for
4b60 20 61 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 64 65 76 69 63 65 20 64 65 73 63 72 69 70 74 69 .a..........///.device.descripti
4b80 6f 6e 20 69 6e 20 74 68 65 20 6c 61 79 6f 75 74 2e 20 4a 53 4f 4e 20 66 6f 72 6d 61 74 20 65 72 on.in.the.layout..JSON.format.er
4ba0 72 6f 72 73 20 77 69 6c 6c 20 74 68 75 73 20 62 65 20 64 65 74 65 63 74 65 64 20 64 75 72 69 6e rors.will.thus.be.detected.durin
4bc0 67 20 72 65 67 69 73 74 72 61 74 69 6f 6e 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 g.registration...........///....
4be0 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 2f 2f 2f ......///.<example>..........///
4c00 20 3c 63 6f 64 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 6e 70 75 74 53 79 73 74 65 6d .<code>..........///.InputSystem
4c20 2e 52 65 67 69 73 74 65 72 4c 61 79 6f 75 74 28 40 22 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 .RegisterLayout(@"..........///.
4c40 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 22 22 6e 61 6d 65 22 ...{..........///........""name"
4c60 22 20 3a 20 22 22 4d 79 44 65 76 69 63 65 22 22 2c 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 ".:.""MyDevice"",..........///..
4c80 20 20 20 20 20 20 22 22 63 6f 6e 74 72 6f 6c 73 22 22 20 3a 20 5b 0d 0a 20 20 20 20 20 20 20 20 ......""controls"".:.[..........
4ca0 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 ///............{..........///...
4cc0 20 20 20 20 20 20 20 20 20 20 20 20 20 22 22 6e 61 6d 65 22 22 20 3a 20 22 22 6d 79 42 75 74 74 .............""name"".:.""myButt
4ce0 6f 6e 22 22 2c 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 on"",..........///..............
4d00 20 20 22 22 6c 61 79 6f 75 74 22 22 20 3a 20 22 22 42 75 74 74 6f 6e 22 22 0d 0a 20 20 20 20 20 ..""layout"".:.""Button"".......
4d20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f ...///............}..........///
4d40 20 20 20 20 20 20 20 20 5d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 7d 0d 0a 20 20 20 ........]..........///....}.....
4d60 20 20 20 20 20 2f 2f 2f 20 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 63 6f 64 65 3e .....///.);..........///.</code>
4d80 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 65 78 61 6d 70 6c 65 3e 0d 0a 20 20 20 20 20 20 ..........///.</example>........
4da0 20 20 2f 2f 2f 20 3c 2f 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 ..///.</remarks>..........///.<s
4dc0 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 52 65 6d 6f 76 65 4c 61 79 6f 75 74 22 2f 3e 0d 0a 20 20 eealso.cref="RemoveLayout"/>....
4de0 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 76 6f 69 64 20 52 65 67 69 73 74 65 ......public.static.void.Registe
4e00 72 4c 61 79 6f 75 74 28 73 74 72 69 6e 67 20 6a 73 6f 6e 2c 20 73 74 72 69 6e 67 20 6e 61 6d 65 rLayout(string.json,.string.name
4e20 20 3d 20 6e 75 6c 6c 2c 20 49 6e 70 75 74 44 65 76 69 63 65 4d 61 74 63 68 65 72 3f 20 6d 61 74 .=.null,.InputDeviceMatcher?.mat
4e40 63 68 65 73 20 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 ches.=.null)..........{.........
4e60 20 20 20 20 20 73 5f 4d 61 6e 61 67 65 72 2e 52 65 67 69 73 74 65 72 43 6f 6e 74 72 6f 6c 4c 61 .....s_Manager.RegisterControlLa
4e80 79 6f 75 74 28 6a 73 6f 6e 2c 20 6e 61 6d 65 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 yout(json,.name);...............
4ea0 20 69 66 20 28 6d 61 74 63 68 65 73 20 21 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 .if.(matches.!=.null)...........
4ec0 20 20 20 20 20 20 20 73 5f 4d 61 6e 61 67 65 72 2e 52 65 67 69 73 74 65 72 43 6f 6e 74 72 6f 6c .......s_Manager.RegisterControl
4ee0 4c 61 79 6f 75 74 4d 61 74 63 68 65 72 28 6e 61 6d 65 2c 20 6d 61 74 63 68 65 73 2e 56 61 6c 75 LayoutMatcher(name,.matches.Valu
4f00 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
4f20 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 52 65 67 69 73 74 65 72 20 61 20 ummary>..........///.Register.a.
4f40 6c 61 79 6f 75 74 20 74 68 61 74 20 61 70 70 6c 69 65 73 20 6f 76 65 72 72 69 64 65 73 20 74 6f layout.that.applies.overrides.to
4f60 20 6f 6e 65 20 6f 72 20 6d 6f 72 65 20 6f 74 68 65 72 20 6c 61 79 6f 75 74 73 2e 0d 0a 20 20 20 .one.or.more.other.layouts......
4f80 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f .....///.</summary>..........///
4fa0 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 6a 73 6f 6e 22 3e 4c 61 79 6f 75 74 20 69 6e 20 4a 53 .<param.name="json">Layout.in.JS
4fc0 4f 4e 20 66 6f 72 6d 61 74 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 ON.format.</param>..........///.
4fe0 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 6e 61 6d 65 22 3e 4f 70 74 69 6f 6e 61 6c 20 6e 61 6d 65 <param.name="name">Optional.name
5000 20 6f 66 20 74 68 65 20 6c 61 79 6f 75 74 2e 20 49 66 20 6e 75 6c 6c 20 6f 72 20 65 6d 70 74 79 .of.the.layout..If.null.or.empty
5020 2c 20 74 68 65 20 6e 61 6d 65 20 69 73 20 74 61 6b 65 6e 20 66 72 6f 6d 20 74 68 65 20 22 6e 61 ,.the.name.is.taken.from.the."na
5040 6d 65 22 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 70 72 6f 70 65 72 74 79 20 6f 66 20 74 68 65 me"..........///.property.of.the
5060 20 4a 53 4f 4e 20 64 61 74 61 2e 20 49 66 20 69 74 20 69 73 20 73 75 70 70 6c 69 65 64 2c 20 69 .JSON.data..If.it.is.supplied,.i
5080 74 20 77 69 6c 6c 20 6f 76 65 72 72 69 64 65 20 74 68 65 20 22 6e 61 6d 65 22 20 70 72 6f 70 65 t.will.override.the."name".prope
50a0 72 74 79 20 69 66 20 70 72 65 73 65 6e 74 2e 20 49 66 20 6e 65 69 74 68 65 72 0d 0a 20 20 20 20 rty.if.present..If.neither......
50c0 20 20 20 20 2f 2f 2f 20 69 73 20 73 75 70 70 6c 69 65 64 2c 20 61 6e 20 3c 73 65 65 20 63 72 65 ....///.is.supplied,.an.<see.cre
50e0 66 3d 22 41 72 67 75 6d 65 6e 74 45 78 63 65 70 74 69 6f 6e 22 2f 3e 20 69 73 20 74 68 72 6f 77 f="ArgumentException"/>.is.throw
5100 6e 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 n.</param>..........///.<remarks
5120 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 4c 61 79 6f 75 74 20 6f 76 65 72 72 69 64 65 73 20 >..........///.Layout.overrides.
5140 61 72 65 20 6c 61 79 6f 75 74 20 70 69 65 63 65 73 20 74 68 61 74 20 61 72 65 20 61 70 70 6c 69 are.layout.pieces.that.are.appli
5160 65 64 20 6f 6e 20 74 6f 70 20 6f 66 20 65 78 69 73 74 69 6e 67 20 6c 61 79 6f 75 74 73 2e 0d 0a ed.on.top.of.existing.layouts...
5180 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 68 69 73 20 63 61 6e 20 62 65 20 75 73 65 64 20 74 6f 20 ........///.This.can.be.used.to.
51a0 6d 6f 64 69 66 79 20 61 6e 79 20 6c 61 79 6f 75 74 20 69 6e 20 74 68 65 20 73 79 73 74 65 6d 20 modify.any.layout.in.the.system.
51c0 6e 6f 6e 2d 64 65 73 74 72 75 63 74 69 76 65 6c 79 2e 20 54 68 65 20 70 72 6f 63 65 73 73 20 77 non-destructively..The.process.w
51e0 6f 72 6b 73 20 74 68 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 73 61 6d 65 20 61 73 20 65 78 orks.the..........///.same.as.ex
5200 74 65 6e 64 69 6e 67 20 61 6e 20 65 78 69 73 74 69 6e 67 20 6c 61 79 6f 75 74 20 65 78 63 65 70 tending.an.existing.layout.excep
5220 74 20 74 68 61 74 20 69 6e 73 74 65 61 64 20 6f 66 20 63 72 65 61 74 69 6e 67 20 61 20 6e 65 77 t.that.instead.of.creating.a.new
5240 20 6c 61 79 6f 75 74 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 62 79 20 6d 65 72 67 69 6e 67 20 .layout..........///.by.merging.
5260 74 68 65 20 64 65 72 69 76 65 64 20 6c 61 79 6f 75 74 20 61 6e 64 20 74 68 65 20 62 61 73 65 20 the.derived.layout.and.the.base.
5280 6c 61 79 6f 75 74 2c 20 74 68 65 20 6f 76 65 72 72 69 64 65 73 20 61 72 65 20 6d 65 72 67 65 64 layout,.the.overrides.are.merged
52a0 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 64 69 72 65 63 74 6c 79 20 69 6e 74 6f 20 74 68 65 20 ..........///.directly.into.the.
52c0 62 61 73 65 20 6c 61 79 6f 75 74 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 base.layout...........///.......
52e0 20 20 20 2f 2f 2f 20 54 68 65 20 6c 61 79 6f 75 74 20 6d 65 72 67 69 6e 67 20 6c 6f 67 69 63 20 ...///.The.layout.merging.logic.
5300 75 73 65 64 20 66 6f 72 20 6f 76 65 72 72 69 64 65 73 2c 20 69 73 20 74 68 65 20 73 61 6d 65 20 used.for.overrides,.is.the.same.
5320 61 73 20 74 68 65 20 6f 6e 65 20 75 73 65 64 20 66 6f 72 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f as.the.one.used.for..........///
5340 20 64 65 72 69 76 65 64 20 6c 61 79 6f 75 74 73 2c 20 69 2e 65 2e 20 3c 73 65 65 20 63 72 65 66 .derived.layouts,.i.e..<see.cref
5360 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 2e 4d 65 72 67 65 4c 61 79 6f 75 74 ="InputControlLayout.MergeLayout
5380 22 2f 3e 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 4c "/>...........///..........///.L
53a0 61 79 6f 75 74 73 20 75 73 65 64 20 61 73 20 6f 76 65 72 72 69 64 65 73 20 6c 6f 6f 6b 20 74 68 ayouts.used.as.overrides.look.th
53c0 65 20 73 61 6d 65 20 61 73 20 6e 6f 72 6d 61 6c 20 6c 61 79 6f 75 74 73 20 61 6e 64 20 68 61 76 e.same.as.normal.layouts.and.hav
53e0 65 20 74 68 65 20 73 61 6d 65 20 66 6f 72 6d 61 74 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 e.the.same.format...........///.
5400 54 68 65 20 6f 6e 6c 79 20 64 69 66 66 65 72 65 6e 63 65 20 69 73 20 74 68 61 74 20 74 68 65 79 The.only.difference.is.that.they
5420 20 61 72 65 20 65 78 70 6c 69 63 69 74 6c 79 20 72 65 67 69 73 74 65 72 65 64 20 61 73 20 6f 76 .are.explicitly.registered.as.ov
5440 65 72 72 69 64 65 73 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f errides...........///........../
5460 2f 2f 20 4e 6f 74 65 20 74 68 61 74 20 75 6e 6c 69 6b 65 20 22 6e 6f 72 6d 61 6c 22 20 6c 61 79 //.Note.that.unlike."normal".lay
5480 6f 75 74 73 2c 20 6c 61 79 6f 75 74 20 6f 76 65 72 72 69 64 65 73 20 68 61 76 65 20 74 68 65 20 outs,.layout.overrides.have.the.
54a0 61 62 69 6c 69 74 79 20 74 6f 20 65 78 74 65 6e 64 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 6d ability.to.extend..........///.m
54c0 75 6c 74 69 70 6c 65 20 62 61 73 65 20 6c 61 79 6f 75 74 73 2e 20 54 68 65 20 63 68 61 6e 67 65 ultiple.base.layouts..The.change
54e0 73 20 66 72 6f 6d 20 74 68 65 20 6f 76 65 72 72 69 64 65 20 77 69 6c 6c 20 73 69 6d 70 6c 79 20 s.from.the.override.will.simply.
5500 62 65 20 6d 65 72 67 65 64 20 69 6e 74 6f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 65 61 63 68 be.merged.into..........///.each
5520 20 6f 66 20 74 68 65 20 6c 61 79 6f 75 74 73 20 69 74 20 65 78 74 65 6e 64 73 2e 20 55 73 65 20 .of.the.layouts.it.extends..Use.
5540 74 68 65 20 3c 63 3e 65 78 74 65 6e 64 4d 75 6c 74 69 70 6c 65 3c 2f 63 3e 20 72 61 74 68 65 72 the.<c>extendMultiple</c>.rather
5560 20 74 68 61 6e 20 74 68 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 63 3e 65 78 74 65 6e 64 .than.the..........///.<c>extend
5580 3c 2f 63 3e 20 70 72 6f 70 65 72 74 79 20 69 6e 20 4a 53 4f 4e 20 74 6f 20 67 69 76 65 20 61 20 </c>.property.in.JSON.to.give.a.
55a0 6c 69 73 74 20 6f 66 20 62 61 73 65 20 6c 61 79 6f 75 74 73 20 69 6e 73 74 65 61 64 20 6f 66 20 list.of.base.layouts.instead.of.
55c0 61 20 73 69 6e 67 6c 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 6f 6e 65 2e 0d 0a 20 20 20 20 a.single..........///.one.......
55e0 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 61 6d 70 6c 65 3e 0d 0a ....///..........///.<example>..
5600 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 63 6f 64 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 ........///.<code>..........///.
5620 2f 2f 20 4f 76 65 72 72 69 64 65 20 64 65 66 61 75 6c 74 20 62 75 74 74 6f 6e 20 70 72 65 73 73 //.Override.default.button.press
5640 20 70 6f 69 6e 74 73 20 6f 6e 20 74 68 65 20 67 61 6d 65 70 61 64 20 74 72 69 67 67 65 72 73 2e .points.on.the.gamepad.triggers.
5660 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 6e 70 75 74 53 79 73 74 65 6d 2e 52 65 67 69 73 74 ..........///.InputSystem.Regist
5680 65 72 4c 61 79 6f 75 74 4f 76 65 72 72 69 64 65 28 40 22 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f erLayoutOverride(@"..........///
56a0 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 22 22 6e 61 .....{..........///.........""na
56c0 6d 65 22 22 20 3a 20 22 22 43 75 73 74 6f 6d 54 72 69 67 67 65 72 50 72 65 73 73 50 6f 69 6e 74 me"".:.""CustomTriggerPressPoint
56e0 73 22 22 2c 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 22 22 65 78 74 65 s"",..........///.........""exte
5700 6e 64 22 22 20 3a 20 22 22 47 61 6d 65 70 61 64 22 22 2c 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f nd"".:.""Gamepad"",..........///
5720 20 20 20 20 20 20 20 20 20 22 22 63 6f 6e 74 72 6f 6c 73 22 22 20 3a 20 5b 0d 0a 20 20 20 20 20 .........""controls"".:.[.......
5740 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 20 22 22 6e 61 6d 65 22 22 20 3a 20 ...///.............{.""name"".:.
5760 22 22 6c 65 66 74 54 72 69 67 67 65 72 22 22 2c 20 22 22 70 61 72 61 6d 65 74 65 72 73 22 22 20 ""leftTrigger"",.""parameters"".
5780 3a 20 22 22 70 72 65 73 73 50 6f 69 6e 74 3d 30 2e 32 35 22 22 20 7d 2c 0d 0a 20 20 20 20 20 20 :.""pressPoint=0.25"".},........
57a0 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 20 22 22 6e 61 6d 65 22 22 20 3a 20 22 ..///.............{.""name"".:."
57c0 22 72 69 67 68 74 54 72 69 67 67 65 72 22 22 2c 20 22 22 70 61 72 61 6d 65 74 65 72 73 22 22 20 "rightTrigger"",.""parameters"".
57e0 3a 20 22 22 70 72 65 73 73 50 6f 69 6e 74 3d 30 2e 32 35 22 22 20 7d 0d 0a 20 20 20 20 20 20 20 :.""pressPoint=0.25"".}.........
5800 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 5d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 .///.........]..........///.....
5820 7d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 22 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 }..........///.");..........///.
5840 3c 2f 63 6f 64 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 65 78 61 6d 70 6c 65 3e 0d </code>..........///.</example>.
5860 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 .........///.</remarks>.........
5880 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 76 6f 69 64 20 52 65 67 69 73 74 65 72 4c 61 79 6f .public.static.void.RegisterLayo
58a0 75 74 4f 76 65 72 72 69 64 65 28 73 74 72 69 6e 67 20 6a 73 6f 6e 2c 20 73 74 72 69 6e 67 20 6e utOverride(string.json,.string.n
58c0 61 6d 65 20 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 ame.=.null)..........{..........
58e0 20 20 20 20 73 5f 4d 61 6e 61 67 65 72 2e 52 65 67 69 73 74 65 72 43 6f 6e 74 72 6f 6c 4c 61 79 ....s_Manager.RegisterControlLay
5900 6f 75 74 28 6a 73 6f 6e 2c 20 6e 61 6d 65 2c 20 69 73 4f 76 65 72 72 69 64 65 3a 20 74 72 75 65 out(json,.name,.isOverride:.true
5920 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 75 );..........}............///.<su
5940 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 41 64 64 20 61 6e 20 61 64 64 69 74 mmary>..........///.Add.an.addit
5960 69 6f 6e 61 6c 20 64 65 76 69 63 65 20 6d 61 74 63 68 65 72 20 74 6f 20 61 6e 20 65 78 69 73 74 ional.device.matcher.to.an.exist
5980 69 6e 67 20 6c 61 79 6f 75 74 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 ing.layout...........///.</summa
59a0 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 6c 61 ry>..........///.<param.name="la
59c0 79 6f 75 74 4e 61 6d 65 22 3e 4e 61 6d 65 20 6f 66 20 74 68 65 20 64 65 76 69 63 65 20 6c 61 79 youtName">Name.of.the.device.lay
59e0 6f 75 74 20 74 68 61 74 20 73 68 6f 75 6c 64 20 62 65 20 69 6e 73 74 61 6e 74 69 61 74 65 64 20 out.that.should.be.instantiated.
5a00 69 66 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 6d 61 74 63 68 65 72 22 2f 3e 0d 0a 20 if.<paramref.name="matcher"/>...
5a20 20 20 20 20 20 20 20 2f 2f 2f 20 6d 61 74 63 68 65 73 20 61 6e 20 3c 73 65 65 20 63 72 65 66 3d .......///.matches.an.<see.cref=
5a40 22 49 6e 70 75 74 44 65 76 69 63 65 44 65 73 63 72 69 70 74 69 6f 6e 22 2f 3e 20 6f 66 20 61 20 "InputDeviceDescription"/>.of.a.
5a60 64 69 73 63 6f 76 65 72 65 64 20 64 65 76 69 63 65 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 discovered.device.</param>......
5a80 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 6d 61 74 63 68 65 72 22 3e 53 70 ....///.<param.name="matcher">Sp
5aa0 65 63 69 66 69 63 61 74 69 6f 6e 20 74 6f 20 6d 61 74 63 68 20 61 67 61 69 6e 73 74 20 3c 73 65 ecification.to.match.against.<se
5ac0 65 20 63 72 65 66 3d 22 49 6e 70 75 74 44 65 76 69 63 65 44 65 73 63 72 69 70 74 69 6f 6e 22 2f e.cref="InputDeviceDescription"/
5ae0 3e 20 69 6e 73 74 61 6e 63 65 73 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f >.instances.</param>..........//
5b00 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 45 61 63 68 20 64 65 /.<remarks>..........///.Each.de
5b20 76 69 63 65 20 6c 61 79 6f 75 74 20 63 61 6e 20 68 61 76 65 20 7a 65 72 6f 20 6f 72 20 6d 6f 72 vice.layout.can.have.zero.or.mor
5b40 65 20 6d 61 74 63 68 65 72 73 20 61 73 73 6f 63 69 61 74 65 64 20 77 69 74 68 20 69 74 2e 20 49 e.matchers.associated.with.it..I
5b60 66 20 61 6e 79 20 6f 6e 65 20 6f 66 20 74 68 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 6d 61 f.any.one.of.the..........///.ma
5b80 74 63 68 65 72 73 20 6d 61 74 63 68 65 73 20 61 20 67 69 76 65 6e 20 3c 73 65 65 20 63 72 65 66 tchers.matches.a.given.<see.cref
5ba0 3d 22 49 6e 70 75 74 44 65 76 69 63 65 44 65 73 63 72 69 70 74 69 6f 6e 22 2f 3e 20 28 73 65 65 ="InputDeviceDescription"/>.(see
5bc0 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 44 65 76 69 63 65 4d 61 74 63 68 65 72 2e 4d .<see.cref="InputDeviceMatcher.M
5be0 61 74 63 68 50 65 72 63 65 6e 74 61 67 65 22 2f 3e 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 atchPercentage"/>)..........///.
5c00 62 65 74 74 65 72 20 74 68 61 6e 20 61 6e 79 20 6f 74 68 65 72 20 6d 61 74 63 68 65 72 20 28 66 better.than.any.other.matcher.(f
5c20 6f 72 20 74 68 65 20 73 61 6d 65 20 6f 72 20 61 6e 79 20 6f 74 68 65 72 20 6c 61 79 6f 75 74 29 or.the.same.or.any.other.layout)
5c40 2c 20 74 68 65 6e 20 74 68 65 20 67 69 76 65 6e 20 6c 61 79 6f 75 74 0d 0a 20 20 20 20 20 20 20 ,.then.the.given.layout.........
5c60 20 2f 2f 2f 20 77 69 6c 6c 20 62 65 20 75 73 65 64 20 66 6f 72 20 74 68 65 20 64 69 73 63 6f 76 .///.will.be.used.for.the.discov
5c80 65 72 65 64 20 64 65 76 69 63 65 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 ered.device...........///.......
5ca0 20 20 20 2f 2f 2f 20 4e 6f 74 65 20 74 68 61 74 20 72 65 67 69 73 74 65 72 69 6e 67 20 61 20 6d ...///.Note.that.registering.a.m
5cc0 61 74 63 68 65 72 20 6d 61 79 20 69 6d 6d 65 64 69 61 74 65 6c 79 20 6c 65 61 64 20 74 6f 20 64 atcher.may.immediately.lead.to.d
5ce0 65 76 69 63 65 73 20 62 65 69 6e 67 20 63 72 65 61 74 65 64 20 6f 72 20 72 65 63 72 65 61 74 65 evices.being.created.or.recreate
5d00 64 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 66 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d d...........///.If.<paramref.nam
5d20 65 3d 22 6d 61 74 63 68 65 72 22 2f 3e 20 6d 61 74 63 68 65 73 20 61 6e 79 20 64 65 76 69 63 65 e="matcher"/>.matches.any.device
5d40 73 20 63 75 72 72 65 6e 74 6c 79 20 6f 6e 20 74 68 65 20 6c 69 73 74 20 6f 66 20 75 6e 73 75 70 s.currently.on.the.list.of.unsup
5d60 70 6f 72 74 65 64 20 64 65 76 69 63 65 73 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 28 73 65 65 ported.devices..........///.(see
5d80 20 3c 73 65 65 20 63 72 65 66 3d 22 47 65 74 55 6e 73 75 70 70 6f 72 74 65 64 44 65 76 69 63 65 .<see.cref="GetUnsupportedDevice
5da0 73 28 29 22 2f 3e 29 2c 20 6e 65 77 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 44 65 76 s()"/>),.new.<see.cref="InputDev
5dc0 69 63 65 22 2f 3e 73 20 77 69 6c 6c 20 62 65 20 63 72 65 61 74 65 64 0d 0a 20 20 20 20 20 20 20 ice"/>s.will.be.created.........
5de0 20 2f 2f 2f 20 75 73 69 6e 67 20 74 68 65 20 6c 61 79 6f 75 74 20 63 61 6c 6c 65 64 20 3c 70 61 .///.using.the.layout.called.<pa
5e00 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 6c 61 79 6f 75 74 4e 61 6d 65 22 2f 3e 2e 20 41 6c 73 6f ramref.name="layoutName"/>..Also
5e20 2c 20 69 66 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 6d 61 74 63 68 65 72 22 2f 3e 0d ,.if.<paramref.name="matcher"/>.
5e40 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 6d 61 74 63 68 65 73 20 74 68 65 20 64 65 73 63 72 69 70 .........///.matches.the.descrip
5e60 74 69 6f 6e 20 6f 66 20 61 20 64 65 76 69 63 65 20 62 65 74 74 65 72 20 74 68 61 6e 20 74 68 65 tion.of.a.device.better.than.the
5e80 20 6d 61 74 63 68 65 72 20 28 69 66 20 61 6e 79 29 20 66 6f 72 20 74 68 65 20 64 65 76 69 63 65 .matcher.(if.any).for.the.device
5ea0 27 73 20 63 75 72 72 65 6e 74 6c 79 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 75 73 65 64 20 6c 's.currently..........///.used.l
5ec0 61 79 6f 75 74 2c 20 74 68 65 20 64 65 76 69 63 65 20 77 69 6c 6c 20 62 65 20 72 65 63 72 65 61 ayout,.the.device.will.be.recrea
5ee0 74 65 64 20 75 73 69 6e 67 20 74 68 65 20 67 69 76 65 6e 20 6c 61 79 6f 75 74 2e 0d 0a 20 20 20 ted.using.the.given.layout......
5f00 20 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f .....///.</remarks>..........///
5f20 20 3c 65 78 63 65 70 74 69 6f 6e 20 63 72 65 66 3d 22 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 .<exception.cref="ArgumentNullEx
5f40 63 65 70 74 69 6f 6e 22 3e 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 6c 61 79 6f 75 74 4e ception"><paramref.name="layoutN
5f60 61 6d 65 22 2f 3e 20 69 73 20 3c 63 3e 6e 75 6c 6c 3c 2f 63 3e 20 6f 72 20 65 6d 70 74 79 2f 3c ame"/>.is.<c>null</c>.or.empty/<
5f80 2f 65 78 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 /exception>..........///.<except
5fa0 69 6f 6e 20 63 72 65 66 3d 22 41 72 67 75 6d 65 6e 74 45 78 63 65 70 74 69 6f 6e 22 3e 3c 70 61 ion.cref="ArgumentException"><pa
5fc0 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 6d 61 74 63 68 65 72 22 2f 3e 20 69 73 20 65 6d 70 74 79 ramref.name="matcher"/>.is.empty
5fe0 20 28 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 44 65 76 69 63 65 4d 61 74 63 68 65 72 2e .(<see.cref="InputDeviceMatcher.
6000 65 6d 70 74 79 22 2f 3e 29 2e 3c 2f 65 78 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 empty"/>).</exception>..........
6020 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 52 65 67 69 73 74 65 72 4c 61 79 6f 75 ///.<seealso.cref="RegisterLayou
6040 74 28 54 79 70 65 2c 73 74 72 69 6e 67 2c 49 6e 70 75 74 44 65 76 69 63 65 4d 61 74 63 68 65 72 t(Type,string,InputDeviceMatcher
6060 3f 29 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 ?)"/>..........///.<seealso.cref
6080 3d 22 54 72 79 46 69 6e 64 4d 61 74 63 68 69 6e 67 4c 61 79 6f 75 74 22 2f 3e 0d 0a 20 20 20 20 ="TryFindMatchingLayout"/>......
60a0 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 76 6f 69 64 20 52 65 67 69 73 74 65 72 4c ....public.static.void.RegisterL
60c0 61 79 6f 75 74 4d 61 74 63 68 65 72 28 73 74 72 69 6e 67 20 6c 61 79 6f 75 74 4e 61 6d 65 2c 20 ayoutMatcher(string.layoutName,.
60e0 49 6e 70 75 74 44 65 76 69 63 65 4d 61 74 63 68 65 72 20 6d 61 74 63 68 65 72 29 0d 0a 20 20 20 InputDeviceMatcher.matcher).....
6100 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 4d 61 6e 61 67 65 72 2e 52 65 .....{..............s_Manager.Re
6120 67 69 73 74 65 72 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 4d 61 74 63 68 65 72 28 6c 61 79 6f 75 gisterControlLayoutMatcher(layou
6140 74 4e 61 6d 65 2c 20 6d 61 74 63 68 65 72 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 tName,.matcher);..........}.....
6160 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>..........//
6180 2f 20 41 64 64 20 61 6e 20 61 64 64 69 74 69 6f 6e 61 6c 20 64 65 76 69 63 65 20 6d 61 74 63 68 /.Add.an.additional.device.match
61a0 65 72 20 74 6f 20 74 68 65 20 6c 61 79 6f 75 74 20 72 65 67 69 73 74 65 72 65 64 20 66 6f 72 20 er.to.the.layout.registered.for.
61c0 3c 74 79 70 65 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 54 44 65 76 69 63 65 22 2f 3e 2e 0d <typeparamref.name="TDevice"/>..
61e0 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>.........
6200 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 6d 61 74 63 68 65 72 22 3e 41 20 64 65 76 .///.<param.name="matcher">A.dev
6220 69 63 65 20 6d 61 74 63 68 65 72 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f ice.matcher.</param>..........//
6240 2f 20 3c 74 79 70 65 70 61 72 61 6d 20 6e 61 6d 65 3d 22 54 44 65 76 69 63 65 22 3e 54 79 70 65 /.<typeparam.name="TDevice">Type
6260 20 74 68 61 74 20 68 61 73 20 62 65 65 6e 20 72 65 67 69 73 74 65 72 65 64 20 61 73 20 61 20 6c .that.has.been.registered.as.a.l
6280 61 79 6f 75 74 2e 20 53 65 65 20 3c 73 65 65 20 63 72 65 66 3d 22 52 65 67 69 73 74 65 72 4c 61 ayout..See.<see.cref="RegisterLa
62a0 79 6f 75 74 7b 54 7d 22 2f 3e 2e 3c 2f 74 79 70 65 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 yout{T}"/>.</typeparam>.........
62c0 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 43 61 6c 6c .///.<remarks>..........///.Call
62e0 69 6e 67 20 74 68 69 73 20 6d 65 74 68 6f 64 20 69 73 20 65 71 75 69 76 61 6c 65 6e 74 20 74 6f ing.this.method.is.equivalent.to
6300 20 63 61 6c 6c 69 6e 67 20 3c 73 65 65 20 63 72 65 66 3d 22 52 65 67 69 73 74 65 72 4c 61 79 6f .calling.<see.cref="RegisterLayo
6320 75 74 4d 61 74 63 68 65 72 28 73 74 72 69 6e 67 2c 49 6e 70 75 74 44 65 76 69 63 65 4d 61 74 63 utMatcher(string,InputDeviceMatc
6340 68 65 72 29 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 77 69 74 68 20 74 68 65 20 6e 61 her)"/>..........///.with.the.na
6360 6d 65 20 75 6e 64 65 72 20 77 68 69 63 68 20 3c 74 79 70 65 70 61 72 61 6d 72 65 66 20 6e 61 6d me.under.which.<typeparamref.nam
6380 65 3d 22 54 44 65 76 69 63 65 22 2f 3e 20 68 61 73 20 62 65 65 6e 20 72 65 67 69 73 74 65 72 65 e="TDevice"/>.has.been.registere
63a0 64 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 0a 20 20 20 20 d...........///.</remarks>......
63c0 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f 6e 20 63 72 65 66 3d 22 41 72 67 75 6d 65 6e ....///.<exception.cref="Argumen
63e0 74 45 78 63 65 70 74 69 6f 6e 22 3e 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 6d 61 74 63 tException"><paramref.name="matc
6400 68 65 72 22 2f 3e 20 69 73 20 65 6d 70 74 79 20 28 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 her"/>.is.empty.(<see.cref="Inpu
6420 74 44 65 76 69 63 65 4d 61 74 63 68 65 72 2e 65 6d 70 74 79 22 2f 3e 29 0d 0a 20 20 20 20 20 20 tDeviceMatcher.empty"/>)........
6440 20 20 2f 2f 2f 20 2d 6f 72 2d 20 3c 74 79 70 65 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 54 ..///.-or-.<typeparamref.name="T
6460 44 65 76 69 63 65 22 2f 3e 20 68 61 73 20 6e 6f 74 20 62 65 65 6e 20 72 65 67 69 73 74 65 72 65 Device"/>.has.not.been.registere
6480 64 20 61 73 20 61 20 6c 61 79 6f 75 74 2e 3c 2f 65 78 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 d.as.a.layout.</exception>......
64a0 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 76 6f 69 64 20 52 65 67 69 73 74 65 72 4c ....public.static.void.RegisterL
64c0 61 79 6f 75 74 4d 61 74 63 68 65 72 3c 54 44 65 76 69 63 65 3e 28 49 6e 70 75 74 44 65 76 69 63 ayoutMatcher<TDevice>(InputDevic
64e0 65 4d 61 74 63 68 65 72 20 6d 61 74 63 68 65 72 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 77 eMatcher.matcher)..............w
6500 68 65 72 65 20 54 44 65 76 69 63 65 20 3a 20 49 6e 70 75 74 44 65 76 69 63 65 0d 0a 20 20 20 20 here.TDevice.:.InputDevice......
6520 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 4d 61 6e 61 67 65 72 2e 52 65 67 ....{..............s_Manager.Reg
6540 69 73 74 65 72 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 4d 61 74 63 68 65 72 28 74 79 70 65 6f 66 isterControlLayoutMatcher(typeof
6560 28 54 44 65 76 69 63 65 29 2c 20 6d 61 74 63 68 65 72 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d (TDevice),.matcher);..........}.
6580 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>........
65a0 20 20 2f 2f 2f 20 52 65 67 69 73 74 65 72 20 61 20 62 75 69 6c 64 65 72 20 74 68 61 74 20 64 65 ..///.Register.a.builder.that.de
65c0 6c 69 76 65 72 73 20 61 6e 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f livers.an.<see.cref="InputContro
65e0 6c 4c 61 79 6f 75 74 22 2f 3e 20 69 6e 73 74 61 6e 63 65 20 6f 6e 20 64 65 6d 61 6e 64 2e 0d 0a lLayout"/>.instance.on.demand...
6600 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>..........
6620 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 62 75 69 6c 64 4d 65 74 68 6f 64 22 3e 4d 65 ///.<param.name="buildMethod">Me
6640 74 68 6f 64 20 74 6f 20 69 6e 76 6f 6b 65 20 74 6f 20 67 65 6e 65 72 61 74 65 20 61 20 6c 61 79 thod.to.invoke.to.generate.a.lay
6660 6f 75 74 20 77 68 65 6e 20 74 68 65 20 6c 61 79 6f 75 74 20 69 73 20 63 68 6f 73 65 6e 2e 0d 0a out.when.the.layout.is.chosen...
6680 20 20 20 20 20 20 20 20 2f 2f 2f 20 53 68 6f 75 6c 64 20 6e 6f 74 20 63 61 63 68 65 20 74 68 65 ........///.Should.not.cache.the
66a0 20 6c 61 79 6f 75 74 20 62 75 74 20 72 61 74 68 65 72 20 72 65 74 75 72 6e 20 61 20 66 72 65 73 .layout.but.rather.return.a.fres
66c0 68 20 69 6e 73 74 61 6e 63 65 20 65 76 65 72 79 20 74 69 6d 65 2e 3c 2f 70 61 72 61 6d 3e 0d 0a h.instance.every.time.</param>..
66e0 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 6e 61 6d 65 22 3e 4e ........///.<param.name="name">N
6700 61 6d 65 20 75 6e 64 65 72 20 77 68 69 63 68 20 74 6f 20 72 65 67 69 73 74 65 72 20 74 68 65 20 ame.under.which.to.register.the.
6720 6c 61 79 6f 75 74 2e 20 49 66 20 61 20 6c 61 79 6f 75 74 20 77 69 74 68 20 74 68 65 20 73 61 6d layout..If.a.layout.with.the.sam
6740 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 6e 61 6d 65 20 69 73 20 61 6c 72 65 61 64 79 20 72 e..........///.name.is.already.r
6760 65 67 69 73 74 65 72 65 64 2c 20 74 68 65 20 63 61 6c 6c 20 74 6f 20 74 68 69 73 20 6d 65 74 68 egistered,.the.call.to.this.meth
6780 6f 64 20 77 69 6c 6c 20 72 65 70 6c 61 63 65 20 74 68 65 20 65 78 69 73 74 69 6e 67 20 6c 61 79 od.will.replace.the.existing.lay
67a0 6f 75 74 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d out.</param>..........///.<param
67c0 20 6e 61 6d 65 3d 22 62 61 73 65 4c 61 79 6f 75 74 22 3e 4e 61 6d 65 20 6f 66 20 74 68 65 20 6c .name="baseLayout">Name.of.the.l
67e0 61 79 6f 75 74 20 74 68 61 74 20 74 68 65 20 6c 61 79 6f 75 74 20 72 65 74 75 72 6e 65 64 20 66 ayout.that.the.layout.returned.f
6800 72 6f 6d 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 62 75 69 6c 64 4d 65 74 68 6f 64 22 rom.<paramref.name="buildMethod"
6820 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 77 69 6c 6c 20 62 65 20 62 61 73 65 64 20 6f 6e />..........///.will.be.based.on
6840 2e 20 54 68 65 20 73 79 73 74 65 6d 20 6e 65 65 64 73 20 74 6f 20 6b 6e 6f 77 20 74 68 69 73 20 ..The.system.needs.to.know.this.
6860 69 6e 20 61 64 76 61 6e 63 65 20 69 6e 20 6f 72 64 65 72 20 74 6f 20 75 70 64 61 74 65 20 64 65 in.advance.in.order.to.update.de
6880 76 69 63 65 73 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 63 6f 72 72 65 63 74 6c 79 20 69 66 20 vices..........///.correctly.if.
68a0 6c 61 79 6f 75 74 20 72 65 67 69 73 74 72 61 74 69 6f 6e 73 20 69 6e 20 74 68 65 20 73 79 73 74 layout.registrations.in.the.syst
68c0 65 6d 20 61 72 65 20 63 68 61 6e 67 65 64 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 em.are.changed.</param>.........
68e0 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 6d 61 74 63 68 65 73 22 3e 4f 70 74 69 6f .///.<param.name="matches">Optio
6900 6e 61 6c 20 6d 61 74 63 68 65 72 20 66 6f 72 20 61 6e 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e nal.matcher.for.an.<see.cref="In
6920 70 75 74 44 65 76 69 63 65 44 65 73 63 72 69 70 74 69 6f 6e 22 2f 3e 2e 20 49 66 20 73 75 70 70 putDeviceDescription"/>..If.supp
6940 6c 69 65 64 2c 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 69 74 20 69 73 20 65 71 75 69 76 61 6c lied,..........///.it.is.equival
6960 65 6e 74 20 74 6f 20 63 61 6c 6c 69 6e 67 20 3c 73 65 65 20 63 72 65 66 3d 22 52 65 67 69 73 74 ent.to.calling.<see.cref="Regist
6980 65 72 4c 61 79 6f 75 74 4d 61 74 63 68 65 72 22 2f 3e 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 erLayoutMatcher"/>.</param>.....
69a0 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f 6e 20 63 72 65 66 3d 22 41 72 67 75 6d 65 .....///.<exception.cref="Argume
69c0 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 22 3e 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d ntNullException"><paramref.name=
69e0 22 62 75 69 6c 64 4d 65 74 68 6f 64 22 2f 3e 20 69 73 20 3c 63 3e 6e 75 6c 6c 3c 2f 63 3e 20 2d "buildMethod"/>.is.<c>null</c>.-
6a00 6f 72 2d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d or-..........///.<paramref.name=
6a20 22 6e 61 6d 65 22 2f 3e 20 69 73 20 3c 63 3e 6e 75 6c 6c 3c 2f 63 3e 20 6f 72 20 65 6d 70 74 79 "name"/>.is.<c>null</c>.or.empty
6a40 2e 3c 2f 65 78 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 .</exception>..........///.<rema
6a60 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 4c 61 79 6f 75 74 20 62 75 69 6c 64 65 72 rks>..........///.Layout.builder
6a80 73 20 61 72 65 20 6d 6f 73 74 20 75 73 65 66 75 6c 20 66 6f 72 20 70 72 6f 63 65 64 75 72 61 6c s.are.most.useful.for.procedural
6aa0 6c 79 20 62 75 69 6c 64 69 6e 67 20 64 65 76 69 63 65 20 6c 61 79 6f 75 74 73 20 66 72 6f 6d 20 ly.building.device.layouts.from.
6ac0 6d 65 74 61 64 61 74 61 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 73 75 70 70 6c 69 65 64 20 62 metadata..........///.supplied.b
6ae0 79 20 65 78 74 65 72 6e 61 6c 20 73 79 73 74 65 6d 73 2e 20 41 20 67 6f 6f 64 20 65 78 61 6d 70 y.external.systems..A.good.examp
6b00 6c 65 20 69 73 20 3c 73 65 65 20 63 72 65 66 3d 22 48 49 44 22 2f 3e 20 77 68 65 72 65 20 74 68 le.is.<see.cref="HID"/>.where.th
6b20 65 20 22 48 49 44 22 20 73 74 61 6e 64 61 72 64 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 69 6e e."HID".standard..........///.in
6b40 63 6c 75 64 65 73 20 61 20 77 61 79 20 66 6f 72 20 69 6e 70 75 74 20 64 65 76 69 63 65 73 20 74 cludes.a.way.for.input.devices.t
6b60 6f 20 64 65 73 63 72 69 62 65 20 74 68 65 69 72 20 76 61 72 69 6f 75 73 20 69 6e 70 75 74 73 20 o.describe.their.various.inputs.
6b80 61 6e 64 20 6f 75 74 70 75 74 73 20 69 6e 20 74 68 65 20 66 6f 72 6d 0d 0a 20 20 20 20 20 20 20 and.outputs.in.the.form.........
6ba0 20 2f 2f 2f 20 6f 66 20 61 20 3c 73 65 65 20 63 72 65 66 3d 22 48 49 44 2e 48 49 44 44 65 76 69 .///.of.a.<see.cref="HID.HIDDevi
6bc0 63 65 44 65 73 63 72 69 70 74 6f 72 22 2f 3e 2e 20 57 68 69 6c 65 20 6e 6f 74 20 73 75 66 66 69 ceDescriptor"/>..While.not.suffi
6be0 63 69 65 6e 74 20 74 6f 20 62 75 69 6c 64 20 61 20 70 65 72 66 65 63 74 6c 79 20 72 6f 62 75 73 cient.to.build.a.perfectly.robus
6c00 74 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 44 t..........///.<see.cref="InputD
6c20 65 76 69 63 65 22 2f 3e 2c 20 74 68 65 73 65 20 64 65 73 63 72 69 70 74 69 6f 6e 73 20 61 72 65 evice"/>,.these.descriptions.are
6c40 20 75 73 75 61 6c 6c 79 20 65 6e 6f 75 67 68 20 74 6f 20 61 74 20 6c 65 61 73 74 20 6d 61 6b 65 .usually.enough.to.at.least.make
6c60 20 74 68 65 20 64 65 76 69 63 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 77 6f 72 6b 20 6f 75 .the.device..........///.work.ou
6c80 74 2d 6f 66 2d 74 68 65 2d 62 6f 78 20 74 6f 20 73 6f 6d 65 20 65 78 74 65 6e 74 2e 0d 0a 20 20 t-of-the-box.to.some.extent.....
6ca0 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 68 65 20 62 75 69 6c 64 ......///..........///.The.build
6cc0 65 72 20 6d 65 74 68 6f 64 20 77 6f 75 6c 64 20 75 73 75 61 6c 6c 79 20 75 73 65 20 3c 73 65 65 er.method.would.usually.use.<see
6ce0 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 2e 42 75 69 6c 64 65 .cref="InputControlLayout.Builde
6d00 72 22 2f 3e 20 74 6f 20 62 75 69 6c 64 20 74 68 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 61 r"/>.to.build.the..........///.a
6d20 63 74 75 61 6c 20 6c 61 79 6f 75 74 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 ctual.layout...........///......
6d40 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 2f 2f 2f 20 3c ....///.<example>..........///.<
6d60 63 6f 64 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 6e 70 75 74 53 79 73 74 65 6d 2e 52 code>..........///.InputSystem.R
6d80 65 67 69 73 74 65 72 4c 61 79 6f 75 74 42 75 69 6c 64 65 72 28 0d 0a 20 20 20 20 20 20 20 20 2f egisterLayoutBuilder(........../
6da0 2f 2f 20 20 20 20 20 28 29 20 3d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 7b 0d //.....().=>..........///.....{.
6dc0 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 76 61 72 20 62 75 69 6c 64 65 72 .........///.........var.builder
6de0 20 3d 20 6e 65 77 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 2e 42 75 69 6c 64 65 .=.new.InputControlLayout.Builde
6e00 72 28 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 2e 57 69 r()..........///..............Wi
6e20 74 68 54 79 70 65 26 6c 74 3b 4d 79 44 65 76 69 63 65 26 67 74 3b 28 29 3b 0d 0a 20 20 20 20 20 thType&lt;MyDevice&gt;();.......
6e40 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 62 75 69 6c 64 65 72 2e 41 64 64 43 6f 6e 74 72 6f ...///.........builder.AddContro
6e60 6c 28 22 62 75 74 74 6f 6e 31 22 29 2e 57 69 74 68 4c 61 79 6f 75 74 28 22 42 75 74 74 6f 6e 22 l("button1").WithLayout("Button"
6e80 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 62 );..........///.........return.b
6ea0 75 69 6c 64 65 72 2e 42 75 69 6c 64 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 uilder.Build();..........///....
6ec0 20 7d 2c 20 22 4d 79 43 75 73 74 6f 6d 4c 61 79 6f 75 74 22 0d 0a 20 20 20 20 20 20 20 20 2f 2f .},."MyCustomLayout"..........//
6ee0 2f 20 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 /.}..........///.</code>........
6f00 20 20 2f 2f 2f 20 3c 2f 65 78 61 6d 70 6c 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 ..///.</example>..........///...
6f20 20 20 20 20 20 20 20 2f 2f 2f 20 4c 61 79 6f 75 74 20 62 75 69 6c 64 65 72 73 20 63 61 6e 20 62 .......///.Layout.builders.can.b
6f40 65 20 75 73 65 64 20 69 6e 20 63 6f 6d 62 69 6e 61 74 69 6f 6e 20 77 69 74 68 20 3c 73 65 65 20 e.used.in.combination.with.<see.
6f60 63 72 65 66 3d 22 6f 6e 46 69 6e 64 4c 61 79 6f 75 74 46 6f 72 44 65 76 69 63 65 22 2f 3e 20 74 cref="onFindLayoutForDevice"/>.t
6f80 6f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 62 75 69 6c 64 20 6c 61 79 6f 75 74 73 20 64 79 6e o..........///.build.layouts.dyn
6fa0 61 6d 69 63 61 6c 6c 79 20 66 6f 72 20 64 65 76 69 63 65 73 20 61 73 20 74 68 65 79 20 61 72 65 amically.for.devices.as.they.are
6fc0 20 63 6f 6e 6e 65 63 74 65 64 20 74 6f 20 74 68 65 20 73 79 73 74 65 6d 2e 0d 0a 20 20 20 20 20 .connected.to.the.system........
6fe0 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 42 65 20 61 77 61 72 65 20 74 68 61 ...///..........///.Be.aware.tha
7000 74 20 74 68 65 20 73 61 6d 65 20 62 75 69 6c 64 65 72 20 3c 65 6d 3e 6d 75 73 74 3c 2f 65 6d 3e t.the.same.builder.<em>must</em>
7020 20 6e 6f 74 20 62 75 69 6c 64 20 64 69 66 66 65 72 65 6e 74 20 6c 61 79 6f 75 74 73 2e 20 45 61 .not.build.different.layouts..Ea
7040 63 68 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 6c 61 79 6f 75 74 20 72 65 67 69 73 74 65 72 65 ch..........///.layout.registere
7060 64 20 69 6e 20 74 68 65 20 73 79 73 74 65 6d 20 69 73 20 63 6f 6e 73 69 64 65 72 65 64 20 74 6f d.in.the.system.is.considered.to
7080 20 62 65 20 69 6d 6d 75 74 61 62 6c 65 20 66 6f 72 20 61 73 20 6c 6f 6e 67 20 61 73 20 69 74 0d .be.immutable.for.as.long.as.it.
70a0 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 69 73 20 72 65 67 69 73 74 65 72 65 64 2e 20 53 6f 2c 20 .........///.is.registered..So,.
70c0 69 66 20 61 20 6c 61 79 6f 75 74 20 62 75 69 6c 64 65 72 20 69 73 20 72 65 67 69 73 74 65 72 65 if.a.layout.builder.is.registere
70e0 64 20 75 6e 64 65 72 20 74 68 65 20 6e 61 6d 65 20 22 43 75 73 74 6f 6d 22 2c 20 66 6f 72 0d 0a d.under.the.name."Custom",.for..
7100 20 20 20 20 20 20 20 20 2f 2f 2f 20 65 78 61 6d 70 6c 65 2c 20 74 68 65 6e 20 65 76 65 72 79 20 ........///.example,.then.every.
7120 74 69 6d 65 20 74 68 65 20 62 75 69 6c 64 65 72 20 69 73 20 69 6e 76 6f 6b 65 64 2c 20 69 74 20 time.the.builder.is.invoked,.it.
7140 6d 75 73 74 20 72 65 74 75 72 6e 20 74 68 65 20 73 61 6d 65 20 69 64 65 6e 74 69 63 61 6c 0d 0a must.return.the.same.identical..
7160 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 ........///.<see.cref="InputCont
7180 72 6f 6c 4c 61 79 6f 75 74 22 2f 3e 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 6d rolLayout"/>...........///.</rem
71a0 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 arks>..........///.<seealso.cref
71c0 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 2e 42 75 69 6c 64 65 72 22 2f 3e 0d ="InputControlLayout.Builder"/>.
71e0 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 6f 6e 46 69 .........///.<seealso.cref="onFi
7200 6e 64 4c 61 79 6f 75 74 46 6f 72 44 65 76 69 63 65 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 ndLayoutForDevice"/>..........pu
7220 62 6c 69 63 20 73 74 61 74 69 63 20 76 6f 69 64 20 52 65 67 69 73 74 65 72 4c 61 79 6f 75 74 42 blic.static.void.RegisterLayoutB
7240 75 69 6c 64 65 72 28 46 75 6e 63 3c 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 3e 20 uilder(Func<InputControlLayout>.
7260 62 75 69 6c 64 4d 65 74 68 6f 64 2c 20 73 74 72 69 6e 67 20 6e 61 6d 65 2c 0d 0a 20 20 20 20 20 buildMethod,.string.name,.......
7280 20 20 20 20 20 20 20 73 74 72 69 6e 67 20 62 61 73 65 4c 61 79 6f 75 74 20 3d 20 6e 75 6c 6c 2c .......string.baseLayout.=.null,
72a0 20 49 6e 70 75 74 44 65 76 69 63 65 4d 61 74 63 68 65 72 3f 20 6d 61 74 63 68 65 73 20 3d 20 6e .InputDeviceMatcher?.matches.=.n
72c0 75 6c 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 69 66 20 ull)..........{..............if.
72e0 28 62 75 69 6c 64 4d 65 74 68 6f 64 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 (buildMethod.==.null)...........
7300 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 .......throw.new.ArgumentNullExc
7320 65 70 74 69 6f 6e 28 6e 61 6d 65 6f 66 28 62 75 69 6c 64 4d 65 74 68 6f 64 29 29 3b 0d 0a 20 20 eption(nameof(buildMethod));....
7340 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 74 72 69 6e 67 2e 49 73 4e 75 6c 6c 4f 72 45 6d 70 ..........if.(string.IsNullOrEmp
7360 74 79 28 6e 61 6d 65 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 ty(name))..................throw
7380 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 28 6e 61 6d 65 6f .new.ArgumentNullException(nameo
73a0 66 28 6e 61 6d 65 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 4d 61 6e 61 67 f(name));................s_Manag
73c0 65 72 2e 52 65 67 69 73 74 65 72 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 42 75 69 6c 64 65 72 28 er.RegisterControlLayoutBuilder(
73e0 62 75 69 6c 64 4d 65 74 68 6f 64 2c 20 6e 61 6d 65 2c 20 62 61 73 65 4c 61 79 6f 75 74 3a 20 62 buildMethod,.name,.baseLayout:.b
7400 61 73 65 4c 61 79 6f 75 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 61 74 aseLayout);..............if.(mat
7420 63 68 65 73 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 73 ches.!=.null)..................s
7440 5f 4d 61 6e 61 67 65 72 2e 52 65 67 69 73 74 65 72 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 4d 61 _Manager.RegisterControlLayoutMa
7460 74 63 68 65 72 28 6e 61 6d 65 2c 20 6d 61 74 63 68 65 73 2e 56 61 6c 75 65 29 3b 0d 0a 20 20 20 tcher(name,.matches.Value);.....
7480 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d .....}............///.<summary>.
74a0 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 52 65 6d 6f 76 65 20 61 6e 20 61 6c 72 65 61 64 79 20 72 .........///.Remove.an.already.r
74c0 65 67 69 73 74 65 72 65 64 20 6c 61 79 6f 75 74 20 66 72 6f 6d 20 74 68 65 20 73 79 73 74 65 6d egistered.layout.from.the.system
74e0 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>.......
7500 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 6e 61 6d 65 22 3e 4e 61 6d 65 20 6f ...///.<param.name="name">Name.o
7520 66 20 74 68 65 20 6c 61 79 6f 75 74 20 74 6f 20 72 65 6d 6f 76 65 2e 20 4e 6f 74 65 20 74 68 61 f.the.layout.to.remove..Note.tha
7540 74 20 6c 61 79 6f 75 74 20 6e 61 6d 65 73 20 61 72 65 20 63 61 73 65 2d 69 6e 73 65 6e 73 69 74 t.layout.names.are.case-insensit
7560 69 76 65 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 ive.</param>..........///.<remar
7580 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 72 65 6d 6f 76 ks>..........///.Note.that.remov
75a0 69 6e 67 20 61 20 6c 61 79 6f 75 74 20 61 6c 73 6f 20 72 65 6d 6f 76 65 73 20 61 6c 6c 20 64 65 ing.a.layout.also.removes.all.de
75c0 76 69 63 65 73 20 74 68 61 74 20 64 69 72 65 63 74 6c 79 20 6f 72 20 69 6e 64 69 72 65 63 74 6c vices.that.directly.or.indirectl
75e0 79 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 75 73 65 20 74 68 65 20 6c 61 79 6f 75 74 2e 0d 0a y..........///.use.the.layout...
7600 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 68 69 73 20 6d 65 ........///..........///.This.me
7620 74 68 6f 64 20 63 61 6e 20 62 65 20 75 73 65 64 20 74 6f 20 72 65 6d 6f 76 65 20 62 6f 74 68 20 thod.can.be.used.to.remove.both.
7640 63 6f 6e 74 72 6f 6c 20 6f 72 20 64 65 76 69 63 65 20 6c 61 79 6f 75 74 73 2e 0d 0a 20 20 20 20 control.or.device.layouts.......
7660 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c ....///.</remarks>..........publ
7680 69 63 20 73 74 61 74 69 63 20 76 6f 69 64 20 52 65 6d 6f 76 65 4c 61 79 6f 75 74 28 73 74 72 69 ic.static.void.RemoveLayout(stri
76a0 6e 67 20 6e 61 6d 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 ng.name)..........{.............
76c0 20 73 5f 4d 61 6e 61 67 65 72 2e 52 65 6d 6f 76 65 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 28 6e .s_Manager.RemoveControlLayout(n
76e0 61 6d 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 ame);..........}............///.
7700 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 72 79 20 74 6f 20 6d 61 <summary>..........///.Try.to.ma
7720 74 63 68 20 61 20 64 65 73 63 72 69 70 74 69 6f 6e 20 66 6f 72 20 61 6e 20 69 6e 70 75 74 20 64 tch.a.description.for.an.input.d
7740 65 76 69 63 65 20 74 6f 20 61 20 6c 61 79 6f 75 74 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 evice.to.a.layout...........///.
7760 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
7780 61 6d 65 3d 22 64 65 76 69 63 65 44 65 73 63 72 69 70 74 69 6f 6e 22 3e 44 65 73 63 72 69 70 74 ame="deviceDescription">Descript
77a0 69 6f 6e 20 6f 66 20 61 6e 20 69 6e 70 75 74 20 64 65 76 69 63 65 2e 3c 2f 70 61 72 61 6d 3e 0d ion.of.an.input.device.</param>.
77c0 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 4e 61 6d 65 20 6f 66 20 74 68 .........///.<returns>Name.of.th
77e0 65 20 6c 61 79 6f 75 74 20 74 68 61 74 20 68 61 73 20 62 65 65 6e 20 6d 61 74 63 68 65 64 20 74 e.layout.that.has.been.matched.t
7800 6f 20 74 68 65 20 67 69 76 65 6e 20 64 65 73 63 72 69 70 74 69 6f 6e 20 6f 72 20 6e 75 6c 6c 20 o.the.given.description.or.null.
7820 69 66 20 6e 6f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 6d 61 74 63 68 69 6e 67 20 6c 61 79 6f if.no..........///.matching.layo
7840 75 74 20 77 61 73 20 66 6f 75 6e 64 2e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 20 ut.was.found.</returns>.........
7860 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 68 69 73 .///.<remarks>..........///.This
7880 20 6d 65 74 68 6f 64 20 70 65 72 66 6f 72 6d 73 20 74 68 65 20 73 61 6d 65 20 6d 61 74 63 68 69 .method.performs.the.same.matchi
78a0 6e 67 20 70 72 6f 63 65 73 73 20 74 68 61 74 20 69 73 20 69 6e 76 6f 6b 65 64 20 69 66 20 61 20 ng.process.that.is.invoked.if.a.
78c0 64 65 76 69 63 65 20 69 73 20 72 65 70 6f 72 74 65 64 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 device.is.reported..........///.
78e0 62 79 20 74 68 65 20 55 6e 69 74 79 20 72 75 6e 74 69 6d 65 20 6f 72 20 75 73 69 6e 67 20 3c 73 by.the.Unity.runtime.or.using.<s
7900 65 65 20 63 72 65 66 3d 22 41 64 64 44 65 76 69 63 65 28 49 6e 70 75 74 44 65 76 69 63 65 44 65 ee.cref="AddDevice(InputDeviceDe
7920 73 63 72 69 70 74 69 6f 6e 29 22 2f 3e 2e 20 54 68 65 20 72 65 73 75 6c 74 0d 0a 20 20 20 20 20 scription)"/>..The.result.......
7940 20 20 20 2f 2f 2f 20 64 65 70 65 6e 64 73 20 6f 6e 20 74 68 65 20 6d 61 74 63 68 65 73 20 28 3c ...///.depends.on.the.matches.(<
7960 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 44 65 76 69 63 65 4d 61 74 63 68 65 72 22 2f 3e 29 see.cref="InputDeviceMatcher"/>)
7980 20 72 65 67 69 73 74 65 72 65 64 20 66 6f 72 20 74 68 65 20 64 65 76 69 63 65 0d 0a 20 20 20 20 .registered.for.the.device......
79a0 20 20 20 20 2f 2f 2f 20 6c 61 79 6f 75 74 20 69 6e 20 74 68 65 20 73 79 73 74 65 6d 2e 0d 0a 20 ....///.layout.in.the.system....
79c0 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 61 6d 70 6c 65 .......///..........///.<example
79e0 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 63 6f 64 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f >..........///.<code>........../
7a00 2f 2f 20 76 61 72 20 6c 61 79 6f 75 74 4e 61 6d 65 20 3d 20 49 6e 70 75 74 53 79 73 74 65 6d 2e //.var.layoutName.=.InputSystem.
7a20 54 72 79 46 69 6e 64 4d 61 74 63 68 69 6e 67 4c 61 79 6f 75 74 28 0d 0a 20 20 20 20 20 20 20 20 TryFindMatchingLayout(..........
7a40 2f 2f 2f 20 20 20 20 20 6e 65 77 20 49 6e 70 75 74 44 65 76 69 63 65 44 65 73 63 72 69 70 74 69 ///.....new.InputDeviceDescripti
7a60 6f 6e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f on..........///.....{........../
7a80 2f 2f 20 20 20 20 20 20 20 20 20 69 6e 74 65 72 66 61 63 65 20 3d 20 22 58 49 6e 70 75 74 22 2c //.........interface.=."XInput",
7aa0 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 70 72 6f 64 75 63 74 20 3d 20 ..........///.........product.=.
7ac0 22 58 62 6f 78 20 57 69 72 65 64 20 43 6f 6e 74 72 6f 6c 6c 65 72 22 2c 0d 0a 20 20 20 20 20 20 "Xbox.Wired.Controller",........
7ae0 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 6d 61 6e 75 66 61 63 74 75 72 65 72 20 3d 20 22 4d 69 ..///.........manufacturer.=."Mi
7b00 63 72 6f 73 6f 66 74 22 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 7d 0d 0a 20 20 20 crosoft"..........///.....}.....
7b20 20 20 20 20 20 2f 2f 2f 20 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 63 6f 64 65 3e .....///.);..........///.</code>
7b40 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 65 78 61 6d 70 6c 65 3e 0d 0a 20 20 20 20 20 20 ..........///.</example>........
7b60 20 20 2f 2f 2f 20 3c 2f 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 ..///.</remarks>..........///.<s
7b80 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 52 65 67 69 73 74 65 72 4c 61 79 6f 75 74 4d 61 74 63 68 eealso.cref="RegisterLayoutMatch
7ba0 65 72 7b 54 44 65 76 69 63 65 7d 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 er{TDevice}"/>..........///.<see
7bc0 61 6c 73 6f 20 63 72 65 66 3d 22 52 65 67 69 73 74 65 72 4c 61 79 6f 75 74 4d 61 74 63 68 65 72 also.cref="RegisterLayoutMatcher
7be0 28 73 74 72 69 6e 67 2c 49 6e 70 75 74 44 65 76 69 63 65 4d 61 74 63 68 65 72 29 22 2f 3e 0d 0a (string,InputDeviceMatcher)"/>..
7c00 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 73 74 72 69 6e 67 20 54 72 79 ........public.static.string.Try
7c20 46 69 6e 64 4d 61 74 63 68 69 6e 67 4c 61 79 6f 75 74 28 49 6e 70 75 74 44 65 76 69 63 65 44 65 FindMatchingLayout(InputDeviceDe
7c40 73 63 72 69 70 74 69 6f 6e 20 64 65 76 69 63 65 44 65 73 63 72 69 70 74 69 6f 6e 29 0d 0a 20 20 scription.deviceDescription)....
7c60 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 73 5f 4d 61 ......{..............return.s_Ma
7c80 6e 61 67 65 72 2e 54 72 79 46 69 6e 64 4d 61 74 63 68 69 6e 67 43 6f 6e 74 72 6f 6c 4c 61 79 6f nager.TryFindMatchingControlLayo
7ca0 75 74 28 72 65 66 20 64 65 76 69 63 65 44 65 73 63 72 69 70 74 69 6f 6e 29 3b 0d 0a 20 20 20 20 ut(ref.deviceDescription);......
7cc0 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a ....}............///.<summary>..
7ce0 20 20 20 20 20 20 20 20 2f 2f 2f 20 52 65 74 75 72 6e 20 61 20 6c 69 73 74 20 77 69 74 68 20 74 ........///.Return.a.list.with.t
7d00 68 65 20 6e 61 6d 65 73 20 6f 66 20 61 6c 6c 20 6c 61 79 6f 75 74 73 20 74 68 61 74 20 68 61 76 he.names.of.all.layouts.that.hav
7d20 65 20 62 65 65 6e 20 72 65 67 69 73 74 65 72 65 64 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 e.been.registered...........///.
7d40 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 74 75 72 6e 73 </summary>..........///.<returns
7d60 3e 41 20 6c 69 73 74 20 6f 66 20 6c 61 79 6f 75 74 20 6e 61 6d 65 73 2e 3c 2f 72 65 74 75 72 6e >A.list.of.layout.names.</return
7d80 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 4c s>..........///.<seealso.cref="L
7da0 6f 61 64 4c 61 79 6f 75 74 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c oadLayout"/>..........///.<seeal
7dc0 73 6f 20 63 72 65 66 3d 22 4c 69 73 74 4c 61 79 6f 75 74 73 42 61 73 65 64 4f 6e 22 2f 3e 0d 0a so.cref="ListLayoutsBasedOn"/>..
7de0 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 52 65 67 69 73 ........///.<seealso.cref="Regis
7e00 74 65 72 4c 61 79 6f 75 74 28 53 79 73 74 65 6d 2e 54 79 70 65 2c 73 74 72 69 6e 67 2c 4e 75 6c terLayout(System.Type,string,Nul
7e20 6c 61 62 6c 65 7b 49 6e 70 75 74 44 65 76 69 63 65 4d 61 74 63 68 65 72 7d 29 22 2f 3e 0d 0a 20 lable{InputDeviceMatcher})"/>...
7e40 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 49 45 6e 75 6d 65 72 61 62 6c 65 .......public.static.IEnumerable
7e60 3c 73 74 72 69 6e 67 3e 20 4c 69 73 74 4c 61 79 6f 75 74 73 28 29 0d 0a 20 20 20 20 20 20 20 20 <string>.ListLayouts()..........
7e80 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 73 5f 4d 61 6e 61 67 65 72 2e {..............return.s_Manager.
7ea0 4c 69 73 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 73 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d ListControlLayouts();..........}
7ec0 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 ............///.<summary>.......
7ee0 20 20 20 2f 2f 2f 20 4c 69 73 74 20 61 6c 6c 20 74 68 65 20 6c 61 79 6f 75 74 73 20 74 68 61 74 ...///.List.all.the.layouts.that
7f00 20 61 72 65 20 62 61 73 65 64 20 6f 6e 20 74 68 65 20 67 69 76 65 6e 20 6c 61 79 6f 75 74 2e 0d .are.based.on.the.given.layout..
7f20 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>.........
7f40 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 62 61 73 65 4c 61 79 6f 75 74 22 3e 4e 61 .///.<param.name="baseLayout">Na
7f60 6d 65 20 6f 66 20 61 20 72 65 67 69 73 74 65 72 65 64 20 6c 61 79 6f 75 74 2e 3c 2f 70 61 72 61 me.of.a.registered.layout.</para
7f80 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f 6e 20 63 72 65 66 3d m>..........///.<exception.cref=
7fa0 22 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 22 3e 3c 70 61 72 61 6d 72 65 "ArgumentNullException"><paramre
7fc0 66 20 6e 61 6d 65 3d 22 62 61 73 65 4c 61 79 6f 75 74 22 2f 3e 20 69 73 20 3c 63 3e 6e 75 6c 6c f.name="baseLayout"/>.is.<c>null
7fe0 3c 2f 63 3e 20 6f 72 20 65 6d 70 74 79 2e 3c 2f 65 78 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 </c>.or.empty.</exception>......
8000 20 20 20 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 54 68 65 20 6e 61 6d 65 73 20 6f 66 20 61 6c ....///.<returns>The.names.of.al
8020 6c 20 72 65 67 69 73 74 65 72 65 64 20 6c 61 79 6f 75 74 73 20 62 61 73 65 64 20 6f 6e 20 3c 70 l.registered.layouts.based.on.<p
8040 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 62 61 73 65 4c 61 79 6f 75 74 22 2f 3e 2e 3c 2f 72 65 aramref.name="baseLayout"/>.</re
8060 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 turns>..........///.<remarks>...
8080 20 20 20 20 20 20 20 2f 2f 2f 20 54 68 65 20 6c 69 73 74 20 77 69 6c 6c 20 6e 6f 74 20 69 6e 63 .......///.The.list.will.not.inc
80a0 6c 75 64 65 20 6c 61 79 6f 75 74 20 6f 76 65 72 72 69 64 65 73 20 28 73 65 65 20 3c 73 65 65 20 lude.layout.overrides.(see.<see.
80c0 63 72 65 66 3d 22 52 65 67 69 73 74 65 72 4c 61 79 6f 75 74 4f 76 65 72 72 69 64 65 22 2f 3e 29 cref="RegisterLayoutOverride"/>)
80e0 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 61 ...........///..........///.<exa
8100 6d 70 6c 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 63 6f 64 65 3e 0d 0a 20 20 20 20 20 mple>..........///.<code>.......
8120 20 20 20 2f 2f 2f 20 2f 2f 20 4c 69 73 74 20 61 6c 6c 20 67 61 6d 65 70 61 64 20 6c 61 79 6f 75 ...///.//.List.all.gamepad.layou
8140 74 73 20 69 6e 20 74 68 65 20 73 79 73 74 65 6d 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 44 ts.in.the.system...........///.D
8160 65 62 75 67 2e 4c 6f 67 28 73 74 72 69 6e 67 2e 4a 6f 69 6e 28 22 5c 6e 22 2c 20 49 6e 70 75 74 ebug.Log(string.Join("\n",.Input
8180 53 79 73 74 65 6d 2e 4c 69 73 74 4c 61 79 6f 75 74 73 42 61 73 65 64 4f 6e 28 22 47 61 6d 65 70 System.ListLayoutsBasedOn("Gamep
81a0 61 64 22 29 29 3b 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 ad"));..........///.</code>.....
81c0 20 20 20 20 20 2f 2f 2f 20 3c 2f 65 78 61 6d 70 6c 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f .....///.</example>..........///
81e0 20 3c 2f 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 .</remarks>..........public.stat
8200 69 63 20 49 45 6e 75 6d 65 72 61 62 6c 65 3c 73 74 72 69 6e 67 3e 20 4c 69 73 74 4c 61 79 6f 75 ic.IEnumerable<string>.ListLayou
8220 74 73 42 61 73 65 64 4f 6e 28 73 74 72 69 6e 67 20 62 61 73 65 4c 61 79 6f 75 74 29 0d 0a 20 20 tsBasedOn(string.baseLayout)....
8240 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 73 74 72 69 6e 67 2e ......{..............if.(string.
8260 49 73 4e 75 6c 6c 4f 72 45 6d 70 74 79 28 62 61 73 65 4c 61 79 6f 75 74 29 29 0d 0a 20 20 20 20 IsNullOrEmpty(baseLayout))......
8280 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 4e 75 ............throw.new.ArgumentNu
82a0 6c 6c 45 78 63 65 70 74 69 6f 6e 28 6e 61 6d 65 6f 66 28 62 61 73 65 4c 61 79 6f 75 74 29 29 3b llException(nameof(baseLayout));
82c0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 73 5f 4d 61 6e 61 67 65 72 2e 4c ..............return.s_Manager.L
82e0 69 73 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 73 28 62 61 73 65 64 4f 6e 3a 20 62 61 73 65 4c istControlLayouts(basedOn:.baseL
8300 61 79 6f 75 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 2f 2f ayout);..........}............//
8320 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 4c 6f 61 64 20 61 20 /.<summary>..........///.Load.a.
8340 72 65 67 69 73 74 65 72 65 64 20 6c 61 79 6f 75 74 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 registered.layout...........///.
8360 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
8380 61 6d 65 3d 22 6e 61 6d 65 22 3e 4e 61 6d 65 20 6f 66 20 74 68 65 20 6c 61 79 6f 75 74 20 74 6f ame="name">Name.of.the.layout.to
83a0 20 6c 6f 61 64 2e 20 4e 6f 74 65 20 74 68 61 74 20 6c 61 79 6f 75 74 20 6e 61 6d 65 73 20 61 72 .load..Note.that.layout.names.ar
83c0 65 20 63 61 73 65 2d 69 6e 73 65 6e 73 69 74 69 76 65 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 e.case-insensitive.</param>.....
83e0 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f 6e 20 63 72 65 66 3d 22 41 72 67 75 6d 65 .....///.<exception.cref="Argume
8400 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 22 3e 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d ntNullException"><paramref.name=
8420 22 6e 61 6d 65 22 2f 3e 20 69 73 20 3c 63 3e 6e 75 6c 6c 3c 2f 63 3e 20 6f 72 20 65 6d 70 74 79 "name"/>.is.<c>null</c>.or.empty
8440 2e 3c 2f 65 78 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 74 75 .</exception>..........///.<retu
8460 72 6e 73 3e 54 68 65 20 63 6f 6e 73 74 72 75 63 74 65 64 20 6c 61 79 6f 75 74 20 69 6e 73 74 61 rns>The.constructed.layout.insta
8480 6e 63 65 20 6f 72 20 3c 63 3e 6e 75 6c 6c 3c 2f 63 3e 20 69 66 20 6e 6f 20 6c 61 79 6f 75 74 20 nce.or.<c>null</c>.if.no.layout.
84a0 6f 66 20 74 68 65 20 67 69 76 65 6e 20 6e 61 6d 65 20 63 6f 75 6c 64 20 62 65 20 66 6f 75 6e 64 of.the.given.name.could.be.found
84c0 2e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b .</returns>..........///.<remark
84e0 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 68 65 20 72 65 73 75 6c 74 20 6f 66 20 74 68 s>..........///.The.result.of.th
8500 69 73 20 6d 65 74 68 6f 64 20 69 73 20 77 68 61 74 27 73 20 63 61 6c 6c 65 64 20 61 20 22 66 75 is.method.is.what's.called.a."fu
8520 6c 6c 79 20 6d 65 72 67 65 64 22 20 6c 61 79 6f 75 74 2c 20 69 2e 65 2e 20 61 20 6c 61 79 6f 75 lly.merged".layout,.i.e..a.layou
8540 74 20 77 69 74 68 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 74 68 65 20 69 6e 66 6f 72 6d 61 74 t.with..........///.the.informat
8560 69 6f 6e 20 6f 66 20 61 6c 6c 20 74 68 65 20 62 61 73 65 20 6c 61 79 6f 75 74 73 20 61 73 20 77 ion.of.all.the.base.layouts.as.w
8580 65 6c 6c 20 61 73 20 66 72 6f 6d 20 61 6c 6c 20 6f 76 65 72 72 69 64 65 73 20 6d 65 72 67 65 64 ell.as.from.all.overrides.merged
85a0 20 69 6e 74 6f 20 69 74 2e 20 53 65 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 20 .into.it..See..........///.<see.
85c0 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 2e 4d 65 72 67 65 4c 61 cref="InputControlLayout.MergeLa
85e0 79 6f 75 74 22 2f 3e 20 66 6f 72 20 64 65 74 61 69 6c 73 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f yout"/>.for.details...........//
8600 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 57 68 61 74 20 74 68 69 73 20 6d 65 61 6e 73 20 69 /..........///.What.this.means.i
8620 6e 20 70 72 61 63 74 69 63 65 20 69 73 20 74 68 61 74 20 61 6c 6c 20 69 6e 68 65 72 69 74 65 64 n.practice.is.that.all.inherited
8640 20 63 6f 6e 74 72 6f 6c 73 20 61 6e 64 20 73 65 74 74 69 6e 67 73 20 77 69 6c 6c 20 62 65 20 70 .controls.and.settings.will.be.p
8660 72 65 73 65 6e 74 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 6f 6e 20 74 68 65 20 6c 61 79 6f 75 resent..........///.on.the.layou
8680 74 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 t...........///..........///.<ex
86a0 61 6d 70 6c 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 2f 2f 20 4c 69 73 74 20 61 6c 6c 20 ample>..........///.//.List.all.
86c0 63 6f 6e 74 72 6f 6c 73 20 64 65 66 69 6e 65 64 20 66 6f 72 20 67 61 6d 65 70 61 64 73 2e 0d 0a controls.defined.for.gamepads...
86e0 20 20 20 20 20 20 20 20 2f 2f 2f 20 76 61 72 20 67 61 6d 65 70 61 64 4c 61 79 6f 75 74 20 3d 20 ........///.var.gamepadLayout.=.
8700 49 6e 70 75 74 53 79 73 74 65 6d 2e 4c 6f 61 64 4c 61 79 6f 75 74 28 22 47 61 6d 65 70 61 64 22 InputSystem.LoadLayout("Gamepad"
8720 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 66 6f 72 65 61 63 68 20 28 76 61 72 20 63 6f 6e );..........///.foreach.(var.con
8740 74 72 6f 6c 20 69 6e 20 67 61 6d 65 70 61 64 4c 61 79 6f 75 74 2e 63 6f 6e 74 72 6f 6c 73 29 0d trol.in.gamepadLayout.controls).
8760 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 .........///.{..........///.....
8780 2f 2f 20 54 68 65 72 65 20 6d 61 79 20 62 65 20 63 6f 6e 74 72 6f 6c 20 65 6c 65 6d 65 6e 74 73 //.There.may.be.control.elements
87a0 20 74 68 61 74 20 61 72 65 20 6e 6f 74 20 69 6e 74 72 6f 64 75 63 69 6e 67 20 6e 65 77 20 63 6f .that.are.not.introducing.new.co
87c0 6e 74 72 6f 6c 73 20 62 75 74 20 72 61 74 68 65 72 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 ntrols.but.rather..........///..
87e0 20 20 20 2f 2f 20 63 68 61 6e 67 65 20 73 65 74 74 69 6e 67 73 20 6f 6e 20 63 6f 6e 74 72 6f 6c ...//.change.settings.on.control
8800 73 20 61 64 64 65 64 20 69 6e 64 69 72 65 63 74 6c 79 20 62 79 20 6f 74 68 65 72 20 6c 61 79 6f s.added.indirectly.by.other.layo
8820 75 74 73 20 72 65 66 65 72 65 6e 63 65 64 20 66 72 6f 6d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f uts.referenced.from..........///
8840 20 20 20 20 20 2f 2f 20 47 61 6d 65 70 61 64 2e 20 54 68 65 73 65 20 61 72 65 20 6e 6f 74 20 61 .....//.Gamepad..These.are.not.a
8860 64 64 69 6e 67 20 6e 65 77 20 63 6f 6e 74 72 6f 6c 73 20 73 6f 20 77 65 20 73 6b 69 70 20 74 68 dding.new.controls.so.we.skip.th
8880 65 6d 20 68 65 72 65 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 69 66 20 28 63 6f em.here...........///.....if.(co
88a0 6e 74 72 6f 6c 2e 69 73 4d 6f 64 69 66 79 69 6e 67 45 78 69 73 74 69 6e 67 43 6f 6e 74 72 6f 6c ntrol.isModifyingExistingControl
88c0 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 63 6f 6e 74 69 6e 75 65 3b )..........///.........continue;
88e0 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 44 ..........///..........///.....D
8900 65 62 75 67 2e 4c 6f 67 28 24 22 43 6f 6e 74 72 6f 6c 3a 20 7b 63 6f 6e 74 72 6f 6c 2e 6e 61 6d ebug.Log($"Control:.{control.nam
8920 65 7d 20 28 7b 63 6f 6e 74 72 6f 6c 2e 6c 61 79 6f 75 74 5d 29 22 29 3b 0d 0a 20 20 20 20 20 20 e}.({control.layout])");........
8940 20 20 2f 2f 2f 20 7d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 65 78 61 6d 70 6c 65 3e 0d ..///.}..........///.</example>.
8960 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 48 6f 77 65 76 65 .........///..........///.Howeve
8980 72 2c 20 6e 6f 74 65 20 74 68 61 74 20 63 6f 6e 74 72 6f 6c 73 20 77 68 69 63 68 20 61 72 65 20 r,.note.that.controls.which.are.
89a0 61 64 64 65 64 20 66 72 6f 6d 20 6f 74 68 65 72 20 6c 61 79 6f 75 74 73 20 72 65 66 65 72 65 6e added.from.other.layouts.referen
89c0 63 65 64 20 62 79 20 74 68 65 20 6c 6f 61 64 65 64 20 6c 61 79 6f 75 74 0d 0a 20 20 20 20 20 20 ced.by.the.loaded.layout........
89e0 20 20 2f 2f 2f 20 77 69 6c 6c 20 6e 6f 74 20 6e 65 63 65 73 73 61 72 69 6c 79 20 62 65 20 76 69 ..///.will.not.necessarily.be.vi
8a00 73 69 62 6c 65 20 6f 6e 20 69 74 20 28 74 68 65 79 20 77 69 6c 6c 20 6f 6e 6c 79 20 69 66 20 72 sible.on.it.(they.will.only.if.r
8a20 65 66 65 72 65 6e 63 65 64 20 62 79 20 61 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 43 eferenced.by.a.<see.cref="InputC
8a40 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 2e 43 6f 6e 74 72 6f 6c 49 74 65 6d 22 2f 3e 0d 0a 20 20 20 ontrolLayout.ControlItem"/>.....
8a60 20 20 20 20 20 2f 2f 2f 20 77 68 65 72 65 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 43 .....///.where.<see.cref="InputC
8a80 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 2e 43 6f 6e 74 72 6f 6c 49 74 65 6d 2e 69 73 4d 6f 64 69 66 ontrolLayout.ControlItem.isModif
8aa0 79 69 6e 67 45 78 69 73 74 69 6e 67 43 6f 6e 74 72 6f 6c 22 2f 3e 20 69 73 20 3c 63 3e 74 72 75 yingExistingControl"/>.is.<c>tru
8ac0 65 3c 2f 63 3e 29 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 46 6f 72 20 65 78 61 6d 70 6c 65 e</c>)...........///.For.example
8ae0 2c 20 6c 65 74 27 73 20 61 73 73 75 6d 65 20 77 65 20 68 61 76 65 20 74 68 65 20 66 6f 6c 6c 6f ,.let's.assume.we.have.the.follo
8b00 77 69 6e 67 20 6c 61 79 6f 75 74 20 77 68 69 63 68 20 61 64 64 73 20 61 20 64 65 76 69 63 65 20 wing.layout.which.adds.a.device.
8b20 77 69 74 68 20 61 20 73 69 6e 67 6c 65 20 73 74 69 63 6b 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f with.a.single.stick...........//
8b40 2f 0d 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 /..........///.<example>........
8b60 20 20 2f 2f 2f 20 3c 63 6f 64 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 6e 70 75 74 53 ..///.<code>..........///.InputS
8b80 79 73 74 65 6d 2e 52 65 67 69 73 74 65 72 4c 61 79 6f 75 74 28 40 22 0d 0a 20 20 20 20 20 20 20 ystem.RegisterLayout(@".........
8ba0 20 2f 2f 2f 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 .///.....{..........///.........
8bc0 22 22 6e 61 6d 65 22 22 20 3a 20 22 22 44 65 76 69 63 65 57 69 74 68 53 74 69 63 6b 22 22 2c 0d ""name"".:.""DeviceWithStick"",.
8be0 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 22 22 63 6f 6e 74 72 6f 6c 73 22 .........///.........""controls"
8c00 22 20 3a 20 5b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 7b ".:.[..........///.............{
8c20 20 22 22 6e 61 6d 65 22 22 20 3a 20 22 22 73 74 69 63 6b 22 22 2c 20 22 22 6c 61 79 6f 75 74 22 .""name"".:.""stick"",.""layout"
8c40 22 20 3a 20 22 22 53 74 69 63 6b 22 22 20 7d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 ".:.""Stick"".}..........///....
8c60 20 20 20 20 20 5d 0d 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 .....]..........///.....}.......
8c80 20 20 20 2f 2f 2f 20 22 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 63 6f 64 65 3e 0d ...///.");..........///.</code>.
8ca0 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 65 78 61 6d 70 6c 65 3e 0d 0a 20 20 20 20 20 20 20 .........///.</example>.........
8cc0 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 66 20 77 65 20 6c 6f 61 64 20 74 68 69 .///..........///.If.we.load.thi
8ce0 73 20 6c 61 79 6f 75 74 2c 20 74 68 65 20 3c 63 3e 22 73 74 69 63 6b 22 3c 2f 63 3e 20 63 6f 6e s.layout,.the.<c>"stick"</c>.con
8d00 74 72 6f 6c 20 77 69 6c 6c 20 62 65 20 76 69 73 69 62 6c 65 20 6f 6e 20 74 68 65 20 6c 61 79 6f trol.will.be.visible.on.the.layo
8d20 75 74 20 62 75 74 20 74 68 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 58 20 61 6e 64 20 59 20 ut.but.the..........///.X.and.Y.
8d40 28 61 73 20 77 65 6c 6c 20 61 73 20 75 70 2f 64 6f 77 6e 2f 6c 65 66 74 2f 72 69 67 68 74 29 20 (as.well.as.up/down/left/right).
8d60 63 6f 6e 74 72 6f 6c 73 20 61 64 64 65 64 20 62 79 20 74 68 65 20 3c 63 3e 22 53 74 69 63 6b 22 controls.added.by.the.<c>"Stick"
8d80 3c 2f 63 3e 20 6c 61 79 6f 75 74 20 77 69 6c 6c 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 6e 6f </c>.layout.will..........///.no
8da0 74 20 62 65 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 0a 20 t.be...........///.</remarks>...
8dc0 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 52 65 67 69 73 74 .......///.<seealso.cref="Regist
8de0 65 72 4c 61 79 6f 75 74 28 54 79 70 65 2c 73 74 72 69 6e 67 2c 4e 75 6c 6c 61 62 6c 65 7b 49 6e erLayout(Type,string,Nullable{In
8e00 70 75 74 44 65 76 69 63 65 4d 61 74 63 68 65 72 7d 29 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 putDeviceMatcher})"/>..........p
8e20 75 62 6c 69 63 20 73 74 61 74 69 63 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 20 ublic.static.InputControlLayout.
8e40 4c 6f 61 64 4c 61 79 6f 75 74 28 73 74 72 69 6e 67 20 6e 61 6d 65 29 0d 0a 20 20 20 20 20 20 20 LoadLayout(string.name).........
8e60 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 74 72 69 6e 67 2e 49 73 4e 75 6c .{..............if.(string.IsNul
8e80 6c 4f 72 45 6d 70 74 79 28 6e 61 6d 65 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 lOrEmpty(name)).................
8ea0 20 74 68 72 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e .throw.new.ArgumentNullException
8ec0 28 6e 61 6d 65 6f 66 28 6e 61 6d 65 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f (nameof(name));..............///
8ee0 2f 46 49 58 4d 45 3a 20 74 68 69 73 20 77 69 6c 6c 20 69 6e 74 65 72 6e 20 74 68 65 20 6e 61 6d /FIXME:.this.will.intern.the.nam
8f00 65 20 65 76 65 6e 20 69 66 20 74 68 65 20 6f 70 65 72 61 74 69 6f 6e 20 66 61 69 6c 73 0d 0a 20 e.even.if.the.operation.fails...
8f20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 73 5f 4d 61 6e 61 67 65 72 2e 54 72 79 4c ...........return.s_Manager.TryL
8f40 6f 61 64 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 28 6e 65 77 20 49 6e 74 65 72 6e 65 64 53 74 72 oadControlLayout(new.InternedStr
8f60 69 6e 67 28 6e 61 6d 65 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 ing(name));..........}..........
8f80 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 4c 6f 61 ..///.<summary>..........///.Loa
8fa0 64 20 74 68 65 20 6c 61 79 6f 75 74 20 72 65 67 69 73 74 65 72 65 64 20 66 6f 72 20 74 68 65 20 d.the.layout.registered.for.the.
8fc0 67 69 76 65 6e 20 74 79 70 65 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 given.type...........///.</summa
8fe0 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 74 79 70 65 70 61 72 61 6d 20 6e 61 6d 65 ry>..........///.<typeparam.name
9000 3d 22 54 43 6f 6e 74 72 6f 6c 22 3e 41 6e 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 20 74 79 70 65 ="TControl">An.InputControl.type
9020 2e 3c 2f 74 79 70 65 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 74 75 .</typeparam>..........///.<retu
9040 72 6e 73 3e 54 68 65 20 6c 61 79 6f 75 74 20 72 65 67 69 73 74 65 72 65 64 20 66 6f 72 20 3c 74 rns>The.layout.registered.for.<t
9060 79 70 65 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 54 43 6f 6e 74 72 6f 6c 22 2f 3e 20 6f 72 ypeparamref.name="TControl"/>.or
9080 20 3c 63 3e 6e 75 6c 6c 3c 2f 63 3e 20 69 66 20 6e 6f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 .<c>null</c>.if.no..........///.
90a0 73 75 63 68 20 6c 61 79 6f 75 74 20 65 78 69 73 74 73 2e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 such.layout.exists.</returns>...
90c0 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f .......///.<remarks>..........//
90e0 2f 20 54 68 69 73 20 6d 65 74 68 6f 64 20 69 73 20 65 71 75 69 76 61 6c 65 6e 74 20 74 6f 20 63 /.This.method.is.equivalent.to.c
9100 61 6c 6c 69 6e 67 20 3c 73 65 65 20 63 72 65 66 3d 22 4c 6f 61 64 4c 61 79 6f 75 74 28 73 74 72 alling.<see.cref="LoadLayout(str
9120 69 6e 67 29 22 2f 3e 20 77 69 74 68 20 74 68 65 20 6e 61 6d 65 0d 0a 20 20 20 20 20 20 20 20 2f ing)"/>.with.the.name........../
9140 2f 2f 20 6f 66 20 74 68 65 20 6c 61 79 6f 75 74 20 75 6e 64 65 72 20 77 68 69 63 68 20 3c 74 79 //.of.the.layout.under.which.<ty
9160 70 65 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 54 43 6f 6e 74 72 6f 6c 22 2f 3e 20 68 61 73 peparamref.name="TControl"/>.has
9180 20 62 65 65 6e 20 72 65 67 69 73 74 65 72 65 64 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a .been.registered...........///..
91a0 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 2f ........///.<example>........../
91c0 2f 2f 20 3c 63 6f 64 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 2f 2f 20 4c 6f 61 64 20 74 //.<code>..........///.//.Load.t
91e0 68 65 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 20 67 65 6e 65 72 61 74 65 64 20 he.InputControlLayout.generated.
9200 66 72 6f 6d 20 53 74 69 63 6b 43 6f 6e 74 72 6f 6c 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 from.StickControl...........///.
9220 76 61 72 20 73 74 69 63 6b 4c 61 79 6f 75 74 20 3d 20 49 6e 70 75 74 53 79 73 74 65 6d 2e 4c 6f var.stickLayout.=.InputSystem.Lo
9240 61 64 4c 61 79 6f 75 74 26 6c 74 3b 53 74 69 63 6b 43 6f 6e 74 72 6f 6c 26 67 74 3b 28 29 3b 0d adLayout&lt;StickControl&gt;();.
9260 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 2f 2f .........///.</code>..........//
9280 2f 20 3c 2f 65 78 61 6d 70 6c 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 6d 61 /.</example>..........///.</rema
92a0 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d rks>..........///.<seealso.cref=
92c0 22 4c 6f 61 64 4c 61 79 6f 75 74 28 73 74 72 69 6e 67 29 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 "LoadLayout(string)"/>..........
92e0 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 public.static.InputControlLayout
9300 20 4c 6f 61 64 4c 61 79 6f 75 74 3c 54 43 6f 6e 74 72 6f 6c 3e 28 29 0d 0a 20 20 20 20 20 20 20 .LoadLayout<TControl>().........
9320 20 20 20 20 20 77 68 65 72 65 20 54 43 6f 6e 74 72 6f 6c 20 3a 20 49 6e 70 75 74 43 6f 6e 74 72 .....where.TControl.:.InputContr
9340 6f 6c 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 65 74 75 72 ol..........{..............retur
9360 6e 20 73 5f 4d 61 6e 61 67 65 72 2e 54 72 79 4c 6f 61 64 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 n.s_Manager.TryLoadControlLayout
9380 28 74 79 70 65 6f 66 28 54 43 6f 6e 74 72 6f 6c 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a (typeof(TControl));..........}..
93a0 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>.........
93c0 20 2f 2f 2f 20 52 65 74 75 72 6e 20 74 68 65 20 6e 61 6d 65 20 6f 66 20 74 68 65 20 6c 61 79 6f .///.Return.the.name.of.the.layo
93e0 75 74 20 74 68 61 74 20 74 68 65 20 6c 61 79 6f 75 74 20 72 65 67 69 73 74 65 72 65 64 20 61 73 ut.that.the.layout.registered.as
9400 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 6c 61 79 6f 75 74 4e 61 6d 65 22 2f 3e 0d 0a .<paramref.name="layoutName"/>..
9420 20 20 20 20 20 20 20 20 2f 2f 2f 20 69 73 20 62 61 73 65 64 20 6f 6e 2e 0d 0a 20 20 20 20 20 20 ........///.is.based.on.........
9440 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
9460 61 72 61 6d 20 6e 61 6d 65 3d 22 6c 61 79 6f 75 74 4e 61 6d 65 22 3e 4e 61 6d 65 20 6f 66 20 61 aram.name="layoutName">Name.of.a
9480 20 6c 61 79 6f 75 74 20 61 73 20 72 65 67 69 73 74 65 72 65 64 20 77 69 74 68 20 61 20 6d 65 74 .layout.as.registered.with.a.met
94a0 68 6f 64 20 73 75 63 68 20 61 73 20 3c 73 65 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 63 72 hod.such.as.<see..........///.cr
94c0 65 66 3d 22 52 65 67 69 73 74 65 72 4c 61 79 6f 75 74 7b 54 7d 28 73 74 72 69 6e 67 2c 49 6e 70 ef="RegisterLayout{T}(string,Inp
94e0 75 74 44 65 76 69 63 65 4d 61 74 63 68 65 72 3f 29 22 2f 3e 2e 20 43 61 73 65 2d 69 6e 73 65 6e utDeviceMatcher?)"/>..Case-insen
9500 73 69 74 69 76 65 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 sitive.</param>..........///.<re
9520 74 75 72 6e 73 3e 4e 61 6d 65 20 6f 66 20 74 68 65 20 69 6d 6d 65 64 69 61 74 65 20 70 61 72 65 turns>Name.of.the.immediate.pare
9540 6e 74 20 6c 61 79 6f 75 74 20 6f 66 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 6c 61 79 nt.layout.of.<paramref.name="lay
9560 6f 75 74 4e 61 6d 65 22 2f 3e 20 6f 72 20 3c 63 3e 6e 75 6c 6c 3c 2f 63 3e 20 69 66 20 6e 6f 20 outName"/>.or.<c>null</c>.if.no.
9580 6c 61 79 6f 75 74 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 77 69 74 68 20 74 68 65 20 67 69 76 layout..........///.with.the.giv
95a0 65 6e 20 6e 61 6d 65 20 69 73 20 72 65 67 69 73 74 65 72 65 64 20 6f 72 20 69 66 20 69 74 20 69 en.name.is.registered.or.if.it.i
95c0 73 20 6e 6f 74 20 62 61 73 65 64 20 6f 6e 20 61 6e 6f 74 68 65 72 20 6c 61 79 6f 75 74 20 6f 72 s.not.based.on.another.layout.or
95e0 20 69 66 20 69 74 20 69 73 20 61 20 6c 61 79 6f 75 74 20 6f 76 65 72 72 69 64 65 2e 3c 2f 72 65 .if.it.is.a.layout.override.</re
9600 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f 6e 20 63 turns>..........///.<exception.c
9620 72 65 66 3d 22 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 22 3e 3c 70 61 72 ref="ArgumentNullException"><par
9640 61 6d 72 65 66 20 6e 61 6d 65 3d 22 6c 61 79 6f 75 74 4e 61 6d 65 22 2f 3e 20 69 73 20 3c 63 3e amref.name="layoutName"/>.is.<c>
9660 6e 75 6c 6c 3c 2f 63 3e 20 6f 72 20 65 6d 70 74 79 2e 3c 2f 65 78 63 65 70 74 69 6f 6e 3e 0d 0a null</c>.or.empty.</exception>..
9680 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f ........///.<remarks>........../
96a0 2f 2f 20 54 68 69 73 20 6d 65 74 68 6f 64 20 64 6f 65 73 20 6e 6f 74 20 77 6f 72 6b 20 66 6f 72 //.This.method.does.not.work.for
96c0 20 6c 61 79 6f 75 74 20 6f 76 65 72 72 69 64 65 73 20 28 77 68 69 63 68 20 63 61 6e 20 62 65 20 .layout.overrides.(which.can.be.
96e0 62 61 73 65 64 20 6f 6e 20 6d 75 6c 74 69 70 6c 65 20 62 61 73 65 20 6c 61 79 6f 75 74 73 29 2e based.on.multiple.base.layouts).
9700 20 54 6f 20 66 69 6e 64 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 6f 75 74 20 77 68 69 63 68 20 .To.find..........///.out.which.
9720 6c 61 79 6f 75 74 73 20 61 20 73 70 65 63 69 66 69 63 20 6f 76 65 72 72 69 64 65 20 72 65 67 69 layouts.a.specific.override.regi
9740 73 74 65 72 65 64 20 77 69 74 68 20 3c 73 65 65 20 63 72 65 66 3d 22 52 65 67 69 73 74 65 72 4c stered.with.<see.cref="RegisterL
9760 61 79 6f 75 74 4f 76 65 72 72 69 64 65 22 2f 3e 20 69 73 20 62 61 73 65 64 20 6f 6e 2c 0d 0a 20 ayoutOverride"/>.is.based.on,...
9780 20 20 20 20 20 20 20 2f 2f 2f 20 6c 6f 61 64 20 74 68 65 20 6c 61 79 6f 75 74 20 77 69 74 68 20 .......///.load.the.layout.with.
97a0 3c 73 65 65 20 63 72 65 66 3d 22 4c 6f 61 64 4c 61 79 6f 75 74 22 2f 3e 20 61 6e 64 20 69 6e 73 <see.cref="LoadLayout"/>.and.ins
97c0 70 65 63 74 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f pect.<see.cref="InputControlLayo
97e0 75 74 2e 62 61 73 65 4c 61 79 6f 75 74 73 22 2f 3e 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 ut.baseLayouts"/>...........///.
9800 54 68 69 73 20 6d 65 74 68 6f 64 20 77 69 6c 6c 20 72 65 74 75 72 6e 20 3c 63 3e 6e 75 6c 6c 3c This.method.will.return.<c>null<
9820 2f 63 3e 20 77 68 65 6e 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 6c 61 79 6f 75 74 4e /c>.when.<paramref.name="layoutN
9840 61 6d 65 22 2f 3e 20 69 73 20 74 68 65 20 6e 61 6d 65 20 6f 66 20 61 20 6c 61 79 6f 75 74 20 6f ame"/>.is.the.name.of.a.layout.o
9860 76 65 72 72 69 64 65 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f verride...........///........../
9880 2f 2f 20 4f 6e 65 20 61 64 76 61 6e 74 61 67 65 20 6f 66 20 74 68 69 73 20 6d 65 74 68 6f 64 20 //.One.advantage.of.this.method.
98a0 6f 76 65 72 20 63 61 6c 6c 69 6e 67 20 3c 73 65 65 20 63 72 65 66 3d 22 4c 6f 61 64 4c 61 79 6f over.calling.<see.cref="LoadLayo
98c0 75 74 22 2f 3e 20 61 6e 64 20 6c 6f 6f 6b 69 6e 67 20 61 74 20 3c 73 65 65 20 63 72 65 66 3d 22 ut"/>.and.looking.at.<see.cref="
98e0 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 2e 62 61 73 65 4c 61 79 6f 75 74 73 22 2f InputControlLayout.baseLayouts"/
9900 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 69 73 20 74 68 61 74 20 74 68 69 73 20 6d 65 74 68 >..........///.is.that.this.meth
9920 6f 64 20 64 6f 65 73 20 6e 6f 74 20 68 61 76 65 20 74 6f 20 61 63 74 75 61 6c 6c 79 20 6c 6f 61 od.does.not.have.to.actually.loa
9940 64 20 74 68 65 20 6c 61 79 6f 75 74 20 62 75 74 20 69 6e 73 74 65 61 64 20 6f 6e 6c 79 20 70 65 d.the.layout.but.instead.only.pe
9960 72 66 6f 72 6d 73 20 61 20 73 69 6d 70 6c 65 20 6c 6f 6f 6b 75 70 2e 0d 0a 20 20 20 20 20 20 20 rforms.a.simple.lookup..........
9980 20 2f 2f 2f 0d 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 .///..........///.<example>.....
99a0 20 20 20 20 20 2f 2f 2f 20 3c 63 6f 64 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 2f 2f 20 .....///.<code>..........///.//.
99c0 50 72 69 6e 74 73 20 22 50 6f 69 6e 74 65 72 22 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 44 Prints."Pointer"...........///.D
99e0 65 62 75 67 2e 4c 6f 67 28 49 6e 70 75 74 53 79 73 74 65 6d 2e 47 65 74 4e 61 6d 65 4f 66 42 61 ebug.Log(InputSystem.GetNameOfBa
9a00 73 65 4c 61 79 6f 75 74 28 22 4d 6f 75 73 65 22 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f seLayout("Mouse"));..........///
9a20 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 2f 2f 20 41 6c 73 6f 20 77 6f 72 6b 73 20 66 6f 72 20 ..........///.//.Also.works.for.
9a40 63 6f 6e 74 72 6f 6c 20 6c 61 79 6f 75 74 73 2e 20 50 72 69 6e 74 73 20 22 41 78 69 73 22 2e 0d control.layouts..Prints."Axis"..
9a60 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 44 65 62 75 67 2e 4c 6f 67 28 49 6e 70 75 74 53 79 73 74 .........///.Debug.Log(InputSyst
9a80 65 6d 2e 47 65 74 4e 61 6d 65 4f 66 42 61 73 65 4c 61 79 6f 75 74 28 22 42 75 74 74 6f 6e 22 29 em.GetNameOfBaseLayout("Button")
9aa0 29 3b 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 );..........///.</code>.........
9ac0 20 2f 2f 2f 20 3c 2f 65 78 61 6d 70 6c 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 72 .///.</example>..........///.</r
9ae0 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 emarks>..........///.<seealso.cr
9b00 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 2e 62 61 73 65 4c 61 79 6f 75 ef="InputControlLayout.baseLayou
9b20 74 73 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 73 74 72 ts"/>..........public.static.str
9b40 69 6e 67 20 47 65 74 4e 61 6d 65 4f 66 42 61 73 65 4c 61 79 6f 75 74 28 73 74 72 69 6e 67 20 6c ing.GetNameOfBaseLayout(string.l
9b60 61 79 6f 75 74 4e 61 6d 65 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 ayoutName)..........{...........
9b80 20 20 20 69 66 20 28 73 74 72 69 6e 67 2e 49 73 4e 75 6c 6c 4f 72 45 6d 70 74 79 28 6c 61 79 6f ...if.(string.IsNullOrEmpty(layo
9ba0 75 74 4e 61 6d 65 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 utName))..................throw.
9bc0 6e 65 77 20 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 28 6e 61 6d 65 6f 66 new.ArgumentNullException(nameof
9be0 28 6c 61 79 6f 75 74 4e 61 6d 65 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 (layoutName));................va
9c00 72 20 69 6e 74 65 72 6e 65 64 4c 61 79 6f 75 74 4e 61 6d 65 20 3d 20 6e 65 77 20 49 6e 74 65 72 r.internedLayoutName.=.new.Inter
9c20 6e 65 64 53 74 72 69 6e 67 28 6c 61 79 6f 75 74 4e 61 6d 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 nedString(layoutName);..........
9c40 20 20 20 20 69 66 20 28 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 2e 73 5f 4c 61 79 ....if.(InputControlLayout.s_Lay
9c60 6f 75 74 73 2e 62 61 73 65 4c 61 79 6f 75 74 54 61 62 6c 65 2e 54 72 79 47 65 74 56 61 6c 75 65 outs.baseLayoutTable.TryGetValue
9c80 28 69 6e 74 65 72 6e 65 64 4c 61 79 6f 75 74 4e 61 6d 65 2c 20 6f 75 74 20 76 61 72 20 72 65 73 (internedLayoutName,.out.var.res
9ca0 75 6c 74 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 72 65 ult))..................return.re
9cc0 73 75 6c 74 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 6e 75 6c 6c sult;................return.null
9ce0 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
9d00 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 43 68 65 63 6b 20 77 68 65 74 68 65 72 mary>..........///.Check.whether
9d20 20 74 68 65 20 66 69 72 73 74 20 6c 61 79 6f 75 74 20 69 73 20 62 61 73 65 64 20 6f 6e 20 74 68 .the.first.layout.is.based.on.th
9d40 65 20 73 65 63 6f 6e 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 e.second...........///.</summary
9d60 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 66 69 72 73 >..........///.<param.name="firs
9d80 74 4c 61 79 6f 75 74 4e 61 6d 65 22 3e 4e 61 6d 65 20 6f 66 20 61 20 72 65 67 69 73 74 65 72 65 tLayoutName">Name.of.a.registere
9da0 64 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 22 d.<see.cref="InputControlLayout"
9dc0 2f 3e 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 />.</param>..........///.<param.
9de0 6e 61 6d 65 3d 22 73 65 63 6f 6e 64 4c 61 79 6f 75 74 4e 61 6d 65 22 3e 4e 61 6d 65 20 6f 66 20 name="secondLayoutName">Name.of.
9e00 61 20 72 65 67 69 73 74 65 72 65 64 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e a.registered.<see.cref="InputCon
9e20 74 72 6f 6c 4c 61 79 6f 75 74 22 2f 3e 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 trolLayout"/>.</param>..........
9e40 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 54 72 75 65 20 69 66 20 3c 70 61 72 61 6d 72 65 66 20 6e ///.<returns>True.if.<paramref.n
9e60 61 6d 65 3d 22 66 69 72 73 74 4c 61 79 6f 75 74 4e 61 6d 65 22 2f 3e 20 69 73 20 62 61 73 65 64 ame="firstLayoutName"/>.is.based
9e80 20 6f 6e 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 73 65 63 6f 6e 64 4c 61 79 6f 75 74 .on.<paramref.name="secondLayout
9ea0 4e 61 6d 65 22 2f 3e 2e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 Name"/>.</returns>..........///.
9ec0 3c 65 78 63 65 70 74 69 6f 6e 20 63 72 65 66 3d 22 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 <exception.cref="ArgumentNullExc
9ee0 65 70 74 69 6f 6e 22 3e 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 66 69 72 73 74 4c 61 79 eption"><paramref.name="firstLay
9f00 6f 75 74 4e 61 6d 65 22 2f 3e 20 69 73 20 3c 63 3e 6e 75 6c 6c 3c 2f 63 3e 20 6f 72 20 65 6d 70 outName"/>.is.<c>null</c>.or.emp
9f20 74 79 20 2d 6f 72 2d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 72 65 66 20 6e ty.-or-..........///.<paramref.n
9f40 61 6d 65 3d 22 73 65 63 6f 6e 64 4c 61 79 6f 75 74 4e 61 6d 65 22 2f 3e 20 69 73 20 3c 63 3e 6e ame="secondLayoutName"/>.is.<c>n
9f60 75 6c 6c 3c 2f 63 3e 20 6f 72 20 65 6d 70 74 79 2e 3c 2f 65 78 63 65 70 74 69 6f 6e 3e 0d 0a 20 ull</c>.or.empty.</exception>...
9f80 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f .......///.<remarks>..........//
9fa0 2f 20 54 68 69 73 20 69 73 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 61 6d 70 6c 65 3e /.This.is..........///.<example>
9fc0 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 65 78 61 6d 70 6c 65 3e 0d 0a 20 20 20 20 20 20 ..........///.</example>........
9fe0 20 20 2f 2f 2f 20 3c 2f 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 ..///.</remarks>..........public
a000 20 73 74 61 74 69 63 20 62 6f 6f 6c 20 49 73 46 69 72 73 74 4c 61 79 6f 75 74 42 61 73 65 64 4f .static.bool.IsFirstLayoutBasedO
a020 6e 53 65 63 6f 6e 64 28 73 74 72 69 6e 67 20 66 69 72 73 74 4c 61 79 6f 75 74 4e 61 6d 65 2c 20 nSecond(string.firstLayoutName,.
a040 73 74 72 69 6e 67 20 73 65 63 6f 6e 64 4c 61 79 6f 75 74 4e 61 6d 65 29 0d 0a 20 20 20 20 20 20 string.secondLayoutName)........
a060 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 74 72 69 6e 67 2e 49 73 4e 75 ..{..............if.(string.IsNu
a080 6c 6c 4f 72 45 6d 70 74 79 28 66 69 72 73 74 4c 61 79 6f 75 74 4e 61 6d 65 29 29 0d 0a 20 20 20 llOrEmpty(firstLayoutName)).....
a0a0 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 4e .............throw.new.ArgumentN
a0c0 75 6c 6c 45 78 63 65 70 74 69 6f 6e 28 6e 61 6d 65 6f 66 28 66 69 72 73 74 4c 61 79 6f 75 74 4e ullException(nameof(firstLayoutN
a0e0 61 6d 65 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 74 72 69 6e 67 2e 49 ame));..............if.(string.I
a100 73 4e 75 6c 6c 4f 72 45 6d 70 74 79 28 73 65 63 6f 6e 64 4c 61 79 6f 75 74 4e 61 6d 65 29 29 0d sNullOrEmpty(secondLayoutName)).
a120 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 41 72 67 75 6d .................throw.new.Argum
a140 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 28 6e 61 6d 65 6f 66 28 73 65 63 6f 6e 64 4c 61 entNullException(nameof(secondLa
a160 79 6f 75 74 4e 61 6d 65 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 69 youtName));................var.i
a180 6e 74 65 72 6e 65 64 46 69 72 73 74 4e 61 6d 65 20 3d 20 6e 65 77 20 49 6e 74 65 72 6e 65 64 53 nternedFirstName.=.new.InternedS
a1a0 74 72 69 6e 67 28 66 69 72 73 74 4c 61 79 6f 75 74 4e 61 6d 65 29 3b 0d 0a 20 20 20 20 20 20 20 tring(firstLayoutName);.........
a1c0 20 20 20 20 20 76 61 72 20 69 6e 74 65 72 6e 65 64 53 65 63 6f 6e 64 4e 61 6d 65 20 3d 20 6e 65 .....var.internedSecondName.=.ne
a1e0 77 20 49 6e 74 65 72 6e 65 64 53 74 72 69 6e 67 28 73 65 63 6f 6e 64 4c 61 79 6f 75 74 4e 61 6d w.InternedString(secondLayoutNam
a200 65 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 69 6e 74 65 72 6e 65 64 46 e);................if.(internedF
a220 69 72 73 74 4e 61 6d 65 20 3d 3d 20 69 6e 74 65 72 6e 65 64 53 65 63 6f 6e 64 4e 61 6d 65 29 0d irstName.==.internedSecondName).
a240 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 74 72 75 65 3b 0d 0a 0d .................return.true;...
a260 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c .............return.InputControl
a280 4c 61 79 6f 75 74 2e 73 5f 4c 61 79 6f 75 74 73 2e 49 73 42 61 73 65 64 4f 6e 28 69 6e 74 65 72 Layout.s_Layouts.IsBasedOn(inter
a2a0 6e 65 64 53 65 63 6f 6e 64 4e 61 6d 65 2c 20 69 6e 74 65 72 6e 65 64 46 69 72 73 74 4e 61 6d 65 nedSecondName,.internedFirstName
a2c0 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 23 65 6e 64 72 65 67 );..........}............#endreg
a2e0 69 6f 6e 0d 0a 0d 0a 20 20 20 20 20 20 20 20 23 72 65 67 69 6f 6e 20 50 72 6f 63 65 73 73 6f 72 ion............#region.Processor
a300 73 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 s............///.<summary>......
a320 20 20 20 20 2f 2f 2f 20 52 65 67 69 73 74 65 72 20 61 6e 20 3c 73 65 65 20 63 72 65 66 3d 22 49 ....///.Register.an.<see.cref="I
a340 6e 70 75 74 50 72 6f 63 65 73 73 6f 72 7b 54 56 61 6c 75 65 7d 22 2f 3e 20 77 69 74 68 20 74 68 nputProcessor{TValue}"/>.with.th
a360 65 20 73 79 73 74 65 6d 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.system...........///.</summary
a380 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 74 79 70 65 >..........///.<param.name="type
a3a0 22 3e 54 79 70 65 20 74 68 61 74 20 69 6d 70 6c 65 6d 65 6e 74 73 20 3c 73 65 65 20 63 72 65 66 ">Type.that.implements.<see.cref
a3c0 3d 22 49 6e 70 75 74 50 72 6f 63 65 73 73 6f 72 22 2f 3e 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 ="InputProcessor"/>.</param>....
a3e0 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 6e 61 6d 65 22 3e 4e 61 6d ......///.<param.name="name">Nam
a400 65 20 74 6f 20 75 73 65 20 66 6f 72 20 74 68 65 20 70 72 6f 63 65 73 73 6f 72 2e 20 49 66 20 3c e.to.use.for.the.processor..If.<
a420 63 3e 6e 75 6c 6c 3c 2f 63 3e 20 6f 72 20 65 6d 70 74 79 2c 20 6e 61 6d 65 20 77 69 6c 6c 20 62 c>null</c>.or.empty,.name.will.b
a440 65 20 74 61 6b 65 6e 20 66 72 6f 6d 20 74 68 65 20 73 68 6f 72 74 20 6e 61 6d 65 0d 0a 20 20 20 e.taken.from.the.short.name.....
a460 20 20 20 20 20 2f 2f 2f 20 6f 66 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 74 79 70 65 .....///.of.<paramref.name="type
a480 22 2f 3e 20 28 69 66 20 69 74 20 65 6e 64 73 20 69 6e 20 22 50 72 6f 63 65 73 73 6f 72 22 2c 20 "/>.(if.it.ends.in."Processor",.
a4a0 74 68 61 74 20 73 75 66 66 69 78 20 77 69 6c 6c 20 62 65 20 63 6c 69 70 70 65 64 20 66 72 6f 6d that.suffix.will.be.clipped.from
a4c0 20 74 68 65 20 6e 61 6d 65 29 2e 20 4e 61 6d 65 73 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 61 .the.name)..Names..........///.a
a4e0 72 65 20 63 61 73 65 2d 69 6e 73 65 6e 73 69 74 69 76 65 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 re.case-insensitive.</param>....
a500 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f ......///.<remarks>..........///
a520 20 50 72 6f 63 65 73 73 6f 72 73 20 61 72 65 20 75 73 65 64 20 62 79 20 62 6f 74 68 20 62 69 6e .Processors.are.used.by.both.bin
a540 64 69 6e 67 73 20 28 73 65 65 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 42 69 6e 64 69 dings.(see.<see.cref="InputBindi
a560 6e 67 22 2f 3e 29 20 61 6e 64 20 62 79 20 63 6f 6e 74 72 6f 6c 73 0d 0a 20 20 20 20 20 20 20 20 ng"/>).and.by.controls..........
a580 2f 2f 2f 20 28 73 65 65 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c ///.(see.<see.cref="InputControl
a5a0 22 2f 3e 29 20 74 6f 20 70 6f 73 74 2d 70 72 6f 63 65 73 73 20 69 6e 70 75 74 20 76 61 6c 75 65 "/>).to.post-process.input.value
a5c0 73 20 61 73 20 74 68 65 79 20 61 72 65 20 62 65 69 6e 67 20 72 65 71 75 65 73 74 65 64 0d 0a 20 s.as.they.are.being.requested...
a5e0 20 20 20 20 20 20 20 2f 2f 2f 20 66 72 6f 6d 20 63 61 6c 6c 73 20 73 75 63 68 20 61 73 20 3c 73 .......///.from.calls.such.as.<s
a600 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 41 63 74 69 6f 6e 2e 52 65 61 64 56 61 6c 75 65 7b 54 ee.cref="InputAction.ReadValue{T
a620 56 61 6c 75 65 7d 22 2f 3e 20 6f 72 20 3c 73 65 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 63 Value}"/>.or.<see..........///.c
a640 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 7b 54 7d 2e 52 65 61 64 56 61 6c 75 65 22 2f ref="InputControl{T}.ReadValue"/
a660 3e 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 >...........///..........///.<ex
a680 61 6d 70 6c 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 63 6f 64 65 3e 0d 0a 20 20 20 20 ample>..........///.<code>......
a6a0 20 20 20 20 2f 2f 2f 20 2f 2f 20 4c 65 74 27 73 20 73 61 79 20 74 68 61 74 20 77 65 20 77 61 6e ....///.//.Let's.say.that.we.wan
a6c0 74 20 74 6f 20 64 65 66 69 6e 65 20 61 20 70 72 6f 63 65 73 73 6f 72 20 74 68 61 74 20 61 64 64 t.to.define.a.processor.that.add
a6e0 73 20 73 6f 6d 65 20 72 61 6e 64 6f 6d 20 6a 69 74 74 65 72 20 74 6f 20 69 74 73 20 69 6e 70 75 s.some.random.jitter.to.its.inpu
a700 74 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 2f 2f 20 57 65 20 68 61 76 65 20 74 6f 20 70 69 t...........///.//.We.have.to.pi
a720 63 6b 20 61 20 76 61 6c 75 65 20 74 79 70 65 20 74 6f 20 6f 70 65 72 61 74 65 20 6f 6e 20 69 66 ck.a.value.type.to.operate.on.if
a740 20 77 65 20 77 61 6e 74 20 74 6f 20 64 65 72 69 76 65 20 66 72 6f 6d 20 49 6e 70 75 74 50 72 6f .we.want.to.derive.from.InputPro
a760 63 65 73 73 6f 72 26 6c 74 3b 54 26 67 74 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 2f 2f 20 cessor&lt;T&gt;..........///.//.
a780 73 6f 20 77 65 20 67 6f 20 77 69 74 68 20 66 6c 6f 61 74 20 68 65 72 65 2e 0d 0a 20 20 20 20 20 so.we.go.with.float.here........
a7a0 20 20 20 2f 2f 2f 20 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 2f 2f 20 41 6c 73 6f 2c 20 ...///.//..........///.//.Also,.
a7c0 61 73 20 77 65 20 77 69 6c 6c 20 6e 65 65 64 20 74 6f 20 70 6c 61 63 65 20 6f 75 72 20 63 61 6c as.we.will.need.to.place.our.cal
a7e0 6c 20 74 6f 20 52 65 67 69 73 74 65 72 50 72 6f 63 65 73 73 6f 72 20 73 6f 6d 65 77 68 65 72 65 l.to.RegisterProcessor.somewhere
a800 2c 20 77 65 20 61 64 64 20 61 74 74 72 69 62 75 74 65 73 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f ,.we.add.attributes..........///
a820 20 2f 2f 20 74 6f 20 68 6f 6f 6b 20 69 6e 74 6f 20 55 6e 69 74 79 27 73 20 69 6e 69 74 69 61 6c .//.to.hook.into.Unity's.initial
a840 69 7a 61 74 69 6f 6e 2e 20 54 68 69 73 20 77 6f 72 6b 73 20 64 69 66 66 65 72 65 6e 74 6c 79 20 ization..This.works.differently.
a860 69 6e 20 74 68 65 20 65 64 69 74 6f 72 20 61 6e 64 20 69 6e 20 74 68 65 20 70 6c 61 79 65 72 2c in.the.editor.and.in.the.player,
a880 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 2f 2f 20 73 6f 20 77 65 20 75 73 65 20 62 6f 74 68 20 ..........///.//.so.we.use.both.
a8a0 5b 49 6e 69 74 69 61 6c 69 7a 65 4f 6e 4c 6f 61 64 5d 20 61 6e 64 20 5b 52 75 6e 74 69 6d 65 49 [InitializeOnLoad].and.[RuntimeI
a8c0 6e 69 74 69 61 6c 69 7a 65 4f 6e 4c 6f 61 64 4d 65 74 68 6f 64 5d 2e 0d 0a 20 20 20 20 20 20 20 nitializeOnLoadMethod]..........
a8e0 20 2f 2f 2f 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 .///.#if.UNITY_EDITOR........../
a900 2f 2f 20 5b 49 6e 69 74 69 61 6c 69 7a 65 4f 6e 4c 6f 61 64 5d 0d 0a 20 20 20 20 20 20 20 20 2f //.[InitializeOnLoad]........../
a920 2f 2f 20 23 65 6e 64 69 66 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 70 75 62 6c 69 63 20 63 6c //.#endif..........///.public.cl
a940 61 73 73 20 4a 69 74 74 65 72 50 72 6f 63 65 73 73 6f 72 20 3a 20 49 6e 70 75 74 50 72 6f 63 65 ass.JitterProcessor.:.InputProce
a960 73 73 6f 72 26 6c 74 3b 66 6c 6f 61 74 26 67 74 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 7b ssor&lt;float&gt;..........///.{
a980 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 2f 2f 20 41 64 64 20 61 20 70 61 72 61 6d ..........///.....//.Add.a.param
a9a0 65 74 65 72 20 74 68 61 74 20 64 65 66 69 6e 65 73 20 74 68 65 20 61 6d 6f 75 6e 74 20 6f 66 20 eter.that.defines.the.amount.of.
a9c0 6a 69 74 74 65 72 20 77 65 20 61 70 70 6c 79 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 jitter.we.apply...........///...
a9e0 20 20 2f 2f 20 54 68 69 73 20 77 69 6c 6c 20 62 65 20 65 64 69 74 61 62 6c 65 20 69 6e 20 74 68 ..//.This.will.be.editable.in.th
aa00 65 20 55 6e 69 74 79 20 65 64 69 74 6f 72 20 55 49 20 61 6e 64 20 63 61 6e 20 62 65 20 73 65 74 e.Unity.editor.UI.and.can.be.set
aa20 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 2f 2f 20 70 72 6f 67 72 61 6d 6d 61 74 69 ..........///.....//.programmati
aa40 63 61 6c 6c 79 20 69 6e 20 63 6f 64 65 2e 20 46 6f 72 20 65 78 61 6d 70 6c 65 3a 0d 0a 20 20 20 cally.in.code..For.example:.....
aa60 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 .....///.....//..........///....
aa80 20 2f 2f 20 20 20 20 6d 79 41 63 74 69 6f 6e 2e 41 64 64 42 69 6e 64 69 6e 67 28 22 26 6c 74 3b .//....myAction.AddBinding("&lt;
aaa0 47 61 6d 65 70 61 64 26 67 74 3b 2f 72 69 67 68 74 54 72 69 67 67 65 72 22 2c 0d 0a 20 20 20 20 Gamepad&gt;/rightTrigger",......
aac0 20 20 20 20 2f 2f 2f 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 70 72 6f 63 65 73 73 6f 72 73 ....///.....//........processors
aae0 3a 20 22 6a 69 74 74 65 72 28 61 6d 6f 75 6e 74 3d 30 2e 31 29 22 29 3b 0d 0a 20 20 20 20 20 20 :."jitter(amount=0.1)");........
ab00 20 20 2f 2f 2f 20 20 20 20 20 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 5b 54 ..///.....//..........///.....[T
ab20 6f 6f 6c 74 69 70 28 22 41 6d 6f 75 6e 74 20 6f 66 20 6a 69 74 74 65 72 20 74 6f 20 61 70 70 6c ooltip("Amount.of.jitter.to.appl
ab40 79 2e 20 57 69 6c 6c 20 61 64 64 20 61 20 72 61 6e 64 6f 6d 20 76 61 6c 75 65 20 69 6e 20 74 68 y..Will.add.a.random.value.in.th
ab60 65 20 72 61 6e 67 65 20 5b 2d 61 6d 6f 75 6e 74 2e 2e 61 6d 6f 75 6e 74 5d 20 22 0d 0a 20 20 20 e.range.[-amount..amount].".....
ab80 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2b 20 22 74 6f 20 65 61 63 68 .....///..............+."to.each
aba0 20 69 6e 70 75 74 20 76 61 6c 75 65 2e 29 5d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 .input.value.)]..........///....
abc0 20 70 75 62 6c 69 63 20 66 6c 6f 61 74 20 61 6d 6f 75 6e 74 3b 0d 0a 20 20 20 20 20 20 20 20 2f .public.float.amount;........../
abe0 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 2f 2f 20 50 72 6f 63 65 73 73 20 69 //..........///.....//.Process.i
ac00 73 20 63 61 6c 6c 65 64 20 77 68 65 6e 20 61 6e 20 69 6e 70 75 74 20 76 61 6c 75 65 20 69 73 20 s.called.when.an.input.value.is.
ac20 72 65 61 64 20 66 72 6f 6d 20 61 20 63 6f 6e 74 72 6f 6c 2e 20 54 68 69 73 20 69 73 0d 0a 20 20 read.from.a.control..This.is....
ac40 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 2f 2f 20 77 68 65 72 65 20 77 65 20 70 65 72 66 6f 72 ......///.....//.where.we.perfor
ac60 6d 20 6f 75 72 20 6a 69 74 74 65 72 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 70 m.our.jitter...........///.....p
ac80 75 62 6c 69 63 20 6f 76 65 72 72 69 64 65 20 66 6c 6f 61 74 20 50 72 6f 63 65 73 73 28 66 6c 6f ublic.override.float.Process(flo
aca0 61 74 20 76 61 6c 75 65 2c 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 20 63 6f 6e 74 72 6f 6c 29 0d at.value,.InputControl.control).
acc0 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 .........///.....{..........///.
ace0 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 66 6c 6f 61 74 20 2b 20 52 61 6e 64 6f 6d 2e 52 61 ........return.float.+.Random.Ra
ad00 6e 67 65 28 2d 61 6d 6f 75 6e 74 2c 20 61 6d 6f 75 6e 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f nge(-amount,.amount);........../
ad20 2f 2f 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f //.....}..........///........../
ad40 2f 2f 20 20 20 20 20 2f 2f 20 5b 49 6e 69 74 69 61 6c 69 7a 65 4f 6e 4c 6f 61 64 5d 20 77 69 6c //.....//.[InitializeOnLoad].wil
ad60 6c 20 63 61 6c 6c 20 74 68 65 20 73 74 61 74 69 63 20 63 6c 61 73 73 20 63 6f 6e 73 74 72 75 63 l.call.the.static.class.construc
ad80 74 6f 72 20 77 68 69 63 68 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 2f 2f 20 77 65 tor.which..........///.....//.we
ada0 20 75 73 65 20 74 6f 20 63 61 6c 6c 20 52 65 67 69 73 74 65 72 2e 0d 0a 20 20 20 20 20 20 20 20 .use.to.call.Register...........
adc0 2f 2f 2f 20 20 20 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 ///.....#if.UNITY_EDITOR........
ade0 20 20 2f 2f 2f 20 20 20 20 20 73 74 61 74 69 63 20 4a 69 74 74 65 72 50 72 6f 63 65 73 73 6f 72 ..///.....static.JitterProcessor
ae00 28 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f ()..........///.....{........../
ae20 2f 2f 20 20 20 20 20 20 20 20 20 52 65 67 69 73 74 65 72 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 //.........Register();..........
ae40 2f 2f 2f 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 23 65 6e 64 69 ///.....}..........///.....#endi
ae60 66 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 f..........///..........///.....
ae80 2f 2f 20 5b 52 75 6e 74 69 6d 65 49 6e 69 74 69 61 6c 69 7a 65 4f 6e 4c 6f 61 64 4d 65 74 68 6f //.[RuntimeInitializeOnLoadMetho
aea0 64 5d 20 77 69 6c 6c 20 6d 61 6b 65 20 73 75 72 65 20 74 68 61 74 20 52 65 67 69 73 74 65 72 20 d].will.make.sure.that.Register.
aec0 67 65 74 73 20 63 61 6c 6c 65 64 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 2f 2f 20 gets.called..........///.....//.
aee0 69 6e 20 74 68 65 20 70 6c 61 79 65 72 20 6f 6e 20 73 74 61 72 74 75 70 2e 0d 0a 20 20 20 20 20 in.the.player.on.startup........
af00 20 20 20 2f 2f 2f 20 20 20 20 20 2f 2f 20 4e 4f 54 45 3a 20 54 68 69 73 20 77 69 6c 6c 20 61 6c ...///.....//.NOTE:.This.will.al
af20 73 6f 20 67 65 74 20 63 61 6c 6c 65 64 20 77 68 65 6e 20 67 6f 69 6e 67 20 69 6e 74 6f 20 70 6c so.get.called.when.going.into.pl
af40 61 79 20 6d 6f 64 65 20 69 6e 20 74 68 65 20 65 64 69 74 6f 72 2e 20 49 6e 20 74 68 61 74 0d 0a ay.mode.in.the.editor..In.that..
af60 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 63 61 73 65 20 77 65 ........///.....//.......case.we
af80 20 67 65 74 20 74 77 6f 20 63 61 6c 6c 73 20 74 6f 20 52 65 67 69 73 74 65 72 20 69 6e 73 74 65 .get.two.calls.to.Register.inste
afa0 61 64 20 6f 66 20 6f 6e 65 2e 20 57 65 20 64 6f 6e 27 74 20 62 6f 74 68 65 72 20 77 69 74 68 20 ad.of.one..We.don't.bother.with.
afc0 74 68 61 74 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 68 that..........///.....//.......h
afe0 65 72 65 2e 20 43 61 6c 6c 69 6e 67 20 52 65 67 69 73 74 65 72 50 72 6f 63 65 73 73 6f 72 20 74 ere..Calling.RegisterProcessor.t
b000 77 69 63 65 20 68 65 72 65 20 64 6f 65 73 6e 27 74 20 64 6f 20 61 6e 79 20 68 61 72 6d 2e 0d 0a wice.here.doesn't.do.any.harm...
b020 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 5b 52 75 6e 74 69 6d 65 49 6e 69 74 69 61 6c 69 ........///.....[RuntimeInitiali
b040 7a 65 4f 6e 4c 6f 61 64 4d 65 74 68 6f 64 5d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 zeOnLoadMethod]..........///....
b060 20 73 74 61 74 69 63 20 76 6f 69 64 20 52 65 67 69 73 74 65 72 28 29 0d 0a 20 20 20 20 20 20 20 .static.void.Register().........
b080 20 2f 2f 2f 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 .///.....{..........///.........
b0a0 2f 2f 20 57 65 20 64 6f 6e 27 74 20 73 75 70 70 6c 79 20 61 20 6e 61 6d 65 20 68 65 72 65 2e 20 //.We.don't.supply.a.name.here..
b0c0 54 68 65 20 69 6e 70 75 74 20 73 79 73 74 65 6d 20 77 69 6c 6c 20 74 61 6b 65 20 22 4a 69 74 74 The.input.system.will.take."Jitt
b0e0 65 72 50 72 6f 63 65 73 73 6f 72 22 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 erProcessor"..........///.......
b100 20 20 2f 2f 20 61 6e 64 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c 79 20 73 6e 69 70 20 6f 66 66 20 ..//.and.automatically.snip.off.
b120 74 68 65 20 22 50 72 6f 63 65 73 73 6f 72 22 20 73 75 66 66 69 78 20 74 68 75 73 20 6c 65 61 76 the."Processor".suffix.thus.leav
b140 69 6e 67 20 75 73 20 77 69 74 68 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 ing.us.with..........///........
b160 20 2f 2f 20 61 20 6e 61 6d 65 20 6f 66 20 22 4a 69 74 74 65 72 22 20 28 61 6c 6c 20 74 68 69 73 .//.a.name.of."Jitter".(all.this
b180 20 69 73 20 63 61 73 65 2d 69 6e 73 65 6e 73 69 74 69 76 65 29 2e 0d 0a 20 20 20 20 20 20 20 20 .is.case-insensitive)...........
b1a0 2f 2f 2f 20 20 20 20 20 20 20 20 20 49 6e 70 75 74 53 79 73 74 65 6d 2e 52 65 67 69 73 74 65 72 ///.........InputSystem.Register
b1c0 50 72 6f 63 65 73 73 6f 72 26 6c 74 3b 4a 69 74 74 65 72 50 72 6f 63 65 73 73 6f 72 26 67 74 3b Processor&lt;JitterProcessor&gt;
b1e0 28 29 3b 0d 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 ();..........///.....}..........
b200 2f 2f 2f 20 7d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 ///.}..........///..........///.
b220 2f 2f 20 49 74 20 64 6f 65 73 6e 27 74 20 72 65 61 6c 6c 79 20 6d 61 6b 65 20 73 65 6e 73 65 20 //.It.doesn't.really.make.sense.
b240 69 6e 20 6f 75 72 20 63 61 73 65 20 61 73 20 74 68 65 20 64 65 66 61 75 6c 74 20 70 61 72 61 6d in.our.case.as.the.default.param
b260 65 74 65 72 20 65 64 69 74 6f 72 20 69 73 20 6a 75 73 74 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f eter.editor.is.just..........///
b280 20 2f 2f 20 66 69 6e 65 20 28 69 74 20 77 69 6c 6c 20 70 69 63 6b 20 75 70 20 74 68 65 20 74 6f .//.fine.(it.will.pick.up.the.to
b2a0 6f 6c 74 69 70 20 77 65 20 64 65 66 69 6e 65 64 20 61 62 6f 76 65 29 20 62 75 74 20 6c 65 74 27 oltip.we.defined.above).but.let'
b2c0 73 20 73 61 79 20 77 65 20 77 61 6e 74 20 74 6f 20 72 65 70 6c 61 63 65 0d 0a 20 20 20 20 20 20 s.say.we.want.to.replace........
b2e0 20 20 2f 2f 2f 20 2f 2f 20 74 68 65 20 64 65 66 61 75 6c 74 20 66 6c 6f 61 74 20 65 64 69 74 20 ..///.//.the.default.float.edit.
b300 66 69 65 6c 64 20 77 65 20 67 65 74 20 6f 6e 20 74 68 65 20 22 61 6d 6f 75 6e 74 22 20 70 61 72 field.we.get.on.the."amount".par
b320 61 6d 65 74 65 72 20 77 69 74 68 20 61 20 73 6c 69 64 65 72 2e 20 57 65 20 63 61 6e 0d 0a 20 20 ameter.with.a.slider..We.can....
b340 20 20 20 20 20 20 2f 2f 2f 20 2f 2f 20 64 6f 20 73 6f 20 62 79 20 64 65 66 69 6e 69 6e 67 20 61 ......///.//.do.so.by.defining.a
b360 20 63 75 73 74 6f 6d 20 70 61 72 61 6d 65 74 65 72 20 65 64 69 74 6f 72 2e 0d 0a 20 20 20 20 20 .custom.parameter.editor........
b380 20 20 20 2f 2f 2f 20 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 2f 2f 20 4e 4f 54 45 3a 20 ...///.//..........///.//.NOTE:.
b3a0 57 65 20 64 6f 6e 27 74 20 6e 65 65 64 20 74 6f 20 68 61 76 65 20 61 20 72 65 67 69 73 74 72 61 We.don't.need.to.have.a.registra
b3c0 74 69 6f 6e 20 63 61 6c 6c 20 68 65 72 65 2e 20 54 68 65 20 69 6e 70 75 74 20 73 79 73 74 65 6d tion.call.here..The.input.system
b3e0 20 77 69 6c 6c 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c 79 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f .will.automatically..........///
b400 20 2f 2f 20 20 20 20 20 20 20 66 69 6e 64 20 6f 75 72 20 70 61 72 61 6d 65 74 65 72 20 65 64 69 .//.......find.our.parameter.edi
b420 74 6f 72 20 62 61 73 65 64 20 6f 6e 20 74 68 65 20 4a 69 74 74 65 72 50 72 6f 63 65 73 73 6f 72 tor.based.on.the.JitterProcessor
b440 20 74 79 70 65 20 70 61 72 61 6d 65 74 65 72 20 77 65 20 67 69 76 65 20 74 6f 0d 0a 20 20 20 20 .type.parameter.we.give.to......
b460 20 20 20 20 2f 2f 2f 20 2f 2f 20 20 20 20 20 20 20 49 6e 70 75 74 50 61 72 61 6d 65 74 65 72 45 ....///.//.......InputParameterE
b480 64 69 74 6f 72 26 6c 74 3b 54 26 67 74 3b 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 23 69 66 ditor&lt;T&gt;...........///.#if
b4a0 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 2f 20 70 75 62 6c 69 .UNITY_EDITOR..........///.publi
b4c0 63 20 63 6c 61 73 73 20 4a 69 74 74 65 72 50 72 6f 63 65 73 73 6f 72 45 64 69 74 6f 72 20 3a 20 c.class.JitterProcessorEditor.:.
b4e0 49 6e 70 75 74 50 61 72 61 6d 65 74 65 72 45 64 69 74 6f 72 26 6c 74 3b 4a 69 74 74 65 72 50 72 InputParameterEditor&lt;JitterPr
b500 6f 63 65 73 73 6f 72 26 67 74 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 7b 0d 0a 20 20 20 20 ocessor&gt;..........///.{......
b520 20 20 20 20 2f 2f 2f 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 ....///.....public.override.void
b540 20 4f 6e 47 55 49 28 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 7b 0d 0a 20 20 20 .OnGUI()..........///.....{.....
b560 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 74 61 72 67 65 74 2e 61 6d 6f 75 6e 74 20 3d .....///.........target.amount.=
b580 20 45 64 69 74 6f 72 47 55 49 4c 61 79 6f 75 74 2e 53 6c 69 64 65 72 28 6d 5f 41 6d 6f 75 6e 74 .EditorGUILayout.Slider(m_Amount
b5a0 4c 61 62 65 6c 2c 20 74 61 72 67 65 74 2e 61 6d 6f 75 6e 74 2c 20 30 2c 20 30 2e 32 35 66 29 3b Label,.target.amount,.0,.0.25f);
b5c0 0d 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 ..........///.....}..........///
b5e0 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 70 72 69 76 61 74 65 20 47 55 49 43 6f 6e ..........///.....private.GUICon
b600 74 65 6e 74 20 6d 5f 41 6d 6f 75 6e 74 4c 61 62 65 6c 20 3d 20 6e 65 77 20 47 55 49 43 6f 6e 74 tent.m_AmountLabel.=.new.GUICont
b620 65 6e 74 28 22 41 6d 6f 75 6e 74 22 2c 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 ent("Amount",..........///......
b640 20 20 20 22 41 6d 6f 75 6e 74 20 6f 66 20 6a 69 74 74 65 72 20 74 6f 20 61 70 70 6c 79 2e 20 57 ..."Amount.of.jitter.to.apply..W
b660 69 6c 6c 20 61 64 64 20 61 20 72 61 6e 64 6f 6d 20 76 61 6c 75 65 20 69 6e 20 74 68 65 20 72 61 ill.add.a.random.value.in.the.ra
b680 6e 67 65 20 5b 2d 61 6d 6f 75 6e 74 2e 2e 61 6d 6f 75 6e 74 5d 20 22 0d 0a 20 20 20 20 20 20 20 nge.[-amount..amount].".........
b6a0 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 2b 20 22 74 6f 20 65 61 63 68 20 69 6e 70 75 .///.............+."to.each.inpu
b6c0 74 20 76 61 6c 75 65 2e 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 7d 0d 0a 20 20 20 20 20 t.value.);..........///.}.......
b6e0 20 20 20 2f 2f 2f 20 23 65 6e 64 69 66 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 63 6f 64 ...///.#endif..........///.</cod
b700 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 65 78 61 6d 70 6c 65 3e 0d 0a 20 20 20 20 e>..........///.</example>......
b720 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 4e 6f 74 65 20 74 68 61 74 20 69 ....///..........///.Note.that.i
b740 74 20 69 73 20 61 6c 6c 6f 77 65 64 20 74 6f 20 72 65 67 69 73 74 65 72 20 74 68 65 20 73 61 6d t.is.allowed.to.register.the.sam
b760 65 20 70 72 6f 63 65 73 73 6f 72 20 74 79 70 65 20 6d 75 6c 74 69 70 6c 65 20 74 79 70 65 73 20 e.processor.type.multiple.types.
b780 77 69 74 68 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 64 69 66 66 65 72 65 6e 74 20 6e 61 6d 65 with..........///.different.name
b7a0 73 2e 20 57 68 65 6e 20 64 6f 69 6e 67 20 73 6f 2c 20 74 68 65 20 66 69 72 73 74 20 72 65 67 69 s..When.doing.so,.the.first.regi
b7c0 73 74 72 61 74 69 6f 6e 20 69 73 20 63 6f 6e 73 69 64 65 72 65 64 20 61 73 20 74 68 65 20 22 70 stration.is.considered.as.the."p
b7e0 72 6f 70 65 72 22 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 6e 61 6d 65 20 66 6f 72 20 74 68 65 roper"..........///.name.for.the
b800 20 70 72 6f 63 65 73 73 6f 72 20 61 6e 64 20 61 6c 6c 20 73 75 62 73 65 71 75 65 6e 74 20 72 65 .processor.and.all.subsequent.re
b820 67 69 73 74 72 61 74 69 6f 6e 73 20 77 69 6c 6c 20 62 65 20 63 6f 6e 73 69 64 65 72 65 64 20 61 gistrations.will.be.considered.a
b840 6c 69 61 73 65 73 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f liases...........///..........//
b860 2f 20 53 65 65 20 74 68 65 20 3c 61 20 68 72 65 66 3d 22 2e 2e 2f 6d 61 6e 75 61 6c 2f 50 72 6f /.See.the.<a.href="../manual/Pro
b880 63 65 73 73 6f 72 73 2e 68 74 6d 6c 22 3e 6d 61 6e 75 61 6c 3c 2f 61 3e 20 66 6f 72 20 6d 6f 72 cessors.html">manual</a>.for.mor
b8a0 65 20 64 65 74 61 69 6c 73 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 6d 61 72 6b e.details...........///.</remark
b8c0 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 49 s>..........///.<seealso.cref="I
b8e0 6e 70 75 74 50 72 6f 63 65 73 73 6f 72 7b 54 7d 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f nputProcessor{T}"/>..........///
b900 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 49 6e 70 75 74 42 69 6e 64 69 6e 67 2e 70 72 6f .<seealso.cref="InputBinding.pro
b920 63 65 73 73 6f 72 73 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f cessors"/>..........///.<seealso
b940 20 63 72 65 66 3d 22 49 6e 70 75 74 41 63 74 69 6f 6e 2e 70 72 6f 63 65 73 73 6f 72 73 22 2f 3e .cref="InputAction.processors"/>
b960 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 49 6e 70 ..........///.<seealso.cref="Inp
b980 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 2e 43 6f 6e 74 72 6f 6c 49 74 65 6d 2e 70 72 6f 63 utControlLayout.ControlItem.proc
b9a0 65 73 73 6f 72 73 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 essors"/>..........///.<seealso.
b9c0 63 72 65 66 3d 22 49 6e 70 75 74 50 61 72 61 6d 65 74 65 72 45 64 69 74 6f 72 7b 54 4f 62 6a 65 cref="InputParameterEditor{TObje
b9e0 63 74 7d 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 76 6f ct}"/>..........public.static.vo
ba00 69 64 20 52 65 67 69 73 74 65 72 50 72 6f 63 65 73 73 6f 72 28 54 79 70 65 20 74 79 70 65 2c 20 id.RegisterProcessor(Type.type,.
ba20 73 74 72 69 6e 67 20 6e 61 6d 65 20 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a string.name.=.null)..........{..
ba40 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 74 79 70 65 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 ............if.(type.==.null)...
ba60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e ...............throw.new.Argumen
ba80 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 28 6e 61 6d 65 6f 66 28 74 79 70 65 29 29 3b 0d 0a 0d tNullException(nameof(type));...
baa0 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 74 72 69 6e 67 2e 49 73 4e 75 6c 6c 4f 72 .............if.(string.IsNullOr
bac0 45 6d 70 74 79 28 6e 61 6d 65 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 Empty(name))..............{.....
bae0 20 20 20 20 20 20 20 20 20 20 20 20 20 6e 61 6d 65 20 3d 20 74 79 70 65 2e 4e 61 6d 65 3b 0d 0a .............name.=.type.Name;..
bb00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6e 61 6d 65 2e 45 6e 64 73 57 69 74 ................if.(name.EndsWit
bb20 68 28 22 50 72 6f 63 65 73 73 6f 72 22 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 h("Processor")).................
bb40 20 20 20 20 20 6e 61 6d 65 20 3d 20 6e 61 6d 65 2e 53 75 62 73 74 72 69 6e 67 28 30 2c 20 6e 61 .....name.=.name.Substring(0,.na
bb60 6d 65 2e 4c 65 6e 67 74 68 20 2d 20 22 50 72 6f 63 65 73 73 6f 72 22 2e 4c 65 6e 67 74 68 29 3b me.Length.-."Processor".Length);
bb80 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 73 ..............}................s
bba0 5f 4d 61 6e 61 67 65 72 2e 70 72 6f 63 65 73 73 6f 72 73 2e 41 64 64 54 79 70 65 52 65 67 69 73 _Manager.processors.AddTypeRegis
bbc0 74 72 61 74 69 6f 6e 28 6e 61 6d 65 2c 20 74 79 70 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d tration(name,.type);..........}.
bbe0 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>........
bc00 20 20 2f 2f 2f 20 52 65 67 69 73 74 65 72 20 61 6e 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 ..///.Register.an.<see.cref="Inp
bc20 75 74 50 72 6f 63 65 73 73 6f 72 7b 54 56 61 6c 75 65 7d 22 2f 3e 20 77 69 74 68 20 74 68 65 20 utProcessor{TValue}"/>.with.the.
bc40 73 79 73 74 65 6d 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 system...........///.</summary>.
bc60 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 74 79 70 65 70 61 72 61 6d 20 6e 61 6d 65 3d 22 54 22 .........///.<typeparam.name="T"
bc80 3e 54 79 70 65 20 74 68 61 74 20 69 6d 70 6c 65 6d 65 6e 74 73 20 3c 73 65 65 20 63 72 65 66 3d >Type.that.implements.<see.cref=
bca0 22 49 6e 70 75 74 50 72 6f 63 65 73 73 6f 72 22 2f 3e 2e 3c 2f 74 79 70 65 70 61 72 61 6d 3e 0d "InputProcessor"/>.</typeparam>.
bcc0 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 6e 61 6d 65 22 3e .........///.<param.name="name">
bce0 4e 61 6d 65 20 74 6f 20 75 73 65 20 66 6f 72 20 74 68 65 20 70 72 6f 63 65 73 73 6f 72 2e 20 49 Name.to.use.for.the.processor..I
bd00 66 20 3c 63 3e 6e 75 6c 6c 3c 2f 63 3e 20 6f 72 20 65 6d 70 74 79 2c 20 6e 61 6d 65 20 77 69 6c f.<c>null</c>.or.empty,.name.wil
bd20 6c 20 62 65 20 74 61 6b 65 6e 20 66 72 6f 6d 20 74 68 65 20 73 68 6f 72 74 20 6e 61 6d 65 0d 0a l.be.taken.from.the.short.name..
bd40 20 20 20 20 20 20 20 20 2f 2f 2f 20 6f 66 20 3c 74 79 70 65 70 61 72 61 6d 72 65 66 20 6e 61 6d ........///.of.<typeparamref.nam
bd60 65 3d 22 54 22 2f 3e 20 28 69 66 20 69 74 20 65 6e 64 73 20 69 6e 20 22 50 72 6f 63 65 73 73 6f e="T"/>.(if.it.ends.in."Processo
bd80 72 22 2c 20 74 68 61 74 20 73 75 66 66 69 78 20 77 69 6c 6c 20 62 65 20 63 6c 69 70 70 65 64 20 r",.that.suffix.will.be.clipped.
bda0 66 72 6f 6d 20 74 68 65 20 6e 61 6d 65 29 2e 20 4e 61 6d 65 73 0d 0a 20 20 20 20 20 20 20 20 2f from.the.name)..Names........../
bdc0 2f 2f 20 61 72 65 20 63 61 73 65 2d 69 6e 73 65 6e 73 69 74 69 76 65 2e 3c 2f 70 61 72 61 6d 3e //.are.case-insensitive.</param>
bde0 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 ..........///.<remarks>.........
be00 20 2f 2f 2f 20 50 72 6f 63 65 73 73 6f 72 73 20 61 72 65 20 75 73 65 64 20 62 79 20 62 6f 74 68 .///.Processors.are.used.by.both
be20 20 62 69 6e 64 69 6e 67 73 20 28 73 65 65 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 42 .bindings.(see.<see.cref="InputB
be40 69 6e 64 69 6e 67 22 2f 3e 29 20 61 6e 64 20 62 79 20 63 6f 6e 74 72 6f 6c 73 0d 0a 20 20 20 20 inding"/>).and.by.controls......
be60 20 20 20 20 2f 2f 2f 20 28 73 65 65 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e ....///.(see.<see.cref="InputCon
be80 74 72 6f 6c 22 2f 3e 29 20 74 6f 20 70 6f 73 74 2d 70 72 6f 63 65 73 73 20 69 6e 70 75 74 20 76 trol"/>).to.post-process.input.v
bea0 61 6c 75 65 73 20 61 73 20 74 68 65 79 20 61 72 65 20 62 65 69 6e 67 20 72 65 71 75 65 73 74 65 alues.as.they.are.being.requeste
bec0 64 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 66 72 6f 6d 20 63 61 6c 6c 73 20 73 75 63 68 20 61 d..........///.from.calls.such.a
bee0 73 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 41 63 74 69 6f 6e 2e 52 65 61 64 56 61 6c s.<see.cref="InputAction.ReadVal
bf00 75 65 7b 54 56 61 6c 75 65 7d 22 2f 3e 20 6f 72 20 3c 73 65 65 0d 0a 20 20 20 20 20 20 20 20 2f ue{TValue}"/>.or.<see........../
bf20 2f 2f 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 7b 54 7d 2e 52 65 61 64 56 61 6c //.cref="InputControl{T}.ReadVal
bf40 75 65 22 2f 3e 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f ue"/>...........///..........///
bf60 20 3c 65 78 61 6d 70 6c 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 63 6f 64 65 3e 0d 0a .<example>..........///.<code>..
bf80 20 20 20 20 20 20 20 20 2f 2f 2f 20 2f 2f 20 4c 65 74 27 73 20 73 61 79 20 74 68 61 74 20 77 65 ........///.//.Let's.say.that.we
bfa0 20 77 61 6e 74 20 74 6f 20 64 65 66 69 6e 65 20 61 20 70 72 6f 63 65 73 73 6f 72 20 74 68 61 74 .want.to.define.a.processor.that
bfc0 20 61 64 64 73 20 73 6f 6d 65 20 72 61 6e 64 6f 6d 20 6a 69 74 74 65 72 20 74 6f 20 69 74 73 20 .adds.some.random.jitter.to.its.
bfe0 69 6e 70 75 74 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 2f 2f 20 57 65 20 68 61 76 65 20 74 input...........///.//.We.have.t
c000 6f 20 70 69 63 6b 20 61 20 76 61 6c 75 65 20 74 79 70 65 20 74 6f 20 6f 70 65 72 61 74 65 20 6f o.pick.a.value.type.to.operate.o
c020 6e 20 69 66 20 77 65 20 77 61 6e 74 20 74 6f 20 64 65 72 69 76 65 20 66 72 6f 6d 20 49 6e 70 75 n.if.we.want.to.derive.from.Inpu
c040 74 50 72 6f 63 65 73 73 6f 72 26 6c 74 3b 54 26 67 74 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f tProcessor&lt;T&gt;..........///
c060 20 2f 2f 20 73 6f 20 77 65 20 67 6f 20 77 69 74 68 20 66 6c 6f 61 74 20 68 65 72 65 2e 0d 0a 20 .//.so.we.go.with.float.here....
c080 20 20 20 20 20 20 20 2f 2f 2f 20 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 2f 2f 20 41 6c .......///.//..........///.//.Al
c0a0 73 6f 2c 20 61 73 20 77 65 20 77 69 6c 6c 20 6e 65 65 64 20 74 6f 20 70 6c 61 63 65 20 6f 75 72 so,.as.we.will.need.to.place.our
c0c0 20 63 61 6c 6c 20 74 6f 20 52 65 67 69 73 74 65 72 50 72 6f 63 65 73 73 6f 72 20 73 6f 6d 65 77 .call.to.RegisterProcessor.somew
c0e0 68 65 72 65 2c 20 77 65 20 61 64 64 20 61 74 74 72 69 62 75 74 65 73 0d 0a 20 20 20 20 20 20 20 here,.we.add.attributes.........
c100 20 2f 2f 2f 20 2f 2f 20 74 6f 20 68 6f 6f 6b 20 69 6e 74 6f 20 55 6e 69 74 79 27 73 20 69 6e 69 .///.//.to.hook.into.Unity's.ini
c120 74 69 61 6c 69 7a 61 74 69 6f 6e 2e 20 54 68 69 73 20 77 6f 72 6b 73 20 64 69 66 66 65 72 65 6e tialization..This.works.differen
c140 74 6c 79 20 69 6e 20 74 68 65 20 65 64 69 74 6f 72 20 61 6e 64 20 69 6e 20 74 68 65 20 70 6c 61 tly.in.the.editor.and.in.the.pla
c160 79 65 72 2c 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 2f 2f 20 73 6f 20 77 65 20 75 73 65 20 62 yer,..........///.//.so.we.use.b
c180 6f 74 68 20 5b 49 6e 69 74 69 61 6c 69 7a 65 4f 6e 4c 6f 61 64 5d 20 61 6e 64 20 5b 52 75 6e 74 oth.[InitializeOnLoad].and.[Runt
c1a0 69 6d 65 49 6e 69 74 69 61 6c 69 7a 65 4f 6e 4c 6f 61 64 4d 65 74 68 6f 64 5d 2e 0d 0a 20 20 20 imeInitializeOnLoadMethod]......
c1c0 20 20 20 20 20 2f 2f 2f 20 23 69 66 20 55 4e 49 54 59 5f 45 44 49 54 4f 52 0d 0a 20 20 20 20 20 .....///.#if.UNITY_EDITOR.......
c1e0 20 20 20 2f 2f 2f 20 5b 49 6e 69 74 69 61 6c 69 7a 65 4f 6e 4c 6f 61 64 5d 0d 0a 20 20 20 20 20 ...///.[InitializeOnLoad].......
c200 20 20 20 2f 2f 2f 20 23 65 6e 64 69 66 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 70 75 62 6c 69 ...///.#endif..........///.publi
c220 63 20 63 6c 61 73 73 20 4a 69 74 74 65 72 50 72 6f 63 65 73 73 6f 72 20 3a 20 49 6e 70 75 74 50 c.class.JitterProcessor.:.InputP
c240 72 6f 63 65 73 73 6f 72 26 6c 74 3b 66 6c 6f 61 74 26 67 74 3b 0d 0a 20 20 20 20 20 20 20 20 2f rocessor&lt;float&gt;........../
c260 2f 2f 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 2f 2f 20 41 64 64 20 61 20 70 //.{..........///.....//.Add.a.p
c280 61 72 61 6d 65 74 65 72 20 74 68 61 74 20 64 65 66 69 6e 65 73 20 74 68 65 20 61 6d 6f 75 6e 74 arameter.that.defines.the.amount
c2a0 20 6f 66 20 6a 69 74 74 65 72 20 77 65 20 61 70 70 6c 79 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f .of.jitter.we.apply...........//
c2c0 2f 20 20 20 20 20 2f 2f 20 54 68 69 73 20 77 69 6c 6c 20 62 65 20 65 64 69 74 61 62 6c 65 20 69 /.....//.This.will.be.editable.i
c2e0 6e 20 74 68 65 20 55 6e 69 74 79 20 65 64 69 74 6f 72 20 55 49 20 61 6e 64 20 63 61 6e 20 62 65 n.the.Unity.editor.UI.and.can.be
c300 20 73 65 74 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 2f 2f 20 70 72 6f 67 72 61 6d .set..........///.....//.program
c320 6d 61 74 69 63 61 6c 6c 79 20 69 6e 20 63 6f 64 65 2e 20 46 6f 72 20 65 78 61 6d 70 6c 65 3a 0d matically.in.code..For.example:.
c340 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f .........///.....//..........///
c360 20 20 20 20 20 2f 2f 20 20 20 20 6d 79 41 63 74 69 6f 6e 2e 41 64 64 42 69 6e 64 69 6e 67 28 22 .....//....myAction.AddBinding("
c380 26 6c 74 3b 47 61 6d 65 70 61 64 26 67 74 3b 2f 72 69 67 68 74 54 72 69 67 67 65 72 22 2c 0d 0a &lt;Gamepad&gt;/rightTrigger",..
c3a0 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 70 72 6f 63 65 73 ........///.....//........proces
c3c0 73 6f 72 73 3a 20 22 6a 69 74 74 65 72 28 61 6d 6f 75 6e 74 3d 30 2e 31 29 22 29 3b 0d 0a 20 20 sors:."jitter(amount=0.1)");....
c3e0 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 ......///.....//..........///...
c400 20 20 5b 54 6f 6f 6c 74 69 70 28 22 41 6d 6f 75 6e 74 20 6f 66 20 6a 69 74 74 65 72 20 74 6f 20 ..[Tooltip("Amount.of.jitter.to.
c420 61 70 70 6c 79 2e 20 57 69 6c 6c 20 61 64 64 20 61 20 72 61 6e 64 6f 6d 20 76 61 6c 75 65 20 69 apply..Will.add.a.random.value.i
c440 6e 20 74 68 65 20 72 61 6e 67 65 20 5b 2d 61 6d 6f 75 6e 74 2e 2e 61 6d 6f 75 6e 74 5d 20 22 0d n.the.range.[-amount..amount].".
c460 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2b 20 22 74 6f 20 .........///..............+."to.
c480 65 61 63 68 20 69 6e 70 75 74 20 76 61 6c 75 65 2e 29 5d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f each.input.value.)]..........///
c4a0 20 20 20 20 20 70 75 62 6c 69 63 20 66 6c 6f 61 74 20 61 6d 6f 75 6e 74 3b 0d 0a 20 20 20 20 20 .....public.float.amount;.......
c4c0 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 2f 2f 20 50 72 6f 63 65 ...///..........///.....//.Proce
c4e0 73 73 20 69 73 20 63 61 6c 6c 65 64 20 77 68 65 6e 20 61 6e 20 69 6e 70 75 74 20 76 61 6c 75 65 ss.is.called.when.an.input.value
c500 20 69 73 20 72 65 61 64 20 66 72 6f 6d 20 61 20 63 6f 6e 74 72 6f 6c 2e 20 54 68 69 73 20 69 73 .is.read.from.a.control..This.is
c520 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 2f 2f 20 77 68 65 72 65 20 77 65 20 70 65 ..........///.....//.where.we.pe
c540 72 66 6f 72 6d 20 6f 75 72 20 6a 69 74 74 65 72 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 rform.our.jitter...........///..
c560 20 20 20 70 75 62 6c 69 63 20 6f 76 65 72 72 69 64 65 20 66 6c 6f 61 74 20 50 72 6f 63 65 73 73 ...public.override.float.Process
c580 28 66 6c 6f 61 74 20 76 61 6c 75 65 2c 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 20 63 6f 6e 74 72 (float.value,.InputControl.contr
c5a0 6f 6c 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 ol)..........///.....{..........
c5c0 2f 2f 2f 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 66 6c 6f 61 74 20 2b 20 52 61 6e 64 6f ///.........return.float.+.Rando
c5e0 6d 2e 52 61 6e 67 65 28 2d 61 6d 6f 75 6e 74 2c 20 61 6d 6f 75 6e 74 29 3b 0d 0a 20 20 20 20 20 m.Range(-amount,.amount);.......
c600 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 0d 0a 20 20 20 20 20 ...///.....}..........///.......
c620 20 20 20 2f 2f 2f 20 20 20 20 20 2f 2f 20 5b 49 6e 69 74 69 61 6c 69 7a 65 4f 6e 4c 6f 61 64 5d ...///.....//.[InitializeOnLoad]
c640 20 77 69 6c 6c 20 63 61 6c 6c 20 74 68 65 20 73 74 61 74 69 63 20 63 6c 61 73 73 20 63 6f 6e 73 .will.call.the.static.class.cons
c660 74 72 75 63 74 6f 72 20 77 68 69 63 68 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 2f tructor.which..........///...../
c680 2f 20 77 65 20 75 73 65 20 74 6f 20 63 61 6c 6c 20 52 65 67 69 73 74 65 72 2e 0d 0a 20 20 20 20 /.we.use.to.call.Register.......
c6a0 20 20 20 20 2f 2f 2f 20 20 20 20 20 23 69 66 20 55 4e 49 54 59 5f 45 44 49 54 4f 52 0d 0a 20 20 ....///.....#if.UNITY_EDITOR....
c6c0 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 73 74 61 74 69 63 20 4a 69 74 74 65 72 50 72 6f 63 65 ......///.....static.JitterProce
c6e0 73 73 6f 72 28 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 ssor()..........///.....{.......
c700 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 52 65 67 69 73 74 65 72 28 29 3b 0d 0a 20 20 20 20 ...///.........Register();......
c720 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 20 20 20 20 23 ....///.....}..........///.....#
c740 65 6e 64 69 66 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 endif..........///..........///.
c760 20 20 20 20 2f 2f 20 5b 52 75 6e 74 69 6d 65 49 6e 69 74 69 61 6c 69 7a 65 4f 6e 4c 6f 61 64 4d ....//.[RuntimeInitializeOnLoadM
c780 65 74 68 6f 64 5d 20 77 69 6c 6c 20 6d 61 6b 65 20 73 75 72 65 20 74 68 61 74 20 52 65 67 69 73 ethod].will.make.sure.that.Regis
c7a0 74 65 72 20 67 65 74 73 20 63 61 6c 6c 65 64 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 ter.gets.called..........///....
c7c0 20 2f 2f 20 69 6e 20 74 68 65 20 70 6c 61 79 65 72 20 6f 6e 20 73 74 61 72 74 75 70 2e 0d 0a 20 .//.in.the.player.on.startup....
c7e0 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 2f 2f 20 4e 4f 54 45 3a 20 54 68 69 73 20 77 69 6c .......///.....//.NOTE:.This.wil
c800 6c 20 61 6c 73 6f 20 67 65 74 20 63 61 6c 6c 65 64 20 77 68 65 6e 20 67 6f 69 6e 67 20 69 6e 74 l.also.get.called.when.going.int
c820 6f 20 70 6c 61 79 20 6d 6f 64 65 20 69 6e 20 74 68 65 20 65 64 69 74 6f 72 2e 20 49 6e 20 74 68 o.play.mode.in.the.editor..In.th
c840 61 74 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 63 61 73 at..........///.....//.......cas
c860 65 20 77 65 20 67 65 74 20 74 77 6f 20 63 61 6c 6c 73 20 74 6f 20 52 65 67 69 73 74 65 72 20 69 e.we.get.two.calls.to.Register.i
c880 6e 73 74 65 61 64 20 6f 66 20 6f 6e 65 2e 20 57 65 20 64 6f 6e 27 74 20 62 6f 74 68 65 72 20 77 nstead.of.one..We.don't.bother.w
c8a0 69 74 68 20 74 68 61 74 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 2f 2f 20 20 20 20 ith.that..........///.....//....
c8c0 20 20 20 68 65 72 65 2e 20 43 61 6c 6c 69 6e 67 20 52 65 67 69 73 74 65 72 50 72 6f 63 65 73 73 ...here..Calling.RegisterProcess
c8e0 6f 72 20 74 77 69 63 65 20 68 65 72 65 20 64 6f 65 73 6e 27 74 20 64 6f 20 61 6e 79 20 68 61 72 or.twice.here.doesn't.do.any.har
c900 6d 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 5b 52 75 6e 74 69 6d 65 49 6e 69 74 m...........///.....[RuntimeInit
c920 69 61 6c 69 7a 65 4f 6e 4c 6f 61 64 4d 65 74 68 6f 64 5d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f ializeOnLoadMethod]..........///
c940 20 20 20 20 20 73 74 61 74 69 63 20 76 6f 69 64 20 52 65 67 69 73 74 65 72 28 29 0d 0a 20 20 20 .....static.void.Register().....
c960 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 .....///.....{..........///.....
c980 20 20 20 20 2f 2f 20 57 65 20 64 6f 6e 27 74 20 73 75 70 70 6c 79 20 61 20 6e 61 6d 65 20 68 65 ....//.We.don't.supply.a.name.he
c9a0 72 65 2e 20 54 68 65 20 69 6e 70 75 74 20 73 79 73 74 65 6d 20 77 69 6c 6c 20 74 61 6b 65 20 22 re..The.input.system.will.take."
c9c0 4a 69 74 74 65 72 50 72 6f 63 65 73 73 6f 72 22 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 JitterProcessor"..........///...
c9e0 20 20 20 20 20 20 2f 2f 20 61 6e 64 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c 79 20 73 6e 69 70 20 ......//.and.automatically.snip.
ca00 6f 66 66 20 74 68 65 20 22 50 72 6f 63 65 73 73 6f 72 22 20 73 75 66 66 69 78 20 74 68 75 73 20 off.the."Processor".suffix.thus.
ca20 6c 65 61 76 69 6e 67 20 75 73 20 77 69 74 68 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 leaving.us.with..........///....
ca40 20 20 20 20 20 2f 2f 20 61 20 6e 61 6d 65 20 6f 66 20 22 4a 69 74 74 65 72 22 20 28 61 6c 6c 20 .....//.a.name.of."Jitter".(all.
ca60 74 68 69 73 20 69 73 20 63 61 73 65 2d 69 6e 73 65 6e 73 69 74 69 76 65 29 2e 0d 0a 20 20 20 20 this.is.case-insensitive).......
ca80 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 49 6e 70 75 74 53 79 73 74 65 6d 2e 52 65 67 69 ....///.........InputSystem.Regi
caa0 73 74 65 72 50 72 6f 63 65 73 73 6f 72 26 6c 74 3b 4a 69 74 74 65 72 50 72 6f 63 65 73 73 6f 72 sterProcessor&lt;JitterProcessor
cac0 26 67 74 3b 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 7d 0d 0a 20 20 20 20 &gt;();..........///.....}......
cae0 20 20 20 20 2f 2f 2f 20 7d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 ....///.}..........///..........
cb00 2f 2f 2f 20 2f 2f 20 49 74 20 64 6f 65 73 6e 27 74 20 72 65 61 6c 6c 79 20 6d 61 6b 65 20 73 65 ///.//.It.doesn't.really.make.se
cb20 6e 73 65 20 69 6e 20 6f 75 72 20 63 61 73 65 20 61 73 20 74 68 65 20 64 65 66 61 75 6c 74 20 70 nse.in.our.case.as.the.default.p
cb40 61 72 61 6d 65 74 65 72 20 65 64 69 74 6f 72 20 69 73 20 6a 75 73 74 0d 0a 20 20 20 20 20 20 20 arameter.editor.is.just.........
cb60 20 2f 2f 2f 20 2f 2f 20 66 69 6e 65 20 28 69 74 20 77 69 6c 6c 20 70 69 63 6b 20 75 70 20 74 68 .///.//.fine.(it.will.pick.up.th
cb80 65 20 74 6f 6f 6c 74 69 70 20 77 65 20 64 65 66 69 6e 65 64 20 61 62 6f 76 65 29 20 62 75 74 20 e.tooltip.we.defined.above).but.
cba0 6c 65 74 27 73 20 73 61 79 20 77 65 20 77 61 6e 74 20 74 6f 20 72 65 70 6c 61 63 65 0d 0a 20 20 let's.say.we.want.to.replace....
cbc0 20 20 20 20 20 20 2f 2f 2f 20 2f 2f 20 74 68 65 20 64 65 66 61 75 6c 74 20 66 6c 6f 61 74 20 65 ......///.//.the.default.float.e
cbe0 64 69 74 20 66 69 65 6c 64 20 77 65 20 67 65 74 20 6f 6e 20 74 68 65 20 22 61 6d 6f 75 6e 74 22 dit.field.we.get.on.the."amount"
cc00 20 70 61 72 61 6d 65 74 65 72 20 77 69 74 68 20 61 20 73 6c 69 64 65 72 2e 20 57 65 20 63 61 6e .parameter.with.a.slider..We.can
cc20 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 2f 2f 20 64 6f 20 73 6f 20 62 79 20 64 65 66 69 6e 69 ..........///.//.do.so.by.defini
cc40 6e 67 20 61 20 63 75 73 74 6f 6d 20 70 61 72 61 6d 65 74 65 72 20 65 64 69 74 6f 72 2e 0d 0a 20 ng.a.custom.parameter.editor....
cc60 20 20 20 20 20 20 20 2f 2f 2f 20 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 2f 2f 20 4e 4f .......///.//..........///.//.NO
cc80 54 45 3a 20 57 65 20 64 6f 6e 27 74 20 6e 65 65 64 20 74 6f 20 68 61 76 65 20 61 20 72 65 67 69 TE:.We.don't.need.to.have.a.regi
cca0 73 74 72 61 74 69 6f 6e 20 63 61 6c 6c 20 68 65 72 65 2e 20 54 68 65 20 69 6e 70 75 74 20 73 79 stration.call.here..The.input.sy
ccc0 73 74 65 6d 20 77 69 6c 6c 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c 79 0d 0a 20 20 20 20 20 20 20 stem.will.automatically.........
cce0 20 2f 2f 2f 20 2f 2f 20 20 20 20 20 20 20 66 69 6e 64 20 6f 75 72 20 70 61 72 61 6d 65 74 65 72 .///.//.......find.our.parameter
cd00 20 65 64 69 74 6f 72 20 62 61 73 65 64 20 6f 6e 20 74 68 65 20 4a 69 74 74 65 72 50 72 6f 63 65 .editor.based.on.the.JitterProce
cd20 73 73 6f 72 20 74 79 70 65 20 70 61 72 61 6d 65 74 65 72 20 77 65 20 67 69 76 65 20 74 6f 0d 0a ssor.type.parameter.we.give.to..
cd40 20 20 20 20 20 20 20 20 2f 2f 2f 20 2f 2f 20 20 20 20 20 20 20 49 6e 70 75 74 50 61 72 61 6d 65 ........///.//.......InputParame
cd60 74 65 72 45 64 69 74 6f 72 26 6c 74 3b 54 26 67 74 3b 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f terEditor&lt;T&gt;...........///
cd80 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 2f 20 70 .#if.UNITY_EDITOR..........///.p
cda0 75 62 6c 69 63 20 63 6c 61 73 73 20 4a 69 74 74 65 72 50 72 6f 63 65 73 73 6f 72 45 64 69 74 6f ublic.class.JitterProcessorEdito
cdc0 72 20 3a 20 49 6e 70 75 74 50 61 72 61 6d 65 74 65 72 45 64 69 74 6f 72 26 6c 74 3b 4a 69 74 74 r.:.InputParameterEditor&lt;Jitt
cde0 65 72 50 72 6f 63 65 73 73 6f 72 26 67 74 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 7b 0d 0a erProcessor&gt;..........///.{..
ce00 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 70 75 62 6c 69 63 20 6f 76 65 72 72 69 64 65 20 ........///.....public.override.
ce20 76 6f 69 64 20 4f 6e 47 55 49 28 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 7b 0d void.OnGUI()..........///.....{.
ce40 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 74 61 72 67 65 74 2e 61 6d 6f 75 .........///.........target.amou
ce60 6e 74 20 3d 20 45 64 69 74 6f 72 47 55 49 4c 61 79 6f 75 74 2e 53 6c 69 64 65 72 28 6d 5f 41 6d nt.=.EditorGUILayout.Slider(m_Am
ce80 6f 75 6e 74 4c 61 62 65 6c 2c 20 74 61 72 67 65 74 2e 61 6d 6f 75 6e 74 2c 20 30 2c 20 30 2e 32 ountLabel,.target.amount,.0,.0.2
cea0 35 66 29 3b 0d 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 5f);..........///.....}.........
cec0 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 70 72 69 76 61 74 65 20 47 55 .///..........///.....private.GU
cee0 49 43 6f 6e 74 65 6e 74 20 6d 5f 41 6d 6f 75 6e 74 4c 61 62 65 6c 20 3d 20 6e 65 77 20 47 55 49 IContent.m_AmountLabel.=.new.GUI
cf00 43 6f 6e 74 65 6e 74 28 22 41 6d 6f 75 6e 74 22 2c 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 Content("Amount",..........///..
cf20 20 20 20 20 20 20 20 22 41 6d 6f 75 6e 74 20 6f 66 20 6a 69 74 74 65 72 20 74 6f 20 61 70 70 6c ......."Amount.of.jitter.to.appl
cf40 79 2e 20 57 69 6c 6c 20 61 64 64 20 61 20 72 61 6e 64 6f 6d 20 76 61 6c 75 65 20 69 6e 20 74 68 y..Will.add.a.random.value.in.th
cf60 65 20 72 61 6e 67 65 20 5b 2d 61 6d 6f 75 6e 74 2e 2e 61 6d 6f 75 6e 74 5d 20 22 0d 0a 20 20 20 e.range.[-amount..amount].".....
cf80 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 2b 20 22 74 6f 20 65 61 63 68 20 .....///.............+."to.each.
cfa0 69 6e 70 75 74 20 76 61 6c 75 65 2e 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 7d 0d 0a 20 input.value.);..........///.}...
cfc0 20 20 20 20 20 20 20 2f 2f 2f 20 23 65 6e 64 69 66 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c .......///.#endif..........///.<
cfe0 2f 63 6f 64 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 65 78 61 6d 70 6c 65 3e 0d 0a /code>..........///.</example>..
d000 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 4e 6f 74 65 20 74 68 ........///..........///.Note.th
d020 61 74 20 69 74 20 69 73 20 61 6c 6c 6f 77 65 64 20 74 6f 20 72 65 67 69 73 74 65 72 20 74 68 65 at.it.is.allowed.to.register.the
d040 20 73 61 6d 65 20 70 72 6f 63 65 73 73 6f 72 20 74 79 70 65 20 6d 75 6c 74 69 70 6c 65 20 74 79 .same.processor.type.multiple.ty
d060 70 65 73 20 77 69 74 68 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 64 69 66 66 65 72 65 6e 74 20 pes.with..........///.different.
d080 6e 61 6d 65 73 2e 20 57 68 65 6e 20 64 6f 69 6e 67 20 73 6f 2c 20 74 68 65 20 66 69 72 73 74 20 names..When.doing.so,.the.first.
d0a0 72 65 67 69 73 74 72 61 74 69 6f 6e 20 69 73 20 63 6f 6e 73 69 64 65 72 65 64 20 61 73 20 74 68 registration.is.considered.as.th
d0c0 65 20 22 70 72 6f 70 65 72 22 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 6e 61 6d 65 20 66 6f 72 e."proper"..........///.name.for
d0e0 20 74 68 65 20 70 72 6f 63 65 73 73 6f 72 20 61 6e 64 20 61 6c 6c 20 73 75 62 73 65 71 75 65 6e .the.processor.and.all.subsequen
d100 74 20 72 65 67 69 73 74 72 61 74 69 6f 6e 73 20 77 69 6c 6c 20 62 65 20 63 6f 6e 73 69 64 65 72 t.registrations.will.be.consider
d120 65 64 20 61 6c 69 61 73 65 73 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 ed.aliases...........///........
d140 20 20 2f 2f 2f 20 53 65 65 20 74 68 65 20 3c 61 20 68 72 65 66 3d 22 2e 2e 2f 6d 61 6e 75 61 6c ..///.See.the.<a.href="../manual
d160 2f 50 72 6f 63 65 73 73 6f 72 73 2e 68 74 6d 6c 22 3e 6d 61 6e 75 61 6c 3c 2f 61 3e 20 66 6f 72 /Processors.html">manual</a>.for
d180 20 6d 6f 72 65 20 64 65 74 61 69 6c 73 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 .more.details...........///.</re
d1a0 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 marks>..........///.<seealso.cre
d1c0 66 3d 22 49 6e 70 75 74 50 72 6f 63 65 73 73 6f 72 7b 54 7d 22 2f 3e 0d 0a 20 20 20 20 20 20 20 f="InputProcessor{T}"/>.........
d1e0 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 49 6e 70 75 74 42 69 6e 64 69 6e 67 .///.<seealso.cref="InputBinding
d200 2e 70 72 6f 63 65 73 73 6f 72 73 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 .processors"/>..........///.<see
d220 61 6c 73 6f 20 63 72 65 66 3d 22 49 6e 70 75 74 41 63 74 69 6f 6e 2e 70 72 6f 63 65 73 73 6f 72 also.cref="InputAction.processor
d240 73 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d s"/>..........///.<seealso.cref=
d260 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 2e 43 6f 6e 74 72 6f 6c 49 74 65 6d 2e "InputControlLayout.ControlItem.
d280 70 72 6f 63 65 73 73 6f 72 73 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 processors"/>..........///.<seea
d2a0 6c 73 6f 20 63 72 65 66 3d 22 49 6e 70 75 74 50 61 72 61 6d 65 74 65 72 45 64 69 74 6f 72 7b 54 lso.cref="InputParameterEditor{T
d2c0 4f 62 6a 65 63 74 7d 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 Object}"/>..........public.stati
d2e0 63 20 76 6f 69 64 20 52 65 67 69 73 74 65 72 50 72 6f 63 65 73 73 6f 72 3c 54 3e 28 73 74 72 69 c.void.RegisterProcessor<T>(stri
d300 6e 67 20 6e 61 6d 65 20 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 ng.name.=.null)..........{......
d320 20 20 20 20 20 20 20 20 52 65 67 69 73 74 65 72 50 72 6f 63 65 73 73 6f 72 28 74 79 70 65 6f 66 ........RegisterProcessor(typeof
d340 28 54 29 2c 20 6e 61 6d 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 (T),.name);..........}..........
d360 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
d380 75 72 6e 20 74 68 65 20 70 72 6f 63 65 73 73 6f 72 20 74 79 70 65 20 72 65 67 69 73 74 65 72 65 urn.the.processor.type.registere
d3a0 64 20 75 6e 64 65 72 20 74 68 65 20 67 69 76 65 6e 20 6e 61 6d 65 2e 20 49 66 20 6e 6f 20 73 75 d.under.the.given.name..If.no.su
d3c0 63 68 20 70 72 6f 63 65 73 73 6f 72 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 68 61 73 20 62 65 ch.processor..........///.has.be
d3e0 65 6e 20 72 65 67 69 73 74 65 72 65 64 2c 20 72 65 74 75 72 6e 20 3c 63 3e 6e 75 6c 6c 3c 2f 63 en.registered,.return.<c>null</c
d400 3e 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 >...........///.</summary>......
d420 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 6e 61 6d 65 22 3e 4e 61 6d 65 20 ....///.<param.name="name">Name.
d440 6f 66 20 70 72 6f 63 65 73 73 6f 72 2e 20 43 61 73 65 2d 69 6e 73 65 6e 73 69 74 69 76 65 2e 3c of.processor..Case-insensitive.<
d460 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f 6e 20 /param>..........///.<exception.
d480 63 72 65 66 3d 22 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 22 3e 3c 70 61 cref="ArgumentNullException"><pa
d4a0 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 6e 61 6d 65 22 2f 3e 20 69 73 20 3c 63 3e 6e 75 6c 6c 3c ramref.name="name"/>.is.<c>null<
d4c0 2f 63 3e 20 6f 72 20 65 6d 70 74 79 2e 3c 2f 65 78 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 /c>.or.empty.</exception>.......
d4e0 20 20 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 54 68 65 20 67 69 76 65 6e 20 70 72 6f 63 65 73 ...///.<returns>The.given.proces
d500 73 6f 72 20 74 79 70 65 20 6f 72 20 3c 63 3e 6e 75 6c 6c 3c 2f 63 3e 20 69 66 20 6e 6f 74 20 66 sor.type.or.<c>null</c>.if.not.f
d520 6f 75 6e 64 2e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 ound.</returns>..........///.<se
d540 65 61 6c 73 6f 20 63 72 65 66 3d 22 52 65 67 69 73 74 65 72 50 72 6f 63 65 73 73 6f 72 7b 54 7d ealso.cref="RegisterProcessor{T}
d560 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 54 79 70 65 20 "/>..........public.static.Type.
d580 54 72 79 47 65 74 50 72 6f 63 65 73 73 6f 72 28 73 74 72 69 6e 67 20 6e 61 6d 65 29 0d 0a 20 20 TryGetProcessor(string.name)....
d5a0 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 73 74 72 69 6e 67 2e ......{..............if.(string.
d5c0 49 73 4e 75 6c 6c 4f 72 45 6d 70 74 79 28 6e 61 6d 65 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 IsNullOrEmpty(name))............
d5e0 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 ......throw.new.ArgumentNullExce
d600 70 74 69 6f 6e 28 6e 61 6d 65 6f 66 28 6e 61 6d 65 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 ption(nameof(name));............
d620 20 20 72 65 74 75 72 6e 20 73 5f 4d 61 6e 61 67 65 72 2e 70 72 6f 63 65 73 73 6f 72 73 2e 4c 6f ..return.s_Manager.processors.Lo
d640 6f 6b 75 70 54 79 70 65 52 65 67 69 73 74 72 61 74 69 6f 6e 28 6e 61 6d 65 29 3b 0d 0a 20 20 20 okupTypeRegistration(name);.....
d660 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d .....}............///.<summary>.
d680 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 4c 69 73 74 20 74 68 65 20 6e 61 6d 65 73 20 6f 66 20 61 .........///.List.the.names.of.a
d6a0 6c 6c 20 70 72 6f 63 65 73 73 6f 72 73 20 68 61 76 65 20 62 65 65 6e 20 72 65 67 69 73 74 65 72 ll.processors.have.been.register
d6c0 65 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 20 20 20 ed...........///.</summary>.....
d6e0 20 20 20 20 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 4c 69 73 74 20 6f 66 20 72 65 67 69 73 74 .....///.<returns>List.of.regist
d700 65 72 65 64 20 70 72 6f 63 65 73 73 6f 72 73 2e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 20 20 20 ered.processors.</returns>......
d720 20 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 4e ....///.<remarks>..........///.N
d740 6f 74 65 20 74 68 61 74 20 74 68 65 20 72 65 73 75 6c 74 20 77 69 6c 6c 20 69 6e 63 6c 75 64 65 ote.that.the.result.will.include
d760 20 62 6f 74 68 20 22 70 72 6f 70 65 72 22 20 6e 61 6d 65 73 20 61 6e 64 20 61 6c 69 61 73 65 73 .both."proper".names.and.aliases
d780 20 72 65 67 69 73 74 65 72 65 64 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 66 6f 72 20 70 72 6f .registered..........///.for.pro
d7a0 63 65 73 73 6f 72 73 2e 20 49 66 2c 20 66 6f 72 20 65 78 61 6d 70 6c 65 2c 20 61 20 67 69 76 65 cessors..If,.for.example,.a.give
d7c0 6e 20 74 79 70 65 20 3c 63 3e 4a 69 74 74 65 72 50 72 6f 63 65 73 73 6f 72 3c 2f 63 3e 20 68 61 n.type.<c>JitterProcessor</c>.ha
d7e0 73 20 62 65 65 6e 20 72 65 67 69 73 74 65 72 65 64 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 75 s.been.registered..........///.u
d800 6e 64 65 72 20 62 6f 74 68 20 22 4a 69 74 74 65 72 22 20 61 6e 64 20 22 52 61 6e 64 6f 6d 69 7a nder.both."Jitter".and."Randomiz
d820 65 22 2c 20 69 74 20 77 69 6c 6c 20 61 70 70 65 61 72 20 69 6e 20 74 68 65 20 6c 69 73 74 20 77 e",.it.will.appear.in.the.list.w
d840 69 74 68 20 62 6f 74 68 20 74 68 6f 73 65 20 6e 61 6d 65 73 2e 0d 0a 20 20 20 20 20 20 20 20 2f ith.both.those.names.........../
d860 2f 2f 20 3c 2f 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 //.</remarks>..........///.<seea
d880 6c 73 6f 20 63 72 65 66 3d 22 54 72 79 47 65 74 50 72 6f 63 65 73 73 6f 72 22 2f 3e 0d 0a 20 20 lso.cref="TryGetProcessor"/>....
d8a0 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 52 65 67 69 73 74 65 ......///.<seealso.cref="Registe
d8c0 72 50 72 6f 63 65 73 73 6f 72 7b 54 7d 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 rProcessor{T}"/>..........public
d8e0 20 73 74 61 74 69 63 20 49 45 6e 75 6d 65 72 61 62 6c 65 3c 73 74 72 69 6e 67 3e 20 4c 69 73 74 .static.IEnumerable<string>.List
d900 50 72 6f 63 65 73 73 6f 72 73 28 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 Processors()..........{.........
d920 20 20 20 20 20 72 65 74 75 72 6e 20 73 5f 4d 61 6e 61 67 65 72 2e 70 72 6f 63 65 73 73 6f 72 73 .....return.s_Manager.processors
d940 2e 6e 61 6d 65 73 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 23 65 .names;..........}............#e
d960 6e 64 72 65 67 69 6f 6e 0d 0a 0d 0a 20 20 20 20 20 20 20 20 23 72 65 67 69 6f 6e 20 44 65 76 69 ndregion............#region.Devi
d980 63 65 73 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 ces............///.<summary>....
d9a0 20 20 20 20 20 20 2f 2f 2f 20 54 68 65 20 6c 69 73 74 20 6f 66 20 63 75 72 72 65 6e 74 6c 79 20 ......///.The.list.of.currently.
d9c0 63 6f 6e 6e 65 63 74 65 64 20 64 65 76 69 63 65 73 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 connected.devices...........///.
d9e0 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 76 61 6c 75 65 3e 43 </summary>..........///.<value>C
da00 75 72 72 65 6e 74 6c 79 20 63 6f 6e 6e 65 63 74 65 64 20 64 65 76 69 63 65 73 2e 3c 2f 76 61 6c urrently.connected.devices.</val
da20 75 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 ue>..........///.<remarks>......
da40 20 20 20 20 2f 2f 2f 20 4e 6f 74 65 20 74 68 61 74 20 61 63 63 65 73 73 69 6e 67 20 74 68 69 73 ....///.Note.that.accessing.this
da60 20 70 72 6f 70 65 72 74 79 20 64 6f 65 73 20 6e 6f 74 20 61 6c 6c 6f 63 61 74 65 2e 20 49 74 20 .property.does.not.allocate..It.
da80 67 69 76 65 73 20 72 65 61 64 2d 6f 6e 6c 79 20 61 63 63 65 73 73 0d 0a 20 20 20 20 20 20 20 20 gives.read-only.access..........
daa0 2f 2f 2f 20 64 69 72 65 63 74 6c 79 20 74 6f 20 74 68 65 20 73 79 73 74 65 6d 27 73 20 69 6e 74 ///.directly.to.the.system's.int
dac0 65 72 6e 61 6c 20 61 72 72 61 79 20 6f 66 20 64 65 76 69 63 65 73 2e 0d 0a 20 20 20 20 20 20 20 ernal.array.of.devices..........
dae0 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 68 65 20 76 61 6c 75 65 20 72 65 74 75 .///..........///.The.value.retu
db00 72 6e 65 64 20 62 79 20 74 68 69 73 20 70 72 6f 70 65 72 74 79 20 73 68 6f 75 6c 64 20 6e 6f 74 rned.by.this.property.should.not
db20 20 62 65 20 68 65 6c 64 20 6f 6e 20 74 6f 2e 20 57 68 65 6e 20 74 68 65 20 64 65 76 69 63 65 0d .be.held.on.to..When.the.device.
db40 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 73 65 74 75 70 20 69 6e 20 74 68 65 20 73 79 73 74 65 6d .........///.setup.in.the.system
db60 20 63 68 61 6e 67 65 73 2c 20 61 6e 79 20 76 61 6c 75 65 20 70 72 65 76 69 6f 75 73 6c 79 20 72 .changes,.any.value.previously.r
db80 65 74 75 72 6e 65 64 20 62 79 20 74 68 69 73 20 70 72 6f 70 65 72 74 79 0d 0a 20 20 20 20 20 20 eturned.by.this.property........
dba0 20 20 2f 2f 2f 20 6d 61 79 20 62 65 63 6f 6d 65 20 69 6e 76 61 6c 69 64 2e 20 51 75 65 72 79 20 ..///.may.become.invalid..Query.
dbc0 74 68 65 20 70 72 6f 70 65 72 74 79 20 64 69 72 65 63 74 6c 79 20 77 68 65 6e 65 76 65 72 20 79 the.property.directly.whenever.y
dbe0 6f 75 20 6e 65 65 64 20 69 74 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 6d 61 72 ou.need.it...........///.</remar
dc00 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 ks>..........///.<seealso.cref="
dc20 41 64 64 44 65 76 69 63 65 7b 54 44 65 76 69 63 65 7d 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f AddDevice{TDevice}"/>........../
dc40 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 52 65 6d 6f 76 65 44 65 76 69 63 65 22 2f //.<seealso.cref="RemoveDevice"/
dc60 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 52 65 61 64 4f 6e 6c >..........public.static.ReadOnl
dc80 79 41 72 72 61 79 3c 49 6e 70 75 74 44 65 76 69 63 65 3e 20 64 65 76 69 63 65 73 20 3d 3e 20 73 yArray<InputDevice>.devices.=>.s
dca0 5f 4d 61 6e 61 67 65 72 2e 64 65 76 69 63 65 73 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f _Manager.devices;............///
dcc0 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 44 65 76 69 63 65 73 20 .<summary>..........///.Devices.
dce0 74 68 61 74 20 68 61 76 65 20 62 65 65 6e 20 64 69 73 63 6f 6e 6e 65 63 74 65 64 20 62 75 74 20 that.have.been.disconnected.but.
dd00 61 72 65 20 72 65 74 61 69 6e 65 64 20 62 79 20 74 68 65 20 69 6e 70 75 74 20 73 79 73 74 65 6d are.retained.by.the.input.system
dd20 20 69 6e 20 63 61 73 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 74 68 65 79 20 61 72 65 20 70 .in.case..........///.they.are.p
dd40 6c 75 67 67 65 64 20 62 61 63 6b 20 69 6e 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 lugged.back.in...........///.</s
dd60 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 76 61 6c 75 65 3e 44 65 76 69 ummary>..........///.<value>Devi
dd80 63 65 73 20 74 68 61 74 20 68 61 76 65 20 62 65 65 6e 20 72 65 74 61 69 6e 65 64 20 62 79 20 74 ces.that.have.been.retained.by.t
dda0 68 65 20 69 6e 70 75 74 20 73 79 73 74 65 6d 20 69 6e 20 63 61 73 65 20 74 68 65 79 20 61 72 65 he.input.system.in.case.they.are
ddc0 20 70 6c 75 67 67 65 64 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 62 61 63 6b 20 69 6e 2e 3c 2f .plugged..........///.back.in.</
dde0 76 61 6c 75 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 value>..........///.<remarks>...
de00 20 20 20 20 20 20 20 2f 2f 2f 20 44 75 72 69 6e 67 20 67 61 6d 65 70 6c 61 79 20 69 74 20 69 73 .......///.During.gameplay.it.is
de20 20 75 6e 64 65 73 69 72 61 62 6c 65 20 74 6f 20 68 61 76 65 20 74 68 65 20 73 79 73 74 65 6d 20 .undesirable.to.have.the.system.
de40 61 6c 6c 6f 63 61 74 65 20 61 6e 64 20 72 65 6c 65 61 73 65 20 6d 61 6e 61 67 65 64 20 6d 65 6d allocate.and.release.managed.mem
de60 6f 72 79 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 61 73 20 64 65 76 69 63 65 73 20 61 72 65 20 ory..........///.as.devices.are.
de80 75 6e 70 6c 75 67 67 65 64 20 61 6e 64 20 70 6c 75 67 67 65 64 20 62 61 63 6b 20 69 6e 20 61 73 unplugged.and.plugged.back.in.as
dea0 20 69 74 20 77 6f 75 6c 64 20 75 6c 74 69 6d 61 74 65 6c 79 20 6c 65 61 64 20 74 6f 20 47 43 20 .it.would.ultimately.lead.to.GC.
dec0 73 70 69 6b 65 73 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 64 75 72 69 6e 67 20 67 61 6d 65 70 spikes..........///.during.gamep
dee0 6c 61 79 2e 20 54 6f 20 61 76 6f 69 64 20 74 68 61 74 2c 20 69 6e 70 75 74 20 64 65 76 69 63 65 lay..To.avoid.that,.input.device
df00 73 20 74 68 61 74 20 68 61 76 65 20 62 65 65 6e 20 72 65 70 6f 72 74 65 64 20 62 79 20 74 68 65 s.that.have.been.reported.by.the
df20 20 3c 73 65 65 20 63 72 65 66 3d 22 49 49 6e 70 75 74 52 75 6e 74 69 6d 65 22 3e 0d 0a 20 20 20 .<see.cref="IInputRuntime">.....
df40 20 20 20 20 20 2f 2f 2f 20 72 75 6e 74 69 6d 65 3c 2f 73 65 65 3e 20 61 6e 64 20 61 72 65 20 72 .....///.runtime</see>.and.are.r
df60 65 6d 6f 76 65 64 20 74 68 72 6f 75 67 68 20 3c 73 65 65 20 63 72 65 66 3d 22 44 65 76 69 63 65 emoved.through.<see.cref="Device
df80 52 65 6d 6f 76 65 45 76 65 6e 74 22 3e 65 76 65 6e 74 73 3c 2f 73 65 65 3e 20 61 72 65 20 72 65 RemoveEvent">events</see>.are.re
dfa0 74 61 69 6e 65 64 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 62 79 20 74 68 65 20 73 79 73 74 65 tained..........///.by.the.syste
dfc0 6d 20 61 6e 64 20 74 68 65 6e 20 72 65 75 73 65 64 20 69 66 20 74 68 65 20 64 65 76 69 63 65 20 m.and.then.reused.if.the.device.
dfe0 69 73 20 70 6c 75 67 67 65 64 20 62 61 63 6b 20 69 6e 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f is.plugged.back.in...........///
e000 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 4e 6f 74 65 20 74 68 61 74 20 74 68 65 20 64 65 76 69 ..........///.Note.that.the.devi
e020 63 65 73 20 6d 6f 76 65 64 20 74 6f 20 64 69 73 63 6f 6e 6e 65 63 74 65 64 20 73 74 61 74 75 73 ces.moved.to.disconnected.status
e040 20 77 69 6c 6c 20 73 74 69 6c 6c 20 73 65 65 20 61 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 .will.still.see.a.<see.cref="Inp
e060 75 74 44 65 76 69 63 65 43 68 61 6e 67 65 2e 52 65 6d 6f 76 65 64 22 2f 3e 0d 0a 20 20 20 20 20 utDeviceChange.Removed"/>.......
e080 20 20 20 2f 2f 2f 20 6e 6f 74 69 66 69 63 61 74 69 6f 6e 20 61 6e 64 20 61 20 3c 73 65 65 20 63 ...///.notification.and.a.<see.c
e0a0 72 65 66 3d 22 49 6e 70 75 74 44 65 76 69 63 65 43 68 61 6e 67 65 2e 41 64 64 65 64 22 2f 3e 20 ref="InputDeviceChange.Added"/>.
e0c0 6e 6f 74 69 66 69 63 61 74 69 6f 6e 20 77 68 65 6e 20 70 6c 75 67 67 65 64 20 62 61 63 6b 20 69 notification.when.plugged.back.i
e0e0 6e 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 6f 20 n...........///..........///.To.
e100 64 65 74 65 72 6d 69 6e 65 20 69 66 20 61 20 6e 65 77 6c 79 20 64 69 73 63 6f 76 65 72 65 64 20 determine.if.a.newly.discovered.
e120 64 65 76 69 63 65 20 69 73 20 6f 6e 65 20 77 65 20 68 61 76 65 20 73 65 65 6e 20 62 65 66 6f 72 device.is.one.we.have.seen.befor
e140 65 2c 20 74 68 65 20 73 79 73 74 65 6d 20 75 73 65 73 20 61 0d 0a 20 20 20 20 20 20 20 20 2f 2f e,.the.system.uses.a..........//
e160 2f 20 73 69 6d 70 6c 65 20 61 70 70 72 6f 61 63 68 20 6f 66 20 63 6f 6d 70 61 72 69 6e 67 20 3c /.simple.approach.of.comparing.<
e180 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 44 65 76 69 63 65 44 65 73 63 72 69 70 74 69 6f 6e see.cref="InputDeviceDescription
e1a0 22 3e 64 65 76 69 63 65 20 64 65 73 63 72 69 70 74 69 6f 6e 73 3c 2f 73 65 65 3e 2e 0d 0a 20 20 ">device.descriptions</see>.....
e1c0 20 20 20 20 20 20 2f 2f 2f 20 4e 6f 74 65 20 74 68 61 74 20 74 68 65 72 65 20 63 61 6e 20 62 65 ......///.Note.that.there.can.be
e1e0 20 65 72 72 6f 72 73 20 61 6e 64 20 61 20 64 65 76 69 63 65 20 6d 61 79 20 62 65 20 69 6e 63 6f .errors.and.a.device.may.be.inco
e200 72 72 65 63 74 6c 79 20 63 6c 61 73 73 69 66 69 65 64 20 61 73 20 3c 73 65 65 20 63 72 65 66 3d rrectly.classified.as.<see.cref=
e220 22 49 6e 70 75 74 44 65 76 69 63 65 43 68 61 6e 67 65 2e 52 65 63 6f 6e 6e 65 63 74 65 64 22 2f "InputDeviceChange.Reconnected"/
e240 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 77 68 65 6e 20 69 6e 20 66 61 63 74 20 69 74 20 69 >..........///.when.in.fact.it.i
e260 73 20 61 20 64 69 66 66 65 72 65 6e 74 20 64 65 76 69 63 65 20 66 72 6f 6d 20 62 65 66 6f 72 65 s.a.different.device.from.before
e280 2e 20 54 68 65 20 70 72 6f 62 6c 65 6d 20 69 73 20 74 68 61 74 20 62 61 73 65 64 20 6f 6e 20 69 ..The.problem.is.that.based.on.i
e2a0 6e 66 6f 72 6d 61 74 69 6f 6e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 6d 61 64 65 20 61 76 61 nformation..........///.made.ava
e2c0 69 6c 61 62 6c 65 20 62 79 20 70 6c 61 74 66 6f 72 6d 73 2c 20 69 74 20 63 61 6e 20 62 65 20 69 ilable.by.platforms,.it.can.be.i
e2e0 6e 68 65 72 65 6e 74 6c 79 20 64 69 66 66 69 63 75 6c 74 20 74 6f 20 64 65 74 65 72 6d 69 6e 65 nherently.difficult.to.determine
e300 20 77 68 65 74 68 65 72 20 61 20 64 65 76 69 63 65 20 69 73 0d 0a 20 20 20 20 20 20 20 20 2f 2f .whether.a.device.is..........//
e320 2f 20 69 6e 64 65 65 64 20 74 68 65 20 76 65 72 79 20 73 61 6d 65 20 6f 6e 65 2e 0d 0a 20 20 20 /.indeed.the.very.same.one......
e340 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 46 6f 72 20 65 78 61 6d 70 6c .....///..........///.For.exampl
e360 65 2c 20 69 74 20 69 73 20 6f 66 74 65 6e 20 6e 6f 74 20 70 6f 73 73 69 62 6c 65 20 74 6f 20 64 e,.it.is.often.not.possible.to.d
e380 65 74 65 72 6d 69 6e 65 20 77 69 74 68 20 31 30 30 25 20 63 65 72 74 61 69 6e 74 79 20 77 68 65 etermine.with.100%.certainty.whe
e3a0 74 68 65 72 20 61 6e 20 69 64 65 6e 74 69 63 61 6c 20 6c 6f 6f 6b 69 6e 67 20 64 65 76 69 63 65 ther.an.identical.looking.device
e3c0 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 74 6f 20 6f 6e 65 20 77 65 27 76 65 20 70 72 65 76 69 ..........///.to.one.we've.previ
e3e0 6f 75 73 6c 79 20 73 65 65 6e 20 6f 6e 20 61 20 64 69 66 66 65 72 65 6e 74 20 55 53 42 20 70 6f ously.seen.on.a.different.USB.po
e400 72 74 20 69 73 20 69 6e 64 65 65 64 20 74 68 65 20 76 65 72 79 20 73 61 6d 65 20 64 65 76 69 63 rt.is.indeed.the.very.same.devic
e420 65 2e 20 4f 53 73 20 77 69 6c 6c 20 75 73 75 61 6c 6c 79 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f e..OSs.will.usually..........///
e440 20 72 65 61 74 74 61 63 68 20 61 20 55 53 42 20 64 65 76 69 63 65 20 74 6f 20 69 74 73 20 70 72 .reattach.a.USB.device.to.its.pr
e460 65 76 69 6f 75 73 20 69 6e 73 74 61 6e 63 65 20 69 66 20 69 74 20 69 73 20 70 6c 75 67 67 65 64 evious.instance.if.it.is.plugged
e480 20 69 6e 74 6f 20 74 68 65 20 73 61 6d 65 20 55 53 42 20 70 6f 72 74 20 62 75 74 20 63 72 65 61 .into.the.same.USB.port.but.crea
e4a0 74 65 20 61 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 6e 65 77 20 69 6e 73 74 61 6e 63 65 20 6f te.a..........///.new.instance.o
e4c0 66 20 74 68 65 20 73 61 6d 65 20 64 65 76 69 63 65 20 69 73 20 70 6c 75 67 67 65 64 20 69 6e 74 f.the.same.device.is.plugged.int
e4e0 6f 20 61 20 64 69 66 66 65 72 65 6e 74 20 70 6f 72 74 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f o.a.different.port...........///
e500 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 46 6f 72 20 64 65 76 69 63 65 73 20 74 68 61 74 20 64 ..........///.For.devices.that.d
e520 6f 20 72 65 6c 61 79 20 74 68 65 69 72 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 44 65 o.relay.their.<see.cref="InputDe
e540 76 69 63 65 44 65 73 63 72 69 70 74 69 6f 6e 2e 73 65 72 69 61 6c 22 3e 73 65 72 69 61 6c 73 3c viceDescription.serial">serials<
e560 2f 73 65 65 3e 20 74 68 65 20 6d 61 74 63 68 69 6e 67 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 /see>.the.matching..........///.
e580 69 73 20 72 65 6c 69 61 62 6c 65 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 is.reliable...........///.......
e5a0 20 20 20 2f 2f 2f 20 54 68 65 20 6c 69 73 74 20 63 61 6e 20 62 65 20 70 75 72 67 65 64 20 62 79 ...///.The.list.can.be.purged.by
e5c0 20 63 61 6c 6c 69 6e 67 20 3c 73 65 65 20 63 72 65 66 3d 22 46 6c 75 73 68 44 69 73 63 6f 6e 6e .calling.<see.cref="FlushDisconn
e5e0 65 63 74 65 64 44 65 76 69 63 65 73 22 2f 3e 2e 20 44 6f 69 6e 67 20 73 6f 2c 20 77 69 6c 6c 20 ectedDevices"/>..Doing.so,.will.
e600 72 65 6c 65 61 73 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 61 6c 6c 20 72 65 66 65 72 65 6e release..........///.all.referen
e620 63 65 20 77 65 20 68 6f 6c 64 20 74 6f 20 74 68 65 20 64 65 76 69 63 65 73 20 6f 72 20 61 6e 79 ce.we.hold.to.the.devices.or.any
e640 20 63 6f 6e 74 72 6f 6c 73 20 69 6e 73 69 64 65 20 6f 66 20 74 68 65 6d 20 61 6e 64 20 61 6c 6c .controls.inside.of.them.and.all
e660 6f 77 20 74 68 65 20 64 65 76 69 63 65 73 20 74 6f 20 62 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f ow.the.devices.to.be..........//
e680 2f 20 72 65 63 6c 61 69 6d 65 64 20 62 79 20 74 68 65 20 67 61 72 62 61 67 65 20 63 6f 6c 6c 65 /.reclaimed.by.the.garbage.colle
e6a0 63 74 6f 72 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 ctor...........///..........///.
e6c0 4e 6f 74 65 20 74 68 61 74 20 69 66 20 79 6f 75 20 63 61 6c 6c 20 3c 73 65 65 20 63 72 65 66 3d Note.that.if.you.call.<see.cref=
e6e0 22 52 65 6d 6f 76 65 44 65 76 69 63 65 22 2f 3e 20 65 78 70 6c 69 63 69 74 6c 79 2c 20 74 68 65 "RemoveDevice"/>.explicitly,.the
e700 20 67 69 76 65 6e 20 64 65 76 69 63 65 20 69 73 20 6e 6f 74 20 72 65 74 61 69 6e 65 64 0d 0a 20 .given.device.is.not.retained...
e720 20 20 20 20 20 20 20 2f 2f 2f 20 62 79 20 74 68 65 20 69 6e 70 75 74 20 73 79 73 74 65 6d 20 61 .......///.by.the.input.system.a
e740 6e 64 20 77 69 6c 6c 20 6e 6f 74 20 61 70 70 65 61 72 20 6f 6e 20 74 68 69 73 20 6c 69 73 74 2e nd.will.not.appear.on.this.list.
e760 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 41 6c 73 6f 20 ..........///..........///.Also.
e780 6e 6f 74 65 20 74 68 61 74 20 64 65 76 69 63 65 73 20 6f 6e 20 74 68 69 73 20 6c 69 73 74 20 77 note.that.devices.on.this.list.w
e7a0 69 6c 6c 20 62 65 20 6c 6f 73 74 20 77 68 65 6e 20 64 6f 6d 61 69 6e 20 72 65 6c 6f 61 64 73 20 ill.be.lost.when.domain.reloads.
e7c0 68 61 70 70 65 6e 20 69 6e 20 74 68 65 20 65 64 69 74 6f 72 20 28 69 2e 65 2e 20 6f 6e 0d 0a 20 happen.in.the.editor.(i.e..on...
e7e0 20 20 20 20 20 20 20 2f 2f 2f 20 73 63 72 69 70 74 20 72 65 63 6f 6d 70 69 6c 61 74 69 6f 6e 20 .......///.script.recompilation.
e800 61 6e 64 20 77 68 65 6e 20 65 6e 74 65 72 69 6e 67 20 70 6c 61 79 20 6d 6f 64 65 29 2e 0d 0a 20 and.when.entering.play.mode)....
e820 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f .......///.</remarks>........../
e840 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 46 6c 75 73 68 44 69 73 63 6f 6e 6e 65 63 //.<seealso.cref="FlushDisconnec
e860 74 65 64 44 65 76 69 63 65 73 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 tedDevices"/>..........public.st
e880 61 74 69 63 20 52 65 61 64 4f 6e 6c 79 41 72 72 61 79 3c 49 6e 70 75 74 44 65 76 69 63 65 3e 20 atic.ReadOnlyArray<InputDevice>.
e8a0 64 69 73 63 6f 6e 6e 65 63 74 65 64 44 65 76 69 63 65 73 20 3d 3e 0d 0a 20 20 20 20 20 20 20 20 disconnectedDevices.=>..........
e8c0 20 20 20 20 6e 65 77 20 52 65 61 64 4f 6e 6c 79 41 72 72 61 79 3c 49 6e 70 75 74 44 65 76 69 63 ....new.ReadOnlyArray<InputDevic
e8e0 65 3e 28 73 5f 4d 61 6e 61 67 65 72 2e 6d 5f 44 69 73 63 6f 6e 6e 65 63 74 65 64 44 65 76 69 63 e>(s_Manager.m_DisconnectedDevic
e900 65 73 2c 20 30 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 4d 61 6e 61 67 65 es,.0,..................s_Manage
e920 72 2e 6d 5f 44 69 73 63 6f 6e 6e 65 63 74 65 64 44 65 76 69 63 65 73 43 6f 75 6e 74 29 3b 0d 0a r.m_DisconnectedDevicesCount);..
e940 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>.........
e960 20 2f 2f 2f 20 45 76 65 6e 74 20 74 68 61 74 20 69 73 20 73 69 67 6e 61 6c 6c 65 64 20 77 68 65 .///.Event.that.is.signalled.whe
e980 6e 20 74 68 65 20 64 65 76 69 63 65 20 73 65 74 75 70 20 69 6e 20 74 68 65 20 73 79 73 74 65 6d n.the.device.setup.in.the.system
e9a0 20 63 68 61 6e 67 65 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 .changes...........///.</summary
e9c0 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 76 61 6c 75 65 3e 43 61 6c 6c 62 61 63 6b 20 77 >..........///.<value>Callback.w
e9e0 68 65 6e 20 64 65 76 69 63 65 20 73 65 74 75 70 20 6e 69 20 73 79 73 74 65 6d 20 63 68 61 6e 67 hen.device.setup.ni.system.chang
ea00 65 73 2e 3c 2f 76 61 6c 75 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b es.</value>..........///.<remark
ea20 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 68 69 73 20 63 61 6e 20 62 65 20 75 73 65 64 s>..........///.This.can.be.used
ea40 20 74 6f 20 64 65 74 65 63 74 20 77 68 65 6e 20 64 65 76 69 63 65 73 20 61 72 65 20 61 64 64 65 .to.detect.when.devices.are.adde
ea60 64 20 6f 72 20 72 65 6d 6f 76 65 64 20 61 73 20 77 65 6c 6c 20 61 73 0d 0a 20 20 20 20 20 20 20 d.or.removed.as.well.as.........
ea80 20 2f 2f 2f 20 64 65 74 65 63 74 69 6e 67 20 77 68 65 6e 20 65 78 69 73 74 69 6e 67 20 64 65 76 .///.detecting.when.existing.dev
eaa0 69 63 65 73 20 63 68 61 6e 67 65 20 74 68 65 69 72 20 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 2e ices.change.their.configuration.
eac0 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 61 6d ..........///..........///.<exam
eae0 70 6c 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 63 6f 64 65 3e 0d 0a 20 20 20 20 20 20 ple>..........///.<code>........
eb00 20 20 2f 2f 2f 20 49 6e 70 75 74 53 79 73 74 65 6d 2e 6f 6e 44 65 76 69 63 65 43 68 61 6e 67 65 ..///.InputSystem.onDeviceChange
eb20 20 2b 3d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 28 64 65 76 69 63 65 2c 20 63 68 .+=..........///.....(device,.ch
eb40 61 6e 67 65 29 20 3d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 7b 0d 0a 20 20 20 ange).=>..........///.....{.....
eb60 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 73 77 69 74 63 68 20 28 63 68 61 6e 67 65 29 .....///.........switch.(change)
eb80 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 ..........///.........{.........
eba0 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 73 65 20 49 6e 70 75 74 44 65 76 69 63 .///.............case.InputDevic
ebc0 65 43 68 61 6e 67 65 2e 41 64 64 65 64 3a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 eChange.Added:..........///.....
ebe0 20 20 20 20 20 20 20 20 20 20 20 20 44 65 62 75 67 2e 4c 6f 67 28 22 44 65 76 69 63 65 20 61 64 ............Debug.Log("Device.ad
ec00 64 65 64 3a 20 22 20 2b 20 64 65 76 69 63 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 ded:.".+.device);..........///..
ec20 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 20 2f ...............break;........../
ec40 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 73 65 20 49 6e 70 75 74 44 65 76 69 63 65 43 //.............case.InputDeviceC
ec60 68 61 6e 67 65 2e 52 65 6d 6f 76 65 64 3a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 hange.Removed:..........///.....
ec80 20 20 20 20 20 20 20 20 20 20 20 20 44 65 62 75 67 2e 4c 6f 67 28 22 44 65 76 69 63 65 20 72 65 ............Debug.Log("Device.re
eca0 6d 6f 76 65 64 3a 20 22 20 2b 20 64 65 76 69 63 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f moved:.".+.device);..........///
ecc0 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;.........
ece0 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 73 65 20 49 6e 70 75 74 44 65 76 69 63 .///.............case.InputDevic
ed00 65 43 68 61 6e 67 65 2e 43 6f 6e 66 69 67 75 72 61 74 69 6f 6e 43 68 61 6e 67 65 64 3a 0d 0a 20 eChange.ConfigurationChanged:...
ed20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 44 65 62 75 67 .......///.................Debug
ed40 2e 4c 6f 67 28 22 44 65 76 69 63 65 20 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 20 63 68 61 6e 67 .Log("Device.configuration.chang
ed60 65 64 3a 20 22 20 2b 20 64 65 76 69 63 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 ed:.".+.device);..........///...
ed80 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 20 2f 2f ..............break;..........//
eda0 2f 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 7d 3b 0d /.........}..........///.....};.
edc0 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 2f 2f .........///.</code>..........//
ede0 2f 20 3c 2f 65 78 61 6d 70 6c 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 6d 61 /.</example>..........///.</rema
ee00 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f 6e 20 63 72 65 rks>..........///.<exception.cre
ee20 66 3d 22 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 22 3e 44 65 6c 65 67 61 f="ArgumentNullException">Delega
ee40 74 65 20 72 65 66 65 72 65 6e 63 65 20 69 73 20 3c 63 3e 6e 75 6c 6c 3c 2f 63 3e 2e 3c 2f 65 78 te.reference.is.<c>null</c>.</ex
ee60 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 ception>..........///.<seealso.c
ee80 72 65 66 3d 22 64 65 76 69 63 65 73 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 ref="devices"/>..........///.<se
eea0 65 61 6c 73 6f 20 63 72 65 66 3d 22 41 64 64 44 65 76 69 63 65 7b 54 44 65 76 69 63 65 7d 22 2f ealso.cref="AddDevice{TDevice}"/
eec0 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 52 65 >..........///.<seealso.cref="Re
eee0 6d 6f 76 65 44 65 76 69 63 65 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 moveDevice"/>..........public.st
ef00 61 74 69 63 20 65 76 65 6e 74 20 41 63 74 69 6f 6e 3c 49 6e 70 75 74 44 65 76 69 63 65 2c 20 49 atic.event.Action<InputDevice,.I
ef20 6e 70 75 74 44 65 76 69 63 65 43 68 61 6e 67 65 3e 20 6f 6e 44 65 76 69 63 65 43 68 61 6e 67 65 nputDeviceChange>.onDeviceChange
ef40 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 61 64 64 0d 0a 20 20 ..........{..............add....
ef60 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.
ef80 28 76 61 6c 75 65 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 (value.==.null).................
efa0 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 .....throw.new.ArgumentNullExcep
efc0 74 69 6f 6e 28 6e 61 6d 65 6f 66 28 76 61 6c 75 65 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 tion(nameof(value));............
efe0 20 20 20 20 20 20 6c 6f 63 6b 20 28 73 5f 4d 61 6e 61 67 65 72 29 0d 0a 20 20 20 20 20 20 20 20 ......lock.(s_Manager)..........
f000 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 4d 61 6e 61 67 65 72 2e 6f 6e 44 65 76 69 63 65 43 68 ............s_Manager.onDeviceCh
f020 61 6e 67 65 20 2b 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 ange.+=.value;..............}...
f040 20 20 20 20 20 20 20 20 20 20 20 72 65 6d 6f 76 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b ...........remove..............{
f060 0d 0a 20 20 20 20 20 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 ..................if.(value.==.n
f080 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 74 68 72 6f 77 20 ull)......................throw.
f0a0 6e 65 77 20 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 28 6e 61 6d 65 6f 66 new.ArgumentNullException(nameof
f0c0 28 76 61 6c 75 65 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6c 6f 63 6b 20 (value));..................lock.
f0e0 28 73 5f 4d 61 6e 61 67 65 72 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 (s_Manager).....................
f100 20 73 5f 4d 61 6e 61 67 65 72 2e 6f 6e 44 65 76 69 63 65 43 68 61 6e 67 65 20 2d 3d 20 76 61 6c .s_Manager.onDeviceChange.-=.val
f120 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 20 7d 0d 0a 0d ue;..............}..........}...
f140 0a 20 20 20 20 20 20 20 20 2f 2f 2f 2f 52 45 56 49 45 57 3a 20 74 68 69 73 20 6f 6e 65 20 69 73 .........////REVIEW:.this.one.is
f160 6e 27 74 20 72 65 61 6c 6c 79 20 77 65 6c 6c 2d 64 65 73 69 67 6e 65 64 20 61 6e 64 20 74 68 65 n't.really.well-designed.and.the
f180 20 6d 65 61 6e 73 20 6f 66 20 69 6e 74 65 72 63 65 70 74 69 6e 67 20 63 6f 6d 6d 75 6e 69 63 61 .means.of.intercepting.communica
f1a0 74 69 6f 6e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 2f 20 20 20 20 20 20 20 20 77 69 74 68 20 74 tion..........////........with.t
f1c0 68 65 20 62 61 63 6b 65 6e 64 20 73 68 6f 75 6c 64 20 62 65 20 72 65 76 69 73 69 74 65 64 20 3e he.backend.should.be.revisited.>
f1e0 31 2e 30 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 1.0..........///.<summary>......
f200 20 20 20 20 2f 2f 2f 20 45 76 65 6e 74 20 74 68 61 74 20 69 73 20 73 69 67 6e 61 6c 6c 65 64 20 ....///.Event.that.is.signalled.
f220 77 68 65 6e 20 61 6e 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 44 65 76 69 63 65 43 6f when.an.<see.cref="InputDeviceCo
f240 6d 6d 61 6e 64 22 2f 3e 20 69 73 20 73 65 6e 74 20 74 6f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f mmand"/>.is.sent.to..........///
f260 20 61 6e 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 44 65 76 69 63 65 22 2f 3e 2e 0d 0a .an.<see.cref="InputDevice"/>...
f280 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>..........
f2a0 2f 2f 2f 20 3c 76 61 6c 75 65 3e 45 76 65 6e 74 20 74 68 61 74 20 67 65 74 73 20 73 69 67 6e 61 ///.<value>Event.that.gets.signa
f2c0 6c 6c 65 64 20 6f 6e 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 44 65 76 69 63 65 43 6f lled.on.<see.cref="InputDeviceCo
f2e0 6d 6d 61 6e 64 22 2f 3e 73 2e 3c 2f 76 61 6c 75 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 mmand"/>s.</value>..........///.
f300 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 68 69 73 20 63 61 6e 20 <remarks>..........///.This.can.
f320 62 65 20 75 73 65 64 20 74 6f 20 69 6e 74 65 72 63 65 70 74 20 63 6f 6d 6d 61 6e 64 73 20 61 6e be.used.to.intercept.commands.an
f340 64 20 6f 70 74 69 6f 6e 61 6c 6c 79 20 68 61 6e 64 6c 65 20 74 68 65 6d 20 77 69 74 68 6f 75 74 d.optionally.handle.them.without
f360 20 74 68 65 6d 20 72 65 61 63 68 69 6e 67 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 74 68 65 20 .them.reaching..........///.the.
f380 3c 73 65 65 20 63 72 65 66 3d 22 49 49 6e 70 75 74 52 75 6e 74 69 6d 65 22 2f 3e 2e 0d 0a 20 20 <see.cref="IInputRuntime"/>.....
f3a0 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 68 65 20 66 69 72 73 74 ......///..........///.The.first
f3c0 20 64 65 6c 65 67 61 74 65 20 69 6e 20 74 68 65 20 6c 69 73 74 20 74 68 61 74 20 72 65 74 75 72 .delegate.in.the.list.that.retur
f3e0 6e 73 20 61 20 72 65 73 75 6c 74 20 6f 74 68 65 72 20 74 68 61 6e 20 3c 63 3e 6e 75 6c 6c 3c 2f ns.a.result.other.than.<c>null</
f400 63 3e 20 69 73 20 63 6f 6e 73 69 64 65 72 65 64 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 74 6f c>.is.considered..........///.to
f420 20 68 61 76 65 20 68 61 6e 64 6c 65 64 20 74 68 65 20 63 6f 6d 6d 61 6e 64 2e 20 49 66 20 61 20 .have.handled.the.command..If.a.
f440 63 6f 6d 6d 61 6e 64 20 69 73 20 68 61 6e 64 6c 65 64 20 62 79 20 61 20 64 65 6c 65 67 61 74 65 command.is.handled.by.a.delegate
f460 20 69 6e 20 74 68 65 20 6c 69 73 74 2c 20 69 74 20 77 69 6c 6c 0d 0a 20 20 20 20 20 20 20 20 2f .in.the.list,.it.will........../
f480 2f 2f 20 6e 6f 74 20 62 65 20 73 65 6e 74 20 6f 6e 20 74 6f 20 74 68 65 20 72 75 6e 74 69 6d 65 //.not.be.sent.on.to.the.runtime
f4a0 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 0a 20 20 20 20 20 ...........///.</remarks>.......
f4c0 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f 6e 20 63 72 65 66 3d 22 41 72 67 75 6d 65 6e 74 ...///.<exception.cref="Argument
f4e0 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 22 3e 44 65 6c 65 67 61 74 65 20 72 65 66 65 72 65 6e 63 NullException">Delegate.referenc
f500 65 20 69 73 20 3c 63 3e 6e 75 6c 6c 3c 2f 63 3e 2e 3c 2f 65 78 63 65 70 74 69 6f 6e 3e 0d 0a 20 e.is.<c>null</c>.</exception>...
f520 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 49 6e 70 75 74 44 .......///.<seealso.cref="InputD
f540 65 76 69 63 65 2e 45 78 65 63 75 74 65 43 6f 6d 6d 61 6e 64 7b 54 43 6f 6d 6d 61 6e 64 7d 22 2f evice.ExecuteCommand{TCommand}"/
f560 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 49 49 >..........///.<seealso.cref="II
f580 6e 70 75 74 52 75 6e 74 69 6d 65 2e 44 65 76 69 63 65 43 6f 6d 6d 61 6e 64 22 2f 3e 0d 0a 20 20 nputRuntime.DeviceCommand"/>....
f5a0 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 65 76 65 6e 74 20 49 6e 70 75 74 44 ......public.static.event.InputD
f5c0 65 76 69 63 65 43 6f 6d 6d 61 6e 64 44 65 6c 65 67 61 74 65 20 6f 6e 44 65 76 69 63 65 43 6f 6d eviceCommandDelegate.onDeviceCom
f5e0 6d 61 6e 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 61 64 64 mand..........{..............add
f600 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 ..............{.................
f620 20 69 66 20 28 76 61 6c 75 65 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 .if.(value.==.null).............
f640 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 .........throw.new.ArgumentNullE
f660 78 63 65 70 74 69 6f 6e 28 6e 61 6d 65 6f 66 28 76 61 6c 75 65 29 29 3b 0d 0a 20 20 20 20 20 20 xception(nameof(value));........
f680 20 20 20 20 20 20 20 20 20 20 6c 6f 63 6b 20 28 73 5f 4d 61 6e 61 67 65 72 29 0d 0a 20 20 20 20 ..........lock.(s_Manager)......
f6a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 4d 61 6e 61 67 65 72 2e 6f 6e 44 65 76 69 ................s_Manager.onDevi
f6c0 63 65 43 6f 6d 6d 61 6e 64 20 2b 3d 20 76 61 6c 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ceCommand.+=.value;.............
f6e0 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 6d 6f 76 65 0d 0a 20 20 20 20 20 20 20 20 .}..............remove..........
f700 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 76 61 6c 75 65 ....{..................if.(value
f720 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 20 20 20 20 74 .==.null)......................t
f740 68 72 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 28 6e hrow.new.ArgumentNullException(n
f760 61 6d 65 6f 66 28 76 61 6c 75 65 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ameof(value));..................
f780 6c 6f 63 6b 20 28 73 5f 4d 61 6e 61 67 65 72 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 lock.(s_Manager)................
f7a0 20 20 20 20 20 20 73 5f 4d 61 6e 61 67 65 72 2e 6f 6e 44 65 76 69 63 65 43 6f 6d 6d 61 6e 64 20 ......s_Manager.onDeviceCommand.
f7c0 2d 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 -=.value;..............}........
f7e0 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 ..}............///.<summary>....
f800 20 20 20 20 20 20 2f 2f 2f 20 45 76 65 6e 74 20 74 68 61 74 20 69 73 20 73 69 67 6e 61 6c 6c 65 ......///.Event.that.is.signalle
f820 64 20 77 68 65 6e 20 74 68 65 20 73 79 73 74 65 6d 20 69 73 20 74 72 79 69 6e 67 20 74 6f 20 6d d.when.the.system.is.trying.to.m
f840 61 74 63 68 20 61 20 6c 61 79 6f 75 74 20 74 6f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 61 20 atch.a.layout.to..........///.a.
f860 64 65 76 69 63 65 20 69 74 20 68 61 73 20 64 69 73 63 6f 76 65 72 65 64 2e 0d 0a 20 20 20 20 20 device.it.has.discovered........
f880 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c ...///.</summary>..........///.<
f8a0 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 68 69 73 20 65 76 65 6e 74 remarks>..........///.This.event
f8c0 20 61 6c 6c 6f 77 73 20 63 75 73 74 6f 6d 69 7a 69 6e 67 20 74 68 65 20 6c 61 79 6f 75 74 20 64 .allows.customizing.the.layout.d
f8e0 69 73 63 6f 76 65 72 79 20 70 72 6f 63 65 73 73 20 61 6e 64 20 74 6f 20 67 65 6e 65 72 61 74 65 iscovery.process.and.to.generate
f900 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 6c 61 79 6f 75 74 73 20 6f 6e 20 74 68 65 20 66 6c 79 ..........///.layouts.on.the.fly
f920 2c 20 69 66 20 6e 65 65 64 20 62 65 2e 20 57 68 65 6e 20 61 20 64 65 76 69 63 65 20 69 73 20 72 ,.if.need.be..When.a.device.is.r
f940 65 70 6f 72 74 65 64 20 66 72 6f 6d 20 74 68 65 20 55 6e 69 74 79 0d 0a 20 20 20 20 20 20 20 20 eported.from.the.Unity..........
f960 2f 2f 2f 20 72 75 6e 74 69 6d 65 20 6f 72 20 74 68 72 6f 75 67 68 20 3c 73 65 65 20 63 72 65 66 ///.runtime.or.through.<see.cref
f980 3d 22 41 64 64 44 65 76 69 63 65 28 49 6e 70 75 74 44 65 76 69 63 65 44 65 73 63 72 69 70 74 69 ="AddDevice(InputDeviceDescripti
f9a0 6f 6e 29 22 2f 3e 2c 20 69 74 20 69 73 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 72 65 70 6f 72 on)"/>,.it.is..........///.repor
f9c0 74 65 64 20 69 6e 20 74 68 65 20 66 6f 72 6d 20 6f 66 20 61 6e 20 3c 73 65 65 20 63 72 65 66 3d ted.in.the.form.of.an.<see.cref=
f9e0 22 49 6e 70 75 74 44 65 76 69 63 65 44 65 73 63 72 69 70 74 69 6f 6e 22 2f 3e 2e 20 54 68 65 20 "InputDeviceDescription"/>..The.
fa00 73 79 73 74 65 6d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 77 69 6c 6c 20 74 61 6b 65 20 74 68 system..........///.will.take.th
fa20 61 74 20 64 65 73 63 72 69 70 74 69 6f 6e 20 61 6e 64 20 72 75 6e 20 69 74 20 74 68 72 6f 75 67 at.description.and.run.it.throug
fa40 68 20 61 6c 6c 20 74 68 65 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 44 65 76 69 63 65 h.all.the.<see.cref="InputDevice
fa60 4d 61 74 63 68 65 72 22 2f 3e 73 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 74 68 61 74 20 68 61 Matcher"/>s..........///.that.ha
fa80 76 65 20 62 65 65 6e 20 72 65 67 69 73 74 65 72 65 64 20 66 6f 72 20 6c 61 79 6f 75 74 73 20 28 ve.been.registered.for.layouts.(
faa0 3c 73 65 65 20 63 72 65 66 3d 22 52 65 67 69 73 74 65 72 4c 61 79 6f 75 74 4d 61 74 63 68 65 72 <see.cref="RegisterLayoutMatcher
fac0 7b 54 44 65 76 69 63 65 7d 22 2f 3e 29 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 42 61 73 65 {TDevice}"/>)...........///.Base
fae0 64 20 6f 6e 20 74 68 61 74 2c 20 69 74 20 77 69 6c 6c 20 63 6f 6d 65 20 75 70 20 77 69 74 68 20 d.on.that,.it.will.come.up.with.
fb00 65 69 74 68 65 72 20 6e 6f 20 6d 61 74 63 68 69 6e 67 20 6c 61 79 6f 75 74 20 6f 72 20 77 69 74 either.no.matching.layout.or.wit
fb20 68 20 61 20 73 69 6e 67 6c 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 6c 61 79 6f 75 74 20 74 h.a.single..........///.layout.t
fb40 68 61 74 20 68 61 73 20 74 68 65 20 68 69 67 68 65 73 74 20 6d 61 74 63 68 69 6e 67 20 73 63 6f hat.has.the.highest.matching.sco
fb60 72 65 20 61 63 63 6f 72 64 69 6e 67 20 74 6f 20 3c 73 65 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f re.according.to.<see..........//
fb80 2f 20 63 72 65 66 3d 22 49 6e 70 75 74 44 65 76 69 63 65 4d 61 74 63 68 65 72 2e 4d 61 74 63 68 /.cref="InputDeviceMatcher.Match
fba0 50 65 72 63 65 6e 74 61 67 65 22 2f 3e 20 28 6f 72 2c 20 69 6e 20 63 61 73 65 20 6d 75 6c 74 69 Percentage"/>.(or,.in.case.multi
fbc0 70 6c 65 20 6c 61 79 6f 75 74 73 20 68 61 76 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 74 68 ple.layouts.have..........///.th
fbe0 65 20 73 61 6d 65 20 73 63 6f 72 65 2c 20 74 68 65 20 66 69 72 73 74 20 6f 6e 65 20 74 6f 20 61 e.same.score,.the.first.one.to.a
fc00 63 68 69 65 76 65 20 74 68 61 74 20 73 63 6f 72 65 20 2d 2d 20 77 68 69 63 68 20 69 73 20 71 75 chieve.that.score.--.which.is.qu
fc20 61 73 69 2d 6e 6f 6e 2d 64 65 74 65 72 6d 69 6e 69 73 74 69 63 29 2e 0d 0a 20 20 20 20 20 20 20 asi-non-deterministic)..........
fc40 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 74 20 77 69 6c 6c 20 74 68 65 6e 20 74 .///..........///.It.will.then.t
fc60 61 6b 65 20 74 68 69 73 20 6c 61 79 6f 75 74 20 6e 61 6d 65 20 28 77 68 69 63 68 2c 20 61 67 61 ake.this.layout.name.(which,.aga
fc80 69 6e 2c 20 6d 61 79 20 62 65 20 65 6d 70 74 79 29 20 61 6e 64 20 69 6e 76 6f 6b 65 20 74 68 69 in,.may.be.empty).and.invoke.thi
fca0 73 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 65 76 65 6e 74 20 68 65 72 65 20 70 61 73 73 69 6e s..........///.event.here.passin
fcc0 67 20 69 74 20 6e 6f 74 20 6f 6e 6c 79 20 74 68 65 20 6c 61 79 6f 75 74 20 6e 61 6d 65 20 62 75 g.it.not.only.the.layout.name.bu
fce0 74 20 61 6c 73 6f 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 73 75 63 68 20 61 73 20 74 68 65 0d 0a t.also.information.such.as.the..
fd00 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 44 65 76 69 ........///.<see.cref="InputDevi
fd20 63 65 44 65 73 63 72 69 70 74 69 6f 6e 22 2f 3e 20 66 6f 72 20 74 68 65 20 64 65 76 69 63 65 2e ceDescription"/>.for.the.device.
fd40 20 45 61 63 68 20 6f 66 20 74 68 65 20 63 61 6c 6c 62 61 63 6b 73 20 68 6f 6f 6b 65 64 0d 0a 20 .Each.of.the.callbacks.hooked...
fd60 20 20 20 20 20 20 20 2f 2f 2f 20 69 6e 74 6f 20 74 68 65 20 65 76 65 6e 74 20 77 69 6c 6c 20 62 .......///.into.the.event.will.b
fd80 65 20 72 75 6e 20 69 6e 20 74 75 72 6e 2e 20 54 68 65 20 3c 65 6d 3e 66 69 72 73 74 3c 2f 65 6d e.run.in.turn..The.<em>first</em
fda0 3e 20 6f 6e 65 20 74 6f 20 72 65 74 75 72 6e 20 61 20 73 74 72 69 6e 67 0d 0a 20 20 20 20 20 20 >.one.to.return.a.string........
fdc0 20 20 2f 2f 2f 20 74 68 61 74 20 69 73 20 6e 6f 74 20 3c 63 3e 6e 75 6c 6c 3c 2f 63 3e 20 61 6e ..///.that.is.not.<c>null</c>.an
fde0 64 20 6e 6f 74 20 65 6d 70 74 79 20 77 69 6c 6c 20 63 61 75 73 65 20 61 20 73 77 69 74 63 68 20 d.not.empty.will.cause.a.switch.
fe00 66 72 6f 6d 20 74 68 65 20 6c 61 79 6f 75 74 20 74 68 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f from.the.layout.the..........///
fe20 20 73 79 73 74 65 6d 20 68 61 73 20 63 68 6f 73 65 6e 20 74 6f 20 74 68 65 20 6c 61 79 6f 75 74 .system.has.chosen.to.the.layout
fe40 20 74 68 61 74 20 68 61 73 20 62 65 65 6e 20 72 65 74 75 72 6e 65 64 20 62 79 20 74 68 65 20 63 .that.has.been.returned.by.the.c
fe60 61 6c 6c 62 61 63 6b 2e 20 54 68 65 20 72 65 6d 61 69 6e 69 6e 67 0d 0a 20 20 20 20 20 20 20 20 allback..The.remaining..........
fe80 2f 2f 2f 20 6c 61 79 6f 75 74 73 20 61 66 74 65 72 20 74 68 61 74 20 77 69 6c 6c 20 74 68 65 6e ///.layouts.after.that.will.then
fea0 20 62 65 20 69 6e 76 6f 6b 65 64 20 77 69 74 68 20 74 68 61 74 20 6e 65 77 6c 79 20 73 65 6c 65 .be.invoked.with.that.newly.sele
fec0 63 74 65 64 20 6e 61 6d 65 20 62 75 74 20 77 69 6c 6c 20 6e 6f 74 0d 0a 20 20 20 20 20 20 20 20 cted.name.but.will.not..........
fee0 2f 2f 2f 20 62 65 20 61 62 6c 65 20 74 6f 20 63 68 61 6e 67 65 20 74 68 65 20 6e 61 6d 65 20 61 ///.be.able.to.change.the.name.a
ff00 6e 79 6d 6f 72 65 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f nymore...........///..........//
ff20 2f 20 49 66 20 6e 6f 6e 65 20 6f 66 20 74 68 65 20 63 61 6c 6c 62 61 63 6b 73 20 72 65 74 75 72 /.If.none.of.the.callbacks.retur
ff40 6e 73 20 61 20 73 74 72 69 6e 67 20 74 68 61 74 20 69 73 20 6e 6f 74 20 3c 63 3e 6e 75 6c 6c 3c ns.a.string.that.is.not.<c>null<
ff60 2f 63 3e 20 6f 72 20 65 6d 70 74 79 2c 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 74 68 65 20 73 /c>.or.empty,..........///.the.s
ff80 79 73 74 65 6d 20 77 69 6c 6c 20 73 74 69 63 6b 20 77 69 74 68 20 74 68 65 20 6c 61 79 6f 75 74 ystem.will.stick.with.the.layout
ffa0 20 74 68 61 74 20 69 74 20 68 61 64 20 69 6e 69 74 69 61 6c 6c 79 20 73 65 6c 65 63 74 65 64 2e .that.it.had.initially.selected.
ffc0 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 4f 6e 63 65 20 ..........///..........///.Once.
ffe0 61 6c 6c 20 63 61 6c 6c 62 61 63 6b 73 20 68 61 76 65 20 62 65 65 6e 20 72 75 6e 2c 20 74 68 65 all.callbacks.have.been.run,.the
10000 20 73 79 73 74 65 6d 20 77 69 6c 6c 20 65 69 74 68 65 72 20 68 61 76 65 20 61 20 66 69 6e 61 6c .system.will.either.have.a.final
10020 20 6c 61 79 6f 75 74 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 6e 61 6d 65 20 6f 72 20 6e 6f 74 .layout..........///.name.or.not
10040 2e 20 49 66 20 69 74 20 64 6f 65 73 2c 20 61 20 64 65 76 69 63 65 20 69 73 20 63 72 65 61 74 65 ..If.it.does,.a.device.is.create
10060 64 20 75 73 69 6e 67 20 74 68 61 74 20 6c 61 79 6f 75 74 2e 20 49 66 20 69 74 20 64 6f 65 73 20 d.using.that.layout..If.it.does.
10080 6e 6f 74 2c 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 6e 6f 20 64 65 76 69 63 65 20 69 73 20 63 not,..........///.no.device.is.c
100a0 72 65 61 74 65 64 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f reated...........///..........//
100c0 2f 20 4f 6e 65 20 74 68 69 6e 67 20 74 68 69 73 20 61 6c 6c 6f 77 73 20 69 73 20 74 6f 20 67 65 /.One.thing.this.allows.is.to.ge
100e0 6e 65 72 61 74 65 20 63 61 6c 6c 62 61 63 6b 73 20 6f 6e 20 74 68 65 20 66 6c 79 2e 20 4c 65 74 nerate.callbacks.on.the.fly..Let
10100 27 73 20 73 61 79 20 74 68 61 74 20 69 66 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 61 6e 20 69 's.say.that.if..........///.an.i
10120 6e 70 75 74 20 64 65 76 69 63 65 20 69 73 20 72 65 70 6f 72 74 65 64 20 77 69 74 68 20 74 68 65 nput.device.is.reported.with.the
10140 20 22 43 75 73 74 6f 6d 22 20 69 6e 74 65 72 66 61 63 65 2c 20 77 65 20 77 61 6e 74 20 74 6f 20 ."Custom".interface,.we.want.to.
10160 67 65 6e 65 72 61 74 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 61 20 6c 61 79 6f 75 74 20 66 generate..........///.a.layout.f
10180 6f 72 20 69 74 20 6f 6e 20 74 68 65 20 66 6c 79 2e 20 46 6f 72 20 64 65 74 61 69 6c 73 20 61 62 or.it.on.the.fly..For.details.ab
101a0 6f 75 74 20 68 6f 77 20 74 6f 20 62 75 69 6c 64 20 6c 61 79 6f 75 74 73 20 64 79 6e 61 6d 69 63 out.how.to.build.layouts.dynamic
101c0 61 6c 6c 79 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 66 72 6f 6d 20 63 6f 64 65 2c 20 73 65 65 ally..........///.from.code,.see
101e0 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 2e 42 .<see.cref="InputControlLayout.B
10200 75 69 6c 64 65 72 22 2f 3e 20 61 6e 64 20 3c 73 65 65 20 63 72 65 66 3d 22 52 65 67 69 73 74 65 uilder"/>.and.<see.cref="Registe
10220 72 4c 61 79 6f 75 74 42 75 69 6c 64 65 72 22 2f 3e 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d rLayoutBuilder"/>...........///.
10240 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>..........
10260 2f 2f 2f 20 3c 63 6f 64 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 6e 70 75 74 53 79 73 ///.<code>..........///.InputSys
10280 74 65 6d 2e 6f 6e 46 69 6e 64 4c 61 79 6f 75 74 46 6f 72 44 65 76 69 63 65 20 2b 3d 0d 0a 20 20 tem.onFindLayoutForDevice.+=....
102a0 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 28 64 65 76 69 63 65 49 64 2c 20 64 65 73 63 72 69 70 ......///.....(deviceId,.descrip
102c0 74 69 6f 6e 2c 20 6d 61 74 63 68 65 64 4c 61 79 6f 75 74 2c 20 72 75 6e 74 69 6d 65 29 20 3d 3e tion,.matchedLayout,.runtime).=>
102e0 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f ..........///.....{..........///
10300 20 20 20 20 20 20 20 20 20 2f 2f 20 49 66 20 74 68 65 20 73 79 73 74 65 6d 20 64 6f 65 73 20 68 .........//.If.the.system.does.h
10320 61 76 65 20 61 20 6d 61 74 63 68 69 6e 67 20 6c 61 79 6f 75 74 2c 20 77 65 20 64 6f 20 6e 6f 74 ave.a.matching.layout,.we.do.not
10340 68 69 6e 67 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 2f 2f 20 54 68 hing...........///.........//.Th
10360 69 73 20 63 6f 75 6c 64 20 62 65 20 74 68 65 20 63 61 73 65 2c 20 66 6f 72 20 65 78 61 6d 70 6c is.could.be.the.case,.for.exampl
10380 65 2c 20 69 66 20 77 65 20 61 6c 72 65 61 64 79 20 67 65 6e 65 72 61 74 65 64 0d 0a 20 20 20 20 e,.if.we.already.generated......
103a0 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 2f 2f 20 61 20 6c 61 79 6f 75 74 20 66 6f 72 20 ....///.........//.a.layout.for.
103c0 74 68 65 20 64 65 76 69 63 65 20 6f 72 20 69 66 20 73 6f 6d 65 6f 6e 65 20 65 78 70 6c 69 63 69 the.device.or.if.someone.explici
103e0 74 6c 79 20 72 65 67 69 73 74 65 72 65 64 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 tly.registered..........///.....
10400 20 20 20 20 2f 2f 20 61 20 6c 61 79 6f 75 74 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 ....//.a.layout...........///...
10420 20 20 20 20 20 20 69 66 20 28 21 73 74 72 69 6e 67 2e 49 73 4e 75 6c 6c 4f 72 45 6d 70 74 79 28 ......if.(!string.IsNullOrEmpty(
10440 6d 61 74 63 68 65 64 4c 61 79 6f 75 74 29 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 matchedLayout))..........///....
10460 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 6e 75 6c 6c 3b 20 2f 2f 20 54 65 6c 6c 20 73 79 .........return.null;.//.Tell.sy
10480 73 74 65 6d 20 77 65 20 64 69 64 20 6e 6f 74 68 69 6e 67 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f stem.we.did.nothing...........//
104a0 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 2f 2f 20 53 65 65 20 69 66 /..........///.........//.See.if
104c0 20 74 68 65 20 72 65 70 6f 72 74 65 64 20 64 65 76 69 63 65 20 75 73 65 73 20 74 68 65 20 22 43 .the.reported.device.uses.the."C
104e0 75 73 74 6f 6d 22 20 69 6e 74 65 72 66 61 63 65 2e 20 57 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f ustom".interface..We..........//
10500 2f 20 20 20 20 20 20 20 20 20 2f 2f 20 61 72 65 20 6f 6e 6c 79 20 69 6e 74 65 72 65 73 74 65 64 /.........//.are.only.interested
10520 20 69 6e 20 74 68 6f 73 65 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 .in.those...........///.........
10540 69 66 20 28 64 65 73 63 72 69 70 74 69 6f 6e 2e 69 6e 74 65 72 66 61 63 65 4e 61 6d 65 20 21 3d if.(description.interfaceName.!=
10560 20 22 43 75 73 74 6f 6d 22 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 ."Custom")..........///.........
10580 20 20 20 20 72 65 74 75 72 6e 20 6e 75 6c 6c 3b 20 2f 2f 20 54 65 6c 6c 20 73 79 73 74 65 6d 20 ....return.null;.//.Tell.system.
105a0 77 65 20 64 69 64 20 6e 6f 74 68 69 6e 67 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 we.did.nothing...........///....
105c0 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 2f 2f 20 53 6f 20 6e 6f 77 20 77 65 20 6b ......///.........//.So.now.we.k
105e0 6e 6f 77 20 74 68 61 74 20 77 65 20 77 61 6e 74 20 74 6f 20 62 75 69 6c 64 20 61 20 6c 61 79 6f now.that.we.want.to.build.a.layo
10600 75 74 20 6f 6e 20 74 68 65 20 66 6c 79 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 ut.on.the.fly..........///......
10620 20 20 20 2f 2f 20 66 6f 72 20 74 68 69 73 20 64 65 76 69 63 65 2e 20 57 68 61 74 20 77 65 20 64 ...//.for.this.device..What.we.d
10640 6f 20 69 73 20 74 6f 20 72 65 67 69 73 74 65 72 20 77 68 61 74 27 73 20 63 61 6c 6c 65 64 20 61 o.is.to.register.what's.called.a
10660 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 2f 2f 20 6c 61 79 6f 75 74 20 ..........///.........//.layout.
10680 62 75 69 6c 64 65 72 2e 20 54 68 65 73 65 20 63 61 6e 20 75 73 65 20 43 23 20 63 6f 64 65 20 74 builder..These.can.use.C#.code.t
106a0 6f 20 62 75 69 6c 64 20 61 6e 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 0d 0a 20 o.build.an.InputControlLayout...
106c0 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 2f 2f 20 6f 6e 20 74 68 65 20 66 6c 79 .......///.........//.on.the.fly
106e0 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 ...........///..........///.....
10700 20 20 20 20 2f 2f 20 46 69 72 73 74 20 77 65 20 6e 65 65 64 20 74 6f 20 63 6f 6d 65 20 75 70 20 ....//.First.we.need.to.come.up.
10720 77 69 74 68 20 61 20 73 75 66 66 69 63 69 65 6e 74 6c 79 20 75 6e 69 71 75 65 20 6e 61 6d 65 20 with.a.sufficiently.unique.name.
10740 66 6f 72 20 74 68 65 20 6c 61 79 6f 75 74 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 for.the.layout..........///.....
10760 20 20 20 20 2f 2f 20 75 6e 64 65 72 20 77 68 69 63 68 20 77 65 20 72 65 67 69 73 74 65 72 20 74 ....//.under.which.we.register.t
10780 68 65 20 62 75 69 6c 64 65 72 2e 20 54 68 69 73 20 77 69 6c 6c 20 75 73 75 61 6c 6c 79 20 69 6e he.builder..This.will.usually.in
107a0 76 6f 6c 76 65 20 73 6f 6d 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 volve.some..........///.........
107c0 2f 2f 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 66 72 6f 6d 20 74 68 65 20 49 6e 70 75 74 44 65 76 //.information.from.the.InputDev
107e0 69 63 65 44 65 73 63 72 69 70 74 69 6f 6e 20 77 65 20 68 61 76 65 20 62 65 65 6e 20 73 75 70 70 iceDescription.we.have.been.supp
10800 6c 69 65 64 20 77 69 74 68 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 lied.with...........///.........
10820 2f 2f 20 4c 65 74 27 73 20 73 61 79 20 77 65 20 63 61 6e 20 73 75 66 66 69 63 69 65 6e 74 6c 79 //.Let's.say.we.can.sufficiently
10840 20 74 65 6c 6c 20 64 65 76 69 63 65 73 20 6f 6e 20 6f 75 72 20 69 6e 74 65 72 66 61 63 65 20 61 .tell.devices.on.our.interface.a
10860 70 61 72 74 20 62 79 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 2f 2f 20 part.by..........///.........//.
10880 70 72 6f 64 75 63 74 20 6e 61 6d 65 20 61 6c 6f 6e 65 2e 20 53 6f 20 77 65 20 6a 75 73 74 20 64 product.name.alone..So.we.just.d
108a0 6f 20 74 68 69 73 3a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 76 61 72 o.this:..........///.........var
108c0 20 6c 61 79 6f 75 74 4e 61 6d 65 20 3d 20 22 43 75 73 74 6f 6d 22 20 2b 20 64 65 73 63 72 69 70 .layoutName.=."Custom".+.descrip
108e0 74 69 6f 6e 2e 70 72 6f 64 75 63 74 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 tion.product;..........///......
10900 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 2f 2f 20 57 65 20 61 6c 73 6f 20 6e 65 65 64 20 ....///.........//.We.also.need.
10920 61 6e 20 49 6e 70 75 74 44 65 76 69 63 65 4d 61 74 63 68 65 72 20 74 68 61 74 20 69 6e 20 74 68 an.InputDeviceMatcher.that.in.th
10940 65 20 66 75 74 75 72 65 20 77 69 6c 6c 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c 79 0d 0a 20 20 20 e.future.will.automatically.....
10960 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 2f 2f 20 73 65 6c 65 63 74 20 6f 75 72 20 6e .....///.........//.select.our.n
10980 65 77 6c 79 20 72 65 67 69 73 74 65 72 65 64 20 6c 61 79 6f 75 74 20 77 68 65 6e 65 76 65 72 20 ewly.registered.layout.whenever.
109a0 61 20 6e 65 77 20 64 65 76 69 63 65 20 6f 66 20 74 68 65 20 73 61 6d 65 20 74 79 70 65 0d 0a 20 a.new.device.of.the.same.type...
109c0 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 2f 2f 20 69 73 20 63 6f 6e 6e 65 63 74 .......///.........//.is.connect
109e0 65 64 2e 20 57 65 20 63 61 6e 20 67 65 74 20 6f 6e 65 20 73 69 6d 70 6c 79 20 6c 69 6b 65 20 73 ed..We.can.get.one.simply.like.s
10a00 6f 3a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 76 61 72 20 6d 61 74 63 o:..........///.........var.matc
10a20 68 65 72 20 3d 20 49 6e 70 75 74 44 65 76 69 63 65 4d 61 74 63 68 65 72 2e 46 72 6f 6d 44 65 73 her.=.InputDeviceMatcher.FromDes
10a40 63 72 69 70 74 69 6f 6e 28 64 65 73 63 72 69 70 74 69 6f 6e 29 3b 0d 0a 20 20 20 20 20 20 20 20 cription(description);..........
10a60 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 2f 2f 20 57 69 74 68 ///..........///.........//.With
10a80 20 74 68 65 73 65 20 70 69 65 63 65 73 20 69 6e 20 70 6c 61 63 65 2c 20 77 65 20 63 61 6e 20 72 .these.pieces.in.place,.we.can.r
10aa0 65 67 69 73 74 65 72 20 6f 75 72 20 62 75 69 6c 64 65 72 20 77 68 69 63 68 0d 0a 20 20 20 20 20 egister.our.builder.which.......
10ac0 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 2f 2f 20 6d 61 69 6e 6c 79 20 63 6f 6e 73 69 73 74 ...///.........//.mainly.consist
10ae0 73 20 6f 66 20 61 20 64 65 6c 65 67 61 74 65 20 74 68 61 74 20 77 69 6c 6c 20 67 65 74 20 69 6e s.of.a.delegate.that.will.get.in
10b00 76 6f 6b 65 64 20 77 68 65 6e 20 61 6e 20 69 6e 73 74 61 6e 63 65 0d 0a 20 20 20 20 20 20 20 20 voked.when.an.instance..........
10b20 2f 2f 2f 20 20 20 20 20 20 20 20 20 2f 2f 20 6f 66 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 61 ///.........//.of.InputControlLa
10b40 79 6f 75 74 20 69 73 20 6e 65 65 64 65 64 20 66 6f 72 20 74 68 65 20 6c 61 79 6f 75 74 2e 0d 0a yout.is.needed.for.the.layout...
10b60 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 49 6e 70 75 74 53 79 73 74 65 6d 2e ........///.........InputSystem.
10b80 52 65 67 69 73 74 65 72 4c 61 79 6f 75 74 42 75 69 6c 64 65 72 28 0d 0a 20 20 20 20 20 20 20 20 RegisterLayoutBuilder(..........
10ba0 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 28 29 20 3d 3e 0d 0a 20 20 20 20 20 20 20 20 2f ///.............().=>........../
10bc0 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 //.............{..........///...
10be0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 48 65 72 65 20 69 73 20 77 68 65 72 65 20 77 ..............//.Here.is.where.w
10c00 65 20 64 6f 20 74 68 65 20 61 63 74 75 61 6c 20 62 75 69 6c 64 69 6e 67 2e 20 49 6e 20 70 72 61 e.do.the.actual.building..In.pra
10c20 63 74 69 63 65 2c 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 ctice,..........///.............
10c40 20 20 20 20 2f 2f 20 74 68 69 73 20 77 6f 75 6c 64 20 70 72 6f 62 61 62 6c 79 20 6c 6f 6f 6b 20 ....//.this.would.probably.look.
10c60 61 74 20 74 68 65 20 27 63 61 70 61 62 69 6c 69 74 69 65 73 27 20 70 72 6f 70 65 72 74 79 0d 0a at.the.'capabilities'.property..
10c80 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 6f ........///.................//.o
10ca0 66 20 74 68 65 20 49 6e 70 75 74 44 65 76 69 63 65 44 65 73 63 72 69 70 74 69 6f 6e 20 77 65 20 f.the.InputDeviceDescription.we.
10cc0 67 6f 74 20 61 6e 64 20 63 72 65 61 74 65 20 61 20 74 61 69 6c 6f 72 2d 6d 61 64 65 0d 0a 20 20 got.and.create.a.tailor-made....
10ce0 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 6c 61 79 ......///.................//.lay
10d00 6f 75 74 2e 20 42 75 74 20 77 68 61 74 20 79 6f 75 20 70 75 74 20 69 6e 20 74 68 65 20 6c 61 79 out..But.what.you.put.in.the.lay
10d20 6f 75 74 20 68 65 72 65 20 72 65 61 6c 6c 79 20 64 65 70 65 6e 64 73 20 6f 6e 0d 0a 20 20 20 20 out.here.really.depends.on......
10d40 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 74 68 65 20 73 ....///.................//.the.s
10d60 70 65 63 69 66 69 63 20 75 73 65 20 63 61 73 65 20 79 6f 75 20 68 61 76 65 2e 0d 0a 20 20 20 20 pecific.use.case.you.have.......
10d80 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 0d 0a 20 20 20 20 ....///.................//......
10da0 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 57 65 20 6a 75 ....///.................//.We.ju
10dc0 73 74 20 61 64 64 20 73 6f 6d 65 20 70 72 65 73 65 74 20 74 68 69 6e 67 73 20 68 65 72 65 20 77 st.add.some.preset.things.here.w
10de0 68 69 63 68 20 73 68 6f 75 6c 64 20 73 74 69 6c 6c 20 73 75 66 66 69 63 69 65 6e 74 6c 79 0d 0a hich.should.still.sufficiently..
10e00 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 73 ........///.................//.s
10e20 65 72 76 65 20 61 73 20 61 20 64 65 6d 6f 6e 73 74 72 61 74 69 6f 6e 2e 0d 0a 20 20 20 20 20 20 erve.as.a.demonstration.........
10e40 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 0d 0a 20 20 20 20 20 20 ..///.................//........
10e60 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4e 6f 74 65 20 74 68 ..///.................//.Note.th
10e80 61 74 20 77 65 20 63 61 6e 20 62 61 73 65 20 6f 75 72 20 6c 61 79 6f 75 74 20 68 65 72 65 20 6f at.we.can.base.our.layout.here.o
10ea0 6e 20 77 68 61 74 65 76 65 72 20 6f 74 68 65 72 20 6c 61 79 6f 75 74 0d 0a 20 20 20 20 20 20 20 n.whatever.other.layout.........
10ec0 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 69 6e 20 74 68 65 20 73 .///.................//.in.the.s
10ee0 79 73 74 65 6d 2e 20 57 65 20 63 6f 75 6c 64 20 65 78 74 65 6e 64 20 47 61 6d 65 70 61 64 2c 20 ystem..We.could.extend.Gamepad,.
10f00 66 6f 72 20 65 78 61 6d 70 6c 65 2e 20 49 66 20 77 65 20 64 6f 6e 27 74 0d 0a 20 20 20 20 20 20 for.example..If.we.don't........
10f20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 63 68 6f 6f 73 65 20 ..///.................//.choose.
10f40 61 20 62 61 73 65 20 6c 61 79 6f 75 74 2c 20 74 68 65 20 73 79 73 74 65 6d 20 61 75 74 6f 6d 61 a.base.layout,.the.system.automa
10f60 74 69 63 61 6c 6c 79 20 69 6d 70 6c 69 65 73 20 49 6e 70 75 74 44 65 76 69 63 65 2e 0d 0a 20 20 tically.implies.InputDevice.....
10f80 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 ......///..........///..........
10fa0 20 20 20 20 20 20 20 76 61 72 20 62 75 69 6c 64 65 72 20 3d 20 6e 65 77 20 49 6e 70 75 74 43 6f .......var.builder.=.new.InputCo
10fc0 6e 74 72 6f 6c 4c 61 79 6f 75 74 2e 42 75 69 6c 64 65 72 28 29 0d 0a 20 20 20 20 20 20 20 20 2f ntrolLayout.Builder()........../
10fe0 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2e 57 69 74 68 44 69 73 70 //......................WithDisp
11000 6c 61 79 4e 61 6d 65 28 64 65 73 63 72 69 70 74 69 6f 6e 2e 70 72 6f 64 75 63 74 29 3b 0d 0a 20 layName(description.product);...
11020 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 .......///..........///.........
11040 20 20 20 20 20 20 20 20 2f 2f 20 41 64 64 20 63 6f 6e 74 72 6f 6c 73 2e 0d 0a 20 20 20 20 20 20 ........//.Add.controls.........
11060 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 75 69 6c 64 65 72 2e 41 64 ..///.................builder.Ad
11080 64 43 6f 6e 74 72 6f 6c 28 22 73 74 69 63 6b 22 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 dControl("stick")..........///..
110a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2e 57 69 74 68 4c 61 79 6f 75 74 28 22 ....................WithLayout("
110c0 53 74 69 63 6b 22 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f Stick");..........///........../
110e0 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 62 75 69 6c 64 65 //.................return.builde
11100 72 2e 42 75 69 6c 64 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 r.Build();..........///.........
11120 20 20 20 20 7d 2c 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 ....},..........///.............
11140 6c 61 79 6f 75 74 4e 61 6d 65 2c 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 layoutName,..........///........
11160 20 20 20 20 20 6d 61 74 63 68 65 73 3a 20 6d 61 74 63 68 65 72 29 3b 0d 0a 20 20 20 20 20 20 20 .....matches:.matcher);.........
11180 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 2f 2f 20 53 6f 2c .///..........///.........//.So,
111a0 20 77 65 20 77 61 6e 74 20 74 68 65 20 73 79 73 74 65 6d 20 74 6f 20 75 73 65 20 6f 75 72 20 6c .we.want.the.system.to.use.our.l
111c0 61 79 6f 75 74 20 66 6f 72 20 74 68 65 20 64 65 76 69 63 65 20 74 68 61 74 20 68 61 73 20 6a 75 ayout.for.the.device.that.has.ju
111e0 73 74 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 2f 2f 20 62 65 65 6e 20 st..........///.........//.been.
11200 63 6f 6e 6e 65 63 74 65 64 2e 20 57 65 20 72 65 74 75 72 6e 20 69 74 20 66 72 6f 6d 20 74 68 69 connected..We.return.it.from.thi
11220 73 20 63 61 6c 6c 62 61 63 6b 20 74 6f 20 64 6f 20 74 68 61 74 2e 0d 0a 20 20 20 20 20 20 20 20 s.callback.to.do.that...........
11240 2f 2f 2f 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 6c 61 79 6f 75 74 4e 61 6d 65 3b 0d 0a ///.........return.layoutName;..
11260 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 7d 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 ........///.....};..........///.
11280 3c 2f 63 6f 64 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 65 78 61 6d 70 6c 65 3e 0d </code>..........///.</example>.
112a0 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 4e 6f 74 65 20 74 .........///..........///.Note.t
112c0 68 61 74 20 69 74 20 6d 61 79 20 61 70 70 65 61 72 20 6c 69 6b 65 20 6f 6e 65 20 63 6f 75 6c 64 hat.it.may.appear.like.one.could
112e0 20 73 69 6d 70 6c 79 20 75 73 65 20 3c 73 65 65 20 63 72 65 66 3d 22 52 65 67 69 73 74 65 72 4c .simply.use.<see.cref="RegisterL
11300 61 79 6f 75 74 42 75 69 6c 64 65 72 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 6c 69 6b ayoutBuilder"/>..........///.lik
11320 65 20 62 65 6c 6f 77 20 69 6e 73 74 65 61 64 20 6f 66 20 67 6f 69 6e 67 20 74 68 72 6f 75 67 68 e.below.instead.of.going.through
11340 20 3c 63 3e 6f 6e 46 69 6e 64 4c 61 79 6f 75 74 46 6f 72 44 65 76 69 63 65 3c 2f 63 3e 2e 0d 0a .<c>onFindLayoutForDevice</c>...
11360 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 61 6d 70 6c ........///..........///.<exampl
11380 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 63 6f 64 65 3e 0d 0a 20 20 20 20 20 20 20 20 e>..........///.<code>..........
113a0 2f 2f 2f 20 49 6e 70 75 74 53 79 73 74 65 6d 2e 52 65 67 69 73 74 65 72 4c 61 79 6f 75 74 42 75 ///.InputSystem.RegisterLayoutBu
113c0 69 6c 64 65 72 28 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 28 29 20 3d 3e 0d 0a 20 ilder(..........///.....().=>...
113e0 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 .......///.....{..........///...
11400 20 20 20 20 20 20 2f 2f 20 4c 61 79 6f 75 74 20 62 75 69 6c 64 69 6e 67 20 63 6f 64 65 20 66 72 ......//.Layout.building.code.fr
11420 6f 6d 20 61 62 6f 76 65 2e 2e 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 7d 2c 0d om.above.............///.....},.
11440 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 22 43 75 73 74 6f 6d 4c 61 79 6f 75 74 22 2c .........///....."CustomLayout",
11460 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 6d 61 74 63 68 65 73 3a 20 6e 65 77 20 49 ..........///.....matches:.new.I
11480 6e 70 75 74 44 65 76 69 63 65 4d 61 74 63 68 65 72 28 29 2e 57 69 74 68 49 6e 74 65 72 66 61 63 nputDeviceMatcher().WithInterfac
114a0 65 28 22 43 75 73 74 6f 6d 22 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 63 6f 64 e("Custom"));..........///.</cod
114c0 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 65 78 61 6d 70 6c 65 3e 0d 0a 20 20 20 20 e>..........///.</example>......
114e0 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 48 6f 77 65 76 65 72 2c 20 74 68 ....///..........///.However,.th
11500 65 20 64 69 66 66 65 72 65 6e 63 65 20 68 65 72 65 20 69 73 20 74 68 61 74 20 61 6c 6c 20 64 65 e.difference.here.is.that.all.de
11520 76 69 63 65 73 20 75 73 69 6e 67 20 74 68 65 20 22 43 75 73 74 6f 6d 22 20 69 6e 74 65 72 66 61 vices.using.the."Custom".interfa
11540 63 65 20 77 69 6c 6c 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 65 6e 64 20 75 70 20 77 69 74 68 ce.will..........///.end.up.with
11560 20 74 68 65 20 73 61 6d 65 20 73 69 6e 67 6c 65 20 6c 61 79 6f 75 74 20 2d 2d 20 77 68 69 63 68 .the.same.single.layout.--.which
11580 20 68 61 73 20 74 6f 20 62 65 20 69 64 65 6e 74 69 63 61 6c 2e 20 42 79 20 68 6f 6f 6b 69 6e 67 .has.to.be.identical..By.hooking
115a0 20 69 6e 74 6f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 63 3e 6f 6e 46 69 6e 64 4c 61 79 6f .into..........///.<c>onFindLayo
115c0 75 74 46 6f 72 44 65 76 69 63 65 3c 2f 63 3e 2c 20 69 74 20 69 73 20 70 6f 73 73 69 62 6c 65 20 utForDevice</c>,.it.is.possible.
115e0 74 6f 20 72 65 67 69 73 74 65 72 20 61 20 6e 65 77 20 6c 61 79 6f 75 74 20 66 6f 72 20 65 76 65 to.register.a.new.layout.for.eve
11600 72 79 20 6e 65 77 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 74 79 70 65 20 6f 66 20 64 65 76 69 ry.new..........///.type.of.devi
11620 63 65 20 74 68 61 74 20 69 73 20 64 69 73 63 6f 76 65 72 65 64 20 61 6e 64 20 74 68 75 73 20 62 ce.that.is.discovered.and.thus.b
11640 75 69 6c 64 20 61 20 6d 75 6c 74 69 74 75 64 65 20 6f 66 20 64 69 66 66 65 72 65 6e 74 20 6c 61 uild.a.multitude.of.different.la
11660 79 6f 75 74 73 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f youts...........///..........///
11680 20 49 74 20 69 73 20 62 65 73 74 20 74 6f 20 72 65 67 69 73 74 65 72 20 66 6f 72 20 74 68 69 73 .It.is.best.to.register.for.this
116a0 20 63 61 6c 6c 62 61 63 6b 20 64 75 72 69 6e 67 20 73 74 61 72 74 75 70 2e 20 4f 6e 65 20 77 61 .callback.during.startup..One.wa
116c0 79 20 74 6f 20 64 6f 20 69 74 20 69 73 20 74 6f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 75 73 y.to.do.it.is.to..........///.us
116e0 65 20 3c 63 3e 49 6e 69 74 69 61 6c 69 7a 65 4f 6e 4c 6f 61 64 41 74 74 72 69 62 75 74 65 3c 2f e.<c>InitializeOnLoadAttribute</
11700 63 3e 20 61 6e 64 20 3c 63 3e 52 75 6e 74 69 6d 65 49 6e 69 74 69 61 6c 69 7a 65 4f 6e 4c 6f 61 c>.and.<c>RuntimeInitializeOnLoa
11720 64 4d 65 74 68 6f 64 3c 2f 63 3e 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 6d 61 dMethod</c>...........///.</rema
11740 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d rks>..........///.<seealso.cref=
11760 22 52 65 67 69 73 74 65 72 4c 61 79 6f 75 74 42 75 69 6c 64 65 72 22 2f 3e 0d 0a 20 20 20 20 20 "RegisterLayoutBuilder"/>.......
11780 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 ...///.<seealso.cref="InputContr
117a0 6f 6c 4c 61 79 6f 75 74 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 olLayout"/>..........public.stat
117c0 69 63 20 65 76 65 6e 74 20 49 6e 70 75 74 44 65 76 69 63 65 46 69 6e 64 43 6f 6e 74 72 6f 6c 4c ic.event.InputDeviceFindControlL
117e0 61 79 6f 75 74 44 65 6c 65 67 61 74 65 20 6f 6e 46 69 6e 64 4c 61 79 6f 75 74 46 6f 72 44 65 76 ayoutDelegate.onFindLayoutForDev
11800 69 63 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 61 64 64 0d ice..........{..............add.
11820 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 .............{..................
11840 6c 6f 63 6b 20 28 73 5f 4d 61 6e 61 67 65 72 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 lock.(s_Manager)................
11860 20 20 20 20 20 20 73 5f 4d 61 6e 61 67 65 72 2e 6f 6e 46 69 6e 64 43 6f 6e 74 72 6f 6c 4c 61 79 ......s_Manager.onFindControlLay
11880 6f 75 74 46 6f 72 44 65 76 69 63 65 20 2b 3d 20 76 61 6c 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 outForDevice.+=.value;..........
118a0 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 6d 6f 76 65 0d 0a 20 20 20 20 20 ....}..............remove.......
118c0 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 6c 6f 63 6b 20 28 .......{..................lock.(
118e0 73 5f 4d 61 6e 61 67 65 72 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 s_Manager)......................
11900 73 5f 4d 61 6e 61 67 65 72 2e 6f 6e 46 69 6e 64 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 46 6f 72 s_Manager.onFindControlLayoutFor
11920 44 65 76 69 63 65 20 2d 3d 20 76 61 6c 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d Device.-=.value;..............}.
11940 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 2f 52 45 56 49 45 57 .........}............////REVIEW
11960 3a 20 73 68 6f 75 6c 64 20 74 68 69 73 20 62 65 20 64 69 73 61 6d 62 69 67 75 61 74 65 64 20 6d :.should.this.be.disambiguated.m
11980 6f 72 65 20 74 6f 20 73 65 70 61 72 61 74 65 20 69 74 20 6d 6f 72 65 20 66 72 6f 6d 20 73 65 6e ore.to.separate.it.more.from.sen
119a0 73 6f 72 20 73 61 6d 70 6c 69 6e 67 20 66 72 65 71 75 65 6e 63 79 3f 0d 0a 20 20 20 20 20 20 20 sor.sampling.frequency?.........
119c0 20 2f 2f 2f 2f 52 45 56 49 45 57 3a 20 74 68 69 73 20 73 68 6f 75 6c 64 20 70 72 6f 62 61 62 6c .////REVIEW:.this.should.probabl
119e0 79 20 62 65 20 65 78 70 6f 73 65 64 20 61 73 20 61 6e 20 69 6e 70 75 74 20 73 65 74 74 69 6e 67 y.be.exposed.as.an.input.setting
11a00 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>.........
11a20 20 2f 2f 2f 20 46 72 65 71 75 65 6e 63 79 20 61 74 20 77 68 69 63 68 20 64 65 76 69 63 65 73 20 .///.Frequency.at.which.devices.
11a40 74 68 61 74 20 6e 65 65 64 20 70 6f 6c 6c 69 6e 67 20 61 72 65 20 62 65 69 6e 67 20 71 75 65 72 that.need.polling.are.being.quer
11a60 69 65 64 20 69 6e 20 74 68 65 20 62 61 63 6b 67 72 6f 75 6e 64 2e 0d 0a 20 20 20 20 20 20 20 20 ied.in.the.background...........
11a80 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 76 61 6c ///.</summary>..........///.<val
11aa0 75 65 3e 50 6f 6c 6c 65 64 20 64 65 76 69 63 65 20 73 61 6d 70 6c 69 6e 67 20 66 72 65 71 75 65 ue>Polled.device.sampling.freque
11ac0 6e 63 79 20 69 6e 20 48 65 72 74 7a 2e 3c 2f 76 61 6c 75 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f ncy.in.Hertz.</value>........../
11ae0 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 6e 70 75 74 20 //.<remarks>..........///.Input.
11b00 64 61 74 61 20 69 73 20 67 61 74 68 65 72 65 64 20 66 72 6f 6d 20 70 6c 61 74 66 6f 72 6d 20 41 data.is.gathered.from.platform.A
11b20 50 49 73 20 65 69 74 68 65 72 20 61 73 20 65 76 65 6e 74 73 20 6f 72 20 70 6f 6c 6c 65 64 20 70 PIs.either.as.events.or.polled.p
11b40 65 72 69 6f 64 69 63 61 6c 6c 79 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 eriodically...........///.......
11b60 20 20 20 2f 2f 2f 20 49 6e 20 74 68 65 20 66 6f 72 6d 65 72 20 63 61 73 65 2c 20 77 68 65 72 65 ...///.In.the.former.case,.where
11b80 20 77 65 20 67 65 74 20 69 6e 70 75 74 20 61 73 20 65 76 65 6e 74 73 2c 20 74 68 65 20 70 6c 61 .we.get.input.as.events,.the.pla
11ba0 74 66 6f 72 6d 20 69 73 20 72 65 73 70 6f 6e 73 69 62 6c 65 20 66 6f 72 20 6d 6f 6e 69 74 6f 72 tform.is.responsible.for.monitor
11bc0 69 6e 67 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 69 6e 70 75 74 20 64 65 76 69 63 65 73 20 61 ing..........///.input.devices.a
11be0 6e 64 20 73 65 6e 64 69 6e 67 20 74 68 65 69 72 20 73 74 61 74 65 20 63 68 61 6e 67 65 73 20 77 nd.sending.their.state.changes.w
11c00 68 69 63 68 20 74 68 65 20 55 6e 69 74 79 20 72 75 6e 74 69 6d 65 20 72 65 63 65 69 76 65 73 0d hich.the.Unity.runtime.receives.
11c20 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 61 6e 64 20 71 75 65 75 65 73 20 61 73 20 3c 73 65 65 20 .........///.and.queues.as.<see.
11c40 63 72 65 66 3d 22 49 6e 70 75 74 45 76 65 6e 74 22 2f 3e 73 2e 20 54 68 69 73 20 66 6f 72 6d 20 cref="InputEvent"/>s..This.form.
11c60 6f 66 20 69 6e 70 75 74 20 63 6f 6c 6c 65 63 74 69 6f 6e 20 75 73 75 61 6c 6c 79 20 68 61 70 70 of.input.collection.usually.happ
11c80 65 6e 73 20 6f 6e 20 61 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 73 79 73 74 65 6d 2d 73 70 65 ens.on.a..........///.system-spe
11ca0 63 69 66 69 63 20 74 68 72 65 61 64 20 28 77 68 69 63 68 20 6d 61 79 20 62 65 20 55 6e 69 74 79 cific.thread.(which.may.be.Unity
11cc0 27 73 20 6d 61 69 6e 20 74 68 72 65 61 64 29 20 61 73 20 70 61 72 74 20 6f 66 20 68 6f 77 20 74 's.main.thread).as.part.of.how.t
11ce0 68 65 20 55 6e 69 74 79 20 70 6c 61 79 65 72 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 6c 6f 6f he.Unity.player..........///.loo
11d00 70 20 6f 70 65 72 61 74 65 73 2e 20 49 6e 20 6d 6f 73 74 20 63 61 73 65 73 2c 20 74 68 69 73 20 p.operates..In.most.cases,.this.
11d20 6d 65 61 6e 73 20 74 68 61 74 20 74 68 69 73 20 66 6f 72 6d 20 6f 66 20 69 6e 70 75 74 20 77 69 means.that.this.form.of.input.wi
11d40 6c 6c 20 69 6e 76 61 72 69 61 62 6c 79 20 67 65 74 20 70 69 63 6b 65 64 20 75 70 0d 0a 20 20 20 ll.invariably.get.picked.up.....
11d60 20 20 20 20 20 2f 2f 2f 20 6f 6e 63 65 20 70 65 72 20 66 72 61 6d 65 2e 0d 0a 20 20 20 20 20 20 .....///.once.per.frame.........
11d80 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 6e 20 74 68 65 20 6c 61 74 74 65 72 ..///..........///.In.the.latter
11da0 20 63 61 73 65 2c 20 77 68 65 72 65 20 69 6e 70 75 74 20 68 61 73 20 74 6f 20 62 65 20 65 78 70 .case,.where.input.has.to.be.exp
11dc0 6c 69 63 69 74 6c 79 20 70 6f 6c 6c 65 64 20 66 72 6f 6d 20 74 68 65 20 73 79 73 74 65 6d 2c 20 licitly.polled.from.the.system,.
11de0 74 68 65 20 55 6e 69 74 79 20 72 75 6e 74 69 6d 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 77 the.Unity.runtime..........///.w
11e00 69 6c 6c 20 70 65 72 69 6f 64 69 63 61 6c 6c 79 20 73 61 6d 70 6c 65 20 74 68 65 20 73 74 61 74 ill.periodically.sample.the.stat
11e20 65 20 6f 66 20 69 6e 70 75 74 20 64 65 76 69 63 65 73 20 61 6e 64 20 73 65 6e 64 20 69 74 20 6f e.of.input.devices.and.send.it.o
11e40 66 66 20 61 73 20 69 6e 70 75 74 20 65 76 65 6e 74 73 2e 20 57 68 65 72 65 76 65 72 0d 0a 20 20 ff.as.input.events..Wherever....
11e60 20 20 20 20 20 20 2f 2f 2f 20 70 6f 73 73 69 62 6c 65 2c 20 74 68 69 73 20 68 61 70 70 65 6e 73 ......///.possible,.this.happens
11e80 20 69 6e 20 74 68 65 20 62 61 63 6b 67 72 6f 75 6e 64 20 61 74 20 61 20 66 69 78 65 64 20 66 72 .in.the.background.at.a.fixed.fr
11ea0 65 71 75 65 6e 63 79 20 6f 6e 20 61 20 64 65 64 69 63 61 74 65 64 20 74 68 72 65 61 64 2e 20 54 equency.on.a.dedicated.thread..T
11ec0 68 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 63 3e 70 6f 6c 6c 69 6e 67 46 72 65 71 75 65 he..........///.<c>pollingFreque
11ee0 6e 63 79 3c 2f 63 3e 20 70 72 6f 70 65 72 74 79 20 63 6f 6e 74 72 6f 6c 73 20 74 68 65 20 72 61 ncy</c>.property.controls.the.ra
11f00 74 65 20 61 74 20 77 68 69 63 68 20 74 68 69 73 20 73 61 6d 70 6c 69 6e 67 20 68 61 70 70 65 6e te.at.which.this.sampling.happen
11f20 73 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 68 65 s...........///..........///.The
11f40 20 75 6e 69 74 20 69 73 20 48 65 72 74 7a 2e 20 41 20 76 61 6c 75 65 20 6f 66 20 31 32 30 2c 20 .unit.is.Hertz..A.value.of.120,.
11f60 66 6f 72 20 65 78 61 6d 70 6c 65 2c 20 6d 65 61 6e 73 20 74 68 61 74 20 64 65 76 69 63 65 73 20 for.example,.means.that.devices.
11f80 61 72 65 20 73 61 6d 70 6c 65 64 20 31 32 30 20 74 69 6d 65 73 0d 0a 20 20 20 20 20 20 20 20 2f are.sampled.120.times........../
11fa0 2f 2f 20 70 65 72 20 73 65 63 6f 6e 64 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 //.per.second...........///.....
11fc0 20 20 20 20 20 2f 2f 2f 20 54 68 65 20 64 65 66 61 75 6c 74 20 70 6f 6c 6c 69 6e 67 20 66 72 65 .....///.The.default.polling.fre
11fe0 71 75 65 6e 63 79 20 69 73 20 36 30 20 48 7a 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 quency.is.60.Hz...........///...
12000 20 20 20 20 20 20 20 2f 2f 2f 20 46 6f 72 20 64 65 76 69 63 65 73 20 74 68 61 74 20 61 72 65 20 .......///.For.devices.that.are.
12020 70 6f 6c 6c 65 64 2c 20 74 68 65 20 66 72 65 71 75 65 6e 63 79 20 73 65 74 74 69 6e 67 20 77 69 polled,.the.frequency.setting.wi
12040 6c 6c 20 64 69 72 65 63 74 6c 79 20 74 72 61 6e 73 6c 61 74 65 20 74 6f 20 63 68 61 6e 67 65 73 ll.directly.translate.to.changes
12060 20 69 6e 20 74 68 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 20 63 72 65 66 3d 22 .in.the..........///.<see.cref="
12080 49 6e 70 75 74 45 76 65 6e 74 2e 74 69 6d 65 22 2f 3e 20 70 61 74 74 65 72 6e 73 2e 20 41 74 20 InputEvent.time"/>.patterns..At.
120a0 36 30 20 48 7a 2c 20 66 6f 72 20 65 78 61 6d 70 6c 65 2c 20 74 69 6d 65 73 74 61 6d 70 73 20 66 60.Hz,.for.example,.timestamps.f
120c0 6f 72 20 61 20 73 70 65 63 69 66 69 63 2c 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 70 6f 6c 6c or.a.specific,..........///.poll
120e0 65 64 20 64 65 76 69 63 65 20 77 69 6c 6c 20 62 65 20 73 70 61 63 65 64 20 61 74 20 72 6f 75 67 ed.device.will.be.spaced.at.roug
12100 68 6c 79 20 31 2f 36 30 74 68 20 6f 66 20 61 20 73 65 63 6f 6e 64 20 61 70 61 72 74 2e 0d 0a 20 hly.1/60th.of.a.second.apart....
12120 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 4e 6f 74 65 20 74 68 61 .......///..........///.Note.tha
12140 74 20 69 74 20 64 65 70 65 6e 64 73 20 6f 6e 20 74 68 65 20 70 6c 61 74 66 6f 72 6d 20 77 68 69 t.it.depends.on.the.platform.whi
12160 63 68 20 64 65 76 69 63 65 73 20 61 72 65 20 70 6f 6c 6c 65 64 20 28 69 66 20 61 6e 79 29 2e 20 ch.devices.are.polled.(if.any)..
12180 4f 6e 20 57 69 6e 33 32 2c 20 66 6f 72 20 65 78 61 6d 70 6c 65 2c 0d 0a 20 20 20 20 20 20 20 20 On.Win32,.for.example,..........
121a0 2f 2f 2f 20 6f 6e 6c 79 20 58 49 6e 70 75 74 20 67 61 6d 65 70 61 64 73 20 61 72 65 20 70 6f 6c ///.only.XInput.gamepads.are.pol
121c0 6c 65 64 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 41 led...........///..........///.A
121e0 6c 73 6f 20 6e 6f 74 65 20 74 68 61 74 20 74 68 65 20 70 6f 6c 6c 69 6e 67 20 66 72 65 71 75 65 lso.note.that.the.polling.freque
12200 6e 63 79 20 61 70 70 6c 69 65 73 20 74 6f 20 61 6c 6c 20 64 65 76 69 63 65 73 20 74 68 61 74 20 ncy.applies.to.all.devices.that.
12220 61 72 65 20 70 6f 6c 6c 65 64 2e 20 49 74 20 69 73 20 6e 6f 74 20 70 6f 73 73 69 62 6c 65 0d 0a are.polled..It.is.not.possible..
12240 20 20 20 20 20 20 20 20 2f 2f 2f 20 74 6f 20 73 65 74 20 70 6f 6c 6c 69 6e 67 20 66 72 65 71 75 ........///.to.set.polling.frequ
12260 65 6e 63 79 20 6f 6e 20 61 20 70 65 72 2d 64 65 76 69 63 65 20 62 61 73 69 73 2e 0d 0a 20 20 20 ency.on.a.per-device.basis......
12280 20 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 .....///.</remarks>..........pub
122a0 6c 69 63 20 73 74 61 74 69 63 20 66 6c 6f 61 74 20 70 6f 6c 6c 69 6e 67 46 72 65 71 75 65 6e 63 lic.static.float.pollingFrequenc
122c0 79 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 3d 3e y..........{..............get.=>
122e0 20 73 5f 4d 61 6e 61 67 65 72 2e 70 6f 6c 6c 69 6e 67 46 72 65 71 75 65 6e 63 79 3b 0d 0a 20 20 .s_Manager.pollingFrequency;....
12300 20 20 20 20 20 20 20 20 20 20 73 65 74 20 3d 3e 20 73 5f 4d 61 6e 61 67 65 72 2e 70 6f 6c 6c 69 ..........set.=>.s_Manager.polli
12320 6e 67 46 72 65 71 75 65 6e 63 79 20 3d 20 76 61 6c 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d ngFrequency.=.value;..........}.
12340 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>........
12360 20 20 2f 2f 2f 20 41 64 64 20 61 20 6e 65 77 20 64 65 76 69 63 65 20 62 79 20 69 6e 73 74 61 6e ..///.Add.a.new.device.by.instan
12380 74 69 61 74 69 6e 67 20 74 68 65 20 67 69 76 65 6e 20 64 65 76 69 63 65 20 6c 61 79 6f 75 74 2e tiating.the.given.device.layout.
123a0 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>........
123c0 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 6c 61 79 6f 75 74 22 3e 4e 61 6d 65 20 ..///.<param.name="layout">Name.
123e0 6f 66 20 74 68 65 20 6c 61 79 6f 75 74 20 74 6f 20 69 6e 73 74 61 6e 74 69 61 74 65 2e 20 4d 75 of.the.layout.to.instantiate..Mu
12400 73 74 20 62 65 20 61 20 64 65 76 69 63 65 20 6c 61 79 6f 75 74 2e 20 4e 6f 74 65 20 74 68 61 74 st.be.a.device.layout..Note.that
12420 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 6c 61 79 6f 75 74 20 6e 61 6d 65 73 20 61 72 65 20 63 ..........///.layout.names.are.c
12440 61 73 65 2d 69 6e 73 65 6e 73 69 74 69 76 65 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 ase-insensitive.</param>........
12460 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 6e 61 6d 65 22 3e 4e 61 6d 65 20 74 6f ..///.<param.name="name">Name.to
12480 20 61 73 73 69 67 6e 20 74 6f 20 74 68 65 20 64 65 76 69 63 65 2e 20 49 66 20 6e 75 6c 6c 2c 20 .assign.to.the.device..If.null,.
124a0 74 68 65 20 6c 61 79 6f 75 74 27 73 20 64 69 73 70 6c 61 79 20 6e 61 6d 65 20 28 3c 73 65 65 0d the.layout's.display.name.(<see.
124c0 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c .........///.cref="InputControlL
124e0 61 79 6f 75 74 2e 64 69 73 70 6c 61 79 4e 61 6d 65 22 2f 3e 20 69 73 20 75 73 65 64 20 69 6e 73 ayout.displayName"/>.is.used.ins
12500 74 65 61 64 2e 20 4e 6f 74 65 20 74 68 61 74 20 64 65 76 69 63 65 20 6e 61 6d 65 73 20 61 72 65 tead..Note.that.device.names.are
12520 20 6d 61 64 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 75 6e 69 71 75 65 20 61 75 74 6f 6d 61 .made..........///.unique.automa
12540 74 69 63 61 6c 6c 79 20 62 79 20 74 68 65 20 73 79 73 74 65 6d 20 62 79 20 61 70 70 65 6e 64 69 tically.by.the.system.by.appendi
12560 6e 67 20 6e 75 6d 62 65 72 73 20 74 6f 20 74 68 65 6d 20 28 65 2e 67 2e 20 22 67 61 6d 65 70 61 ng.numbers.to.them.(e.g.."gamepa
12580 64 22 2c 20 22 67 61 6d 65 70 61 64 31 22 2c 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 22 67 61 d",."gamepad1",..........///."ga
125a0 6d 65 70 61 64 32 22 2c 20 65 74 63 2e 29 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 mepad2",.etc.).</param>.........
125c0 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 76 61 72 69 61 6e 74 73 22 3e 53 65 6d 69 .///.<param.name="variants">Semi
125e0 63 6f 6c 6f 6e 2d 73 65 70 61 72 61 74 65 64 20 6c 69 73 74 20 6f 66 20 6c 61 79 6f 75 74 20 76 colon-separated.list.of.layout.v
12600 61 72 69 61 6e 74 73 20 74 6f 20 75 73 65 20 66 6f 72 20 74 68 65 20 64 65 76 69 63 65 2e 3c 2f ariants.to.use.for.the.device.</
12620 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f 6e 20 63 param>..........///.<exception.c
12640 72 65 66 3d 22 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 22 3e 3c 70 61 72 ref="ArgumentNullException"><par
12660 61 6d 72 65 66 20 6e 61 6d 65 3d 22 6c 61 79 6f 75 74 22 2f 3e 20 69 73 20 3c 63 3e 6e 75 6c 6c amref.name="layout"/>.is.<c>null
12680 3c 2f 63 3e 20 6f 72 20 65 6d 70 74 79 2e 3c 2f 65 78 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 </c>.or.empty.</exception>......
126a0 20 20 20 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 54 68 65 20 6e 65 77 6c 79 20 63 72 65 61 74 ....///.<returns>The.newly.creat
126c0 65 64 20 69 6e 70 75 74 20 64 65 76 69 63 65 2e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 20 20 20 ed.input.device.</returns>......
126e0 20 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 ....///.<remarks>..........///.T
12700 68 65 20 64 65 76 69 63 65 20 77 69 6c 6c 20 62 65 20 61 64 64 65 64 20 74 6f 20 74 68 65 20 3c he.device.will.be.added.to.the.<
12720 73 65 65 20 63 72 65 66 3d 22 64 65 76 69 63 65 73 22 2f 3e 20 6c 69 73 74 20 61 6e 64 20 61 20 see.cref="devices"/>.list.and.a.
12740 6e 6f 74 69 66 69 63 61 74 69 6f 6e 20 6f 6e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 notification.on..........///.<se
12760 65 20 63 72 65 66 3d 22 6f 6e 44 65 76 69 63 65 43 68 61 6e 67 65 22 2f 3e 20 77 69 6c 6c 20 62 e.cref="onDeviceChange"/>.will.b
12780 65 20 74 72 69 67 67 65 72 65 64 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 e.triggered...........///.......
127a0 20 20 20 2f 2f 2f 20 4e 6f 74 65 20 74 68 61 74 20 61 64 64 69 6e 67 20 61 20 64 65 76 69 63 65 ...///.Note.that.adding.a.device
127c0 20 74 6f 20 74 68 65 20 73 79 73 74 65 6d 20 77 69 6c 6c 20 61 6c 6c 6f 63 61 74 65 20 61 6e 64 .to.the.system.will.allocate.and
127e0 20 61 6c 73 6f 20 63 72 65 61 74 65 20 67 61 72 62 61 67 65 20 6f 6e 20 74 68 65 20 47 43 20 68 .also.create.garbage.on.the.GC.h
12800 65 61 70 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c eap...........///..........///.<
12820 65 78 61 6d 70 6c 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 63 6f 64 65 3e 0d 0a 20 20 example>..........///.<code>....
12840 20 20 20 20 20 20 2f 2f 2f 20 2f 2f 20 54 68 69 73 20 69 73 20 6f 6e 65 20 77 61 79 20 74 6f 20 ......///.//.This.is.one.way.to.
12860 69 6e 73 74 61 6e 74 69 61 74 65 20 74 68 65 20 22 47 61 6d 65 70 61 64 22 20 6c 61 79 6f 75 74 instantiate.the."Gamepad".layout
12880 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 6e 70 75 74 53 79 73 74 65 6d 2e 41 64 64 44 65 ...........///.InputSystem.AddDe
128a0 76 69 63 65 28 22 47 61 6d 65 70 61 64 22 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 vice("Gamepad");..........///...
128c0 20 20 20 20 20 20 20 2f 2f 2f 20 2f 2f 20 49 6e 20 74 68 69 73 20 63 61 73 65 2c 20 62 65 63 61 .......///.//.In.this.case,.beca
128e0 75 73 65 20 74 68 65 20 22 47 61 6d 65 70 61 64 22 20 6c 61 79 6f 75 74 20 69 73 20 62 61 73 65 use.the."Gamepad".layout.is.base
12900 64 20 6f 6e 20 74 68 65 20 47 61 6d 65 70 61 64 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 2f 2f d.on.the.Gamepad..........///.//
12920 20 63 6c 61 73 73 2c 20 77 65 20 63 61 6e 20 61 6c 73 6f 20 64 6f 20 74 68 69 73 20 69 6e 73 74 .class,.we.can.also.do.this.inst
12940 65 61 64 3a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 6e 70 75 74 53 79 73 74 65 6d 2e 41 64 ead:..........///.InputSystem.Ad
12960 64 44 65 76 69 63 65 26 6c 74 3b 47 61 6d 65 70 61 64 26 67 74 3b 28 29 3b 0d 0a 20 20 20 20 20 dDevice&lt;Gamepad&gt;();.......
12980 20 20 20 2f 2f 2f 20 3c 2f 63 6f 64 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 65 78 ...///.</code>..........///.</ex
129a0 61 6d 70 6c 65 3e 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 0a ample>..........///.</remarks>..
129c0 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 41 64 64 44 65 ........///.<seealso.cref="AddDe
129e0 76 69 63 65 7b 54 7d 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f vice{T}"/>..........///.<seealso
12a00 20 63 72 65 66 3d 22 52 65 6d 6f 76 65 44 65 76 69 63 65 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 .cref="RemoveDevice"/>..........
12a20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 6f 6e 44 65 76 69 63 65 43 68 61 6e 67 ///.<seealso.cref="onDeviceChang
12a40 65 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d e"/>..........///.<seealso.cref=
12a60 22 49 6e 70 75 74 44 65 76 69 63 65 43 68 61 6e 67 65 2e 41 64 64 65 64 22 2f 3e 0d 0a 20 20 20 "InputDeviceChange.Added"/>.....
12a80 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 64 65 76 69 63 65 73 22 .....///.<seealso.cref="devices"
12aa0 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 52 />..........///.<seealso.cref="R
12ac0 65 67 69 73 74 65 72 4c 61 79 6f 75 74 28 54 79 70 65 2c 73 74 72 69 6e 67 2c 4e 75 6c 6c 61 62 egisterLayout(Type,string,Nullab
12ae0 6c 65 7b 49 6e 70 75 74 44 65 76 69 63 65 4d 61 74 63 68 65 72 7d 29 22 2f 3e 0d 0a 20 20 20 20 le{InputDeviceMatcher})"/>......
12b00 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 49 6e 70 75 74 44 65 76 69 63 65 20 41 64 ....public.static.InputDevice.Ad
12b20 64 44 65 76 69 63 65 28 73 74 72 69 6e 67 20 6c 61 79 6f 75 74 2c 20 73 74 72 69 6e 67 20 6e 61 dDevice(string.layout,.string.na
12b40 6d 65 20 3d 20 6e 75 6c 6c 2c 20 73 74 72 69 6e 67 20 76 61 72 69 61 6e 74 73 20 3d 20 6e 75 6c me.=.null,.string.variants.=.nul
12b60 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 69 66 20 28 73 l)..........{..............if.(s
12b80 74 72 69 6e 67 2e 49 73 4e 75 6c 6c 4f 72 45 6d 70 74 79 28 6c 61 79 6f 75 74 29 29 0d 0a 20 20 tring.IsNullOrEmpty(layout))....
12ba0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 ..............throw.new.Argument
12bc0 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 28 6e 61 6d 65 6f 66 28 6c 61 79 6f 75 74 29 29 3b 0d 0a NullException(nameof(layout));..
12be0 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 73 5f 4d 61 6e 61 67 65 72 2e 41 64 64 ............return.s_Manager.Add
12c00 44 65 76 69 63 65 28 6c 61 79 6f 75 74 2c 20 6e 61 6d 65 2c 20 6e 65 77 20 49 6e 74 65 72 6e 65 Device(layout,.name,.new.Interne
12c20 64 53 74 72 69 6e 67 28 76 61 72 69 61 6e 74 73 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a dString(variants));..........}..
12c40 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>.........
12c60 20 2f 2f 2f 20 41 64 64 20 61 20 6e 65 77 20 64 65 76 69 63 65 20 62 79 20 69 6e 73 74 61 6e 74 .///.Add.a.new.device.by.instant
12c80 69 61 74 69 6e 67 20 74 68 65 20 6c 61 79 6f 75 74 20 72 65 67 69 73 74 65 72 65 64 20 66 6f 72 iating.the.layout.registered.for
12ca0 20 74 79 70 65 20 3c 74 79 70 65 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 54 44 65 76 69 63 .type.<typeparamref.name="TDevic
12cc0 65 22 2f 3e 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 e"/>...........///.</summary>...
12ce0 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 6e 61 6d 65 22 3e 4e 61 .......///.<param.name="name">Na
12d00 6d 65 20 74 6f 20 61 73 73 69 67 6e 20 74 6f 20 74 68 65 20 64 65 76 69 63 65 2e 20 49 66 20 6e me.to.assign.to.the.device..If.n
12d20 75 6c 6c 2c 20 74 68 65 20 6c 61 79 6f 75 74 27 73 20 64 69 73 70 6c 61 79 20 6e 61 6d 65 20 28 ull,.the.layout's.display.name.(
12d40 3c 73 65 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e <see..........///.cref="InputCon
12d60 74 72 6f 6c 4c 61 79 6f 75 74 2e 64 69 73 70 6c 61 79 4e 61 6d 65 22 2f 3e 20 69 73 20 75 73 65 trolLayout.displayName"/>.is.use
12d80 64 20 69 6e 73 74 65 61 64 2e 20 4e 6f 74 65 20 74 68 61 74 20 64 65 76 69 63 65 20 6e 61 6d 65 d.instead..Note.that.device.name
12da0 73 20 61 72 65 20 6d 61 64 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 75 6e 69 71 75 65 20 61 s.are.made..........///.unique.a
12dc0 75 74 6f 6d 61 74 69 63 61 6c 6c 79 20 62 79 20 74 68 65 20 73 79 73 74 65 6d 20 62 79 20 61 70 utomatically.by.the.system.by.ap
12de0 70 65 6e 64 69 6e 67 20 6e 75 6d 62 65 72 73 20 74 6f 20 74 68 65 6d 20 28 65 2e 67 2e 20 22 67 pending.numbers.to.them.(e.g.."g
12e00 61 6d 65 70 61 64 22 2c 20 22 67 61 6d 65 70 61 64 31 22 2c 0d 0a 20 20 20 20 20 20 20 20 2f 2f amepad",."gamepad1",..........//
12e20 2f 20 22 67 61 6d 65 70 61 64 32 22 2c 20 65 74 63 2e 29 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 /."gamepad2",.etc.).</param>....
12e40 20 20 20 20 20 20 2f 2f 2f 20 3c 74 79 70 65 70 61 72 61 6d 20 6e 61 6d 65 3d 22 54 44 65 76 69 ......///.<typeparam.name="TDevi
12e60 63 65 22 3e 54 79 70 65 20 6f 66 20 64 65 76 69 63 65 20 74 6f 20 61 64 64 2e 3c 2f 74 79 70 65 ce">Type.of.device.to.add.</type
12e80 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 54 68 65 param>..........///.<returns>The
12ea0 20 6e 65 77 6c 79 20 61 64 64 65 64 20 64 65 76 69 63 65 2e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a .newly.added.device.</returns>..
12ec0 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f 6e 20 63 72 65 66 3d 22 49 6e 76 ........///.<exception.cref="Inv
12ee0 61 6c 69 64 4f 70 65 72 61 74 69 6f 6e 45 78 63 65 70 74 69 6f 6e 22 3e 49 6e 73 74 61 6e 74 69 alidOperationException">Instanti
12f00 61 74 69 6e 67 20 74 68 65 20 6c 61 79 6f 75 74 20 66 6f 72 20 3c 74 79 70 65 70 61 72 61 6d 72 ating.the.layout.for.<typeparamr
12f20 65 66 20 6e 61 6d 65 3d 22 54 44 65 76 69 63 65 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f ef.name="TDevice"/>..........///
12f40 20 64 69 64 20 6e 6f 74 20 70 72 6f 64 75 63 65 20 61 20 64 65 76 69 63 65 20 6f 66 20 74 79 70 .did.not.produce.a.device.of.typ
12f60 65 20 3c 74 79 70 65 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 54 44 65 76 69 63 65 22 2f 3e e.<typeparamref.name="TDevice"/>
12f80 2e 3c 2f 65 78 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 .</exception>..........///.<rema
12fa0 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 68 65 20 64 65 76 69 63 65 20 77 69 6c rks>..........///.The.device.wil
12fc0 6c 20 62 65 20 61 64 64 65 64 20 74 6f 20 74 68 65 20 3c 73 65 65 20 63 72 65 66 3d 22 64 65 76 l.be.added.to.the.<see.cref="dev
12fe0 69 63 65 73 22 2f 3e 20 6c 69 73 74 20 61 6e 64 20 61 20 6e 6f 74 69 66 69 63 61 74 69 6f 6e 20 ices"/>.list.and.a.notification.
13000 6f 6e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 20 63 72 65 66 3d 22 6f 6e 44 65 76 on..........///.<see.cref="onDev
13020 69 63 65 43 68 61 6e 67 65 22 2f 3e 20 77 69 6c 6c 20 62 65 20 74 72 69 67 67 65 72 65 64 2e 0d iceChange"/>.will.be.triggered..
13040 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 4e 6f 74 65 20 74 .........///..........///.Note.t
13060 68 61 74 20 61 64 64 69 6e 67 20 61 20 64 65 76 69 63 65 20 74 6f 20 74 68 65 20 73 79 73 74 65 hat.adding.a.device.to.the.syste
13080 6d 20 77 69 6c 6c 20 61 6c 6c 6f 63 61 74 65 20 61 6e 64 20 61 6c 73 6f 20 63 72 65 61 74 65 20 m.will.allocate.and.also.create.
130a0 67 61 72 62 61 67 65 20 6f 6e 20 74 68 65 20 47 43 20 68 65 61 70 2e 0d 0a 20 20 20 20 20 20 20 garbage.on.the.GC.heap..........
130c0 20 2f 2f 2f 0d 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 .///..........///.<example>.....
130e0 20 20 20 20 20 2f 2f 2f 20 3c 63 6f 64 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 2f 2f 20 .....///.<code>..........///.//.
13100 41 64 64 20 61 20 67 61 6d 65 70 61 64 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 6e 70 75 Add.a.gamepad...........///.Inpu
13120 74 53 79 73 74 65 6d 2e 41 64 64 44 65 76 69 63 65 26 6c 74 3b 47 61 6d 65 70 61 64 26 67 74 3b tSystem.AddDevice&lt;Gamepad&gt;
13140 28 29 3b 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 ();..........///.</code>........
13160 20 20 2f 2f 2f 20 3c 2f 65 78 61 6d 70 6c 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f ..///.</example>..........///.</
13180 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 remarks>..........///.<seealso.c
131a0 72 65 66 3d 22 52 65 6d 6f 76 65 44 65 76 69 63 65 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f ref="RemoveDevice"/>..........//
131c0 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 6f 6e 44 65 76 69 63 65 43 68 61 6e 67 65 22 /.<seealso.cref="onDeviceChange"
131e0 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 49 />..........///.<seealso.cref="I
13200 6e 70 75 74 44 65 76 69 63 65 43 68 61 6e 67 65 2e 41 64 64 65 64 22 2f 3e 0d 0a 20 20 20 20 20 nputDeviceChange.Added"/>.......
13220 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 64 65 76 69 63 65 73 22 2f 3e ...///.<seealso.cref="devices"/>
13240 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 54 44 65 76 69 63 65 20 ..........public.static.TDevice.
13260 41 64 64 44 65 76 69 63 65 3c 54 44 65 76 69 63 65 3e 28 73 74 72 69 6e 67 20 6e 61 6d 65 20 3d AddDevice<TDevice>(string.name.=
13280 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 77 68 65 72 65 20 54 44 65 76 69 63 .null)..............where.TDevic
132a0 65 20 3a 20 49 6e 70 75 74 44 65 76 69 63 65 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 e.:.InputDevice..........{......
132c0 20 20 20 20 20 20 20 20 76 61 72 20 64 65 76 69 63 65 20 3d 20 73 5f 4d 61 6e 61 67 65 72 2e 41 ........var.device.=.s_Manager.A
132e0 64 64 44 65 76 69 63 65 28 74 79 70 65 6f 66 28 54 44 65 76 69 63 65 29 2c 20 6e 61 6d 65 29 3b ddDevice(typeof(TDevice),.name);
13300 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 28 64 65 76 69 63 65 20 69 73 20 54 44 ..............if.(!(device.is.TD
13320 65 76 69 63 65 20 64 65 76 69 63 65 4f 66 54 79 70 65 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 evice.deviceOfType))............
13340 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 6f 6e 73 69 64 65 72 ..{..................//.Consider
13360 20 74 68 65 20 65 6e 74 69 72 65 20 6f 70 65 72 61 74 69 6f 6e 20 61 73 20 66 61 69 6c 65 64 2c .the.entire.operation.as.failed,
13380 20 73 6f 20 72 65 6d 6f 76 65 20 74 68 65 20 64 65 76 69 63 65 20 77 65 20 6a 75 73 74 20 61 64 .so.remove.the.device.we.just.ad
133a0 64 65 64 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 64 65 76 69 63 65 ded...................if.(device
133c0 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 52 .!=.null)......................R
133e0 65 6d 6f 76 65 44 65 76 69 63 65 28 64 65 76 69 63 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 emoveDevice(device);............
13400 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 49 6e 76 61 6c 69 64 4f 70 65 72 61 74 69 6f 6e ......throw.new.InvalidOperation
13420 45 78 63 65 70 74 69 6f 6e 28 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 Exception(......................
13440 24 22 4c 61 79 6f 75 74 20 72 65 67 69 73 74 65 72 65 64 20 66 6f 72 20 74 79 70 65 20 27 7b 74 $"Layout.registered.for.type.'{t
13460 79 70 65 6f 66 28 54 44 65 76 69 63 65 29 2e 4e 61 6d 65 7d 27 20 64 69 64 20 6e 6f 74 20 70 72 ypeof(TDevice).Name}'.did.not.pr
13480 6f 64 75 63 65 20 61 20 64 65 76 69 63 65 20 6f 66 20 74 68 61 74 20 74 79 70 65 3b 20 6c 61 79 oduce.a.device.of.that.type;.lay
134a0 6f 75 74 20 70 72 6f 62 61 62 6c 79 20 68 61 73 20 62 65 65 6e 20 6f 76 65 72 72 69 64 64 65 6e out.probably.has.been.overridden
134c0 22 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 ");..............}..............
134e0 72 65 74 75 72 6e 20 64 65 76 69 63 65 4f 66 54 79 70 65 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d return.deviceOfType;..........}.
13500 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>........
13520 20 20 2f 2f 2f 20 54 65 6c 6c 20 74 68 65 20 69 6e 70 75 74 20 73 79 73 74 65 6d 20 74 68 61 74 ..///.Tell.the.input.system.that
13540 20 61 20 6e 65 77 20 64 65 76 69 63 65 20 68 61 73 20 62 65 63 6f 6d 65 20 61 76 61 69 6c 61 62 .a.new.device.has.become.availab
13560 6c 65 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 le...........///.</summary>.....
13580 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 64 65 73 63 72 69 70 74 69 6f .....///.<param.name="descriptio
135a0 6e 22 3e 44 65 73 63 72 69 70 74 69 6f 6e 20 6f 66 20 74 68 65 20 69 6e 70 75 74 20 64 65 76 69 n">Description.of.the.input.devi
135c0 63 65 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 74 75 72 6e ce.</param>..........///.<return
135e0 73 3e 54 68 65 20 6e 65 77 6c 79 20 63 72 65 61 74 65 64 20 64 65 76 69 63 65 20 74 68 61 74 20 s>The.newly.created.device.that.
13600 68 61 73 20 62 65 65 6e 20 61 64 64 65 64 20 74 6f 20 3c 73 65 65 20 63 72 65 66 3d 22 64 65 76 has.been.added.to.<see.cref="dev
13620 69 63 65 73 22 2f 3e 2e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 ices"/>.</returns>..........///.
13640 3c 65 78 63 65 70 74 69 6f 6e 20 63 72 65 66 3d 22 41 72 67 75 6d 65 6e 74 45 78 63 65 70 74 69 <exception.cref="ArgumentExcepti
13660 6f 6e 22 3e 54 68 65 20 67 69 76 65 6e 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 64 65 on">The.given.<paramref.name="de
13680 73 63 72 69 70 74 69 6f 6e 22 2f 3e 20 69 73 20 65 6d 70 74 79 20 2d 6f 72 2d 0d 0a 20 20 20 20 scription"/>.is.empty.-or-......
136a0 20 20 20 20 2f 2f 2f 20 6e 6f 20 6c 61 79 6f 75 74 20 63 61 6e 20 62 65 20 66 6f 75 6e 64 20 74 ....///.no.layout.can.be.found.t
136c0 68 61 74 20 6d 61 74 63 68 65 73 20 74 68 65 20 67 69 76 65 6e 20 64 65 76 69 63 65 20 3c 70 61 hat.matches.the.given.device.<pa
136e0 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 64 65 73 63 72 69 70 74 69 6f 6e 22 2f 3e 2e 3c 2f 65 78 ramref.name="description"/>.</ex
13700 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d ception>..........///.<remarks>.
13720 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 68 69 73 20 6d 65 74 68 6f 64 20 69 73 20 64 69 66 66 .........///.This.method.is.diff
13740 65 72 65 6e 74 20 66 72 6f 6d 20 6d 65 74 68 6f 64 73 20 73 75 63 68 20 61 73 20 3c 73 65 65 20 erent.from.methods.such.as.<see.
13760 63 72 65 66 3d 22 41 64 64 44 65 76 69 63 65 28 73 74 72 69 6e 67 2c 73 74 72 69 6e 67 2c 73 74 cref="AddDevice(string,string,st
13780 72 69 6e 67 29 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 6f 72 20 3c 73 65 65 20 63 72 ring)"/>..........///.or.<see.cr
137a0 65 66 3d 22 41 64 64 44 65 76 69 63 65 7b 54 44 65 76 69 63 65 7d 22 2f 3e 20 69 6e 20 74 68 61 ef="AddDevice{TDevice}"/>.in.tha
137c0 74 20 69 74 20 65 6d 70 6c 6f 79 73 20 74 68 65 20 75 73 75 61 6c 20 6d 61 74 63 68 69 6e 67 20 t.it.employs.the.usual.matching.
137e0 70 72 6f 63 65 73 73 20 74 68 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 73 61 6d 65 20 77 61 process.the..........///.same.wa
13800 79 20 74 68 61 74 20 69 74 20 68 61 70 70 65 6e 73 20 77 68 65 6e 20 74 68 65 20 55 6e 69 74 79 y.that.it.happens.when.the.Unity
13820 20 72 75 6e 74 69 6d 65 20 72 65 70 6f 72 74 73 20 61 6e 20 69 6e 70 75 74 20 64 65 76 69 63 65 .runtime.reports.an.input.device
13840 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 6e 20 70 ...........///..........///.In.p
13860 61 72 74 69 63 75 6c 61 72 2c 20 74 68 65 20 73 61 6d 65 20 70 72 6f 63 65 64 75 72 65 20 64 65 articular,.the.same.procedure.de
13880 73 63 72 69 62 65 64 20 69 6e 20 74 68 65 20 64 6f 63 75 6d 65 6e 74 61 74 69 6f 6e 20 66 6f 72 scribed.in.the.documentation.for
138a0 20 3c 73 65 65 20 63 72 65 66 3d 22 6f 6e 46 69 6e 64 4c 61 79 6f 75 74 46 6f 72 44 65 76 69 63 .<see.cref="onFindLayoutForDevic
138c0 65 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 69 73 20 65 6d 70 6c 6f 79 65 64 20 77 68 e"/>..........///.is.employed.wh
138e0 65 72 65 20 61 6c 6c 20 72 65 67 69 73 74 65 72 65 64 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e ere.all.registered.<see.cref="In
13900 70 75 74 44 65 76 69 63 65 4d 61 74 63 68 65 72 22 2f 3e 73 20 61 72 65 20 6d 61 74 63 68 65 64 putDeviceMatcher"/>s.are.matched
13920 20 61 67 61 69 6e 73 74 20 74 68 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 73 75 70 70 6c 69 .against.the..........///.suppli
13940 65 64 20 64 65 76 69 63 65 20 64 65 73 63 72 69 70 74 69 6f 6e 20 61 6e 64 20 74 68 65 20 6d 6f ed.device.description.and.the.mo
13960 73 74 20 73 75 69 74 61 62 6c 65 20 6d 61 74 63 68 20 64 65 74 65 72 6d 69 6e 65 73 20 74 68 65 st.suitable.match.determines.the
13980 20 6c 61 79 6f 75 74 20 74 6f 20 75 73 65 2e 20 54 68 69 73 20 69 6e 0d 0a 20 20 20 20 20 20 20 .layout.to.use..This.in.........
139a0 20 2f 2f 2f 20 74 75 72 6e 20 69 73 20 72 75 6e 20 74 68 72 6f 75 67 68 20 3c 73 65 65 20 63 72 .///.turn.is.run.through.<see.cr
139c0 65 66 3d 22 6f 6e 46 69 6e 64 4c 61 79 6f 75 74 46 6f 72 44 65 76 69 63 65 22 2f 3e 20 74 6f 20 ef="onFindLayoutForDevice"/>.to.
139e0 64 65 74 65 72 6d 69 6e 65 20 74 68 65 20 66 69 6e 61 6c 20 6c 61 79 6f 75 74 20 74 6f 20 75 73 determine.the.final.layout.to.us
13a00 65 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 66 20 e...........///..........///.If.
13a20 6e 6f 20 73 75 69 74 61 62 6c 65 20 6c 61 79 6f 75 74 20 63 61 6e 20 62 65 20 66 6f 75 6e 64 2c no.suitable.layout.can.be.found,
13a40 20 74 68 65 20 6d 65 74 68 6f 64 20 74 68 72 6f 77 73 20 3c 63 3e 41 72 67 75 6d 65 6e 74 45 78 .the.method.throws.<c>ArgumentEx
13a60 63 65 70 74 69 6f 6e 3c 2f 63 3e 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 61 6d 70 ception</c>...........///.<examp
13a80 6c 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 63 6f 64 65 3e 0d 0a 20 20 20 20 20 20 20 le>..........///.<code>.........
13aa0 20 2f 2f 2f 20 49 6e 70 75 74 53 79 73 74 65 6d 2e 41 64 64 44 65 76 69 63 65 28 0d 0a 20 20 20 .///.InputSystem.AddDevice(.....
13ac0 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 6e 65 77 20 49 6e 70 75 74 44 65 76 69 63 65 44 65 73 63 .....///.....new.InputDeviceDesc
13ae0 72 69 70 74 69 6f 6e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 7b 0d 0a 20 20 20 20 ription..........///.....{......
13b00 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 69 6e 74 65 72 66 61 63 65 4e 61 6d 65 20 3d 20 ....///.........interfaceName.=.
13b20 22 43 75 73 74 6f 6d 22 2c 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 70 "Custom",..........///.........p
13b40 72 6f 64 75 63 74 20 3d 20 22 50 72 6f 64 75 63 74 22 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 roduct.=."Product"..........///.
13b60 20 20 20 20 7d 29 3b 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 ....});..........///.</code>....
13b80 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 65 78 61 6d 70 6c 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f ......///.</example>..........//
13ba0 2f 20 3c 2f 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 /.</remarks>..........public.sta
13bc0 74 69 63 20 49 6e 70 75 74 44 65 76 69 63 65 20 41 64 64 44 65 76 69 63 65 28 49 6e 70 75 74 44 tic.InputDevice.AddDevice(InputD
13be0 65 76 69 63 65 44 65 73 63 72 69 70 74 69 6f 6e 20 64 65 73 63 72 69 70 74 69 6f 6e 29 0d 0a 20 eviceDescription.description)...
13c00 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 64 65 73 63 72 69 .......{..............if.(descri
13c20 70 74 69 6f 6e 2e 65 6d 70 74 79 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 ption.empty)..................th
13c40 72 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 45 78 63 65 70 74 69 6f 6e 28 22 44 65 73 63 72 row.new.ArgumentException("Descr
13c60 69 70 74 69 6f 6e 20 6d 75 73 74 20 6e 6f 74 20 62 65 20 65 6d 70 74 79 22 2c 20 6e 61 6d 65 6f iption.must.not.be.empty",.nameo
13c80 66 28 64 65 73 63 72 69 70 74 69 6f 6e 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 f(description));..............re
13ca0 74 75 72 6e 20 73 5f 4d 61 6e 61 67 65 72 2e 41 64 64 44 65 76 69 63 65 28 64 65 73 63 72 69 70 turn.s_Manager.AddDevice(descrip
13cc0 74 69 6f 6e 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 tion);..........}............///
13ce0 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 41 64 64 20 74 68 65 20 .<summary>..........///.Add.the.
13d00 67 69 76 65 6e 20 64 65 76 69 63 65 20 62 61 63 6b 20 74 6f 20 74 68 65 20 73 79 73 74 65 6d 2e given.device.back.to.the.system.
13d20 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>........
13d40 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 64 65 76 69 63 65 22 3e 41 6e 20 69 6e ..///.<param.name="device">An.in
13d60 70 75 74 20 64 65 76 69 63 65 2e 20 49 66 20 74 68 65 20 64 65 76 69 63 65 20 69 73 20 63 75 72 put.device..If.the.device.is.cur
13d80 72 65 6e 74 6c 79 20 61 6c 72 65 61 64 79 20 61 64 64 65 64 20 74 6f 0d 0a 20 20 20 20 20 20 20 rently.already.added.to.........
13da0 20 2f 2f 2f 20 74 68 65 20 73 79 73 74 65 6d 20 28 69 2e 65 2e 20 69 73 20 69 6e 20 3c 73 65 65 .///.the.system.(i.e..is.in.<see
13dc0 20 63 72 65 66 3d 22 64 65 76 69 63 65 73 22 2f 3e 29 2c 20 74 68 65 20 6d 65 74 68 6f 64 20 77 .cref="devices"/>),.the.method.w
13de0 69 6c 6c 20 64 6f 20 6e 6f 74 68 69 6e 67 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 ill.do.nothing.</param>.........
13e00 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f 6e 20 63 72 65 66 3d 22 41 72 67 75 6d 65 6e 74 4e 75 .///.<exception.cref="ArgumentNu
13e20 6c 6c 45 78 63 65 70 74 69 6f 6e 22 3e 3c 2f 65 78 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 llException"></exception>.......
13e40 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 68 ...///.<remarks>..........///.Th
13e60 69 73 20 63 61 6e 20 62 65 20 75 73 65 64 20 77 68 65 6e 20 61 20 64 65 76 69 63 65 20 68 61 73 is.can.be.used.when.a.device.has
13e80 20 62 65 65 6e 20 6d 61 6e 75 61 6c 6c 79 20 72 65 6d 6f 76 65 64 20 77 69 74 68 20 3c 73 65 65 .been.manually.removed.with.<see
13ea0 20 63 72 65 66 3d 22 52 65 6d 6f 76 65 44 65 76 69 63 65 22 2f 3e 2e 0d 0a 20 20 20 20 20 20 20 .cref="RemoveDevice"/>..........
13ec0 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 68 65 20 64 65 76 69 63 65 20 77 69 6c .///..........///.The.device.wil
13ee0 6c 20 62 65 20 61 64 64 65 64 20 74 6f 20 74 68 65 20 3c 73 65 65 20 63 72 65 66 3d 22 64 65 76 l.be.added.to.the.<see.cref="dev
13f00 69 63 65 73 22 2f 3e 20 6c 69 73 74 20 61 6e 64 20 61 20 6e 6f 74 69 66 69 63 61 74 69 6f 6e 20 ices"/>.list.and.a.notification.
13f20 6f 6e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 20 63 72 65 66 3d 22 6f 6e 44 65 76 on..........///.<see.cref="onDev
13f40 69 63 65 43 68 61 6e 67 65 22 2f 3e 20 77 69 6c 6c 20 62 65 20 74 72 69 67 67 65 72 65 64 2e 0d iceChange"/>.will.be.triggered..
13f60 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 74 20 6d 61 79 .........///..........///.It.may
13f80 20 62 65 20 74 65 6d 70 74 69 6e 67 20 74 6f 20 64 6f 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 .be.tempting.to.do.the.following
13fa0 20 62 75 74 20 74 68 69 73 20 77 69 6c 6c 20 6e 6f 74 20 77 6f 72 6b 3a 0d 0a 20 20 20 20 20 20 .but.this.will.not.work:........
13fc0 20 20 2f 2f 2f 0d 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 ..///..........///.<example>....
13fe0 20 20 20 20 20 20 2f 2f 2f 20 3c 63 6f 64 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 2f 2f ......///.<code>..........///.//
14000 20 54 68 69 73 20 77 69 6c 6c 20 2a 4e 4f 54 2a 20 77 6f 72 6b 2e 0d 0a 20 20 20 20 20 20 20 20 .This.will.*NOT*.work...........
14020 2f 2f 2f 20 76 61 72 20 64 65 76 69 63 65 20 3d 20 6e 65 77 20 47 61 6d 65 70 61 64 28 29 3b 0d ///.var.device.=.new.Gamepad();.
14040 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 6e 70 75 74 53 79 73 74 65 6d 2e 41 64 64 44 65 76 69 .........///.InputSystem.AddDevi
14060 63 65 28 64 65 76 69 63 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 63 6f 64 65 3e ce(device);..........///.</code>
14080 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 65 78 61 6d 70 6c 65 3e 0d 0a 20 20 20 20 20 20 ..........///.</example>........
140a0 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e ..///..........///.<see.cref="In
140c0 70 75 74 44 65 76 69 63 65 22 2f 3e 73 2c 20 6c 69 6b 65 20 3c 73 65 65 20 63 72 65 66 3d 22 49 putDevice"/>s,.like.<see.cref="I
140e0 6e 70 75 74 43 6f 6e 74 72 6f 6c 22 2f 3e 73 20 69 6e 20 67 65 6e 65 72 61 6c 2c 20 63 61 6e 6e nputControl"/>s.in.general,.cann
14100 6f 74 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 73 69 6d 70 6c 79 20 62 65 20 69 6e 73 74 61 6e ot..........///.simply.be.instan
14120 74 69 61 74 65 64 20 77 69 74 68 20 3c 63 3e 6e 65 77 3c 2f 63 3e 20 62 75 74 20 6d 75 73 74 20 tiated.with.<c>new</c>.but.must.
14140 62 65 20 63 72 65 61 74 65 64 20 62 79 20 74 68 65 20 69 6e 70 75 74 20 73 79 73 74 65 6d 0d 0a be.created.by.the.input.system..
14160 20 20 20 20 20 20 20 20 2f 2f 2f 20 69 6e 73 74 65 61 64 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f ........///.instead...........//
14180 2f 20 3c 2f 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c /.</remarks>..........///.<seeal
141a0 73 6f 20 63 72 65 66 3d 22 52 65 6d 6f 76 65 44 65 76 69 63 65 22 2f 3e 0d 0a 20 20 20 20 20 20 so.cref="RemoveDevice"/>........
141c0 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 41 64 64 44 65 76 69 63 65 7b 54 ..///.<seealso.cref="AddDevice{T
141e0 44 65 76 69 63 65 7d 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f Device}"/>..........///.<seealso
14200 20 63 72 65 66 3d 22 64 65 76 69 63 65 73 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 .cref="devices"/>..........publi
14220 63 20 73 74 61 74 69 63 20 76 6f 69 64 20 41 64 64 44 65 76 69 63 65 28 49 6e 70 75 74 44 65 76 c.static.void.AddDevice(InputDev
14240 69 63 65 20 64 65 76 69 63 65 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 ice.device)..........{..........
14260 20 20 20 20 69 66 20 28 64 65 76 69 63 65 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 ....if.(device.==.null).........
14280 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 .........throw.new.ArgumentNullE
142a0 78 63 65 70 74 69 6f 6e 28 6e 61 6d 65 6f 66 28 64 65 76 69 63 65 29 29 3b 0d 0a 20 20 20 20 20 xception(nameof(device));.......
142c0 20 20 20 20 20 20 20 73 5f 4d 61 6e 61 67 65 72 2e 41 64 64 44 65 76 69 63 65 28 64 65 76 69 63 .......s_Manager.AddDevice(devic
142e0 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
14300 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 52 65 6d 6f 76 65 20 61 20 64 65 ummary>..........///.Remove.a.de
14320 76 69 63 65 20 66 72 6f 6d 20 74 68 65 20 73 79 73 74 65 6d 20 73 75 63 68 20 74 68 61 74 20 69 vice.from.the.system.such.that.i
14340 74 20 6e 6f 20 6c 6f 6e 67 65 72 20 72 65 63 65 69 76 65 73 20 69 6e 70 75 74 20 61 6e 64 20 69 t.no.longer.receives.input.and.i
14360 73 20 6e 6f 20 6c 6f 6e 67 65 72 20 70 61 72 74 20 6f 66 20 74 68 65 0d 0a 20 20 20 20 20 20 20 s.no.longer.part.of.the.........
14380 20 2f 2f 2f 20 73 65 74 20 6f 66 20 64 65 76 69 63 65 73 20 69 6e 20 3c 73 65 65 20 63 72 65 66 .///.set.of.devices.in.<see.cref
143a0 3d 22 64 65 76 69 63 65 73 22 2f 3e 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d ="devices"/>...........///.</sum
143c0 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 22 mary>..........///.<param.name="
143e0 64 65 76 69 63 65 22 3e 44 65 76 69 63 65 20 74 6f 20 72 65 6d 6f 76 65 2e 20 49 66 20 74 68 65 device">Device.to.remove..If.the
14400 20 64 65 76 69 63 65 20 68 61 73 20 61 6c 72 65 61 64 79 20 62 65 65 6e 20 72 65 6d 6f 76 65 64 .device.has.already.been.removed
14420 20 28 69 2e 65 2e 20 69 66 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 44 65 76 69 63 65 .(i.e..if.<see.cref="InputDevice
14440 2e 61 64 64 65 64 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 69 73 20 66 61 6c 73 65 29 .added"/>..........///.is.false)
14460 2c 20 74 68 65 20 6d 65 74 68 6f 64 20 64 6f 65 73 20 6e 6f 74 68 69 6e 67 2e 3c 2f 70 61 72 61 ,.the.method.does.nothing.</para
14480 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 m>..........///.<remarks>.......
144a0 20 20 20 2f 2f 2f 20 41 63 74 69 6f 6e 73 20 74 68 61 74 20 61 72 65 20 62 6f 75 6e 64 20 74 6f ...///.Actions.that.are.bound.to
144c0 20 63 6f 6e 74 72 6f 6c 73 20 6f 6e 20 74 68 65 20 64 65 76 69 63 65 20 77 69 6c 6c 20 61 75 74 .controls.on.the.device.will.aut
144e0 6f 6d 61 74 69 63 61 6c 6c 79 20 75 6e 62 69 6e 64 20 77 68 65 6e 20 74 68 65 20 64 65 76 69 63 omatically.unbind.when.the.devic
14500 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 69 73 20 72 65 6d 6f 76 65 64 2e 0d 0a 20 20 20 20 e..........///.is.removed.......
14520 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 57 68 65 6e 20 61 20 64 65 76 69 ....///..........///.When.a.devi
14540 63 65 20 69 73 20 72 65 6d 6f 76 65 64 2c 20 3c 73 65 65 20 63 72 65 66 3d 22 6f 6e 44 65 76 69 ce.is.removed,.<see.cref="onDevi
14560 63 65 43 68 61 6e 67 65 22 2f 3e 20 77 69 6c 6c 20 62 65 20 74 72 69 67 67 65 72 65 64 20 77 69 ceChange"/>.will.be.triggered.wi
14580 74 68 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 44 65 76 69 63 65 43 68 61 6e 67 65 2e th.<see.cref="InputDeviceChange.
145a0 52 65 6d 6f 76 65 64 22 2f 3e 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 68 65 20 64 65 76 Removed"/>...........///.The.dev
145c0 69 63 65 20 77 69 6c 6c 20 62 65 20 72 65 6d 6f 76 65 64 20 66 72 6f 6d 20 3c 73 65 65 20 63 72 ice.will.be.removed.from.<see.cr
145e0 65 66 3d 22 64 65 76 69 63 65 73 22 2f 3e 20 61 73 20 77 65 6c 6c 20 61 73 20 66 72 6f 6d 20 61 ef="devices"/>.as.well.as.from.a
14600 6e 79 20 64 65 76 69 63 65 2d 73 70 65 63 69 66 69 63 20 67 65 74 74 65 72 73 20 73 75 63 68 20 ny.device-specific.getters.such.
14620 61 73 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 20 63 72 65 66 3d 22 47 61 6d 65 70 as..........///.<see.cref="Gamep
14640 61 64 2e 61 6c 6c 22 2f 3e 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 6d 61 72 6b ad.all"/>...........///.</remark
14660 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f 6e 20 63 72 65 66 3d s>..........///.<exception.cref=
14680 22 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 22 3e 3c 70 61 72 61 6d 72 65 "ArgumentNullException"><paramre
146a0 66 20 6e 61 6d 65 3d 22 64 65 76 69 63 65 22 2f 3e 20 69 73 20 6e 75 6c 6c 2e 3c 2f 65 78 63 65 f.name="device"/>.is.null.</exce
146c0 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 ption>..........///.<seealso.cre
146e0 66 3d 22 49 6e 70 75 74 44 65 76 69 63 65 2e 61 64 64 65 64 22 2f 3e 0d 0a 20 20 20 20 20 20 20 f="InputDevice.added"/>.........
14700 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 76 6f 69 64 20 52 65 6d 6f 76 65 44 65 76 69 63 65 .public.static.void.RemoveDevice
14720 28 49 6e 70 75 74 44 65 76 69 63 65 20 64 65 76 69 63 65 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d (InputDevice.device)..........{.
14740 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 4d 61 6e 61 67 65 72 2e 52 65 6d 6f 76 65 44 65 76 .............s_Manager.RemoveDev
14760 69 63 65 28 64 65 76 69 63 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 ice(device);..........}.........
14780 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 50 75 ...///.<summary>..........///.Pu
147a0 72 67 65 20 61 6c 6c 20 64 69 73 63 6f 6e 6e 65 63 74 65 64 20 64 65 76 69 63 65 73 20 66 72 6f rge.all.disconnected.devices.fro
147c0 6d 20 3c 73 65 65 20 63 72 65 66 3d 22 64 69 73 63 6f 6e 6e 65 63 74 65 64 44 65 76 69 63 65 73 m.<see.cref="disconnectedDevices
147e0 22 2f 3e 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 "/>...........///.</summary>....
14800 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f ......///.<remarks>..........///
14820 20 54 68 69 73 20 77 69 6c 6c 20 72 65 6c 65 61 73 65 20 61 6c 6c 20 72 65 66 65 72 65 6e 63 65 .This.will.release.all.reference
14840 73 20 68 65 6c 64 20 6f 6e 20 74 6f 20 66 6f 72 20 74 68 65 73 65 20 64 65 76 69 63 65 73 20 6f s.held.on.to.for.these.devices.o
14860 72 20 61 6e 79 20 6f 66 20 74 68 65 69 72 20 63 6f 6e 74 72 6f 6c 73 20 61 6e 64 20 77 69 6c 6c r.any.of.their.controls.and.will
14880 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 61 6c 6c 6f 77 20 74 68 65 20 64 65 76 69 63 65 73 20 ..........///.allow.the.devices.
148a0 74 6f 20 62 65 20 72 65 63 6c 61 69 6d 65 64 20 62 79 20 74 68 65 20 67 61 72 62 61 67 65 20 63 to.be.reclaimed.by.the.garbage.c
148c0 6f 6c 6c 65 63 74 6f 72 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 6d 61 72 6b 73 ollector...........///.</remarks
148e0 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 64 69 >..........///.<seealso.cref="di
14900 73 63 6f 6e 6e 65 63 74 65 64 44 65 76 69 63 65 73 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 sconnectedDevices"/>..........pu
14920 62 6c 69 63 20 73 74 61 74 69 63 20 76 6f 69 64 20 46 6c 75 73 68 44 69 73 63 6f 6e 6e 65 63 74 blic.static.void.FlushDisconnect
14940 65 64 44 65 76 69 63 65 73 28 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 edDevices()..........{..........
14960 20 20 20 20 73 5f 4d 61 6e 61 67 65 72 2e 46 6c 75 73 68 44 69 73 63 6f 6e 6e 65 63 74 65 64 44 ....s_Manager.FlushDisconnectedD
14980 65 76 69 63 65 73 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 evices();..........}............
149a0 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 49 6e 70 75 74 44 65 76 69 63 65 20 47 65 74 44 65 76 public.static.InputDevice.GetDev
149c0 69 63 65 28 73 74 72 69 6e 67 20 6e 61 6d 65 4f 72 4c 61 79 6f 75 74 29 0d 0a 20 20 20 20 20 20 ice(string.nameOrLayout)........
149e0 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 73 5f 4d 61 6e 61 67 65 ..{..............return.s_Manage
14a00 72 2e 54 72 79 47 65 74 44 65 76 69 63 65 28 6e 61 6d 65 4f 72 4c 61 79 6f 75 74 29 3b 0d 0a 20 r.TryGetDevice(nameOrLayout);...
14a20 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 73 74 61 74 69 .......}............public.stati
14a40 63 20 54 44 65 76 69 63 65 20 47 65 74 44 65 76 69 63 65 3c 54 44 65 76 69 63 65 3e 28 29 0d 0a c.TDevice.GetDevice<TDevice>()..
14a60 20 20 20 20 20 20 20 20 20 20 20 20 77 68 65 72 65 20 54 44 65 76 69 63 65 20 3a 20 49 6e 70 75 ............where.TDevice.:.Inpu
14a80 74 44 65 76 69 63 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 tDevice..........{..............
14aa0 54 44 65 76 69 63 65 20 72 65 73 75 6c 74 20 3d 20 6e 75 6c 6c 3b 0d 0a 20 20 20 20 20 20 20 20 TDevice.result.=.null;..........
14ac0 20 20 20 20 76 61 72 20 6c 61 73 74 55 70 64 61 74 65 54 69 6d 65 20 3d 20 2d 31 2e 30 3b 0d 0a ....var.lastUpdateTime.=.-1.0;..
14ae0 20 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 65 61 63 68 20 28 76 61 72 20 64 65 76 69 63 65 20 ............foreach.(var.device.
14b00 69 6e 20 64 65 76 69 63 65 73 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 in.devices)..............{......
14b20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 64 65 76 69 63 65 4f 66 54 79 70 65 20 3d 20 64 ............var.deviceOfType.=.d
14b40 65 76 69 63 65 20 61 73 20 54 44 65 76 69 63 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 evice.as.TDevice;...............
14b60 20 20 20 69 66 20 28 64 65 76 69 63 65 4f 66 54 79 70 65 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 ...if.(deviceOfType.==.null)....
14b80 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 69 6e 75 65 3b 0d 0a 0d 0a 20 ..................continue;.....
14ba0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 72 65 73 75 6c 74 20 3d 3d 20 6e 75 6c ...............if.(result.==.nul
14bc0 6c 20 7c 7c 20 64 65 76 69 63 65 4f 66 54 79 70 65 2e 6d 5f 4c 61 73 74 55 70 64 61 74 65 54 69 l.||.deviceOfType.m_LastUpdateTi
14be0 6d 65 49 6e 74 65 72 6e 61 6c 20 3e 20 6c 61 73 74 55 70 64 61 74 65 54 69 6d 65 29 0d 0a 20 20 meInternal.>.lastUpdateTime)....
14c00 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 ..............{.................
14c20 20 20 20 20 20 72 65 73 75 6c 74 20 3d 20 64 65 76 69 63 65 4f 66 54 79 70 65 3b 0d 0a 20 20 20 .....result.=.deviceOfType;.....
14c40 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6c 61 73 74 55 70 64 61 74 65 54 69 6d 65 20 .................lastUpdateTime.
14c60 3d 20 72 65 73 75 6c 74 2e 6d 5f 4c 61 73 74 55 70 64 61 74 65 54 69 6d 65 49 6e 74 65 72 6e 61 =.result.m_LastUpdateTimeInterna
14c80 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 20 20 l;..................}...........
14ca0 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 72 65 73 75 6c ...}................return.resul
14cc0 74 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 2f 52 45 56 t;..........}............////REV
14ce0 49 45 57 3a 20 74 68 69 73 20 41 50 49 20 73 65 65 6d 73 20 69 6e 63 6f 6e 73 69 73 74 65 6e 74 IEW:.this.API.seems.inconsistent
14d00 20 77 69 74 68 20 47 65 74 44 65 76 69 63 65 28 73 74 72 69 6e 67 29 3b 20 62 6f 74 68 20 68 61 .with.GetDevice(string);.both.ha
14d20 76 65 20 76 65 72 79 20 64 69 66 66 65 72 65 6e 74 20 6d 65 61 6e 69 6e 67 20 79 65 74 20 76 65 ve.very.different.meaning.yet.ve
14d40 72 79 20 73 69 6d 69 6c 61 72 20 73 69 67 6e 61 74 75 72 65 73 0d 0a 20 20 20 20 20 20 20 20 2f ry.similar.signatures........../
14d60 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 75 72 6e //.<summary>..........///.Return
14d80 20 74 68 65 20 64 65 76 69 63 65 20 6f 66 20 74 68 65 20 67 69 76 65 6e 20 74 79 70 65 20 3c 74 .the.device.of.the.given.type.<t
14da0 79 70 65 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 54 44 65 76 69 63 65 22 2f 3e 20 74 68 61 ypeparamref.name="TDevice"/>.tha
14dc0 74 20 68 61 73 20 74 68 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 67 69 76 65 6e 20 75 73 61 t.has.the..........///.given.usa
14de0 67 65 20 61 73 73 69 67 6e 65 64 2e 20 52 65 74 75 72 6e 73 20 6e 75 6c 6c 20 69 66 20 6e 6f 20 ge.assigned..Returns.null.if.no.
14e00 73 75 63 68 20 64 65 76 69 63 65 20 63 75 72 72 65 6e 74 6c 79 20 65 78 69 73 74 73 2e 0d 0a 20 such.device.currently.exists....
14e20 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>........../
14e40 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 75 73 61 67 65 22 3e 55 73 61 67 65 20 6f 66 20 //.<param.name="usage">Usage.of.
14e60 74 68 65 20 64 65 76 69 63 65 2c 20 65 2e 67 2e 20 22 4c 65 66 74 48 61 6e 64 22 2e 3c 2f 70 61 the.device,.e.g.."LeftHand".</pa
14e80 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 74 79 70 65 70 61 72 61 6d 20 6e 61 6d ram>..........///.<typeparam.nam
14ea0 65 3d 22 54 44 65 76 69 63 65 22 3e 54 79 70 65 20 6f 66 20 64 65 76 69 63 65 20 74 6f 20 6c 6f e="TDevice">Type.of.device.to.lo
14ec0 6f 6b 20 66 6f 72 2e 3c 2f 74 79 70 65 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f ok.for.</typeparam>..........///
14ee0 20 3c 72 65 74 75 72 6e 73 3e 54 68 65 20 64 65 76 69 63 65 20 77 69 74 68 20 74 68 65 20 67 69 .<returns>The.device.with.the.gi
14f00 76 65 6e 20 74 79 70 65 20 61 6e 64 20 75 73 61 67 65 20 6f 72 20 6e 75 6c 6c 2e 3c 2f 72 65 74 ven.type.and.usage.or.null.</ret
14f20 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 urns>..........///.<remarks>....
14f40 20 20 20 20 20 20 2f 2f 2f 20 44 65 76 69 63 65 73 20 75 73 61 67 65 73 20 61 72 65 20 6d 6f 73 ......///.Devices.usages.are.mos
14f60 74 20 63 6f 6d 6d 6f 6e 6c 79 20 65 6d 70 6c 6f 79 65 64 20 74 6f 20 22 74 61 67 22 20 64 65 76 t.commonly.employed.to."tag".dev
14f80 69 63 65 73 20 66 6f 72 20 61 20 73 70 65 63 69 66 69 63 20 72 6f 6c 65 2e 0d 0a 20 20 20 20 20 ices.for.a.specific.role........
14fa0 20 20 20 2f 2f 2f 20 41 20 63 6f 6d 6d 6f 6e 20 73 63 65 6e 61 72 69 6f 2c 20 66 6f 72 20 65 78 ...///.A.common.scenario,.for.ex
14fc0 61 6d 70 6c 65 2c 20 69 73 20 74 6f 20 64 69 73 74 69 6e 67 75 69 73 68 20 77 68 69 63 68 20 68 ample,.is.to.distinguish.which.h
14fe0 61 6e 64 20 61 20 73 70 65 63 69 66 69 63 20 3c 73 65 65 20 63 72 65 66 3d 22 58 52 2e 58 52 43 and.a.specific.<see.cref="XR.XRC
15000 6f 6e 74 72 6f 6c 6c 65 72 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 69 73 20 61 73 73 ontroller"/>..........///.is.ass
15020 6f 63 69 61 74 65 64 20 77 69 74 68 2e 20 48 6f 77 65 76 65 72 2c 20 61 72 62 69 74 72 61 72 79 ociated.with..However,.arbitrary
15040 20 75 73 61 67 65 73 20 63 61 6e 20 62 65 20 61 73 73 69 67 6e 65 64 20 74 6f 20 64 65 76 69 63 .usages.can.be.assigned.to.devic
15060 65 73 2e 0d 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 es...........///.<example>......
15080 20 20 20 20 2f 2f 2f 20 3c 63 6f 64 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 2f 2f 20 47 ....///.<code>..........///.//.G
150a0 65 74 20 74 68 65 20 6c 65 66 74 20 68 61 6e 64 20 58 52 43 6f 6e 74 72 6f 6c 6c 65 72 2e 0d 0a et.the.left.hand.XRController...
150c0 20 20 20 20 20 20 20 20 2f 2f 2f 20 76 61 72 20 6c 65 66 74 48 61 6e 64 20 3d 20 49 6e 70 75 74 ........///.var.leftHand.=.Input
150e0 53 79 73 74 65 6d 2e 47 65 74 44 65 76 69 63 65 26 6c 74 3b 58 52 43 6f 6e 74 72 6f 6c 6c 65 72 System.GetDevice&lt;XRController
15100 26 67 74 3b 28 43 6f 6d 6d 6f 6e 55 73 61 67 65 73 2e 6c 65 66 74 48 61 6e 64 29 3b 0d 0a 20 20 &gt;(CommonUsages.leftHand);....
15120 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 2f 2f 20 4d 61 72 6b 20 67 ......///..........///.//.Mark.g
15140 61 6d 65 70 61 64 20 23 32 20 61 73 20 62 65 69 6e 67 20 66 6f 72 20 70 6c 61 79 65 72 20 31 2e amepad.#2.as.being.for.player.1.
15160 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 6e 70 75 74 53 79 73 74 65 6d 2e 53 65 74 44 65 76 ..........///.InputSystem.SetDev
15180 69 63 65 55 73 61 67 65 28 47 61 6d 65 70 61 64 2e 61 6c 6c 5b 31 5d 2c 20 22 50 6c 61 79 65 72 iceUsage(Gamepad.all[1],."Player
151a0 31 22 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 2f 2f 20 41 6e 64 20 6c 61 74 65 72 20 6c 1");..........///.//.And.later.l
151c0 6f 6f 6b 20 69 74 20 75 70 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 76 61 72 20 70 6c 61 79 ook.it.up...........///.var.play
151e0 65 72 31 47 61 6d 65 70 61 64 20 3d 20 49 6e 70 75 74 53 79 73 74 65 6d 2e 47 65 74 44 65 76 69 er1Gamepad.=.InputSystem.GetDevi
15200 63 65 26 6c 74 3b 47 61 6d 65 70 61 64 26 67 74 3b 28 6e 65 77 20 49 6e 74 65 72 6e 65 64 53 74 ce&lt;Gamepad&gt;(new.InternedSt
15220 72 69 6e 67 28 22 50 6c 61 79 65 72 31 22 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c ring("Player1"));..........///.<
15240 2f 63 6f 64 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 65 78 61 6d 70 6c 65 3e 0d 0a /code>..........///.</example>..
15260 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 ........///.</remarks>..........
15280 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 53 65 74 44 65 76 69 63 65 55 73 61 67 ///.<seealso.cref="SetDeviceUsag
152a0 65 28 49 6e 70 75 74 44 65 76 69 63 65 2c 73 74 72 69 6e 67 29 22 2f 3e 0d 0a 20 20 20 20 20 20 e(InputDevice,string)"/>........
152c0 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f ..///.<seealso.cref="InputContro
152e0 6c 2e 75 73 61 67 65 73 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 l.usages"/>..........public.stat
15300 69 63 20 54 44 65 76 69 63 65 20 47 65 74 44 65 76 69 63 65 3c 54 44 65 76 69 63 65 3e 28 49 6e ic.TDevice.GetDevice<TDevice>(In
15320 74 65 72 6e 65 64 53 74 72 69 6e 67 20 75 73 61 67 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ternedString.usage).............
15340 20 77 68 65 72 65 20 54 44 65 76 69 63 65 20 3a 20 49 6e 70 75 74 44 65 76 69 63 65 0d 0a 20 20 .where.TDevice.:.InputDevice....
15360 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 54 44 65 76 69 63 65 20 72 65 73 ......{..............TDevice.res
15380 75 6c 74 20 3d 20 6e 75 6c 6c 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 6c 61 73 ult.=.null;..............var.las
153a0 74 55 70 64 61 74 65 54 69 6d 65 20 3d 20 2d 31 2e 30 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 tUpdateTime.=.-1.0;.............
153c0 20 66 6f 72 65 61 63 68 20 28 76 61 72 20 64 65 76 69 63 65 20 69 6e 20 64 65 76 69 63 65 73 29 .foreach.(var.device.in.devices)
153e0 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 ..............{.................
15400 20 76 61 72 20 64 65 76 69 63 65 4f 66 54 79 70 65 20 3d 20 64 65 76 69 63 65 20 61 73 20 54 44 .var.deviceOfType.=.device.as.TD
15420 65 76 69 63 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 64 65 76 69 evice;..................if.(devi
15440 63 65 4f 66 54 79 70 65 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 ceOfType.==.null)...............
15460 20 20 20 20 20 20 20 63 6f 6e 74 69 6e 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .......continue;................
15480 20 20 69 66 20 28 21 64 65 76 69 63 65 4f 66 54 79 70 65 2e 75 73 61 67 65 73 2e 43 6f 6e 74 61 ..if.(!deviceOfType.usages.Conta
154a0 69 6e 73 28 75 73 61 67 65 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ins(usage)).....................
154c0 20 63 6f 6e 74 69 6e 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 .continue;....................if
154e0 20 28 72 65 73 75 6c 74 20 3d 3d 20 6e 75 6c 6c 20 7c 7c 20 64 65 76 69 63 65 4f 66 54 79 70 65 .(result.==.null.||.deviceOfType
15500 2e 6d 5f 4c 61 73 74 55 70 64 61 74 65 54 69 6d 65 49 6e 74 65 72 6e 61 6c 20 3e 20 6c 61 73 74 .m_LastUpdateTimeInternal.>.last
15520 55 70 64 61 74 65 54 69 6d 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a UpdateTime)..................{..
15540 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 73 75 6c 74 20 3d 20 64 65 76 ....................result.=.dev
15560 69 63 65 4f 66 54 79 70 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 iceOfType;......................
15580 6c 61 73 74 55 70 64 61 74 65 54 69 6d 65 20 3d 20 72 65 73 75 6c 74 2e 6d 5f 4c 61 73 74 55 70 lastUpdateTime.=.result.m_LastUp
155a0 64 61 74 65 54 69 6d 65 49 6e 74 65 72 6e 61 6c 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 dateTimeInternal;...............
155c0 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 20 20 20 ...}..............}.............
155e0 20 20 20 72 65 74 75 72 6e 20 72 65 73 75 6c 74 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a ...return.result;..........}....
15600 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 54 44 65 76 69 63 65 20 47 65 ........public.static.TDevice.Ge
15620 74 44 65 76 69 63 65 3c 54 44 65 76 69 63 65 3e 28 73 74 72 69 6e 67 20 75 73 61 67 65 29 0d 0a tDevice<TDevice>(string.usage)..
15640 20 20 20 20 20 20 20 20 20 20 20 20 77 68 65 72 65 20 54 44 65 76 69 63 65 20 3a 20 49 6e 70 75 ............where.TDevice.:.Inpu
15660 74 44 65 76 69 63 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 tDevice..........{..............
15680 72 65 74 75 72 6e 20 47 65 74 44 65 76 69 63 65 3c 54 44 65 76 69 63 65 3e 28 6e 65 77 20 49 6e return.GetDevice<TDevice>(new.In
156a0 74 65 72 6e 65 64 53 74 72 69 6e 67 28 75 73 61 67 65 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d ternedString(usage));..........}
156c0 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 ............///.<summary>.......
156e0 20 20 20 2f 2f 2f 20 4c 6f 6f 6b 20 75 70 20 61 20 64 65 76 69 63 65 20 62 79 20 69 74 73 20 75 ...///.Look.up.a.device.by.its.u
15700 6e 69 71 75 65 20 49 44 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 nique.ID...........///.</summary
15720 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 64 65 76 69 >..........///.<param.name="devi
15740 63 65 49 64 22 3e 55 6e 69 71 75 65 20 49 44 20 6f 66 20 64 65 76 69 63 65 2e 20 53 75 63 68 20 ceId">Unique.ID.of.device..Such.
15760 61 73 20 67 69 76 65 6e 20 62 79 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 45 76 65 6e as.given.by.<see.cref="InputEven
15780 74 2e 64 65 76 69 63 65 49 64 22 2f 3e 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 t.deviceId"/>.</param>..........
157a0 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 54 68 65 20 64 65 76 69 63 65 20 66 6f 72 20 74 68 65 20 ///.<returns>The.device.for.the.
157c0 67 69 76 65 6e 20 49 44 20 6f 72 20 6e 75 6c 6c 20 69 66 20 6e 6f 20 64 65 76 69 63 65 20 77 69 given.ID.or.null.if.no.device.wi
157e0 74 68 20 74 68 65 20 67 69 76 65 6e 20 49 44 20 65 78 69 73 74 73 20 28 6f 72 20 6e 6f 20 6c 6f th.the.given.ID.exists.(or.no.lo
15800 6e 67 65 72 20 65 78 69 73 74 73 29 2e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 20 nger.exists).</returns>.........
15820 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 44 65 76 69 .///.<remarks>..........///.Devi
15840 63 65 20 49 44 73 20 61 72 65 20 6e 6f 74 20 72 65 75 73 65 64 20 69 6e 20 61 20 67 69 76 65 6e ce.IDs.are.not.reused.in.a.given
15860 20 73 65 73 73 69 6f 6e 20 6f 66 20 74 68 65 20 61 70 70 6c 69 63 61 74 69 6f 6e 20 28 6f 72 20 .session.of.the.application.(or.
15880 55 6e 69 74 79 20 65 64 69 74 6f 72 29 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 Unity.editor)...........///.</re
158a0 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 marks>..........///.<seealso.cre
158c0 66 3d 22 49 6e 70 75 74 45 76 65 6e 74 2e 64 65 76 69 63 65 49 64 22 2f 3e 0d 0a 20 20 20 20 20 f="InputEvent.deviceId"/>.......
158e0 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 49 6e 70 75 74 44 65 76 69 63 ...///.<seealso.cref="InputDevic
15900 65 2e 64 65 76 69 63 65 49 64 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 e.deviceId"/>..........///.<seea
15920 6c 73 6f 20 63 72 65 66 3d 22 49 49 6e 70 75 74 52 75 6e 74 69 6d 65 2e 41 6c 6c 6f 63 61 74 65 lso.cref="IInputRuntime.Allocate
15940 44 65 76 69 63 65 49 64 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 DeviceId"/>..........public.stat
15960 69 63 20 49 6e 70 75 74 44 65 76 69 63 65 20 47 65 74 44 65 76 69 63 65 42 79 49 64 28 69 6e 74 ic.InputDevice.GetDeviceById(int
15980 20 64 65 76 69 63 65 49 64 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 .deviceId)..........{...........
159a0 20 20 20 72 65 74 75 72 6e 20 73 5f 4d 61 6e 61 67 65 72 2e 54 72 79 47 65 74 44 65 76 69 63 65 ...return.s_Manager.TryGetDevice
159c0 42 79 49 64 28 64 65 76 69 63 65 49 64 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 ById(deviceId);..........}......
159e0 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>..........///
15a00 20 52 65 74 75 72 6e 20 74 68 65 20 6c 69 73 74 20 6f 66 20 64 65 76 69 63 65 73 20 74 68 61 74 .Return.the.list.of.devices.that
15a20 20 68 61 76 65 20 62 65 65 6e 20 72 65 70 6f 72 74 65 64 20 62 79 20 74 68 65 20 3c 73 65 65 20 .have.been.reported.by.the.<see.
15a40 63 72 65 66 3d 22 49 49 6e 70 75 74 52 75 6e 74 69 6d 65 22 3e 72 75 6e 74 69 6d 65 3c 2f 73 65 cref="IInputRuntime">runtime</se
15a60 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 62 75 74 20 63 6f 75 6c 64 20 6e 6f 74 20 62 65 e>..........///.but.could.not.be
15a80 20 6d 61 74 63 68 65 64 20 74 6f 20 61 6e 79 20 6b 6e 6f 77 6e 20 3c 73 65 65 20 63 72 65 66 3d .matched.to.any.known.<see.cref=
15aa0 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 6f 75 74 22 3e 6c 61 79 6f 75 74 3c 2f 73 65 65 "InputControlLayout">layout</see
15ac0 3e 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 >...........///.</summary>......
15ae0 20 20 20 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 41 20 6c 69 73 74 20 6f 66 20 64 65 73 63 72 ....///.<returns>A.list.of.descr
15b00 69 70 74 69 6f 6e 73 20 6f 66 20 64 65 76 69 63 65 73 20 74 68 61 74 20 63 6f 75 6c 64 20 6e 6f iptions.of.devices.that.could.no
15b20 74 20 62 65 20 72 65 63 6f 67 6e 69 7a 65 64 2e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 20 20 20 t.be.recognized.</returns>......
15b40 20 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 ....///.<remarks>..........///.I
15b60 66 20 6e 65 77 20 6c 61 79 6f 75 74 73 20 61 72 65 20 61 64 64 65 64 20 74 6f 20 74 68 65 20 73 f.new.layouts.are.added.to.the.s
15b80 79 73 74 65 6d 20 6f 72 20 69 66 20 61 64 64 69 74 69 6f 6e 61 6c 20 3c 73 65 65 20 63 72 65 66 ystem.or.if.additional.<see.cref
15ba0 3d 22 49 6e 70 75 74 44 65 76 69 63 65 4d 61 74 63 68 65 72 22 3e 6d 61 74 63 68 65 73 3c 2f 73 ="InputDeviceMatcher">matches</s
15bc0 65 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 61 72 65 20 61 64 64 65 64 20 74 6f 20 65 78 ee>..........///.are.added.to.ex
15be0 69 73 74 69 6e 67 20 6c 61 79 6f 75 74 73 2c 20 64 65 76 69 63 65 73 20 69 6e 20 74 68 69 73 20 isting.layouts,.devices.in.this.
15c00 6c 69 73 74 20 6d 61 79 20 61 70 70 65 61 72 20 6f 72 20 64 69 73 61 70 70 65 61 72 2e 0d 0a 20 list.may.appear.or.disappear....
15c20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f .......///.</remarks>........../
15c40 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 49 6e 70 75 74 44 65 76 69 63 65 4d 61 74 //.<seealso.cref="InputDeviceMat
15c60 63 68 65 72 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 cher"/>..........///.<seealso.cr
15c80 65 66 3d 22 52 65 67 69 73 74 65 72 4c 61 79 6f 75 74 4d 61 74 63 68 65 72 22 2f 3e 0d 0a 20 20 ef="RegisterLayoutMatcher"/>....
15ca0 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 4c 69 73 74 3c 49 6e 70 75 74 44 65 ......public.static.List<InputDe
15cc0 76 69 63 65 44 65 73 63 72 69 70 74 69 6f 6e 3e 20 47 65 74 55 6e 73 75 70 70 6f 72 74 65 64 44 viceDescription>.GetUnsupportedD
15ce0 65 76 69 63 65 73 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 evices()..........{.............
15d00 20 76 61 72 20 6c 69 73 74 20 3d 20 6e 65 77 20 4c 69 73 74 3c 49 6e 70 75 74 44 65 76 69 63 65 .var.list.=.new.List<InputDevice
15d20 44 65 73 63 72 69 70 74 69 6f 6e 3e 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 47 65 74 Description>();..............Get
15d40 55 6e 73 75 70 70 6f 72 74 65 64 44 65 76 69 63 65 73 28 6c 69 73 74 29 3b 0d 0a 20 20 20 20 20 UnsupportedDevices(list);.......
15d60 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 6c 69 73 74 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a .......return.list;..........}..
15d80 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 69 6e 74 20 47 65 74 55 ..........public.static.int.GetU
15da0 6e 73 75 70 70 6f 72 74 65 64 44 65 76 69 63 65 73 28 4c 69 73 74 3c 49 6e 70 75 74 44 65 76 69 nsupportedDevices(List<InputDevi
15dc0 63 65 44 65 73 63 72 69 70 74 69 6f 6e 3e 20 64 65 73 63 72 69 70 74 69 6f 6e 73 29 0d 0a 20 20 ceDescription>.descriptions)....
15de0 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 73 5f 4d 61 ......{..............return.s_Ma
15e00 6e 61 67 65 72 2e 47 65 74 55 6e 73 75 70 70 6f 72 74 65 64 44 65 76 69 63 65 73 28 64 65 73 63 nager.GetUnsupportedDevices(desc
15e20 72 69 70 74 69 6f 6e 73 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 riptions);..........}...........
15e40 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 28 52 65 2d .///.<summary>..........///.(Re-
15e60 29 65 6e 61 62 6c 65 20 74 68 65 20 67 69 76 65 6e 20 64 65 76 69 63 65 2e 0d 0a 20 20 20 20 20 )enable.the.given.device........
15e80 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c ...///.</summary>..........///.<
15ea0 70 61 72 61 6d 20 6e 61 6d 65 3d 22 64 65 76 69 63 65 22 3e 44 65 76 69 63 65 20 74 6f 20 65 6e param.name="device">Device.to.en
15ec0 61 62 6c 65 2e 20 49 66 20 61 6c 72 65 61 64 79 20 65 6e 61 62 6c 65 64 2c 20 74 68 65 20 6d 65 able..If.already.enabled,.the.me
15ee0 74 68 6f 64 20 77 69 6c 6c 20 64 6f 20 6e 6f 74 68 69 6e 67 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 thod.will.do.nothing.</param>...
15f00 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f .......///.<remarks>..........//
15f20 2f 20 54 68 69 73 20 63 61 6e 20 62 65 20 75 73 65 64 20 61 66 74 65 72 20 61 20 64 65 76 69 63 /.This.can.be.used.after.a.devic
15f40 65 20 68 61 73 20 62 65 65 6e 20 64 69 73 61 62 6c 65 64 20 77 69 74 68 20 3c 73 65 65 20 63 72 e.has.been.disabled.with.<see.cr
15f60 65 66 3d 22 44 69 73 61 62 6c 65 44 65 76 69 63 65 22 2f 3e 20 6f 72 0d 0a 20 20 20 20 20 20 20 ef="DisableDevice"/>.or.........
15f80 20 2f 2f 2f 20 77 69 74 68 20 64 65 76 69 63 65 73 20 74 68 61 74 20 73 74 61 72 74 20 6f 75 74 .///.with.devices.that.start.out
15fa0 20 69 6e 20 64 69 73 61 62 6c 65 64 20 73 74 61 74 65 20 28 75 73 75 61 6c 6c 79 20 74 68 65 20 .in.disabled.state.(usually.the.
15fc0 63 61 73 65 20 66 6f 72 20 61 6c 6c 20 3c 73 65 65 20 63 72 65 66 3d 22 53 65 6e 73 6f 72 22 2f case.for.all.<see.cref="Sensor"/
15fe0 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 64 65 76 69 63 65 73 29 2e 0d 0a 20 20 20 20 20 20 >..........///.devices).........
16000 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 57 68 65 6e 20 65 6e 61 62 6c 65 64 2c ..///..........///.When.enabled,
16020 20 61 20 64 65 76 69 63 65 20 77 69 6c 6c 20 72 65 63 65 69 76 65 20 69 6e 70 75 74 20 77 68 65 .a.device.will.receive.input.whe
16040 6e 20 61 76 61 69 6c 61 62 6c 65 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 n.available...........///.......
16060 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 2f 2f 2f 20 3c 63 ...///.<example>..........///.<c
16080 6f 64 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 2f 2f 20 45 6e 61 62 6c 65 20 74 68 65 20 ode>..........///.//.Enable.the.
160a0 67 79 72 6f 73 63 6f 70 65 2c 20 69 66 20 70 72 65 73 65 6e 74 2e 0d 0a 20 20 20 20 20 20 20 20 gyroscope,.if.present...........
160c0 2f 2f 2f 20 69 66 20 28 47 79 72 6f 73 63 6f 70 65 2e 63 75 72 72 65 6e 74 20 21 3d 20 6e 75 6c ///.if.(Gyroscope.current.!=.nul
160e0 6c 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 49 6e 70 75 74 53 79 73 74 65 6d 2e l)..........///.....InputSystem.
16100 45 6e 61 62 6c 65 44 65 76 69 63 65 28 47 79 72 6f 73 63 6f 70 65 2e 63 75 72 72 65 6e 74 29 3b EnableDevice(Gyroscope.current);
16120 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 2f ..........///.</code>........../
16140 2f 2f 20 3c 2f 65 78 61 6d 70 6c 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 6d //.</example>..........///.</rem
16160 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 arks>..........///.<seealso.cref
16180 3d 22 44 69 73 61 62 6c 65 44 65 76 69 63 65 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 ="DisableDevice"/>..........///.
161a0 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 49 6e 70 75 74 44 65 76 69 63 65 2e 65 6e 61 62 6c <seealso.cref="InputDevice.enabl
161c0 65 64 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 76 6f 69 ed"/>..........public.static.voi
161e0 64 20 45 6e 61 62 6c 65 44 65 76 69 63 65 28 49 6e 70 75 74 44 65 76 69 63 65 20 64 65 76 69 63 d.EnableDevice(InputDevice.devic
16200 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 5f 4d 61 6e e)..........{..............s_Man
16220 61 67 65 72 2e 45 6e 61 62 6c 65 4f 72 44 69 73 61 62 6c 65 44 65 76 69 63 65 28 64 65 76 69 63 ager.EnableOrDisableDevice(devic
16240 65 2c 20 74 72 75 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 e,.true);..........}............
16260 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 44 69 73 61 62 ///.<summary>..........///.Disab
16280 6c 65 20 74 68 65 20 67 69 76 65 6e 20 64 65 76 69 63 65 2c 20 69 2e 65 2e 20 22 6d 75 74 65 22 le.the.given.device,.i.e.."mute"
162a0 20 69 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 .it...........///.</summary>....
162c0 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 64 65 76 69 63 65 22 3e 44 ......///.<param.name="device">D
162e0 65 76 69 63 65 20 74 6f 20 64 69 73 61 62 6c 65 2e 20 49 66 20 61 6c 72 65 61 64 79 20 64 69 73 evice.to.disable..If.already.dis
16300 61 62 6c 65 64 2c 20 74 68 65 20 6d 65 74 68 6f 64 20 77 69 6c 6c 20 64 6f 20 6e 6f 74 68 69 6e abled,.the.method.will.do.nothin
16320 67 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 g.</param>..........///.<remarks
16340 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 41 20 64 69 73 61 62 6c 65 64 20 64 65 76 69 63 65 >..........///.A.disabled.device
16360 20 77 69 6c 6c 20 6e 6f 74 20 72 65 63 65 69 76 65 20 69 6e 70 75 74 20 61 6e 64 20 77 69 6c 6c .will.not.receive.input.and.will
16380 20 72 65 6d 61 69 6e 20 69 6e 20 69 74 73 20 64 65 66 61 75 6c 74 20 73 74 61 74 65 2e 20 49 74 .remain.in.its.default.state..It
163a0 20 77 69 6c 6c 20 72 65 6d 61 69 6e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 70 72 65 73 65 6e .will.remain..........///.presen
163c0 74 20 69 6e 20 74 68 65 20 73 79 73 74 65 6d 20 62 75 74 20 77 69 74 68 6f 75 74 20 61 63 74 75 t.in.the.system.but.without.actu
163e0 61 6c 6c 79 20 66 65 65 64 69 6e 67 20 69 6e 70 75 74 20 69 6e 74 6f 20 69 74 2e 0d 0a 20 20 20 ally.feeding.input.into.it......
16400 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 44 69 73 61 62 6c 69 6e 67 20 .....///..........///.Disabling.
16420 64 65 76 69 63 65 73 20 69 73 20 6d 6f 73 74 20 75 73 65 66 75 6c 20 66 6f 72 20 3c 73 65 65 20 devices.is.most.useful.for.<see.
16440 63 72 65 66 3d 22 53 65 6e 73 6f 72 22 2f 3e 20 64 65 76 69 63 65 73 20 6f 6e 20 62 61 74 74 65 cref="Sensor"/>.devices.on.batte
16460 72 79 2d 70 6f 77 65 72 65 64 20 70 6c 61 74 66 6f 72 6d 73 0d 0a 20 20 20 20 20 20 20 20 2f 2f ry-powered.platforms..........//
16480 2f 20 77 68 65 72 65 20 68 61 76 69 6e 67 20 61 20 73 65 6e 73 6f 72 20 65 6e 61 62 6c 65 64 20 /.where.having.a.sensor.enabled.
164a0 77 69 6c 6c 20 69 6e 63 72 65 61 73 65 20 65 6e 65 72 67 79 20 63 6f 6e 73 75 6d 70 74 69 6f 6e will.increase.energy.consumption
164c0 2e 20 53 65 6e 73 6f 72 73 20 77 69 6c 6c 20 75 73 75 61 6c 6c 79 20 73 74 61 72 74 0d 0a 20 20 ..Sensors.will.usually.start....
164e0 20 20 20 20 20 20 2f 2f 2f 20 6f 75 74 20 69 6e 20 64 69 73 61 62 6c 65 64 20 73 74 61 74 65 20 ......///.out.in.disabled.state.
16500 61 6e 64 20 63 61 6e 20 62 65 20 65 6e 61 62 6c 65 64 2c 20 77 68 65 6e 20 6e 65 65 64 65 64 2c and.can.be.enabled,.when.needed,
16520 20 77 69 74 68 20 3c 73 65 65 20 63 72 65 66 3d 22 45 6e 61 62 6c 65 44 65 76 69 63 65 22 2f 3e .with.<see.cref="EnableDevice"/>
16540 20 61 6e 64 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 64 69 73 61 62 6c 65 64 20 61 67 61 69 6e .and..........///.disabled.again
16560 20 77 74 68 20 74 68 69 73 20 6d 65 74 68 6f 64 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a .wth.this.method...........///..
16580 20 20 20 20 20 20 20 20 2f 2f 2f 20 48 6f 77 65 76 65 72 2c 20 64 69 73 61 62 6c 69 6e 67 20 61 ........///.However,.disabling.a
165a0 20 64 65 76 69 63 65 20 63 61 6e 20 62 65 20 75 73 65 66 75 6c 20 69 6e 20 6f 74 68 65 72 20 73 .device.can.be.useful.in.other.s
165c0 69 74 75 61 74 69 6f 6e 73 2c 20 74 6f 6f 2e 20 46 6f 72 20 65 78 61 6d 70 6c 65 2c 20 77 68 65 ituations,.too..For.example,.whe
165e0 6e 20 73 69 6d 75 6c 61 74 69 6e 67 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 69 6e 70 75 74 20 n.simulating..........///.input.
16600 28 73 61 79 2c 20 6d 6f 75 73 65 20 69 6e 70 75 74 29 20 6c 6f 63 61 6c 6c 79 20 66 72 6f 6d 20 (say,.mouse.input).locally.from.
16620 61 20 72 65 6d 6f 74 65 20 73 6f 75 72 63 65 2c 20 69 74 20 63 61 6e 20 62 65 20 64 65 73 69 72 a.remote.source,.it.can.be.desir
16640 61 62 6c 65 20 74 6f 20 74 75 72 6e 20 6f 66 66 20 74 68 65 20 72 65 73 70 65 63 74 69 76 65 0d able.to.turn.off.the.respective.
16660 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 6c 6f 63 61 6c 20 64 65 76 69 63 65 2e 0d 0a 20 20 20 20 .........///.local.device.......
16680 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 6f 20 72 65 6d 6f 76 65 20 61 ....///..........///.To.remove.a
166a0 20 64 65 76 69 63 65 20 61 6c 74 6f 67 65 74 68 65 72 2c 20 75 73 65 20 3c 73 65 65 20 63 72 65 .device.altogether,.use.<see.cre
166c0 66 3d 22 52 65 6d 6f 76 65 44 65 76 69 63 65 22 2f 3e 20 69 6e 73 74 65 61 64 2e 20 54 68 69 73 f="RemoveDevice"/>.instead..This
166e0 20 77 69 6c 6c 20 6e 6f 74 20 6f 6e 6c 79 20 73 69 6c 65 6e 63 65 0d 0a 20 20 20 20 20 20 20 20 .will.not.only.silence..........
16700 2f 2f 2f 20 69 6e 70 75 74 20 62 75 74 20 72 65 6d 6f 76 65 20 74 68 65 20 3c 73 65 65 20 63 72 ///.input.but.remove.the.<see.cr
16720 65 66 3d 22 49 6e 70 75 74 44 65 76 69 63 65 22 2f 3e 20 69 6e 73 74 61 6e 63 65 20 66 72 6f 6d ef="InputDevice"/>.instance.from
16740 20 74 68 65 20 73 79 73 74 65 6d 20 61 6c 74 6f 67 65 74 68 65 72 2e 0d 0a 20 20 20 20 20 20 20 .the.system.altogether..........
16760 20 2f 2f 2f 20 3c 2f 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 .///.</remarks>..........///.<se
16780 65 61 6c 73 6f 20 63 72 65 66 3d 22 45 6e 61 62 6c 65 44 65 76 69 63 65 22 2f 3e 0d 0a 20 20 20 ealso.cref="EnableDevice"/>.....
167a0 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 49 6e 70 75 74 44 65 76 .....///.<seealso.cref="InputDev
167c0 69 63 65 2e 65 6e 61 62 6c 65 64 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 ice.enabled"/>..........public.s
167e0 74 61 74 69 63 20 76 6f 69 64 20 44 69 73 61 62 6c 65 44 65 76 69 63 65 28 49 6e 70 75 74 44 65 tatic.void.DisableDevice(InputDe
16800 76 69 63 65 20 64 65 76 69 63 65 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 vice.device)..........{.........
16820 20 20 20 20 20 73 5f 4d 61 6e 61 67 65 72 2e 45 6e 61 62 6c 65 4f 72 44 69 73 61 62 6c 65 44 65 .....s_Manager.EnableOrDisableDe
16840 76 69 63 65 28 64 65 76 69 63 65 2c 20 66 61 6c 73 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d vice(device,.false);..........}.
16860 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 62 6f 6f 6c 20 54 72 ...........public.static.bool.Tr
16880 79 53 79 6e 63 44 65 76 69 63 65 28 49 6e 70 75 74 44 65 76 69 63 65 20 64 65 76 69 63 65 29 0d ySyncDevice(InputDevice.device).
168a0 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 64 65 76 69 .........{..............if.(devi
168c0 63 65 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 74 68 72 ce.==.null)..................thr
168e0 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 28 6e 61 6d ow.new.ArgumentNullException(nam
16900 65 6f 66 28 64 65 76 69 63 65 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 eof(device));................var
16920 20 73 79 6e 63 43 6f 6d 6d 61 6e 64 20 3d 20 52 65 71 75 65 73 74 53 79 6e 63 43 6f 6d 6d 61 6e .syncCommand.=.RequestSyncComman
16940 64 2e 43 72 65 61 74 65 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 72 65 73 d.Create();..............var.res
16960 75 6c 74 20 3d 20 64 65 76 69 63 65 2e 45 78 65 63 75 74 65 43 6f 6d 6d 61 6e 64 28 72 65 66 20 ult.=.device.ExecuteCommand(ref.
16980 73 79 6e 63 43 6f 6d 6d 61 6e 64 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 syncCommand);..............retur
169a0 6e 20 72 65 73 75 6c 74 20 3e 3d 20 30 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 n.result.>=.0;..........}.......
169c0 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 62 6f 6f 6c 20 54 72 79 52 65 73 65 74 .....public.static.bool.TryReset
169e0 44 65 76 69 63 65 28 49 6e 70 75 74 44 65 76 69 63 65 20 64 65 76 69 63 65 29 0d 0a 20 20 20 20 Device(InputDevice.device)......
16a00 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 64 65 76 69 63 65 20 3d 3d ....{..............if.(device.==
16a20 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 .null)..................throw.ne
16a40 77 20 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 28 6e 61 6d 65 6f 66 28 64 w.ArgumentNullException(nameof(d
16a60 65 76 69 63 65 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 64 65 76 evice));..............return.dev
16a80 69 63 65 2e 52 65 71 75 65 73 74 52 65 73 65 74 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a ice.RequestReset();..........}..
16aa0 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 2f 52 45 56 49 45 57 3a 20 73 68 6f 75 6c 64 20 74 68 65 ..........////REVIEW:.should.the
16ac0 72 65 20 62 65 20 61 20 67 6c 6f 62 61 6c 20 70 61 75 73 65 20 73 74 61 74 65 3f 20 77 68 61 74 re.be.a.global.pause.state?.what
16ae0 20 61 62 6f 75 74 20 68 61 70 74 69 63 73 20 74 68 61 74 20 61 72 65 20 69 73 73 75 65 64 20 2a .about.haptics.that.are.issued.*
16b00 77 68 69 6c 65 2a 20 70 61 75 73 65 64 3f 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 while*.paused?............///.<s
16b20 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 50 61 75 73 65 20 68 61 70 74 69 ummary>..........///.Pause.hapti
16b40 63 20 65 66 66 65 63 74 20 70 6c 61 79 62 61 63 6b 20 6f 6e 20 61 6c 6c 20 64 65 76 69 63 65 73 c.effect.playback.on.all.devices
16b60 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>.......
16b80 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 43 61 ...///.<remarks>..........///.Ca
16ba0 6c 6c 73 20 3c 73 65 65 20 63 72 65 66 3d 22 48 61 70 74 69 63 73 2e 49 48 61 70 74 69 63 73 2e lls.<see.cref="Haptics.IHaptics.
16bc0 50 61 75 73 65 48 61 70 74 69 63 73 22 2f 3e 20 6f 6e 20 61 6c 6c 20 3c 73 65 65 20 63 72 65 66 PauseHaptics"/>.on.all.<see.cref
16be0 3d 22 49 6e 70 75 74 44 65 76 69 63 65 22 3e 69 6e 70 75 74 20 64 65 76 69 63 65 73 3c 2f 73 65 ="InputDevice">input.devices</se
16c00 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 74 68 61 74 20 69 6d 70 6c 65 6d 65 6e 74 20 74 e>..........///.that.implement.t
16c20 68 65 20 69 6e 74 65 72 66 61 63 65 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 6d he.interface...........///.</rem
16c40 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 arks>..........///.<seealso.cref
16c60 3d 22 52 65 73 75 6d 65 48 61 70 74 69 63 73 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 ="ResumeHaptics"/>..........///.
16c80 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 52 65 73 65 74 48 61 70 74 69 63 73 22 2f 3e 0d 0a <seealso.cref="ResetHaptics"/>..
16ca0 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 2f ........///.<example>........../
16cc0 2f 2f 20 3c 63 6f 64 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 2f 2f 20 57 68 65 6e 20 67 //.<code>..........///.//.When.g
16ce0 6f 69 6e 67 20 69 6e 74 6f 20 74 68 65 20 6d 65 6e 75 20 66 72 6f 6d 20 67 61 6d 65 70 6c 61 79 oing.into.the.menu.from.gameplay
16d00 2c 20 70 61 75 73 65 20 68 61 70 74 69 63 73 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 67 61 ,.pause.haptics...........///.ga
16d20 6d 65 70 6c 61 79 43 6f 6e 74 72 6f 6c 73 2e 62 61 63 6b 41 63 74 69 6f 6e 2e 6f 6e 50 65 72 66 meplayControls.backAction.onPerf
16d40 6f 72 6d 65 64 20 2b 3d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 63 74 78 20 3d 3e ormed.+=..........///.....ctx.=>
16d60 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f ..........///.....{..........///
16d80 20 20 20 20 20 20 20 20 20 67 61 6d 65 70 6c 61 79 43 6f 6e 74 72 6f 6c 73 2e 44 69 73 61 62 6c .........gameplayControls.Disabl
16da0 65 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 6d 65 6e 75 43 6f e();..........///.........menuCo
16dc0 6e 74 72 6f 6c 73 2e 45 6e 61 62 6c 65 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 ntrols.Enable();..........///...
16de0 20 20 20 20 20 20 49 6e 70 75 74 53 79 73 74 65 6d 2e 50 61 75 73 65 48 61 70 74 69 63 73 28 29 ......InputSystem.PauseHaptics()
16e00 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 7d 3b 0d 0a 20 20 20 20 20 20 20 20 2f ;..........///.....};........../
16e20 2f 2f 20 3c 2f 63 6f 64 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 65 78 61 6d 70 6c //.</code>..........///.</exampl
16e40 65 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 76 6f 69 64 20 50 e>..........public.static.void.P
16e60 61 75 73 65 48 61 70 74 69 63 73 28 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 auseHaptics()..........{........
16e80 20 20 20 20 20 20 76 61 72 20 64 65 76 69 63 65 73 4c 69 73 74 20 3d 20 64 65 76 69 63 65 73 3b ......var.devicesList.=.devices;
16ea0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 64 65 76 69 63 65 73 43 6f 75 6e 74 20 3d ..............var.devicesCount.=
16ec0 20 64 65 76 69 63 65 73 4c 69 73 74 2e 43 6f 75 6e 74 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 .devicesList.Count;.............
16ee0 20 20 20 66 6f 72 20 28 76 61 72 20 69 20 3d 20 30 3b 20 69 20 3c 20 64 65 76 69 63 65 73 43 6f ...for.(var.i.=.0;.i.<.devicesCo
16f00 75 6e 74 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 unt;.++i)..............{........
16f20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 64 65 76 69 63 65 20 3d 20 64 65 76 69 63 65 73 4c 69 ..........var.device.=.devicesLi
16f40 73 74 5b 69 5d 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 64 65 76 69 st[i];..................if.(devi
16f60 63 65 20 69 73 20 49 48 61 70 74 69 63 73 20 68 61 70 74 69 63 73 29 0d 0a 20 20 20 20 20 20 20 ce.is.IHaptics.haptics).........
16f80 20 20 20 20 20 20 20 20 20 20 20 20 20 68 61 70 74 69 63 73 2e 50 61 75 73 65 48 61 70 74 69 63 .............haptics.PauseHaptic
16fa0 73 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 20 7d 0d 0a s();..............}..........}..
16fc0 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>.........
16fe0 20 2f 2f 2f 20 52 65 73 75 6d 65 20 68 61 70 74 69 63 20 65 66 66 65 63 74 20 70 6c 61 79 62 61 .///.Resume.haptic.effect.playba
17000 63 6b 20 6f 6e 20 61 6c 6c 20 64 65 76 69 63 65 73 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 ck.on.all.devices...........///.
17020 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 72 6b 73 </summary>..........///.<remarks
17040 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 43 61 6c 6c 73 20 3c 73 65 65 20 63 72 65 66 3d 22 >..........///.Calls.<see.cref="
17060 48 61 70 74 69 63 73 2e 49 48 61 70 74 69 63 73 2e 52 65 73 75 6d 65 48 61 70 74 69 63 73 22 2f Haptics.IHaptics.ResumeHaptics"/
17080 3e 20 6f 6e 20 61 6c 6c 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 44 65 76 69 63 65 22 >.on.all.<see.cref="InputDevice"
170a0 3e 69 6e 70 75 74 20 64 65 76 69 63 65 73 3c 2f 73 65 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f >input.devices</see>..........//
170c0 2f 20 74 68 61 74 20 69 6d 70 6c 65 6d 65 6e 74 20 74 68 65 20 69 6e 74 65 72 66 61 63 65 2e 0d /.that.implement.the.interface..
170e0 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 .........///.</remarks>.........
17100 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 50 61 75 73 65 48 61 70 74 69 63 73 .///.<seealso.cref="PauseHaptics
17120 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 76 6f 69 64 20 "/>..........public.static.void.
17140 52 65 73 75 6d 65 48 61 70 74 69 63 73 28 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 ResumeHaptics()..........{......
17160 20 20 20 20 20 20 20 20 76 61 72 20 64 65 76 69 63 65 73 4c 69 73 74 20 3d 20 64 65 76 69 63 65 ........var.devicesList.=.device
17180 73 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 64 65 76 69 63 65 73 43 6f 75 6e 74 s;..............var.devicesCount
171a0 20 3d 20 64 65 76 69 63 65 73 4c 69 73 74 2e 43 6f 75 6e 74 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 .=.devicesList.Count;...........
171c0 20 20 20 20 20 66 6f 72 20 28 76 61 72 20 69 20 3d 20 30 3b 20 69 20 3c 20 64 65 76 69 63 65 73 .....for.(var.i.=.0;.i.<.devices
171e0 43 6f 75 6e 74 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 Count;.++i)..............{......
17200 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 64 65 76 69 63 65 20 3d 20 64 65 76 69 63 65 73 ............var.device.=.devices
17220 4c 69 73 74 5b 69 5d 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 64 65 List[i];..................if.(de
17240 76 69 63 65 20 69 73 20 49 48 61 70 74 69 63 73 20 68 61 70 74 69 63 73 29 0d 0a 20 20 20 20 20 vice.is.IHaptics.haptics).......
17260 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 68 61 70 74 69 63 73 2e 52 65 73 75 6d 65 48 61 70 ...............haptics.ResumeHap
17280 74 69 63 73 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 20 tics();..............}..........
172a0 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>......
172c0 20 20 20 20 2f 2f 2f 20 53 74 6f 70 20 68 61 70 74 69 63 20 65 66 66 65 63 74 20 70 6c 61 79 62 ....///.Stop.haptic.effect.playb
172e0 61 63 6b 20 6f 6e 20 61 6c 6c 20 64 65 76 69 63 65 73 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f ack.on.all.devices...........///
17300 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 72 6b .</summary>..........///.<remark
17320 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 57 69 6c 6c 20 72 65 73 65 74 20 68 61 70 74 69 s>..........///.Will.reset.hapti
17340 63 73 20 65 66 66 65 63 74 73 20 6f 6e 20 61 6c 6c 20 64 65 76 69 63 65 73 20 74 6f 20 74 68 65 cs.effects.on.all.devices.to.the
17360 69 72 20 64 65 66 61 75 6c 74 20 73 74 61 74 65 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a ir.default.state...........///..
17380 20 20 20 20 20 20 20 20 2f 2f 2f 20 43 61 6c 6c 73 20 3c 73 65 65 20 63 72 65 66 3d 22 48 61 70 ........///.Calls.<see.cref="Hap
173a0 74 69 63 73 2e 49 48 61 70 74 69 63 73 2e 52 65 73 65 74 48 61 70 74 69 63 73 22 2f 3e 20 6f 6e tics.IHaptics.ResetHaptics"/>.on
173c0 20 61 6c 6c 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 44 65 76 69 63 65 22 3e 69 6e 70 .all.<see.cref="InputDevice">inp
173e0 75 74 20 64 65 76 69 63 65 73 3c 2f 73 65 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 74 68 ut.devices</see>..........///.th
17400 61 74 20 69 6d 70 6c 65 6d 65 6e 74 20 74 68 65 20 69 6e 74 65 72 66 61 63 65 2e 0d 0a 20 20 20 at.implement.the.interface......
17420 20 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 .....///.</remarks>..........pub
17440 6c 69 63 20 73 74 61 74 69 63 20 76 6f 69 64 20 52 65 73 65 74 48 61 70 74 69 63 73 28 29 0d 0a lic.static.void.ResetHaptics()..
17460 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 64 65 76 69 63 ........{..............var.devic
17480 65 73 4c 69 73 74 20 3d 20 64 65 76 69 63 65 73 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 esList.=.devices;..............v
174a0 61 72 20 64 65 76 69 63 65 73 43 6f 75 6e 74 20 3d 20 64 65 76 69 63 65 73 4c 69 73 74 2e 43 6f ar.devicesCount.=.devicesList.Co
174c0 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 76 61 72 20 69 20 3d unt;................for.(var.i.=
174e0 20 30 3b 20 69 20 3c 20 64 65 76 69 63 65 73 43 6f 75 6e 74 3b 20 2b 2b 69 29 0d 0a 20 20 20 20 .0;.i.<.devicesCount;.++i)......
17500 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 76 61 72 20 64 ........{..................var.d
17520 65 76 69 63 65 20 3d 20 64 65 76 69 63 65 73 4c 69 73 74 5b 69 5d 3b 0d 0a 20 20 20 20 20 20 20 evice.=.devicesList[i];.........
17540 20 20 20 20 20 20 20 20 20 69 66 20 28 64 65 76 69 63 65 20 69 73 20 49 48 61 70 74 69 63 73 20 .........if.(device.is.IHaptics.
17560 68 61 70 74 69 63 73 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 68 61 haptics)......................ha
17580 70 74 69 63 73 2e 52 65 73 65 74 48 61 70 74 69 63 73 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 ptics.ResetHaptics();...........
175a0 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 23 65 6e 64 72 ...}..........}............#endr
175c0 65 67 69 6f 6e 0d 0a 0d 0a 20 20 20 20 20 20 20 20 23 72 65 67 69 6f 6e 20 43 6f 6e 74 72 6f 6c egion............#region.Control
175e0 73 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 s............///.<summary>......
17600 20 20 20 20 2f 2f 2f 20 53 65 74 20 74 68 65 20 75 73 61 67 65 20 74 61 67 20 6f 66 20 74 68 65 ....///.Set.the.usage.tag.of.the
17620 20 67 69 76 65 6e 20 64 65 76 69 63 65 20 74 6f 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d .given.device.to.<paramref.name=
17640 22 75 73 61 67 65 22 2f 3e 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 "usage"/>...........///.</summar
17660 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 64 65 76 y>..........///.<param.name="dev
17680 69 63 65 22 3e 44 65 76 69 63 65 20 74 6f 20 73 65 74 20 74 68 65 20 75 73 61 67 65 20 6f 6e 2e ice">Device.to.set.the.usage.on.
176a0 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d </param>..........///.<param.nam
176c0 65 3d 22 75 73 61 67 65 22 3e 4e 65 77 20 75 73 61 67 65 20 66 6f 72 20 74 68 65 20 64 65 76 69 e="usage">New.usage.for.the.devi
176e0 63 65 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b ce.</param>..........///.<remark
17700 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 55 73 61 67 65 73 20 61 6c 6c 6f 77 20 74 6f 20 s>..........///.Usages.allow.to.
17720 22 74 61 67 22 20 61 20 73 70 65 63 69 66 69 63 20 64 65 76 69 63 65 20 73 75 63 68 20 74 68 61 "tag".a.specific.device.such.tha
17740 74 20 74 68 65 20 74 61 67 20 63 61 6e 20 74 68 65 6e 20 62 65 20 75 73 65 64 20 69 6e 20 6c 6f t.the.tag.can.then.be.used.in.lo
17760 6f 6b 75 70 73 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 61 6e 64 20 62 69 6e 64 69 6e 67 73 2e okups..........///.and.bindings.
17780 20 41 20 63 6f 6d 6d 6f 6e 20 75 73 65 20 69 73 20 66 6f 72 20 69 64 65 6e 74 69 66 79 69 6e 67 .A.common.use.is.for.identifying
177a0 20 74 68 65 20 68 61 6e 64 65 64 6e 65 73 73 20 6f 66 20 61 6e 20 3c 73 65 65 20 63 72 65 66 3d .the.handedness.of.an.<see.cref=
177c0 22 58 52 2e 58 52 43 6f 6e 74 72 6f 6c 6c 65 72 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f "XR.XRController"/>..........///
177e0 20 62 75 74 20 74 68 65 20 75 73 61 67 65 73 20 63 61 6e 20 62 65 20 61 72 62 69 74 72 61 72 79 .but.the.usages.can.be.arbitrary
17800 20 73 74 72 69 6e 67 73 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 .strings...........///..........
17820 2f 2f 2f 20 54 68 69 73 20 6d 65 74 68 6f 64 20 65 69 74 68 65 72 20 73 65 74 73 20 74 68 65 20 ///.This.method.either.sets.the.
17840 75 73 61 67 65 73 20 6f 66 20 74 68 65 20 64 65 76 69 63 65 20 74 6f 20 61 20 73 69 6e 67 6c 65 usages.of.the.device.to.a.single
17860 20 73 74 72 69 6e 67 20 28 6d 65 61 6e 69 6e 67 20 69 74 20 77 69 6c 6c 0d 0a 20 20 20 20 20 20 .string.(meaning.it.will........
17880 20 20 2f 2f 2f 20 63 6c 65 61 72 20 77 68 61 74 65 76 65 72 2c 20 69 66 20 61 6e 79 20 75 73 61 ..///.clear.whatever,.if.any.usa
178a0 67 65 73 2c 20 74 68 65 20 64 65 76 69 63 65 20 68 61 73 20 77 68 65 6e 20 74 68 65 20 6d 65 74 ges,.the.device.has.when.the.met
178c0 68 6f 64 20 69 73 20 63 61 6c 6c 65 64 29 20 6f 72 2c 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 hod.is.called).or,..........///.
178e0 69 66 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 75 73 61 67 65 22 2f 3e 20 69 73 20 6e if.<paramref.name="usage"/>.is.n
17900 75 6c 6c 20 6f 72 20 65 6d 70 74 79 2c 20 72 65 73 65 74 73 20 74 68 65 20 75 73 61 67 65 73 20 ull.or.empty,.resets.the.usages.
17920 6f 66 20 74 68 65 20 64 65 76 69 63 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 74 6f 20 62 65 of.the.device..........///.to.be
17940 20 65 6d 70 74 79 2e 20 54 6f 20 61 64 64 20 74 6f 20 61 20 64 65 76 69 63 65 27 73 20 73 65 74 .empty..To.add.to.a.device's.set
17960 20 6f 66 20 75 73 61 67 65 73 2c 20 63 61 6c 6c 20 3c 73 65 65 20 63 72 65 66 3d 22 41 64 64 44 .of.usages,.call.<see.cref="AddD
17980 65 76 69 63 65 55 73 61 67 65 28 49 6e 70 75 74 44 65 76 69 63 65 2c 73 74 72 69 6e 67 29 22 2f eviceUsage(InputDevice,string)"/
179a0 3e 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 6f 20 72 65 6d 6f 76 65 20 75 73 61 67 65 73 >...........///.To.remove.usages
179c0 20 66 72 6f 6d 20 61 20 64 65 76 69 63 65 2c 20 63 61 6c 6c 20 3c 73 65 65 20 63 72 65 66 3d 22 .from.a.device,.call.<see.cref="
179e0 52 65 6d 6f 76 65 44 65 76 69 63 65 55 73 61 67 65 28 49 6e 70 75 74 44 65 76 69 63 65 2c 73 74 RemoveDeviceUsage(InputDevice,st
17a00 72 69 6e 67 29 22 2f 3e 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 ring)"/>...........///..........
17a20 2f 2f 2f 20 54 68 65 20 73 65 74 20 6f 66 20 75 73 61 67 65 73 20 61 20 64 65 76 69 63 65 20 68 ///.The.set.of.usages.a.device.h
17a40 61 73 20 63 61 6e 20 62 65 20 71 75 65 72 69 65 64 20 77 69 74 68 20 3c 73 65 65 20 63 72 65 66 as.can.be.queried.with.<see.cref
17a60 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 2e 75 73 61 67 65 73 22 2f 3e 20 28 61 20 64 65 76 69 ="InputControl.usages"/>.(a.devi
17a80 63 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 69 73 20 61 6e 20 3c 73 65 65 20 63 72 65 66 3d ce..........///.is.an.<see.cref=
17aa0 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 22 2f 3e 20 61 6e 64 20 74 68 75 73 2c 20 6c 69 6b 65 20 "InputControl"/>.and.thus,.like.
17ac0 63 6f 6e 74 72 6f 6c 73 2c 20 68 61 73 20 61 6e 20 61 73 73 6f 63 69 61 74 65 64 20 73 65 74 20 controls,.has.an.associated.set.
17ae0 6f 66 20 75 73 61 67 65 73 29 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 of.usages)...........///........
17b00 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 2f 2f 2f 20 3c 63 6f ..///.<example>..........///.<co
17b20 64 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 2f 2f 20 54 61 67 20 61 20 67 61 6d 65 70 61 de>..........///.//.Tag.a.gamepa
17b40 64 20 74 6f 20 62 65 20 61 73 73 6f 63 69 61 74 65 64 20 77 69 74 68 20 70 6c 61 79 65 72 20 23 d.to.be.associated.with.player.#
17b60 31 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 6e 70 75 74 53 79 73 74 65 6d 2e 53 65 74 44 1...........///.InputSystem.SetD
17b80 65 76 69 63 65 55 73 61 67 65 28 6d 79 47 61 6d 65 70 61 64 2c 20 22 50 6c 61 79 65 72 31 22 29 eviceUsage(myGamepad,."Player1")
17ba0 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 2f 2f 20 43 ;..........///..........///.//.C
17bc0 72 65 61 74 65 20 61 6e 20 61 63 74 69 6f 6e 20 74 68 61 74 20 62 69 6e 64 73 20 74 6f 20 70 6c reate.an.action.that.binds.to.pl
17be0 61 79 65 72 20 23 31 27 73 20 67 61 6d 65 70 61 64 20 73 70 65 63 69 66 69 63 61 6c 6c 79 2e 0d ayer.#1's.gamepad.specifically..
17c00 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 76 61 72 20 61 63 74 69 6f 6e 20 3d 20 6e 65 77 20 49 6e .........///.var.action.=.new.In
17c20 70 75 74 41 63 74 69 6f 6e 28 62 69 6e 64 69 6e 67 3a 20 22 26 6c 74 3b 47 61 6d 65 70 61 64 26 putAction(binding:."&lt;Gamepad&
17c40 67 74 3b 7b 50 6c 61 79 65 72 31 7d 2f 62 75 74 74 6f 6e 53 6f 75 74 68 22 29 3b 0d 0a 20 20 20 gt;{Player1}/buttonSouth");.....
17c60 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 2f 2f 20 4d 6f 76 65 20 74 68 .....///..........///.//.Move.th
17c80 65 20 74 61 67 20 66 72 6f 6d 20 6f 6e 65 20 67 61 6d 65 70 61 64 20 74 6f 20 61 6e 6f 74 68 65 e.tag.from.one.gamepad.to.anothe
17ca0 72 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 6e 70 75 74 53 79 73 74 65 6d 2e 53 65 74 44 r...........///.InputSystem.SetD
17cc0 65 76 69 63 65 55 73 61 67 65 28 6d 79 47 61 6d 65 70 61 64 2c 20 6e 75 6c 6c 29 3b 20 2f 2f 20 eviceUsage(myGamepad,.null);.//.
17ce0 43 6c 65 61 72 73 20 75 73 61 67 65 73 20 6f 6e 20 27 6d 79 47 61 6d 65 70 61 64 27 2e 0d 0a 20 Clears.usages.on.'myGamepad'....
17d00 20 20 20 20 20 20 20 2f 2f 2f 20 49 6e 70 75 74 53 79 73 74 65 6d 2e 53 65 74 44 65 76 69 63 65 .......///.InputSystem.SetDevice
17d20 55 73 61 67 65 28 6f 74 68 65 72 47 61 6d 65 70 61 64 2c 20 22 50 6c 61 79 65 72 31 22 29 3b 0d Usage(otherGamepad,."Player1");.
17d40 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 2f 2f .........///.</code>..........//
17d60 2f 20 3c 2f 65 78 61 6d 70 6c 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 6d 61 /.</example>..........///.</rema
17d80 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f 6e 20 63 72 65 rks>..........///.<exception.cre
17da0 66 3d 22 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 22 3e 3c 70 61 72 61 6d f="ArgumentNullException"><param
17dc0 72 65 66 20 6e 61 6d 65 3d 22 64 65 76 69 63 65 22 2f 3e 20 69 73 20 6e 75 6c 6c 2e 3c 2f 65 78 ref.name="device"/>.is.null.</ex
17de0 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 ception>..........///.<seealso.c
17e00 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 2e 75 73 61 67 65 73 22 2f 3e 0d 0a 20 20 20 ref="InputControl.usages"/>.....
17e20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 41 64 64 44 65 76 69 63 .....///.<seealso.cref="AddDevic
17e40 65 55 73 61 67 65 28 49 6e 70 75 74 44 65 76 69 63 65 2c 73 74 72 69 6e 67 29 22 2f 3e 0d 0a 20 eUsage(InputDevice,string)"/>...
17e60 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 52 65 6d 6f 76 65 .......///.<seealso.cref="Remove
17e80 44 65 76 69 63 65 55 73 61 67 65 28 49 6e 70 75 74 44 65 76 69 63 65 2c 73 74 72 69 6e 67 29 22 DeviceUsage(InputDevice,string)"
17ea0 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 43 />..........///.<seealso.cref="C
17ec0 6f 6d 6d 6f 6e 55 73 61 67 65 73 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 ommonUsages"/>..........///.<see
17ee0 61 6c 73 6f 20 63 72 65 66 3d 22 49 6e 70 75 74 44 65 76 69 63 65 43 68 61 6e 67 65 2e 55 73 61 also.cref="InputDeviceChange.Usa
17f00 67 65 43 68 61 6e 67 65 64 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 geChanged"/>..........public.sta
17f20 74 69 63 20 76 6f 69 64 20 53 65 74 44 65 76 69 63 65 55 73 61 67 65 28 49 6e 70 75 74 44 65 76 tic.void.SetDeviceUsage(InputDev
17f40 69 63 65 20 64 65 76 69 63 65 2c 20 73 74 72 69 6e 67 20 75 73 61 67 65 29 0d 0a 20 20 20 20 20 ice.device,.string.usage).......
17f60 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 53 65 74 44 65 76 69 63 65 55 73 61 67 65 ...{..............SetDeviceUsage
17f80 28 64 65 76 69 63 65 2c 20 6e 65 77 20 49 6e 74 65 72 6e 65 64 53 74 72 69 6e 67 28 75 73 61 67 (device,.new.InternedString(usag
17fa0 65 29 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 e));..........}............///.<
17fc0 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 20 74 68 65 20 75 73 summary>..........///.Set.the.us
17fe0 61 67 65 20 74 61 67 20 6f 66 20 74 68 65 20 67 69 76 65 6e 20 64 65 76 69 63 65 20 74 6f 20 3c age.tag.of.the.given.device.to.<
18000 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 75 73 61 67 65 22 2f 3e 2e 0d 0a 20 20 20 20 20 20 paramref.name="usage"/>.........
18020 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
18040 61 72 61 6d 20 6e 61 6d 65 3d 22 64 65 76 69 63 65 22 3e 44 65 76 69 63 65 20 74 6f 20 73 65 74 aram.name="device">Device.to.set
18060 20 74 68 65 20 75 73 61 67 65 20 6f 6e 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 .the.usage.on.</param>..........
18080 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 75 73 61 67 65 22 3e 4e 65 77 20 75 73 61 67 ///.<param.name="usage">New.usag
180a0 65 20 66 6f 72 20 74 68 65 20 64 65 76 69 63 65 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 e.for.the.device.</param>.......
180c0 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 55 73 ...///.<remarks>..........///.Us
180e0 61 67 65 73 20 61 6c 6c 6f 77 20 74 6f 20 22 74 61 67 22 20 61 20 73 70 65 63 69 66 69 63 20 64 ages.allow.to."tag".a.specific.d
18100 65 76 69 63 65 20 73 75 63 68 20 74 68 61 74 20 74 68 65 20 74 61 67 20 63 61 6e 20 74 68 65 6e evice.such.that.the.tag.can.then
18120 20 62 65 20 75 73 65 64 20 69 6e 20 6c 6f 6f 6b 75 70 73 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f .be.used.in.lookups..........///
18140 20 61 6e 64 20 62 69 6e 64 69 6e 67 73 2e 20 41 20 63 6f 6d 6d 6f 6e 20 75 73 65 20 69 73 20 66 .and.bindings..A.common.use.is.f
18160 6f 72 20 69 64 65 6e 74 69 66 79 69 6e 67 20 74 68 65 20 68 61 6e 64 65 64 6e 65 73 73 20 6f 66 or.identifying.the.handedness.of
18180 20 61 6e 20 3c 73 65 65 20 63 72 65 66 3d 22 58 52 2e 58 52 43 6f 6e 74 72 6f 6c 6c 65 72 22 2f .an.<see.cref="XR.XRController"/
181a0 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 62 75 74 20 74 68 65 20 75 73 61 67 65 73 20 63 61 >..........///.but.the.usages.ca
181c0 6e 20 62 65 20 61 72 62 69 74 72 61 72 79 20 73 74 72 69 6e 67 73 2e 0d 0a 20 20 20 20 20 20 20 n.be.arbitrary.strings..........
181e0 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 68 69 73 20 6d 65 74 68 6f 64 20 65 69 .///..........///.This.method.ei
18200 74 68 65 72 20 73 65 74 73 20 74 68 65 20 75 73 61 67 65 73 20 6f 66 20 74 68 65 20 64 65 76 69 ther.sets.the.usages.of.the.devi
18220 63 65 20 74 6f 20 61 20 73 69 6e 67 6c 65 20 73 74 72 69 6e 67 20 28 6d 65 61 6e 69 6e 67 20 69 ce.to.a.single.string.(meaning.i
18240 74 20 77 69 6c 6c 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 63 6c 65 61 72 20 77 68 61 74 65 76 t.will..........///.clear.whatev
18260 65 72 2c 20 69 66 20 61 6e 79 20 75 73 61 67 65 73 2c 20 74 68 65 20 64 65 76 69 63 65 20 68 61 er,.if.any.usages,.the.device.ha
18280 73 20 77 68 65 6e 20 74 68 65 20 6d 65 74 68 6f 64 20 69 73 20 63 61 6c 6c 65 64 29 20 6f 72 2c s.when.the.method.is.called).or,
182a0 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 69 66 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d ..........///.if.<paramref.name=
182c0 22 75 73 61 67 65 22 2f 3e 20 69 73 20 6e 75 6c 6c 20 6f 72 20 65 6d 70 74 79 2c 20 72 65 73 65 "usage"/>.is.null.or.empty,.rese
182e0 74 73 20 74 68 65 20 75 73 61 67 65 73 20 6f 66 20 74 68 65 20 64 65 76 69 63 65 0d 0a 20 20 20 ts.the.usages.of.the.device.....
18300 20 20 20 20 20 2f 2f 2f 20 74 6f 20 62 65 20 65 6d 70 74 79 2e 20 54 6f 20 61 64 64 20 74 6f 20 .....///.to.be.empty..To.add.to.
18320 61 20 64 65 76 69 63 65 27 73 20 73 65 74 20 6f 66 20 75 73 61 67 65 73 2c 20 63 61 6c 6c 20 3c a.device's.set.of.usages,.call.<
18340 73 65 65 20 63 72 65 66 3d 22 41 64 64 44 65 76 69 63 65 55 73 61 67 65 28 49 6e 70 75 74 44 65 see.cref="AddDeviceUsage(InputDe
18360 76 69 63 65 2c 49 6e 74 65 72 6e 65 64 53 74 72 69 6e 67 29 22 2f 3e 2e 0d 0a 20 20 20 20 20 20 vice,InternedString)"/>.........
18380 20 20 2f 2f 2f 20 54 6f 20 72 65 6d 6f 76 65 20 75 73 61 67 65 73 20 66 72 6f 6d 20 61 20 64 65 ..///.To.remove.usages.from.a.de
183a0 76 69 63 65 2c 20 63 61 6c 6c 20 3c 73 65 65 20 63 72 65 66 3d 22 52 65 6d 6f 76 65 44 65 76 69 vice,.call.<see.cref="RemoveDevi
183c0 63 65 55 73 61 67 65 28 49 6e 70 75 74 44 65 76 69 63 65 2c 49 6e 74 65 72 6e 65 64 53 74 72 69 ceUsage(InputDevice,InternedStri
183e0 6e 67 29 22 2f 3e 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f ng)"/>...........///..........//
18400 2f 20 54 68 65 20 73 65 74 20 6f 66 20 75 73 61 67 65 73 20 61 20 64 65 76 69 63 65 20 68 61 73 /.The.set.of.usages.a.device.has
18420 20 63 61 6e 20 62 65 20 71 75 65 72 69 65 64 20 77 69 74 68 20 3c 73 65 65 20 63 72 65 66 3d 22 .can.be.queried.with.<see.cref="
18440 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 2e 75 73 61 67 65 73 22 2f 3e 20 28 61 20 64 65 76 69 63 65 InputControl.usages"/>.(a.device
18460 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 69 73 20 61 6e 20 3c 73 65 65 20 63 72 65 66 3d 22 49 ..........///.is.an.<see.cref="I
18480 6e 70 75 74 43 6f 6e 74 72 6f 6c 22 2f 3e 20 61 6e 64 20 74 68 75 73 2c 20 6c 69 6b 65 20 63 6f nputControl"/>.and.thus,.like.co
184a0 6e 74 72 6f 6c 73 2c 20 68 61 73 20 61 6e 20 61 73 73 6f 63 69 61 74 65 64 20 73 65 74 20 6f 66 ntrols,.has.an.associated.set.of
184c0 20 75 73 61 67 65 73 29 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 .usages)...........///..........
184e0 2f 2f 2f 20 49 66 20 74 68 65 20 73 65 74 20 6f 66 20 75 73 61 67 65 73 20 6f 6e 20 74 68 65 20 ///.If.the.set.of.usages.on.the.
18500 64 65 76 69 63 65 20 63 68 61 6e 67 65 73 20 61 73 20 61 20 72 65 73 75 6c 74 20 6f 66 20 63 61 device.changes.as.a.result.of.ca
18520 6c 6c 69 6e 67 20 74 68 69 73 20 6d 65 74 68 6f 64 2c 20 3c 73 65 65 20 63 72 65 66 3d 22 6f 6e lling.this.method,.<see.cref="on
18540 44 65 76 69 63 65 43 68 61 6e 67 65 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 77 69 6c DeviceChange"/>..........///.wil
18560 6c 20 62 65 20 74 72 69 67 67 65 72 65 64 20 77 69 74 68 20 3c 73 65 65 20 63 72 65 66 3d 22 49 l.be.triggered.with.<see.cref="I
18580 6e 70 75 74 44 65 76 69 63 65 43 68 61 6e 67 65 2e 55 73 61 67 65 43 68 61 6e 67 65 64 22 2f 3e nputDeviceChange.UsageChanged"/>
185a0 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 61 ...........///..........///.<exa
185c0 6d 70 6c 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 63 6f 64 65 3e 0d 0a 20 20 20 20 20 mple>..........///.<code>.......
185e0 20 20 20 2f 2f 2f 20 2f 2f 20 54 61 67 20 61 20 67 61 6d 65 70 61 64 20 74 6f 20 62 65 20 61 73 ...///.//.Tag.a.gamepad.to.be.as
18600 73 6f 63 69 61 74 65 64 20 77 69 74 68 20 70 6c 61 79 65 72 20 23 31 2e 0d 0a 20 20 20 20 20 20 sociated.with.player.#1.........
18620 20 20 2f 2f 2f 20 49 6e 70 75 74 53 79 73 74 65 6d 2e 53 65 74 44 65 76 69 63 65 55 73 61 67 65 ..///.InputSystem.SetDeviceUsage
18640 28 6d 79 47 61 6d 65 70 61 64 2c 20 6e 65 77 20 49 6e 74 65 72 6e 65 64 53 74 72 69 6e 67 28 22 (myGamepad,.new.InternedString("
18660 50 6c 61 79 65 72 31 22 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 Player1"));..........///........
18680 20 20 2f 2f 2f 20 2f 2f 20 43 72 65 61 74 65 20 61 6e 20 61 63 74 69 6f 6e 20 74 68 61 74 20 62 ..///.//.Create.an.action.that.b
186a0 69 6e 64 73 20 74 6f 20 70 6c 61 79 65 72 20 23 31 27 73 20 67 61 6d 65 70 61 64 20 73 70 65 63 inds.to.player.#1's.gamepad.spec
186c0 69 66 69 63 61 6c 6c 79 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 76 61 72 20 61 63 74 69 6f ifically...........///.var.actio
186e0 6e 20 3d 20 6e 65 77 20 49 6e 70 75 74 41 63 74 69 6f 6e 28 62 69 6e 64 69 6e 67 3a 20 22 26 6c n.=.new.InputAction(binding:."&l
18700 74 3b 47 61 6d 65 70 61 64 26 67 74 3b 7b 50 6c 61 79 65 72 31 7d 2f 62 75 74 74 6f 6e 53 6f 75 t;Gamepad&gt;{Player1}/buttonSou
18720 74 68 22 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 th");..........///..........///.
18740 2f 2f 20 4d 6f 76 65 20 74 68 65 20 74 61 67 20 66 72 6f 6d 20 6f 6e 65 20 67 61 6d 65 70 61 64 //.Move.the.tag.from.one.gamepad
18760 20 74 6f 20 61 6e 6f 74 68 65 72 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 6e 70 75 74 53 .to.another...........///.InputS
18780 79 73 74 65 6d 2e 53 65 74 44 65 76 69 63 65 55 73 61 67 65 28 6d 79 47 61 6d 65 70 61 64 2c 20 ystem.SetDeviceUsage(myGamepad,.
187a0 6e 75 6c 6c 29 3b 20 2f 2f 20 43 6c 65 61 72 73 20 75 73 61 67 65 73 20 6f 6e 20 27 6d 79 47 61 null);.//.Clears.usages.on.'myGa
187c0 6d 65 70 61 64 27 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 6e 70 75 74 53 79 73 74 65 6d mepad'...........///.InputSystem
187e0 2e 53 65 74 44 65 76 69 63 65 55 73 61 67 65 28 6f 74 68 65 72 47 61 6d 65 70 61 64 2c 20 6e 65 .SetDeviceUsage(otherGamepad,.ne
18800 77 20 49 6e 74 65 72 6e 65 64 53 74 72 69 6e 67 28 22 50 6c 61 79 65 72 31 22 29 29 3b 0d 0a 20 w.InternedString("Player1"));...
18820 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 2f 2f 2f 20 .......///.</code>..........///.
18840 3c 2f 65 78 61 6d 70 6c 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 6d 61 72 6b </example>..........///.</remark
18860 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f 6e 20 63 72 65 66 3d s>..........///.<exception.cref=
18880 22 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 22 3e 3c 70 61 72 61 6d 72 65 "ArgumentNullException"><paramre
188a0 66 20 6e 61 6d 65 3d 22 64 65 76 69 63 65 22 2f 3e 20 69 73 20 6e 75 6c 6c 2e 3c 2f 65 78 63 65 f.name="device"/>.is.null.</exce
188c0 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 ption>..........///.<seealso.cre
188e0 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 2e 75 73 61 67 65 73 22 2f 3e 0d 0a 20 20 20 20 20 f="InputControl.usages"/>.......
18900 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 41 64 64 44 65 76 69 63 65 55 ...///.<seealso.cref="AddDeviceU
18920 73 61 67 65 28 49 6e 70 75 74 44 65 76 69 63 65 2c 49 6e 74 65 72 6e 65 64 53 74 72 69 6e 67 29 sage(InputDevice,InternedString)
18940 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 "/>..........///.<seealso.cref="
18960 52 65 6d 6f 76 65 44 65 76 69 63 65 55 73 61 67 65 28 49 6e 70 75 74 44 65 76 69 63 65 2c 49 6e RemoveDeviceUsage(InputDevice,In
18980 74 65 72 6e 65 64 53 74 72 69 6e 67 29 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 ternedString)"/>..........///.<s
189a0 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 43 6f 6d 6d 6f 6e 55 73 61 67 65 73 22 2f 3e 0d 0a 20 20 eealso.cref="CommonUsages"/>....
189c0 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 49 6e 70 75 74 44 65 ......///.<seealso.cref="InputDe
189e0 76 69 63 65 43 68 61 6e 67 65 2e 55 73 61 67 65 43 68 61 6e 67 65 64 22 2f 3e 0d 0a 20 20 20 20 viceChange.UsageChanged"/>......
18a00 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 76 6f 69 64 20 53 65 74 44 65 76 69 63 65 ....public.static.void.SetDevice
18a20 55 73 61 67 65 28 49 6e 70 75 74 44 65 76 69 63 65 20 64 65 76 69 63 65 2c 20 49 6e 74 65 72 6e Usage(InputDevice.device,.Intern
18a40 65 64 53 74 72 69 6e 67 20 75 73 61 67 65 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 edString.usage)..........{......
18a60 20 20 20 20 20 20 20 20 73 5f 4d 61 6e 61 67 65 72 2e 53 65 74 44 65 76 69 63 65 55 73 61 67 65 ........s_Manager.SetDeviceUsage
18a80 28 64 65 76 69 63 65 2c 20 75 73 61 67 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 (device,.usage);..........}.....
18aa0 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>..........//
18ac0 2f 20 41 64 64 20 61 20 75 73 61 67 65 20 74 61 67 20 74 6f 20 74 68 65 20 67 69 76 65 6e 20 64 /.Add.a.usage.tag.to.the.given.d
18ae0 65 76 69 63 65 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a evice...........///.</summary>..
18b00 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 64 65 76 69 63 65 22 ........///.<param.name="device"
18b20 3e 44 65 76 69 63 65 20 74 6f 20 61 64 64 20 74 68 65 20 75 73 61 67 65 20 74 6f 2e 3c 2f 70 61 >Device.to.add.the.usage.to.</pa
18b40 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 75 ram>..........///.<param.name="u
18b60 73 61 67 65 22 3e 4e 65 77 20 75 73 61 67 65 20 74 6f 20 61 64 64 20 74 6f 20 74 68 65 20 64 65 sage">New.usage.to.add.to.the.de
18b80 76 69 63 65 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 vice.</param>..........///.<rema
18ba0 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 55 73 61 67 65 73 20 61 6c 6c 6f 77 20 74 rks>..........///.Usages.allow.t
18bc0 6f 20 22 74 61 67 22 20 61 20 73 70 65 63 69 66 69 63 20 64 65 76 69 63 65 20 73 75 63 68 20 74 o."tag".a.specific.device.such.t
18be0 68 61 74 20 74 68 65 20 74 61 67 20 63 61 6e 20 74 68 65 6e 20 62 65 20 75 73 65 64 20 69 6e 20 hat.the.tag.can.then.be.used.in.
18c00 6c 6f 6f 6b 75 70 73 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 61 6e 64 20 62 69 6e 64 69 6e 67 lookups..........///.and.binding
18c20 73 2e 20 41 20 63 6f 6d 6d 6f 6e 20 75 73 65 20 69 73 20 66 6f 72 20 69 64 65 6e 74 69 66 79 69 s..A.common.use.is.for.identifyi
18c40 6e 67 20 74 68 65 20 68 61 6e 64 65 64 6e 65 73 73 20 6f 66 20 61 6e 20 3c 73 65 65 20 63 72 65 ng.the.handedness.of.an.<see.cre
18c60 66 3d 22 58 52 2e 58 52 43 6f 6e 74 72 6f 6c 6c 65 72 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f f="XR.XRController"/>........../
18c80 2f 2f 20 62 75 74 20 74 68 65 20 75 73 61 67 65 73 20 63 61 6e 20 62 65 20 61 72 62 69 74 72 61 //.but.the.usages.can.be.arbitra
18ca0 72 79 20 73 74 72 69 6e 67 73 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 ry.strings...........///........
18cc0 20 20 2f 2f 2f 20 54 68 69 73 20 6d 65 74 68 6f 64 20 61 64 64 73 20 61 20 6e 65 77 20 75 73 61 ..///.This.method.adds.a.new.usa
18ce0 67 65 20 74 6f 20 74 68 65 20 64 65 76 69 63 65 27 73 20 73 65 74 20 6f 66 20 75 73 61 67 65 73 ge.to.the.device's.set.of.usages
18d00 2e 20 49 66 20 74 68 65 20 64 65 76 69 63 65 20 61 6c 72 65 61 64 79 20 68 61 73 0d 0a 20 20 20 ..If.the.device.already.has.....
18d20 20 20 20 20 20 2f 2f 2f 20 74 68 65 20 67 69 76 65 6e 20 75 73 61 67 65 2c 20 74 68 65 20 6d 65 .....///.the.given.usage,.the.me
18d40 74 68 6f 64 20 64 6f 65 73 20 6e 6f 74 68 69 6e 67 2e 20 54 6f 20 69 6e 73 74 65 61 64 20 73 65 thod.does.nothing..To.instead.se
18d60 74 20 74 68 65 20 64 65 76 69 63 65 27 73 20 75 73 61 67 65 73 20 74 6f 20 61 20 73 69 6e 67 6c t.the.device's.usages.to.a.singl
18d80 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 6f 6e 65 2c 20 75 73 65 20 3c 73 65 65 20 63 72 65 e..........///.one,.use.<see.cre
18da0 66 3d 22 53 65 74 44 65 76 69 63 65 55 73 61 67 65 28 49 6e 70 75 74 44 65 76 69 63 65 2c 73 74 f="SetDeviceUsage(InputDevice,st
18dc0 72 69 6e 67 29 22 2f 3e 2e 20 54 6f 20 72 65 6d 6f 76 65 20 75 73 61 67 65 73 20 66 72 6f 6d 20 ring)"/>..To.remove.usages.from.
18de0 61 20 64 65 76 69 63 65 2c 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 63 61 6c 6c 20 3c 73 65 65 a.device,..........///.call.<see
18e00 20 63 72 65 66 3d 22 52 65 6d 6f 76 65 44 65 76 69 63 65 55 73 61 67 65 28 49 6e 70 75 74 44 65 .cref="RemoveDeviceUsage(InputDe
18e20 76 69 63 65 2c 73 74 72 69 6e 67 29 22 2f 3e 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 vice,string)"/>...........///...
18e40 20 20 20 20 20 20 20 2f 2f 2f 20 54 68 65 20 73 65 74 20 6f 66 20 75 73 61 67 65 73 20 61 20 64 .......///.The.set.of.usages.a.d
18e60 65 76 69 63 65 20 68 61 73 20 63 61 6e 20 62 65 20 71 75 65 72 69 65 64 20 77 69 74 68 20 3c 73 evice.has.can.be.queried.with.<s
18e80 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 2e 75 73 61 67 65 73 22 2f 3e 20 ee.cref="InputControl.usages"/>.
18ea0 28 61 20 64 65 76 69 63 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 69 73 20 61 6e 20 3c 73 65 (a.device..........///.is.an.<se
18ec0 65 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 22 2f 3e 20 61 6e 64 20 74 68 75 73 e.cref="InputControl"/>.and.thus
18ee0 2c 20 6c 69 6b 65 20 63 6f 6e 74 72 6f 6c 73 2c 20 68 61 73 20 61 6e 20 61 73 73 6f 63 69 61 74 ,.like.controls,.has.an.associat
18f00 65 64 20 73 65 74 20 6f 66 20 75 73 61 67 65 73 29 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d ed.set.of.usages)...........///.
18f20 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 66 20 74 68 65 20 73 65 74 20 6f 66 20 75 73 61 67 65 .........///.If.the.set.of.usage
18f40 73 20 6f 6e 20 74 68 65 20 64 65 76 69 63 65 20 63 68 61 6e 67 65 73 20 61 73 20 61 20 72 65 73 s.on.the.device.changes.as.a.res
18f60 75 6c 74 20 6f 66 20 63 61 6c 6c 69 6e 67 20 74 68 69 73 20 6d 65 74 68 6f 64 2c 20 3c 73 65 65 ult.of.calling.this.method,.<see
18f80 20 63 72 65 66 3d 22 6f 6e 44 65 76 69 63 65 43 68 61 6e 67 65 22 2f 3e 0d 0a 20 20 20 20 20 20 .cref="onDeviceChange"/>........
18fa0 20 20 2f 2f 2f 20 77 69 6c 6c 20 62 65 20 74 72 69 67 67 65 72 65 64 20 77 69 74 68 20 3c 73 65 ..///.will.be.triggered.with.<se
18fc0 65 20 63 72 65 66 3d 22 49 6e 70 75 74 44 65 76 69 63 65 43 68 61 6e 67 65 2e 55 73 61 67 65 43 e.cref="InputDeviceChange.UsageC
18fe0 68 61 6e 67 65 64 22 2f 3e 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 6d 61 72 6b hanged"/>...........///.</remark
19000 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f 6e 20 63 72 65 66 3d s>..........///.<exception.cref=
19020 22 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 22 3e 3c 70 61 72 61 6d 72 65 "ArgumentNullException"><paramre
19040 66 20 6e 61 6d 65 3d 22 64 65 76 69 63 65 22 2f 3e 20 69 73 20 6e 75 6c 6c 2e 3c 2f 65 78 63 65 f.name="device"/>.is.null.</exce
19060 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f 6e 20 63 ption>..........///.<exception.c
19080 72 65 66 3d 22 41 72 67 75 6d 65 6e 74 45 78 63 65 70 74 69 6f 6e 22 3e 3c 70 61 72 61 6d 72 65 ref="ArgumentException"><paramre
190a0 66 20 6e 61 6d 65 3d 22 75 73 61 67 65 22 2f 3e 20 69 73 20 6e 75 6c 6c 20 6f 72 20 65 6d 70 74 f.name="usage"/>.is.null.or.empt
190c0 79 2e 3c 2f 65 78 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 y.</exception>..........///.<see
190e0 61 6c 73 6f 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 2e 75 73 61 67 65 73 22 2f also.cref="InputControl.usages"/
19100 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 53 65 >..........///.<seealso.cref="Se
19120 74 44 65 76 69 63 65 55 73 61 67 65 28 49 6e 70 75 74 44 65 76 69 63 65 2c 73 74 72 69 6e 67 29 tDeviceUsage(InputDevice,string)
19140 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 "/>..........///.<seealso.cref="
19160 52 65 6d 6f 76 65 44 65 76 69 63 65 55 73 61 67 65 28 49 6e 70 75 74 44 65 76 69 63 65 2c 73 74 RemoveDeviceUsage(InputDevice,st
19180 72 69 6e 67 29 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 ring)"/>..........///.<seealso.c
191a0 72 65 66 3d 22 43 6f 6d 6d 6f 6e 55 73 61 67 65 73 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f ref="CommonUsages"/>..........//
191c0 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 49 6e 70 75 74 44 65 76 69 63 65 43 68 61 6e /.<seealso.cref="InputDeviceChan
191e0 67 65 2e 55 73 61 67 65 43 68 61 6e 67 65 64 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c ge.UsageChanged"/>..........publ
19200 69 63 20 73 74 61 74 69 63 20 76 6f 69 64 20 41 64 64 44 65 76 69 63 65 55 73 61 67 65 28 49 6e ic.static.void.AddDeviceUsage(In
19220 70 75 74 44 65 76 69 63 65 20 64 65 76 69 63 65 2c 20 73 74 72 69 6e 67 20 75 73 61 67 65 29 0d putDevice.device,.string.usage).
19240 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 5f 4d 61 6e 61 67 65 .........{..............s_Manage
19260 72 2e 41 64 64 44 65 76 69 63 65 55 73 61 67 65 28 64 65 76 69 63 65 2c 20 6e 65 77 20 49 6e 74 r.AddDeviceUsage(device,.new.Int
19280 65 72 6e 65 64 53 74 72 69 6e 67 28 75 73 61 67 65 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d ernedString(usage));..........}.
192a0 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>........
192c0 20 20 2f 2f 2f 20 41 64 64 20 61 20 75 73 61 67 65 20 74 61 67 20 74 6f 20 74 68 65 20 67 69 76 ..///.Add.a.usage.tag.to.the.giv
192e0 65 6e 20 64 65 76 69 63 65 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 en.device...........///.</summar
19300 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 64 65 76 y>..........///.<param.name="dev
19320 69 63 65 22 3e 44 65 76 69 63 65 20 74 6f 20 61 64 64 20 74 68 65 20 75 73 61 67 65 20 74 6f 2e ice">Device.to.add.the.usage.to.
19340 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d </param>..........///.<param.nam
19360 65 3d 22 75 73 61 67 65 22 3e 4e 65 77 20 75 73 61 67 65 20 74 6f 20 61 64 64 20 74 6f 20 74 68 e="usage">New.usage.to.add.to.th
19380 65 20 64 65 76 69 63 65 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c e.device.</param>..........///.<
193a0 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 55 73 61 67 65 73 20 61 6c 6c remarks>..........///.Usages.all
193c0 6f 77 20 74 6f 20 22 74 61 67 22 20 61 20 73 70 65 63 69 66 69 63 20 64 65 76 69 63 65 20 73 75 ow.to."tag".a.specific.device.su
193e0 63 68 20 74 68 61 74 20 74 68 65 20 74 61 67 20 63 61 6e 20 74 68 65 6e 20 62 65 20 75 73 65 64 ch.that.the.tag.can.then.be.used
19400 20 69 6e 20 6c 6f 6f 6b 75 70 73 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 61 6e 64 20 62 69 6e .in.lookups..........///.and.bin
19420 64 69 6e 67 73 2e 20 41 20 63 6f 6d 6d 6f 6e 20 75 73 65 20 69 73 20 66 6f 72 20 69 64 65 6e 74 dings..A.common.use.is.for.ident
19440 69 66 79 69 6e 67 20 74 68 65 20 68 61 6e 64 65 64 6e 65 73 73 20 6f 66 20 61 6e 20 3c 73 65 65 ifying.the.handedness.of.an.<see
19460 20 63 72 65 66 3d 22 58 52 2e 58 52 43 6f 6e 74 72 6f 6c 6c 65 72 22 2f 3e 0d 0a 20 20 20 20 20 .cref="XR.XRController"/>.......
19480 20 20 20 2f 2f 2f 20 62 75 74 20 74 68 65 20 75 73 61 67 65 73 20 63 61 6e 20 62 65 20 61 72 62 ...///.but.the.usages.can.be.arb
194a0 69 74 72 61 72 79 20 73 74 72 69 6e 67 73 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 itrary.strings...........///....
194c0 20 20 20 20 20 20 2f 2f 2f 20 54 68 69 73 20 6d 65 74 68 6f 64 20 61 64 64 73 20 61 20 6e 65 77 ......///.This.method.adds.a.new
194e0 20 75 73 61 67 65 20 74 6f 20 74 68 65 20 64 65 76 69 63 65 27 73 20 73 65 74 20 6f 66 20 75 73 .usage.to.the.device's.set.of.us
19500 61 67 65 73 2e 20 49 66 20 74 68 65 20 64 65 76 69 63 65 20 61 6c 72 65 61 64 79 20 68 61 73 0d ages..If.the.device.already.has.
19520 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 74 68 65 20 67 69 76 65 6e 20 75 73 61 67 65 2c 20 74 68 .........///.the.given.usage,.th
19540 65 20 6d 65 74 68 6f 64 20 64 6f 65 73 20 6e 6f 74 68 69 6e 67 2e 20 54 6f 20 69 6e 73 74 65 61 e.method.does.nothing..To.instea
19560 64 20 73 65 74 20 74 68 65 20 64 65 76 69 63 65 27 73 20 75 73 61 67 65 73 20 74 6f 20 61 20 73 d.set.the.device's.usages.to.a.s
19580 69 6e 67 6c 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 6f 6e 65 2c 20 75 73 65 20 3c 73 65 65 ingle..........///.one,.use.<see
195a0 20 63 72 65 66 3d 22 53 65 74 44 65 76 69 63 65 55 73 61 67 65 28 49 6e 70 75 74 44 65 76 69 63 .cref="SetDeviceUsage(InputDevic
195c0 65 2c 49 6e 74 65 72 6e 65 64 53 74 72 69 6e 67 29 22 2f 3e 2e 20 54 6f 20 72 65 6d 6f 76 65 20 e,InternedString)"/>..To.remove.
195e0 75 73 61 67 65 73 20 66 72 6f 6d 20 61 20 64 65 76 69 63 65 2c 0d 0a 20 20 20 20 20 20 20 20 2f usages.from.a.device,........../
19600 2f 2f 20 63 61 6c 6c 20 3c 73 65 65 20 63 72 65 66 3d 22 52 65 6d 6f 76 65 44 65 76 69 63 65 55 //.call.<see.cref="RemoveDeviceU
19620 73 61 67 65 28 49 6e 70 75 74 44 65 76 69 63 65 2c 49 6e 74 65 72 6e 65 64 53 74 72 69 6e 67 29 sage(InputDevice,InternedString)
19640 22 2f 3e 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 "/>...........///..........///.T
19660 68 65 20 73 65 74 20 6f 66 20 75 73 61 67 65 73 20 61 20 64 65 76 69 63 65 20 68 61 73 20 63 61 he.set.of.usages.a.device.has.ca
19680 6e 20 62 65 20 71 75 65 72 69 65 64 20 77 69 74 68 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 n.be.queried.with.<see.cref="Inp
196a0 75 74 43 6f 6e 74 72 6f 6c 2e 75 73 61 67 65 73 22 2f 3e 20 28 61 20 64 65 76 69 63 65 0d 0a 20 utControl.usages"/>.(a.device...
196c0 20 20 20 20 20 20 20 2f 2f 2f 20 69 73 20 61 6e 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 .......///.is.an.<see.cref="Inpu
196e0 74 43 6f 6e 74 72 6f 6c 22 2f 3e 20 61 6e 64 20 74 68 75 73 2c 20 6c 69 6b 65 20 63 6f 6e 74 72 tControl"/>.and.thus,.like.contr
19700 6f 6c 73 2c 20 68 61 73 20 61 6e 20 61 73 73 6f 63 69 61 74 65 64 20 73 65 74 20 6f 66 20 75 73 ols,.has.an.associated.set.of.us
19720 61 67 65 73 29 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f ages)...........///..........///
19740 20 49 66 20 74 68 65 20 73 65 74 20 6f 66 20 75 73 61 67 65 73 20 6f 6e 20 74 68 65 20 64 65 76 .If.the.set.of.usages.on.the.dev
19760 69 63 65 20 63 68 61 6e 67 65 73 20 61 73 20 61 20 72 65 73 75 6c 74 20 6f 66 20 63 61 6c 6c 69 ice.changes.as.a.result.of.calli
19780 6e 67 20 74 68 69 73 20 6d 65 74 68 6f 64 2c 20 3c 73 65 65 20 63 72 65 66 3d 22 6f 6e 44 65 76 ng.this.method,.<see.cref="onDev
197a0 69 63 65 43 68 61 6e 67 65 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 77 69 6c 6c 20 62 iceChange"/>..........///.will.b
197c0 65 20 74 72 69 67 67 65 72 65 64 20 77 69 74 68 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 e.triggered.with.<see.cref="Inpu
197e0 74 44 65 76 69 63 65 43 68 61 6e 67 65 2e 55 73 61 67 65 43 68 61 6e 67 65 64 22 2f 3e 2e 0d 0a tDeviceChange.UsageChanged"/>...
19800 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 ........///.</remarks>..........
19820 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f 6e 20 63 72 65 66 3d 22 41 72 67 75 6d 65 6e 74 4e 75 6c ///.<exception.cref="ArgumentNul
19840 6c 45 78 63 65 70 74 69 6f 6e 22 3e 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 64 65 76 69 lException"><paramref.name="devi
19860 63 65 22 2f 3e 20 69 73 20 6e 75 6c 6c 2e 3c 2f 65 78 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 ce"/>.is.null.</exception>......
19880 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f 6e 20 63 72 65 66 3d 22 41 72 67 75 6d 65 6e ....///.<exception.cref="Argumen
198a0 74 45 78 63 65 70 74 69 6f 6e 22 3e 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 75 73 61 67 tException"><paramref.name="usag
198c0 65 22 2f 3e 20 69 73 20 65 6d 70 74 79 2e 3c 2f 65 78 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 e"/>.is.empty.</exception>......
198e0 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 ....///.<seealso.cref="InputCont
19900 72 6f 6c 2e 75 73 61 67 65 73 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 rol.usages"/>..........///.<seea
19920 6c 73 6f 20 63 72 65 66 3d 22 53 65 74 44 65 76 69 63 65 55 73 61 67 65 28 49 6e 70 75 74 44 65 lso.cref="SetDeviceUsage(InputDe
19940 76 69 63 65 2c 49 6e 74 65 72 6e 65 64 53 74 72 69 6e 67 29 22 2f 3e 0d 0a 20 20 20 20 20 20 20 vice,InternedString)"/>.........
19960 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 52 65 6d 6f 76 65 44 65 76 69 63 65 .///.<seealso.cref="RemoveDevice
19980 55 73 61 67 65 28 49 6e 70 75 74 44 65 76 69 63 65 2c 49 6e 74 65 72 6e 65 64 53 74 72 69 6e 67 Usage(InputDevice,InternedString
199a0 29 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d )"/>..........///.<seealso.cref=
199c0 22 43 6f 6d 6d 6f 6e 55 73 61 67 65 73 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 "CommonUsages"/>..........///.<s
199e0 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 49 6e 70 75 74 44 65 76 69 63 65 43 68 61 6e 67 65 2e 55 eealso.cref="InputDeviceChange.U
19a00 73 61 67 65 43 68 61 6e 67 65 64 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 sageChanged"/>..........public.s
19a20 74 61 74 69 63 20 76 6f 69 64 20 41 64 64 44 65 76 69 63 65 55 73 61 67 65 28 49 6e 70 75 74 44 tatic.void.AddDeviceUsage(InputD
19a40 65 76 69 63 65 20 64 65 76 69 63 65 2c 20 49 6e 74 65 72 6e 65 64 53 74 72 69 6e 67 20 75 73 61 evice.device,.InternedString.usa
19a60 67 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 5f 4d 61 ge)..........{..............s_Ma
19a80 6e 61 67 65 72 2e 41 64 64 44 65 76 69 63 65 55 73 61 67 65 28 64 65 76 69 63 65 2c 20 75 73 61 nager.AddDeviceUsage(device,.usa
19aa0 67 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 ge);..........}............///.<
19ac0 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 52 65 6d 6f 76 65 20 61 20 75 summary>..........///.Remove.a.u
19ae0 73 61 67 65 20 74 61 67 20 66 72 6f 6d 20 74 68 65 20 67 69 76 65 6e 20 64 65 76 69 63 65 2e 0d sage.tag.from.the.given.device..
19b00 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>.........
19b20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 64 65 76 69 63 65 22 3e 44 65 76 69 63 65 .///.<param.name="device">Device
19b40 20 74 6f 20 72 65 6d 6f 76 65 20 74 68 65 20 75 73 61 67 65 20 66 72 6f 6d 2e 3c 2f 70 61 72 61 .to.remove.the.usage.from.</para
19b60 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 75 73 61 m>..........///.<param.name="usa
19b80 67 65 22 3e 55 73 61 67 65 20 74 6f 20 72 65 6d 6f 76 65 20 66 72 6f 6d 20 74 68 65 20 64 65 76 ge">Usage.to.remove.from.the.dev
19ba0 69 63 65 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 ice.</param>..........///.<remar
19bc0 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 68 69 73 20 6d 65 74 68 6f 64 20 72 65 6d ks>..........///.This.method.rem
19be0 6f 76 65 73 20 61 6e 20 65 78 69 73 74 69 6e 67 20 75 73 61 67 65 20 66 72 6f 6d 20 74 68 65 20 oves.an.existing.usage.from.the.
19c00 67 69 76 65 6e 20 64 65 76 69 63 65 2e 20 49 66 20 74 68 65 20 64 65 76 69 63 65 20 64 6f 65 73 given.device..If.the.device.does
19c20 20 6e 6f 74 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 68 61 76 65 20 74 68 65 20 67 69 76 65 6e .not..........///.have.the.given
19c40 20 75 73 61 67 65 20 74 61 67 2c 20 74 68 65 20 6d 65 74 68 6f 64 20 64 6f 65 73 20 6e 6f 74 68 .usage.tag,.the.method.does.noth
19c60 69 6e 67 2e 20 55 73 65 20 3c 73 65 65 20 63 72 65 66 3d 22 53 65 74 44 65 76 69 63 65 55 73 61 ing..Use.<see.cref="SetDeviceUsa
19c80 67 65 28 49 6e 70 75 74 44 65 76 69 63 65 2c 73 74 72 69 6e 67 29 22 2f 3e 0d 0a 20 20 20 20 20 ge(InputDevice,string)"/>.......
19ca0 20 20 20 2f 2f 2f 20 6f 72 20 3c 73 65 65 20 63 72 65 66 3d 22 41 64 64 44 65 76 69 63 65 55 73 ...///.or.<see.cref="AddDeviceUs
19cc0 61 67 65 28 49 6e 70 75 74 44 65 76 69 63 65 2c 73 74 72 69 6e 67 29 22 2f 3e 20 74 6f 20 61 64 age(InputDevice,string)"/>.to.ad
19ce0 64 20 75 73 61 67 65 73 20 74 6f 20 61 20 64 65 76 69 63 65 2e 0d 0a 20 20 20 20 20 20 20 20 2f d.usages.to.a.device.........../
19d00 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 68 65 20 73 65 74 20 6f 66 20 75 73 61 67 65 //..........///.The.set.of.usage
19d20 73 20 61 20 64 65 76 69 63 65 20 68 61 73 20 63 61 6e 20 62 65 20 71 75 65 72 69 65 64 20 77 69 s.a.device.has.can.be.queried.wi
19d40 74 68 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 2e 75 73 61 67 65 th.<see.cref="InputControl.usage
19d60 73 22 2f 3e 20 28 61 20 64 65 76 69 63 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 69 73 20 61 s"/>.(a.device..........///.is.a
19d80 6e 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 22 2f 3e 20 61 6e 64 n.<see.cref="InputControl"/>.and
19da0 20 74 68 75 73 2c 20 6c 69 6b 65 20 63 6f 6e 74 72 6f 6c 73 2c 20 68 61 73 20 61 6e 20 61 73 73 .thus,.like.controls,.has.an.ass
19dc0 6f 63 69 61 74 65 64 20 73 65 74 20 6f 66 20 75 73 61 67 65 73 29 2e 0d 0a 20 20 20 20 20 20 20 ociated.set.of.usages)..........
19de0 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 66 20 74 68 65 20 73 65 74 20 6f 66 20 .///..........///.If.the.set.of.
19e00 75 73 61 67 65 73 20 6f 6e 20 74 68 65 20 64 65 76 69 63 65 20 63 68 61 6e 67 65 73 20 61 73 20 usages.on.the.device.changes.as.
19e20 61 20 72 65 73 75 6c 74 20 6f 66 20 63 61 6c 6c 69 6e 67 20 74 68 69 73 20 6d 65 74 68 6f 64 2c a.result.of.calling.this.method,
19e40 20 3c 73 65 65 20 63 72 65 66 3d 22 6f 6e 44 65 76 69 63 65 43 68 61 6e 67 65 22 2f 3e 0d 0a 20 .<see.cref="onDeviceChange"/>...
19e60 20 20 20 20 20 20 20 2f 2f 2f 20 77 69 6c 6c 20 62 65 20 74 72 69 67 67 65 72 65 64 20 77 69 74 .......///.will.be.triggered.wit
19e80 68 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 44 65 76 69 63 65 43 68 61 6e 67 65 2e 55 h.<see.cref="InputDeviceChange.U
19ea0 73 61 67 65 43 68 61 6e 67 65 64 22 2f 3e 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 72 sageChanged"/>...........///.</r
19ec0 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f 6e 20 emarks>..........///.<exception.
19ee0 63 72 65 66 3d 22 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 22 3e 3c 70 61 cref="ArgumentNullException"><pa
19f00 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 64 65 76 69 63 65 22 2f 3e 20 69 73 20 6e 75 6c 6c 2e 3c ramref.name="device"/>.is.null.<
19f20 2f 65 78 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 /exception>..........///.<except
19f40 69 6f 6e 20 63 72 65 66 3d 22 41 72 67 75 6d 65 6e 74 45 78 63 65 70 74 69 6f 6e 22 3e 3c 70 61 ion.cref="ArgumentException"><pa
19f60 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 75 73 61 67 65 22 2f 3e 20 69 73 20 6e 75 6c 6c 20 6f 72 ramref.name="usage"/>.is.null.or
19f80 20 65 6d 70 74 79 2e 3c 2f 65 78 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f .empty.</exception>..........///
19fa0 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 2e 75 73 61 .<seealso.cref="InputControl.usa
19fc0 67 65 73 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 ges"/>..........///.<seealso.cre
19fe0 66 3d 22 53 65 74 44 65 76 69 63 65 55 73 61 67 65 28 49 6e 70 75 74 44 65 76 69 63 65 2c 73 74 f="SetDeviceUsage(InputDevice,st
1a000 72 69 6e 67 29 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 ring)"/>..........///.<seealso.c
1a020 72 65 66 3d 22 41 64 64 44 65 76 69 63 65 55 73 61 67 65 28 49 6e 70 75 74 44 65 76 69 63 65 2c ref="AddDeviceUsage(InputDevice,
1a040 73 74 72 69 6e 67 29 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f string)"/>..........///.<seealso
1a060 20 63 72 65 66 3d 22 43 6f 6d 6d 6f 6e 55 73 61 67 65 73 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 .cref="CommonUsages"/>..........
1a080 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 49 6e 70 75 74 44 65 76 69 63 65 43 68 ///.<seealso.cref="InputDeviceCh
1a0a0 61 6e 67 65 2e 55 73 61 67 65 43 68 61 6e 67 65 64 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 ange.UsageChanged"/>..........pu
1a0c0 62 6c 69 63 20 73 74 61 74 69 63 20 76 6f 69 64 20 52 65 6d 6f 76 65 44 65 76 69 63 65 55 73 61 blic.static.void.RemoveDeviceUsa
1a0e0 67 65 28 49 6e 70 75 74 44 65 76 69 63 65 20 64 65 76 69 63 65 2c 20 73 74 72 69 6e 67 20 75 73 ge(InputDevice.device,.string.us
1a100 61 67 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 5f 4d age)..........{..............s_M
1a120 61 6e 61 67 65 72 2e 52 65 6d 6f 76 65 44 65 76 69 63 65 55 73 61 67 65 28 64 65 76 69 63 65 2c anager.RemoveDeviceUsage(device,
1a140 20 6e 65 77 20 49 6e 74 65 72 6e 65 64 53 74 72 69 6e 67 28 75 73 61 67 65 29 29 3b 0d 0a 20 20 .new.InternedString(usage));....
1a160 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>
1a180 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 52 65 6d 6f 76 65 20 61 20 75 73 61 67 65 20 74 61 67 ..........///.Remove.a.usage.tag
1a1a0 20 66 72 6f 6d 20 74 68 65 20 67 69 76 65 6e 20 64 65 76 69 63 65 2e 0d 0a 20 20 20 20 20 20 20 .from.the.given.device..........
1a1c0 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
1a1e0 72 61 6d 20 6e 61 6d 65 3d 22 64 65 76 69 63 65 22 3e 44 65 76 69 63 65 20 74 6f 20 72 65 6d 6f ram.name="device">Device.to.remo
1a200 76 65 20 74 68 65 20 75 73 61 67 65 20 66 72 6f 6d 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 ve.the.usage.from.</param>......
1a220 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 75 73 61 67 65 22 3e 55 73 61 67 ....///.<param.name="usage">Usag
1a240 65 20 74 6f 20 72 65 6d 6f 76 65 20 66 72 6f 6d 20 74 68 65 20 64 65 76 69 63 65 2e 3c 2f 70 61 e.to.remove.from.the.device.</pa
1a260 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 ram>..........///.<remarks>.....
1a280 20 20 20 20 20 2f 2f 2f 20 54 68 69 73 20 6d 65 74 68 6f 64 20 72 65 6d 6f 76 65 73 20 61 6e 20 .....///.This.method.removes.an.
1a2a0 65 78 69 73 74 69 6e 67 20 75 73 61 67 65 20 66 72 6f 6d 20 74 68 65 20 67 69 76 65 6e 20 64 65 existing.usage.from.the.given.de
1a2c0 76 69 63 65 2e 20 49 66 20 74 68 65 20 64 65 76 69 63 65 20 64 6f 65 73 20 6e 6f 74 0d 0a 20 20 vice..If.the.device.does.not....
1a2e0 20 20 20 20 20 20 2f 2f 2f 20 68 61 76 65 20 74 68 65 20 67 69 76 65 6e 20 75 73 61 67 65 20 74 ......///.have.the.given.usage.t
1a300 61 67 2c 20 74 68 65 20 6d 65 74 68 6f 64 20 64 6f 65 73 20 6e 6f 74 68 69 6e 67 2e 20 55 73 65 ag,.the.method.does.nothing..Use
1a320 20 3c 73 65 65 20 63 72 65 66 3d 22 53 65 74 44 65 76 69 63 65 55 73 61 67 65 28 49 6e 70 75 74 .<see.cref="SetDeviceUsage(Input
1a340 44 65 76 69 63 65 2c 49 6e 74 65 72 6e 65 64 53 74 72 69 6e 67 29 22 2f 3e 0d 0a 20 20 20 20 20 Device,InternedString)"/>.......
1a360 20 20 20 2f 2f 2f 20 6f 72 20 3c 73 65 65 20 63 72 65 66 3d 22 41 64 64 44 65 76 69 63 65 55 73 ...///.or.<see.cref="AddDeviceUs
1a380 61 67 65 28 49 6e 70 75 74 44 65 76 69 63 65 2c 49 6e 74 65 72 6e 65 64 53 74 72 69 6e 67 29 22 age(InputDevice,InternedString)"
1a3a0 2f 3e 20 74 6f 20 61 64 64 20 75 73 61 67 65 73 20 74 6f 20 61 20 64 65 76 69 63 65 2e 0d 0a 20 />.to.add.usages.to.a.device....
1a3c0 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 68 65 20 73 65 74 20 .......///..........///.The.set.
1a3e0 6f 66 20 75 73 61 67 65 73 20 61 20 64 65 76 69 63 65 20 68 61 73 20 63 61 6e 20 62 65 20 71 75 of.usages.a.device.has.can.be.qu
1a400 65 72 69 65 64 20 77 69 74 68 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 eried.with.<see.cref="InputContr
1a420 6f 6c 2e 75 73 61 67 65 73 22 2f 3e 20 28 61 20 64 65 76 69 63 65 0d 0a 20 20 20 20 20 20 20 20 ol.usages"/>.(a.device..........
1a440 2f 2f 2f 20 69 73 20 61 6e 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f ///.is.an.<see.cref="InputContro
1a460 6c 22 2f 3e 20 61 6e 64 20 74 68 75 73 2c 20 6c 69 6b 65 20 63 6f 6e 74 72 6f 6c 73 2c 20 68 61 l"/>.and.thus,.like.controls,.ha
1a480 73 20 61 6e 20 61 73 73 6f 63 69 61 74 65 64 20 73 65 74 20 6f 66 20 75 73 61 67 65 73 29 2e 0d s.an.associated.set.of.usages)..
1a4a0 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 66 20 74 68 65 .........///..........///.If.the
1a4c0 20 73 65 74 20 6f 66 20 75 73 61 67 65 73 20 6f 6e 20 74 68 65 20 64 65 76 69 63 65 20 63 68 61 .set.of.usages.on.the.device.cha
1a4e0 6e 67 65 73 20 61 73 20 61 20 72 65 73 75 6c 74 20 6f 66 20 63 61 6c 6c 69 6e 67 20 74 68 69 73 nges.as.a.result.of.calling.this
1a500 20 6d 65 74 68 6f 64 2c 20 3c 73 65 65 20 63 72 65 66 3d 22 6f 6e 44 65 76 69 63 65 43 68 61 6e .method,.<see.cref="onDeviceChan
1a520 67 65 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 77 69 6c 6c 20 62 65 20 74 72 69 67 67 ge"/>..........///.will.be.trigg
1a540 65 72 65 64 20 77 69 74 68 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 44 65 76 69 63 65 ered.with.<see.cref="InputDevice
1a560 43 68 61 6e 67 65 2e 55 73 61 67 65 43 68 61 6e 67 65 64 22 2f 3e 2e 0d 0a 20 20 20 20 20 20 20 Change.UsageChanged"/>..........
1a580 20 2f 2f 2f 20 3c 2f 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 .///.</remarks>..........///.<ex
1a5a0 63 65 70 74 69 6f 6e 20 63 72 65 66 3d 22 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 ception.cref="ArgumentNullExcept
1a5c0 69 6f 6e 22 3e 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 64 65 76 69 63 65 22 2f 3e 20 69 ion"><paramref.name="device"/>.i
1a5e0 73 20 6e 75 6c 6c 2e 3c 2f 65 78 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f s.null.</exception>..........///
1a600 20 3c 65 78 63 65 70 74 69 6f 6e 20 63 72 65 66 3d 22 41 72 67 75 6d 65 6e 74 45 78 63 65 70 74 .<exception.cref="ArgumentExcept
1a620 69 6f 6e 22 3e 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 75 73 61 67 65 22 2f 3e 20 69 73 ion"><paramref.name="usage"/>.is
1a640 20 65 6d 70 74 79 2e 3c 2f 65 78 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f .empty.</exception>..........///
1a660 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 2e 75 73 61 .<seealso.cref="InputControl.usa
1a680 67 65 73 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 ges"/>..........///.<seealso.cre
1a6a0 66 3d 22 53 65 74 44 65 76 69 63 65 55 73 61 67 65 28 49 6e 70 75 74 44 65 76 69 63 65 2c 49 6e f="SetDeviceUsage(InputDevice,In
1a6c0 74 65 72 6e 65 64 53 74 72 69 6e 67 29 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 ternedString)"/>..........///.<s
1a6e0 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 41 64 64 44 65 76 69 63 65 55 73 61 67 65 28 49 6e 70 75 eealso.cref="AddDeviceUsage(Inpu
1a700 74 44 65 76 69 63 65 2c 49 6e 74 65 72 6e 65 64 53 74 72 69 6e 67 29 22 2f 3e 0d 0a 20 20 20 20 tDevice,InternedString)"/>......
1a720 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 43 6f 6d 6d 6f 6e 55 73 61 ....///.<seealso.cref="CommonUsa
1a740 67 65 73 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 ges"/>..........///.<seealso.cre
1a760 66 3d 22 49 6e 70 75 74 44 65 76 69 63 65 43 68 61 6e 67 65 2e 55 73 61 67 65 43 68 61 6e 67 65 f="InputDeviceChange.UsageChange
1a780 64 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 76 6f 69 64 d"/>..........public.static.void
1a7a0 20 52 65 6d 6f 76 65 44 65 76 69 63 65 55 73 61 67 65 28 49 6e 70 75 74 44 65 76 69 63 65 20 64 .RemoveDeviceUsage(InputDevice.d
1a7c0 65 76 69 63 65 2c 20 49 6e 74 65 72 6e 65 64 53 74 72 69 6e 67 20 75 73 61 67 65 29 0d 0a 20 20 evice,.InternedString.usage)....
1a7e0 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 4d 61 6e 61 67 65 72 2e 52 ......{..............s_Manager.R
1a800 65 6d 6f 76 65 44 65 76 69 63 65 55 73 61 67 65 28 64 65 76 69 63 65 2c 20 75 73 61 67 65 29 3b emoveDeviceUsage(device,.usage);
1a820 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 6d ..........}............///.<summ
1a840 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 46 69 6e 64 20 74 68 65 20 66 69 72 73 74 ary>..........///.Find.the.first
1a860 20 63 6f 6e 74 72 6f 6c 20 74 68 61 74 20 6d 61 74 63 68 65 73 20 74 68 65 20 67 69 76 65 6e 20 .control.that.matches.the.given.
1a880 63 6f 6e 74 72 6f 6c 20 70 61 74 68 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d control.path...........///.</sum
1a8a0 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 22 mary>..........///.<param.name="
1a8c0 70 61 74 68 22 3e 50 61 74 68 20 6f 66 20 61 20 63 6f 6e 74 72 6f 6c 2c 20 65 2e 67 2e 20 3c 63 path">Path.of.a.control,.e.g..<c
1a8e0 3e 22 26 6c 74 3b 47 61 6d 65 70 61 64 26 67 74 3b 2f 62 75 74 74 6f 6e 53 6f 75 74 68 22 3c 2f >"&lt;Gamepad&gt;/buttonSouth"</
1a900 63 3e 2e 20 53 65 65 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 50 c>..See.<see.cref="InputControlP
1a920 61 74 68 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 66 6f 72 20 64 65 74 61 69 6c 73 2e ath"/>..........///.for.details.
1a940 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 54 </param>..........///.<returns>T
1a960 68 65 20 66 69 72 73 74 20 63 6f 6e 74 72 6f 6c 20 74 68 61 74 20 6d 61 74 63 68 65 73 20 74 68 he.first.control.that.matches.th
1a980 65 20 67 69 76 65 6e 20 70 61 74 68 20 6f 72 20 3c 63 3e 6e 75 6c 6c 3c 2f 63 3e 20 69 66 20 6e e.given.path.or.<c>null</c>.if.n
1a9a0 6f 20 63 6f 6e 74 72 6f 6c 20 6d 61 74 63 68 65 73 2e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 20 o.control.matches.</returns>....
1a9c0 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f 6e 20 63 72 65 66 3d 22 41 72 67 75 6d ......///.<exception.cref="Argum
1a9e0 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 22 3e 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 entNullException"><paramref.name
1aa00 3d 22 70 61 74 68 22 2f 3e 20 69 73 20 3c 63 3e 6e 75 6c 6c 3c 2f 63 3e 20 6f 72 20 65 6d 70 74 ="path"/>.is.<c>null</c>.or.empt
1aa20 79 2e 3c 2f 65 78 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 6d y.</exception>..........///.<rem
1aa40 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 66 20 6d 75 6c 74 69 70 6c 65 20 63 arks>..........///.If.multiple.c
1aa60 6f 6e 74 72 6f 6c 73 20 6d 61 74 63 68 20 74 68 65 20 67 69 76 65 6e 20 70 61 74 68 2c 20 77 68 ontrols.match.the.given.path,.wh
1aa80 69 63 68 20 72 65 73 75 6c 74 20 69 73 20 63 6f 6e 73 69 64 65 72 65 64 20 74 68 65 20 66 69 72 ich.result.is.considered.the.fir
1aaa0 73 74 20 69 73 20 69 6e 64 65 74 65 72 6d 69 6e 61 74 65 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f st.is.indeterminate...........//
1aac0 2f 0d 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 /..........///.<example>........
1aae0 20 20 2f 2f 2f 20 3c 63 6f 64 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 2f 2f 20 41 64 64 ..///.<code>..........///.//.Add
1ab00 20 67 61 6d 65 70 61 64 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 6e 70 75 74 53 79 73 74 .gamepad...........///.InputSyst
1ab20 65 6d 2e 41 64 64 44 65 76 69 63 65 26 6c 74 3b 47 61 6d 65 70 61 64 26 67 74 3b 28 29 3b 0d 0a em.AddDevice&lt;Gamepad&gt;();..
1ab40 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 2f 2f 20 4c 6f 6f 6b ........///..........///.//.Look
1ab60 20 75 70 20 76 61 72 69 6f 75 73 20 63 6f 6e 74 72 6f 6c 73 20 6f 6e 20 69 74 2e 0d 0a 20 20 20 .up.various.controls.on.it......
1ab80 20 20 20 20 20 2f 2f 2f 20 76 61 72 20 61 42 75 74 74 6f 6e 20 3d 20 49 6e 70 75 74 53 79 73 74 .....///.var.aButton.=.InputSyst
1aba0 65 6d 2e 46 69 6e 64 43 6f 6e 74 72 6f 6c 28 22 26 6c 74 3b 47 61 6d 65 70 61 64 26 67 74 3b 2f em.FindControl("&lt;Gamepad&gt;/
1abc0 62 75 74 74 6f 6e 53 6f 75 74 68 22 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 76 61 72 20 buttonSouth");..........///.var.
1abe0 6c 65 66 74 53 74 69 63 6b 58 20 3d 20 49 6e 70 75 74 53 79 73 74 65 6d 2e 46 69 6e 64 43 6f 6e leftStickX.=.InputSystem.FindCon
1ac00 74 72 6f 6c 28 22 2a 2f 6c 65 66 74 53 74 69 63 6b 2f 78 22 29 3b 0d 0a 20 20 20 20 20 20 20 20 trol("*/leftStick/x");..........
1ac20 2f 2f 2f 20 76 61 72 20 62 42 75 74 74 6f 6e 20 3d 20 49 6e 70 75 74 53 79 73 74 65 6d 2e 46 69 ///.var.bButton.=.InputSystem.Fi
1ac40 6e 64 43 6f 6e 74 72 6f 6c 22 2a 2f 7b 62 61 63 6b 7d 22 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f ndControl"*/{back}");........../
1ac60 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 2f 2f 20 54 68 69 73 20 6f 6e 65 20 72 65 74 75 //..........///.//.This.one.retu
1ac80 72 6e 73 20 74 68 65 20 67 61 6d 65 70 61 64 20 69 74 73 65 6c 66 20 61 73 20 64 65 76 69 63 65 rns.the.gamepad.itself.as.device
1aca0 73 20 61 72 65 20 61 6c 73 6f 20 63 6f 6e 74 72 6f 6c 73 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f s.are.also.controls...........//
1acc0 2f 20 76 61 72 20 67 61 6d 65 70 61 64 20 3d 20 49 6e 70 75 74 53 79 73 74 65 6d 2e 46 69 6e 64 /.var.gamepad.=.InputSystem.Find
1ace0 43 6f 6e 74 72 6f 6c 28 22 26 6c 74 3b 47 61 6d 65 70 61 64 26 67 74 3b 22 29 3b 0d 0a 20 20 20 Control("&lt;Gamepad&gt;");.....
1ad00 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 2f 2f 2f 20 3c 2f .....///.</code>..........///.</
1ad20 65 78 61 6d 70 6c 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 6d 61 72 6b 73 3e example>..........///.</remarks>
1ad40 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 49 6e 70 ..........///.<seealso.cref="Inp
1ad60 75 74 43 6f 6e 74 72 6f 6c 50 61 74 68 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 utControlPath"/>..........///.<s
1ad80 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 2e 70 61 74 68 22 2f eealso.cref="InputControl.path"/
1ada0 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 49 6e 70 75 74 43 6f >..........public.static.InputCo
1adc0 6e 74 72 6f 6c 20 46 69 6e 64 43 6f 6e 74 72 6f 6c 28 73 74 72 69 6e 67 20 70 61 74 68 29 0d 0a ntrol.FindControl(string.path)..
1ade0 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 73 74 72 69 6e ........{..............if.(strin
1ae00 67 2e 49 73 4e 75 6c 6c 4f 72 45 6d 70 74 79 28 70 61 74 68 29 29 0d 0a 20 20 20 20 20 20 20 20 g.IsNullOrEmpty(path))..........
1ae20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 ........throw.new.ArgumentNullEx
1ae40 63 65 70 74 69 6f 6e 28 6e 61 6d 65 6f 66 28 70 61 74 68 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 ception(nameof(path));..........
1ae60 20 20 20 20 20 20 76 61 72 20 64 65 76 69 63 65 73 20 3d 20 73 5f 4d 61 6e 61 67 65 72 2e 64 65 ......var.devices.=.s_Manager.de
1ae80 76 69 63 65 73 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 6e 75 6d 44 65 76 69 63 vices;..............var.numDevic
1aea0 65 73 20 3d 20 64 65 76 69 63 65 73 2e 43 6f 75 6e 74 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 es.=.devices.Count;.............
1aec0 20 20 20 66 6f 72 20 28 76 61 72 20 69 20 3d 20 30 3b 20 69 20 3c 20 6e 75 6d 44 65 76 69 63 65 ...for.(var.i.=.0;.i.<.numDevice
1aee0 73 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 s;.++i)..............{..........
1af00 20 20 20 20 20 20 20 20 76 61 72 20 64 65 76 69 63 65 20 3d 20 64 65 76 69 63 65 73 5b 69 5d 3b ........var.device.=.devices[i];
1af20 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 63 6f 6e 74 72 6f 6c 20 3d 20 ..................var.control.=.
1af40 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 50 61 74 68 2e 54 72 79 46 69 6e 64 43 6f 6e 74 72 6f 6c 28 InputControlPath.TryFindControl(
1af60 64 65 76 69 63 65 2c 20 70 61 74 68 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 device,.path);..................
1af80 69 66 20 28 63 6f 6e 74 72 6f 6c 20 21 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 if.(control.!=.null)............
1afa0 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 63 6f 6e 74 72 6f 6c 3b 0d 0a 20 20 20 20 20 ..........return.control;.......
1afc0 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 6e .......}................return.n
1afe0 75 6c 6c 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 ull;..........}............///.<
1b000 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 46 69 6e 64 20 61 6c 6c 20 63 summary>..........///.Find.all.c
1b020 6f 6e 74 72 6f 6c 73 20 74 68 61 74 20 6d 61 74 63 68 20 74 68 65 20 67 69 76 65 6e 20 3c 73 65 ontrols.that.match.the.given.<se
1b040 65 20 63 72 65 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 50 61 74 68 22 3e 63 6f 6e 74 72 6f e.cref="InputControlPath">contro
1b060 6c 20 70 61 74 68 3c 2f 73 65 65 3e 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d l.path</see>...........///.</sum
1b080 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 22 mary>..........///.<param.name="
1b0a0 70 61 74 68 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 74 path"></param>..........///.<ret
1b0c0 75 72 6e 73 3e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 urns></returns>..........///.<ex
1b0e0 61 6d 70 6c 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 63 6f 64 65 3e 0d 0a 20 20 20 20 ample>..........///.<code>......
1b100 20 20 20 20 2f 2f 2f 20 2f 2f 20 46 69 6e 64 20 61 6c 6c 20 67 61 6d 65 70 61 64 73 20 28 6c 69 ....///.//.Find.all.gamepads.(li
1b120 74 65 72 61 6c 6c 79 3a 20 74 68 61 74 20 75 73 65 20 74 68 65 20 22 47 61 6d 65 70 61 64 22 20 terally:.that.use.the."Gamepad".
1b140 6c 61 79 6f 75 74 29 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 6e 70 75 74 53 79 73 74 65 layout)...........///.InputSyste
1b160 6d 2e 46 69 6e 64 43 6f 6e 74 72 6f 6c 73 28 22 26 6c 74 3b 47 61 6d 65 70 61 64 26 67 74 3b 22 m.FindControls("&lt;Gamepad&gt;"
1b180 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 2f 2f 20 );..........///..........///.//.
1b1a0 46 69 6e 64 20 61 6c 6c 20 73 74 69 63 6b 73 20 6f 6e 20 61 6c 6c 20 67 61 6d 65 70 61 64 73 2e Find.all.sticks.on.all.gamepads.
1b1c0 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 6e 70 75 74 53 79 73 74 65 6d 2e 46 69 6e 64 43 6f ..........///.InputSystem.FindCo
1b1e0 6e 74 72 6f 6c 73 28 22 26 6c 74 3b 47 61 6d 65 70 61 64 26 67 74 3b 2f 2a 73 74 69 63 6b 22 29 ntrols("&lt;Gamepad&gt;/*stick")
1b200 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 2f 2f 20 53 ;..........///..........///.//.S
1b220 61 6d 65 20 62 75 74 20 66 69 6c 74 65 72 20 73 74 69 63 6b 20 62 79 20 74 79 70 65 20 72 61 74 ame.but.filter.stick.by.type.rat
1b240 68 65 72 20 74 68 61 6e 20 62 79 20 6e 61 6d 65 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 her.than.by.name...........///.I
1b260 6e 70 75 74 53 79 73 74 65 6d 2e 46 69 6e 64 43 6f 6e 74 72 6f 6c 73 26 6c 74 3b 53 74 69 63 6b nputSystem.FindControls&lt;Stick
1b280 43 6f 6e 74 72 6f 6c 26 67 74 3b 28 22 26 6c 74 3b 47 61 6d 65 70 61 64 26 67 74 3b 2f 2a 22 29 Control&gt;("&lt;Gamepad&gt;/*")
1b2a0 3b 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>..........
1b2c0 2f 2f 2f 20 3c 2f 65 78 61 6d 70 6c 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 ///.</example>..........///.<see
1b2e0 61 6c 73 6f 20 63 72 65 66 3d 22 46 69 6e 64 43 6f 6e 74 72 6f 6c 73 7b 54 43 6f 6e 74 72 6f 6c also.cref="FindControls{TControl
1b300 7d 28 73 74 72 69 6e 67 29 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c }(string)"/>..........///.<seeal
1b320 73 6f 20 63 72 65 66 3d 22 46 69 6e 64 43 6f 6e 74 72 6f 6c 73 7b 54 43 6f 6e 74 72 6f 6c 7d 28 so.cref="FindControls{TControl}(
1b340 73 74 72 69 6e 67 2c 72 65 66 20 55 6e 69 74 79 45 6e 67 69 6e 65 2e 49 6e 70 75 74 53 79 73 74 string,ref.UnityEngine.InputSyst
1b360 65 6d 2e 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 69 73 74 7b 54 43 6f 6e 74 72 6f 6c 7d 29 22 2f em.InputControlList{TControl})"/
1b380 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 49 6e 70 75 74 43 6f >..........public.static.InputCo
1b3a0 6e 74 72 6f 6c 4c 69 73 74 3c 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 3e 20 46 69 6e 64 43 6f 6e 74 ntrolList<InputControl>.FindCont
1b3c0 72 6f 6c 73 28 73 74 72 69 6e 67 20 70 61 74 68 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 rols(string.path)..........{....
1b3e0 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 46 69 6e 64 43 6f 6e 74 72 6f 6c 73 3c 49 6e ..........return.FindControls<In
1b400 70 75 74 43 6f 6e 74 72 6f 6c 3e 28 70 61 74 68 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d putControl>(path);..........}...
1b420 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 49 6e 70 75 74 43 6f 6e 74 .........public.static.InputCont
1b440 72 6f 6c 4c 69 73 74 3c 54 43 6f 6e 74 72 6f 6c 3e 20 46 69 6e 64 43 6f 6e 74 72 6f 6c 73 3c 54 rolList<TControl>.FindControls<T
1b460 43 6f 6e 74 72 6f 6c 3e 28 73 74 72 69 6e 67 20 70 61 74 68 29 0d 0a 20 20 20 20 20 20 20 20 20 Control>(string.path)...........
1b480 20 20 20 77 68 65 72 65 20 54 43 6f 6e 74 72 6f 6c 20 3a 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c ...where.TControl.:.InputControl
1b4a0 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 76 61 72 20 6c 69 73 ..........{..............var.lis
1b4c0 74 20 3d 20 6e 65 77 20 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 69 73 74 3c 54 43 6f 6e 74 72 6f t.=.new.InputControlList<TContro
1b4e0 6c 3e 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 46 69 6e 64 43 6f 6e 74 72 6f 6c 73 28 l>();..............FindControls(
1b500 70 61 74 68 2c 20 72 65 66 20 6c 69 73 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 path,.ref.list);..............re
1b520 74 75 72 6e 20 6c 69 73 74 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 turn.list;..........}...........
1b540 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 69 6e 74 20 46 69 6e 64 43 6f 6e 74 72 6f 6c 73 3c .public.static.int.FindControls<
1b560 54 43 6f 6e 74 72 6f 6c 3e 28 73 74 72 69 6e 67 20 70 61 74 68 2c 20 72 65 66 20 49 6e 70 75 74 TControl>(string.path,.ref.Input
1b580 43 6f 6e 74 72 6f 6c 4c 69 73 74 3c 54 43 6f 6e 74 72 6f 6c 3e 20 63 6f 6e 74 72 6f 6c 73 29 0d ControlList<TControl>.controls).
1b5a0 0a 20 20 20 20 20 20 20 20 20 20 20 20 77 68 65 72 65 20 54 43 6f 6e 74 72 6f 6c 20 3a 20 49 6e .............where.TControl.:.In
1b5c0 70 75 74 43 6f 6e 74 72 6f 6c 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 putControl..........{...........
1b5e0 20 20 20 72 65 74 75 72 6e 20 73 5f 4d 61 6e 61 67 65 72 2e 47 65 74 43 6f 6e 74 72 6f 6c 73 28 ...return.s_Manager.GetControls(
1b600 70 61 74 68 2c 20 72 65 66 20 63 6f 6e 74 72 6f 6c 73 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d path,.ref.controls);..........}.
1b620 0a 0d 0a 20 20 20 20 20 20 20 20 23 65 6e 64 72 65 67 69 6f 6e 0d 0a 0d 0a 20 20 20 20 20 20 20 ...........#endregion...........
1b640 20 23 72 65 67 69 6f 6e 20 45 76 65 6e 74 73 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c .#region.Events............///.<
1b660 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 43 61 6c 6c 65 64 20 64 75 72 summary>..........///.Called.dur
1b680 69 6e 67 20 3c 73 65 65 20 63 72 65 66 3d 22 55 70 64 61 74 65 22 2f 3e 20 66 6f 72 20 65 61 63 ing.<see.cref="Update"/>.for.eac
1b6a0 68 20 65 76 65 6e 74 20 74 68 61 74 20 69 73 20 70 72 6f 63 65 73 73 65 64 2e 0d 0a 20 20 20 20 h.event.that.is.processed.......
1b6c0 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 ....///.</summary>..........///.
1b6e0 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 45 76 65 72 79 20 74 69 6d <remarks>..........///.Every.tim
1b700 65 20 74 68 65 20 69 6e 70 75 74 20 73 79 73 74 65 6d 20 75 70 64 61 74 65 73 20 28 73 65 65 20 e.the.input.system.updates.(see.
1b720 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 53 65 74 74 69 6e 67 73 2e 75 70 64 61 74 65 4d <see.cref="InputSettings.updateM
1b740 6f 64 65 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 6f 72 20 3c 73 65 65 20 63 72 65 66 ode"/>..........///.or.<see.cref
1b760 3d 22 55 70 64 61 74 65 22 2f 3e 20 66 6f 72 20 64 65 74 61 69 6c 73 20 61 62 6f 75 74 20 77 68 ="Update"/>.for.details.about.wh
1b780 65 6e 20 61 6e 64 20 68 6f 77 20 74 68 69 73 20 68 61 70 70 65 6e 73 29 2c 0d 0a 20 20 20 20 20 en.and.how.this.happens),.......
1b7a0 20 20 20 2f 2f 2f 20 69 74 20 66 6c 75 73 68 65 73 20 61 6c 6c 20 65 76 65 6e 74 73 20 66 72 6f ...///.it.flushes.all.events.fro
1b7c0 6d 20 74 68 65 20 69 6e 74 65 72 6e 61 6c 20 65 76 65 6e 74 20 62 75 66 66 65 72 20 74 68 61 74 m.the.internal.event.buffer.that
1b7e0 20 61 72 65 20 64 75 65 20 69 6e 20 74 68 65 20 63 75 72 72 65 6e 74 0d 0a 20 20 20 20 20 20 20 .are.due.in.the.current.........
1b800 20 2f 2f 2f 20 75 70 64 61 74 65 20 28 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 53 65 74 .///.update.(<see.cref="InputSet
1b820 74 69 6e 67 73 2e 74 69 6d 65 73 6c 69 63 65 45 76 65 6e 74 73 22 2f 3e 20 66 6f 72 20 64 65 74 tings.timesliceEvents"/>.for.det
1b840 61 69 6c 73 20 61 62 6f 75 74 20 77 68 65 6e 20 65 76 65 6e 74 73 0d 0a 20 20 20 20 20 20 20 20 ails.about.when.events..........
1b860 2f 2f 2f 20 6d 61 79 20 62 65 20 70 6f 73 74 70 6f 6e 65 64 20 74 6f 20 61 20 73 75 62 73 65 71 ///.may.be.postponed.to.a.subseq
1b880 75 65 6e 74 20 66 72 61 6d 65 29 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 uent.frame)...........///.......
1b8a0 20 20 20 2f 2f 2f 20 41 73 20 74 68 65 20 69 6e 70 75 74 20 73 79 73 74 65 6d 20 72 65 61 64 73 ...///.As.the.input.system.reads
1b8c0 20 65 76 65 6e 74 73 20 66 72 6f 6d 20 74 68 65 20 62 75 66 66 65 72 20 6f 6e 65 20 62 79 20 6f .events.from.the.buffer.one.by.o
1b8e0 6e 65 2c 20 69 74 20 77 69 6c 6c 20 74 72 69 67 67 65 72 20 74 68 69 73 0d 0a 20 20 20 20 20 20 ne,.it.will.trigger.this........
1b900 20 20 2f 2f 2f 20 63 61 6c 6c 62 61 63 6b 20 66 6f 72 20 65 61 63 68 20 65 76 65 6e 74 20 77 68 ..///.callback.for.each.event.wh
1b920 69 63 68 20 6f 72 69 67 69 6e 61 74 65 73 20 66 72 6f 6d 20 61 20 72 65 63 6f 67 6e 69 7a 65 64 ich.originates.from.a.recognized
1b940 20 64 65 76 69 63 65 2c 20 62 65 66 6f 72 65 20 74 68 65 6e 20 70 72 6f 63 65 65 64 69 6e 67 0d .device,.before.then.proceeding.
1b960 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 74 6f 20 70 72 6f 63 65 73 73 20 74 68 65 20 65 76 65 6e .........///.to.process.the.even
1b980 74 2e 20 48 6f 77 65 76 65 72 2c 20 69 66 20 61 6e 79 20 6f 66 20 74 68 65 20 63 61 6c 6c 62 61 t..However,.if.any.of.the.callba
1b9a0 63 6b 73 20 73 65 74 73 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 45 76 65 6e 74 2e 68 cks.sets.<see.cref="InputEvent.h
1b9c0 61 6e 64 6c 65 64 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 74 6f 20 74 72 75 65 2c 20 andled"/>..........///.to.true,.
1b9e0 74 68 65 20 65 76 65 6e 74 20 77 69 6c 6c 20 62 65 20 73 6b 69 70 70 65 64 20 61 6e 64 20 69 67 the.event.will.be.skipped.and.ig
1ba00 6e 6f 72 65 64 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f nored...........///..........///
1ba20 20 4e 6f 74 65 20 74 68 61 74 20 74 68 65 20 69 6e 70 75 74 20 73 79 73 74 65 6d 20 64 6f 65 73 .Note.that.the.input.system.does
1ba40 20 4e 4f 54 20 73 6f 72 74 20 65 76 65 6e 74 73 20 62 79 20 74 69 6d 65 73 74 61 6d 70 73 20 28 .NOT.sort.events.by.timestamps.(
1ba60 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 45 76 65 6e 74 2e 74 69 6d 65 22 2f 3e 29 2e 0d <see.cref="InputEvent.time"/>)..
1ba80 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 6e 73 74 65 61 64 2c 20 74 68 65 79 20 61 72 65 20 63 .........///.Instead,.they.are.c
1baa0 6f 6e 73 75 6d 65 64 20 69 6e 20 74 68 65 20 6f 72 64 65 72 20 74 68 65 79 20 61 72 65 20 70 72 onsumed.in.the.order.they.are.pr
1bac0 6f 64 75 63 65 64 2e 20 54 68 69 73 20 6d 65 61 6e 73 20 74 68 61 74 20 74 68 65 79 0d 0a 20 20 oduced..This.means.that.they....
1bae0 20 20 20 20 20 20 2f 2f 2f 20 77 69 6c 6c 20 61 6c 73 6f 20 73 75 72 66 61 63 65 20 6f 6e 20 74 ......///.will.also.surface.on.t
1bb00 68 69 73 20 63 61 6c 6c 62 61 63 6b 20 69 6e 20 74 68 61 74 20 6f 72 64 65 72 2e 0d 0a 20 20 20 his.callback.in.that.order......
1bb20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 61 6d 70 6c 65 3e 0d .....///..........///.<example>.
1bb40 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 63 6f 64 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f .........///.<code>..........///
1bb60 20 2f 2f 20 54 72 65 61 74 20 6c 65 66 74 2b 72 69 67 68 74 20 6d 6f 75 73 65 20 62 75 74 74 6f .//.Treat.left+right.mouse.butto
1bb80 6e 20 61 73 20 6d 69 64 64 6c 65 20 6d 6f 75 73 65 20 62 75 74 74 6f 6e 2e 0d 0a 20 20 20 20 20 n.as.middle.mouse.button........
1bba0 20 20 20 2f 2f 2f 20 2f 2f 20 28 4e 6f 74 65 3a 20 54 68 69 73 20 65 78 61 6d 70 6c 65 20 69 73 ...///.//.(Note:.This.example.is
1bbc0 20 6d 6f 72 65 20 66 6f 72 20 64 65 6d 6f 6e 73 74 72 61 74 69 76 65 20 70 75 72 70 6f 73 65 73 .more.for.demonstrative.purposes
1bbe0 3b 20 69 74 20 69 73 6e 27 74 20 6e 65 63 65 73 73 61 72 69 6c 79 20 61 20 67 6f 6f 64 20 75 73 ;.it.isn't.necessarily.a.good.us
1bc00 65 20 63 61 73 65 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 6e 70 75 74 53 79 73 74 65 6d e.case)..........///.InputSystem
1bc20 2e 6f 6e 45 76 65 6e 74 20 2b 3d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 28 65 76 65 .onEvent.+=..........///....(eve
1bc40 6e 74 50 74 72 2c 20 64 65 76 69 63 65 29 20 3d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 ntPtr,.device).=>..........///..
1bc60 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 2f 2f 20 4f 6e 6c 79 20 ..{..........///........//.Only.
1bc80 64 65 61 6c 20 77 69 74 68 20 73 74 61 74 65 20 65 76 65 6e 74 73 2e 0d 0a 20 20 20 20 20 20 20 deal.with.state.events..........
1bca0 20 2f 2f 2f 20 20 20 20 20 20 20 20 69 66 20 28 21 65 76 65 6e 74 50 74 72 2e 49 73 41 26 6c 74 .///........if.(!eventPtr.IsA&lt
1bcc0 3b 53 74 61 74 65 45 76 65 6e 74 26 67 74 3b 28 29 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 ;StateEvent&gt;())..........///.
1bce0 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 2f 2f 2f 0d ...........return;..........///.
1bd00 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 69 66 20 28 21 28 64 65 76 69 63 65 .........///........if.(!(device
1bd20 20 69 73 20 4d 6f 75 73 65 20 6d 6f 75 73 65 29 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 .is.Mouse.mouse))..........///..
1bd40 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 2f 2f 2f 0d 0a ..........return;..........///..
1bd60 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 6d 6f 75 73 65 2e 6c 65 66 74 42 75 74 ........///........mouse.leftBut
1bd80 74 6f 6e 2e 52 65 61 64 56 61 6c 75 65 46 72 6f 6d 45 76 65 6e 74 28 65 76 65 6e 74 50 74 72 2c ton.ReadValueFromEvent(eventPtr,
1bda0 20 6f 75 74 20 76 61 72 20 6c 6d 62 44 6f 77 6e 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 .out.var.lmbDown);..........///.
1bdc0 20 20 20 20 20 20 20 6d 6f 75 73 65 2e 72 69 67 68 74 42 75 74 74 6f 6e 2e 52 65 61 64 56 61 6c .......mouse.rightButton.ReadVal
1bde0 75 65 46 72 6f 6d 45 76 65 6e 74 28 65 76 65 6e 74 50 74 72 2c 20 6f 75 74 20 76 61 72 20 72 6d ueFromEvent(eventPtr,.out.var.rm
1be00 62 44 6f 77 6e 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f bDown);..........///..........//
1be20 2f 20 20 20 20 20 20 20 20 69 66 20 28 6c 6d 62 44 6f 77 6e 20 3e 20 30 20 26 26 20 72 6d 62 44 /........if.(lmbDown.>.0.&&.rmbD
1be40 6f 77 6e 20 3e 20 30 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 20 own.>.0)..........///...........
1be60 20 6d 6f 75 73 65 2e 6d 69 64 64 6c 65 42 75 74 74 6f 6e 2e 57 72 69 74 65 56 61 6c 75 65 49 6e .mouse.middleButton.WriteValueIn
1be80 74 6f 45 76 65 6e 74 28 31 66 2c 20 65 76 65 6e 74 50 74 72 29 3b 0d 0a 20 20 20 20 20 20 20 20 toEvent(1f,.eventPtr);..........
1bea0 2f 2f 2f 20 20 20 20 7d 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 63 6f 64 65 3e 0d 0a ///....};..........///.</code>..
1bec0 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 65 78 61 6d 70 6c 65 3e 0d 0a 20 20 20 20 20 20 20 20 ........///.</example>..........
1bee0 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 66 20 79 6f 75 20 61 72 65 20 6c 6f 6f 6b ///..........///.If.you.are.look
1bf00 69 6e 67 20 66 6f 72 20 61 20 77 61 79 20 74 6f 20 63 61 70 74 75 72 65 20 65 76 65 6e 74 73 2c ing.for.a.way.to.capture.events,
1bf20 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 45 76 65 6e 74 54 72 61 63 65 22 2f 3e 20 6d .<see.cref="InputEventTrace"/>.m
1bf40 61 79 20 62 65 20 6f 66 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 69 6e 74 65 72 65 73 74 20 61 ay.be.of..........///.interest.a
1bf60 6e 64 20 61 6e 20 61 6c 74 65 72 6e 61 74 69 76 65 20 74 6f 20 64 69 72 65 63 74 6c 79 20 68 6f nd.an.alternative.to.directly.ho
1bf80 6f 6b 69 6e 67 20 69 6e 74 6f 20 74 68 69 73 20 65 76 65 6e 74 2e 0d 0a 20 20 20 20 20 20 20 20 oking.into.this.event...........
1bfa0 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 66 20 79 6f 75 20 61 72 65 20 6c 6f 6f 6b ///..........///.If.you.are.look
1bfc0 69 6e 67 20 74 6f 20 6d 6f 6e 69 74 6f 72 20 63 68 61 6e 67 65 73 20 74 6f 20 73 70 65 63 69 66 ing.to.monitor.changes.to.specif
1bfe0 69 63 20 69 6e 70 75 74 20 63 6f 6e 74 72 6f 6c 73 2c 20 73 74 61 74 65 20 63 68 61 6e 67 65 20 ic.input.controls,.state.change.
1c000 6d 6f 6e 69 74 6f 72 73 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 28 73 65 65 20 3c 73 65 65 20 monitors..........///.(see.<see.
1c020 63 72 65 66 3d 22 49 6e 70 75 74 53 74 61 74 65 2e 41 64 64 43 68 61 6e 67 65 4d 6f 6e 69 74 6f cref="InputState.AddChangeMonito
1c040 72 28 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 2c 49 49 6e 70 75 74 53 74 61 74 65 43 68 61 6e 67 65 r(InputControl,IInputStateChange
1c060 4d 6f 6e 69 74 6f 72 2c 6c 6f 6e 67 29 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 61 72 Monitor,long)"/>..........///.ar
1c080 65 20 75 73 75 61 6c 6c 79 20 61 20 6d 6f 72 65 20 65 66 66 69 63 69 65 6e 74 20 61 6e 64 20 63 e.usually.a.more.efficient.and.c
1c0a0 6f 6e 76 65 6e 69 65 6e 74 20 77 61 79 20 74 6f 20 73 65 74 20 74 68 69 73 20 75 70 2e 0d 0a 20 onvenient.way.to.set.this.up....
1c0c0 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f .......///.</remarks>........../
1c0e0 2f 2f 20 3c 65 78 63 65 70 74 69 6f 6e 20 63 72 65 66 3d 22 41 72 67 75 6d 65 6e 74 4e 75 6c 6c //.<exception.cref="ArgumentNull
1c100 45 78 63 65 70 74 69 6f 6e 22 3e 44 65 6c 65 67 61 74 65 20 72 65 66 65 72 65 6e 63 65 20 69 73 Exception">Delegate.reference.is
1c120 20 3c 63 3e 6e 75 6c 6c 3c 2f 63 3e 2e 3c 2f 65 78 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 .<c>null</c>.</exception>.......
1c140 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 51 75 65 75 65 45 76 65 6e 74 ...///.<seealso.cref="QueueEvent
1c160 28 49 6e 70 75 74 45 76 65 6e 74 50 74 72 29 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 (InputEventPtr)"/>..........///.
1c180 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 49 6e 70 75 74 45 76 65 6e 74 22 2f 3e 0d 0a 20 20 <seealso.cref="InputEvent"/>....
1c1a0 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 55 70 64 61 74 65 22 ......///.<seealso.cref="Update"
1c1c0 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 49 />..........///.<seealso.cref="I
1c1e0 6e 70 75 74 53 65 74 74 69 6e 67 73 2e 75 70 64 61 74 65 4d 6f 64 65 22 2f 3e 0d 0a 20 20 20 20 nputSettings.updateMode"/>......
1c200 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 65 76 65 6e 74 20 41 63 74 69 6f 6e 3c 49 ....public.static.event.Action<I
1c220 6e 70 75 74 45 76 65 6e 74 50 74 72 2c 20 49 6e 70 75 74 44 65 76 69 63 65 3e 20 6f 6e 45 76 65 nputEventPtr,.InputDevice>.onEve
1c240 6e 74 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 61 64 64 0d 0a nt..........{..............add..
1c260 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
1c280 66 20 28 76 61 6c 75 65 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 f.(value.==.null)...............
1c2a0 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 .......throw.new.ArgumentNullExc
1c2c0 65 70 74 69 6f 6e 28 6e 61 6d 65 6f 66 28 76 61 6c 75 65 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 eption(nameof(value));..........
1c2e0 20 20 20 20 20 20 20 20 6c 6f 63 6b 20 28 73 5f 4d 61 6e 61 67 65 72 29 0d 0a 20 20 20 20 20 20 ........lock.(s_Manager)........
1c300 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 4d 61 6e 61 67 65 72 2e 6f 6e 45 76 65 6e 74 20 ..............s_Manager.onEvent.
1c320 2b 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 +=.value;..............}........
1c340 20 20 20 20 20 20 72 65 6d 6f 76 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 ......remove..............{.....
1c360 20 20 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 .............if.(value.==.null).
1c380 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 41 .....................throw.new.A
1c3a0 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 28 6e 61 6d 65 6f 66 28 76 61 6c 75 rgumentNullException(nameof(valu
1c3c0 65 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6c 6f 63 6b 20 28 73 5f 4d 61 e));..................lock.(s_Ma
1c3e0 6e 61 67 65 72 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 4d 61 nager)......................s_Ma
1c400 6e 61 67 65 72 2e 6f 6e 45 76 65 6e 74 20 2d 3d 20 76 61 6c 75 65 3b 0d 0a 20 20 20 20 20 20 20 nager.onEvent.-=.value;.........
1c420 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 .....}..........}............///
1c440 2f 54 4f 44 4f 3a 20 6e 65 65 64 20 74 6f 20 68 61 6e 64 6c 65 20 65 76 65 6e 74 73 20 62 65 69 /TODO:.need.to.handle.events.bei
1c460 6e 67 20 71 75 65 75 65 64 20 2a 64 75 72 69 6e 67 2a 20 65 76 65 6e 74 20 70 72 6f 63 65 73 73 ng.queued.*during*.event.process
1c480 69 6e 67 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 ing............///.<summary>....
1c4a0 20 20 20 20 20 20 2f 2f 2f 20 41 64 64 20 61 6e 20 65 76 65 6e 74 20 74 6f 20 74 68 65 20 69 6e ......///.Add.an.event.to.the.in
1c4c0 74 65 72 6e 61 6c 20 65 76 65 6e 74 20 71 75 65 75 65 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f ternal.event.queue...........///
1c4e0 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 .</summary>..........///.<param.
1c500 6e 61 6d 65 3d 22 65 76 65 6e 74 50 74 72 22 3e 45 76 65 6e 74 20 74 6f 20 61 64 64 20 74 6f 20 name="eventPtr">Event.to.add.to.
1c520 74 68 65 20 69 6e 74 65 72 6e 61 6c 20 65 76 65 6e 74 20 62 75 66 66 65 72 2e 3c 2f 70 61 72 61 the.internal.event.buffer.</para
1c540 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f 6e 20 63 72 65 66 3d m>..........///.<exception.cref=
1c560 22 41 72 67 75 6d 65 6e 74 45 78 63 65 70 74 69 6f 6e 22 3e 3c 70 61 72 61 6d 72 65 66 20 6e 61 "ArgumentException"><paramref.na
1c580 6d 65 3d 22 65 76 65 6e 74 50 74 72 22 2f 3e 20 69 73 20 6e 6f 74 0d 0a 20 20 20 20 20 20 20 20 me="eventPtr"/>.is.not..........
1c5a0 2f 2f 2f 20 76 61 6c 69 64 20 28 73 65 65 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 45 ///.valid.(see.<see.cref="InputE
1c5c0 76 65 6e 74 50 74 72 2e 76 61 6c 69 64 22 2f 3e 29 2e 3c 2f 65 78 63 65 70 74 69 6f 6e 3e 0d 0a ventPtr.valid"/>).</exception>..
1c5e0 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f ........///.<remarks>........../
1c600 2f 2f 20 54 68 65 20 65 76 65 6e 74 20 77 69 6c 6c 20 62 65 20 63 6f 70 69 65 64 20 69 6e 20 66 //.The.event.will.be.copied.in.f
1c620 75 6c 6c 20 74 6f 20 74 68 65 20 69 6e 74 65 72 6e 61 6c 20 65 76 65 6e 74 20 62 75 66 66 65 72 ull.to.the.internal.event.buffer
1c640 20 6d 65 61 6e 69 6e 67 20 74 68 61 74 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 79 6f 75 20 63 .meaning.that..........///.you.c
1c660 61 6e 20 72 65 6c 65 61 73 65 20 6d 65 6d 6f 72 79 20 66 6f 72 20 74 68 65 20 65 76 65 6e 74 20 an.release.memory.for.the.event.
1c680 61 66 74 65 72 20 69 74 20 68 61 73 20 62 65 65 6e 20 71 75 65 75 65 64 2e 20 54 68 65 20 69 6e after.it.has.been.queued..The.in
1c6a0 74 65 72 6e 61 6c 20 65 76 65 6e 74 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 62 75 66 66 65 72 ternal.event..........///.buffer
1c6c0 20 69 73 20 66 6c 75 73 68 65 64 20 6f 6e 20 74 68 65 20 6e 65 78 74 20 69 6e 70 75 74 20 73 79 .is.flushed.on.the.next.input.sy
1c6e0 73 74 65 6d 20 75 70 64 61 74 65 20 28 73 65 65 20 3c 73 65 65 20 63 72 65 66 3d 22 55 70 64 61 stem.update.(see.<see.cref="Upda
1c700 74 65 22 2f 3e 29 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 4e 6f 74 65 20 74 68 61 74 20 69 te"/>)...........///.Note.that.i
1c720 66 20 74 69 6d 65 73 6c 69 63 69 6e 67 20 69 73 20 69 6e 20 65 66 66 65 63 74 20 28 73 65 65 20 f.timeslicing.is.in.effect.(see.
1c740 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 53 65 74 74 69 6e 67 73 2e 74 69 6d 65 73 6c 69 <see.cref="InputSettings.timesli
1c760 63 65 45 76 65 6e 74 73 22 2f 3e 29 2c 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 74 68 65 6e 20 ceEvents"/>),..........///.then.
1c780 74 68 65 20 65 76 65 6e 74 20 6d 61 79 20 6e 6f 74 20 67 65 74 20 70 72 6f 63 65 73 73 65 64 20 the.event.may.not.get.processed.
1c7a0 75 6e 74 69 6c 20 69 74 73 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 45 76 65 6e 74 2e until.its.<see.cref="InputEvent.
1c7c0 74 69 6d 65 22 2f 3e 20 74 69 6d 65 73 74 61 6d 70 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 69 time"/>.timestamp..........///.i
1c7e0 73 20 77 69 74 68 69 6e 20 74 68 65 20 75 70 64 61 74 65 20 77 69 6e 64 6f 77 20 6f 66 20 74 68 s.within.the.update.window.of.th
1c800 65 20 69 6e 70 75 74 20 73 79 73 74 65 6d 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 e.input.system...........///....
1c820 20 20 20 20 20 20 2f 2f 2f 20 41 73 20 70 61 72 74 20 6f 66 20 71 75 65 75 69 6e 67 2c 20 74 68 ......///.As.part.of.queuing,.th
1c840 65 20 65 76 65 6e 74 20 77 69 6c 6c 20 72 65 63 65 69 76 65 20 69 74 73 20 6f 77 6e 20 75 6e 69 e.event.will.receive.its.own.uni
1c860 71 75 65 20 49 44 20 28 73 65 65 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 45 76 65 6e que.ID.(see.<see.cref="InputEven
1c880 74 2e 65 76 65 6e 74 49 64 22 2f 3e 29 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 4e 6f 74 65 t.eventId"/>)...........///.Note
1c8a0 20 74 68 61 74 20 74 68 69 73 20 49 44 20 77 69 6c 6c 20 62 65 20 77 72 69 74 74 65 6e 20 69 6e .that.this.ID.will.be.written.in
1c8c0 74 6f 20 74 68 65 20 6d 65 6d 6f 72 79 20 62 75 66 66 65 72 20 72 65 66 65 72 65 6e 63 65 64 20 to.the.memory.buffer.referenced.
1c8e0 62 79 20 3c 73 65 65 20 63 72 65 66 3d 22 65 76 65 6e 74 50 74 72 22 2f 3e 0d 0a 20 20 20 20 20 by.<see.cref="eventPtr"/>.......
1c900 20 20 20 2f 2f 2f 20 6d 65 61 6e 69 6e 67 20 74 68 61 74 20 61 66 74 65 72 20 63 61 6c 6c 69 6e ...///.meaning.that.after.callin
1c920 67 20 3c 63 3e 51 75 65 75 65 45 76 65 6e 74 3c 2f 63 3e 2c 20 79 6f 75 20 77 69 6c 6c 20 73 65 g.<c>QueueEvent</c>,.you.will.se
1c940 65 20 74 68 65 20 65 76 65 6e 74 20 49 44 20 77 69 74 68 20 77 68 69 63 68 20 74 68 65 20 65 76 e.the.event.ID.with.which.the.ev
1c960 65 6e 74 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 77 61 73 20 71 75 65 75 65 64 2e 0d 0a 20 20 ent..........///.was.queued.....
1c980 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 61 6d 70 6c 65 3e ......///..........///.<example>
1c9a0 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 63 6f 64 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f ..........///.<code>..........//
1c9c0 2f 20 2f 2f 20 51 75 65 75 65 20 61 6e 20 69 6e 70 75 74 20 65 76 65 6e 74 20 6f 6e 20 74 68 65 /.//.Queue.an.input.event.on.the
1c9e0 20 66 69 72 73 74 20 67 61 6d 65 70 61 64 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 76 61 72 .first.gamepad...........///.var
1ca00 20 67 61 6d 65 70 61 64 20 3d 20 47 61 6d 65 70 61 64 2e 61 6c 6c 5b 30 5d 3b 0d 0a 20 20 20 20 .gamepad.=.Gamepad.all[0];......
1ca20 20 20 20 20 2f 2f 2f 20 75 73 69 6e 67 20 28 53 74 61 74 65 45 76 65 6e 74 2e 46 72 6f 6d 28 67 ....///.using.(StateEvent.From(g
1ca40 61 6d 65 70 61 64 2c 20 6f 75 74 20 76 61 72 20 65 76 65 6e 74 50 74 72 29 29 0d 0a 20 20 20 20 amepad,.out.var.eventPtr))......
1ca60 20 20 20 20 2f 2f 2f 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 67 61 6d 65 70 ....///.{..........///.....gamep
1ca80 61 64 2e 6c 65 66 74 53 74 69 63 6b 2e 57 72 69 74 65 56 61 6c 75 65 49 6e 74 6f 45 76 65 6e 74 ad.leftStick.WriteValueIntoEvent
1caa0 28 6e 65 77 20 56 65 63 74 6f 72 32 28 30 2e 31 32 33 2c 20 30 2e 32 33 34 29 2c 20 65 76 65 6e (new.Vector2(0.123,.0.234),.even
1cac0 74 50 74 72 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 49 6e 70 75 74 53 79 73 tPtr);..........///.....InputSys
1cae0 74 65 6d 2e 51 75 65 75 65 45 76 65 6e 74 28 65 76 65 6e 74 50 74 72 29 3b 0d 0a 20 20 20 20 20 tem.QueueEvent(eventPtr);.......
1cb00 20 20 20 2f 2f 2f 20 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 ...///.}..........///.</code>...
1cb20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 65 78 61 6d 70 6c 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f .......///.</example>........../
1cb40 2f 2f 20 3c 2f 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 //.</remarks>..........///.<seea
1cb60 6c 73 6f 20 63 72 65 66 3d 22 55 70 64 61 74 65 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 lso.cref="Update"/>..........pub
1cb80 6c 69 63 20 73 74 61 74 69 63 20 76 6f 69 64 20 51 75 65 75 65 45 76 65 6e 74 28 49 6e 70 75 74 lic.static.void.QueueEvent(Input
1cba0 45 76 65 6e 74 50 74 72 20 65 76 65 6e 74 50 74 72 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 EventPtr.eventPtr)..........{...
1cbc0 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 65 76 65 6e 74 50 74 72 2e 76 61 6c 69 64 29 0d ...........if.(!eventPtr.valid).
1cbe0 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 41 72 67 75 6d .................throw.new.Argum
1cc00 65 6e 74 45 78 63 65 70 74 69 6f 6e 28 22 52 65 63 65 69 76 65 64 20 61 20 6e 75 6c 6c 20 65 76 entException("Received.a.null.ev
1cc20 65 6e 74 20 70 6f 69 6e 74 65 72 22 2c 20 6e 61 6d 65 6f 66 28 65 76 65 6e 74 50 74 72 29 29 3b ent.pointer",.nameof(eventPtr));
1cc40 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 4d 61 6e 61 67 65 72 2e 51 75 65 75 65 45 ................s_Manager.QueueE
1cc60 76 65 6e 74 28 65 76 65 6e 74 50 74 72 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 vent(eventPtr);..........}......
1cc80 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 76 6f 69 64 20 51 75 65 75 65 45 76 ......public.static.void.QueueEv
1cca0 65 6e 74 3c 54 45 76 65 6e 74 3e 28 72 65 66 20 54 45 76 65 6e 74 20 69 6e 70 75 74 45 76 65 6e ent<TEvent>(ref.TEvent.inputEven
1ccc0 74 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 77 68 65 72 65 20 54 45 76 65 6e 74 20 3a 20 73 t)..............where.TEvent.:.s
1cce0 74 72 75 63 74 2c 20 49 49 6e 70 75 74 45 76 65 6e 74 54 79 70 65 49 6e 66 6f 0d 0a 20 20 20 20 truct,.IInputEventTypeInfo......
1cd00 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 4d 61 6e 61 67 65 72 2e 51 75 65 ....{..............s_Manager.Que
1cd20 75 65 45 76 65 6e 74 28 72 65 66 20 69 6e 70 75 74 45 76 65 6e 74 29 3b 0d 0a 20 20 20 20 20 20 ueEvent(ref.inputEvent);........
1cd40 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 2f 52 45 56 49 45 57 3a 20 63 6f 6e 73 69 ..}............////REVIEW:.consi
1cd60 64 65 72 20 6d 6f 76 69 6e 67 20 74 68 65 73 65 20 6f 75 74 20 69 6e 74 6f 20 65 78 74 65 6e 73 der.moving.these.out.into.extens
1cd80 69 6f 6e 20 6d 65 74 68 6f 64 73 20 69 6e 20 55 6e 69 74 79 45 6e 67 69 6e 65 2e 49 6e 70 75 74 ion.methods.in.UnityEngine.Input
1cda0 53 79 73 74 65 6d 2e 4c 6f 77 4c 65 76 65 6c 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 2f 54 System.LowLevel............////T
1cdc0 4f 44 4f 3a 20 66 69 6e 64 20 61 20 6d 6f 72 65 20 65 6c 65 67 61 6e 74 20 73 6f 6c 75 74 69 6f ODO:.find.a.more.elegant.solutio
1cde0 6e 20 66 6f 72 20 74 68 69 73 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 4d 6f 6e 6f 20 77 69 6c 6c n.for.this..........//.Mono.will
1ce00 20 75 6e 67 72 61 63 65 66 75 6c 6c 79 20 70 6f 6f 70 20 65 78 63 65 70 74 69 6f 6e 73 20 69 66 .ungracefully.poop.exceptions.if
1ce20 20 77 65 20 74 72 79 20 74 6f 20 75 73 65 20 4c 61 79 6f 75 74 4b 69 6e 64 2e 45 78 70 6c 69 63 .we.try.to.use.LayoutKind.Explic
1ce40 69 74 20 69 6e 20 67 65 6e 65 72 69 63 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 73 74 72 75 63 74 it.in.generic..........//.struct
1ce60 73 2e 20 53 6f 20 77 65 20 63 61 6e 27 74 20 6a 75 73 74 20 73 74 75 66 66 20 61 20 67 65 6e 65 s..So.we.can't.just.stuff.a.gene
1ce80 72 69 63 20 54 53 74 61 74 65 20 69 6e 74 6f 20 61 20 53 74 61 74 65 45 76 65 6e 74 3c 54 53 74 ric.TState.into.a.StateEvent<TSt
1cea0 61 74 65 3e 20 61 6e 64 20 65 6e 66 6f 72 63 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 70 72 6f ate>.and.enforce..........//.pro
1cec0 70 65 72 20 6c 61 79 6f 75 74 2e 20 54 68 75 73 20 74 68 65 20 6a 75 6d 70 69 6e 67 20 74 68 72 per.layout..Thus.the.jumping.thr
1cee0 6f 75 67 68 20 6c 6f 74 73 20 6f 66 20 75 67 6c 79 20 68 6f 6f 70 73 20 68 65 72 65 2e 0d 0a 20 ough.lots.of.ugly.hoops.here....
1cf00 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 75 6e 73 61 66 65 20 73 74 72 75 63 74 20 53 74 61 .......private.unsafe.struct.Sta
1cf20 74 65 45 76 65 6e 74 42 75 66 66 65 72 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 teEventBuffer..........{........
1cf40 20 20 20 20 20 20 70 75 62 6c 69 63 20 53 74 61 74 65 45 76 65 6e 74 20 73 74 61 74 65 45 76 65 ......public.StateEvent.stateEve
1cf60 6e 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 63 6f 6e 73 74 20 69 6e nt;..............public.const.in
1cf80 74 20 6b 4d 61 78 53 69 7a 65 20 3d 20 35 31 32 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 t.kMaxSize.=.512;..............p
1cfa0 75 62 6c 69 63 20 66 69 78 65 64 20 62 79 74 65 20 64 61 74 61 5b 6b 4d 61 78 53 69 7a 65 20 2d ublic.fixed.byte.data[kMaxSize.-
1cfc0 20 31 5d 3b 20 2f 2f 20 53 74 61 74 65 45 76 65 6e 74 20 61 6c 72 65 61 64 79 20 61 64 64 73 20 .1];.//.StateEvent.already.adds.
1cfe0 6f 6e 65 2e 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 one...........}..........///.<su
1d000 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 51 75 65 75 65 20 61 20 3c 73 65 65 mmary>..........///.Queue.a.<see
1d020 20 63 72 65 66 3d 22 53 74 61 74 65 45 76 65 6e 74 22 2f 3e 20 74 6f 20 75 70 64 61 74 65 20 74 .cref="StateEvent"/>.to.update.t
1d040 68 65 20 69 6e 70 75 74 20 73 74 61 74 65 20 6f 66 20 74 68 65 20 67 69 76 65 6e 20 64 65 76 69 he.input.state.of.the.given.devi
1d060 63 65 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 ce...........///.</summary>.....
1d080 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 64 65 76 69 63 65 22 3e 44 65 .....///.<param.name="device">De
1d0a0 76 69 63 65 20 77 68 6f 73 65 20 69 6e 70 75 74 20 73 74 61 74 65 20 74 6f 20 75 70 64 61 74 65 vice.whose.input.state.to.update
1d0c0 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d </param>..........///.<param.nam
1d0e0 65 3d 22 73 74 61 74 65 22 3e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 e="state"></param>..........///.
1d100 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 74 69 6d 65 22 3e 54 69 6d 65 73 74 61 6d 70 20 66 6f 72 <param.name="time">Timestamp.for
1d120 20 74 68 65 20 65 76 65 6e 74 2e 20 49 66 20 6e 6f 74 20 73 75 70 70 6c 69 65 64 2c 20 74 68 65 .the.event..If.not.supplied,.the
1d140 20 63 75 72 72 65 6e 74 20 74 69 6d 65 20 69 73 20 75 73 65 64 2e 20 4e 6f 74 65 0d 0a 20 20 20 .current.time.is.used..Note.....
1d160 20 20 20 20 20 2f 2f 2f 20 74 68 61 74 20 69 66 20 74 68 65 20 67 69 76 65 6e 20 74 69 6d 65 20 .....///.that.if.the.given.time.
1d180 69 73 20 69 6e 20 74 68 65 20 66 75 74 75 72 65 20 61 6e 64 20 74 69 6d 65 73 6c 69 63 69 6e 67 is.in.the.future.and.timeslicing
1d1a0 20 69 73 20 61 63 74 69 76 65 20 28 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 53 65 74 74 .is.active.(<see.cref="InputSett
1d1c0 69 6e 67 73 2e 74 69 6d 65 73 6c 69 63 65 45 76 65 6e 74 73 22 2f 3e 2c 0d 0a 20 20 20 20 20 20 ings.timesliceEvents"/>,........
1d1e0 20 20 2f 2f 2f 20 74 68 65 20 65 76 65 6e 74 20 77 69 6c 6c 20 6f 6e 6c 79 20 67 65 74 20 70 72 ..///.the.event.will.only.get.pr
1d200 6f 63 65 73 73 65 64 20 6f 6e 63 65 20 74 68 65 20 61 63 74 75 61 6c 20 74 69 6d 65 20 68 61 73 ocessed.once.the.actual.time.has
1d220 20 63 61 75 67 68 74 20 75 70 20 77 69 74 68 20 74 68 65 20 67 69 76 65 6e 20 74 69 6d 65 2e 3c .caught.up.with.the.given.time.<
1d240 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 74 79 70 65 70 61 72 61 6d 20 /param>..........///.<typeparam.
1d260 6e 61 6d 65 3d 22 54 53 74 61 74 65 22 3e 54 79 70 65 20 6f 66 20 69 6e 70 75 74 20 73 74 61 74 name="TState">Type.of.input.stat
1d280 65 2c 20 73 75 63 68 20 61 73 20 3c 73 65 65 20 63 72 65 66 3d 22 4d 6f 75 73 65 53 74 61 74 65 e,.such.as.<see.cref="MouseState
1d2a0 22 2f 3e 2e 20 4d 75 73 74 20 6d 61 74 63 68 20 74 68 65 20 65 78 70 65 63 74 65 64 0d 0a 20 20 "/>..Must.match.the.expected....
1d2c0 20 20 20 20 20 20 2f 2f 2f 20 74 79 70 65 20 6f 66 20 73 74 61 74 65 20 6f 66 20 3c 70 61 72 61 ......///.type.of.state.of.<para
1d2e0 6d 72 65 66 20 6e 61 6d 65 3d 22 64 65 76 69 63 65 22 2f 3e 2e 3c 2f 74 79 70 65 70 61 72 61 6d mref.name="device"/>.</typeparam
1d300 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 >..........///.<remarks>........
1d320 20 20 2f 2f 2f 20 54 68 65 20 67 69 76 65 6e 20 73 74 61 74 65 20 6d 75 73 74 20 6d 61 74 63 68 ..///.The.given.state.must.match
1d340 20 65 78 61 63 74 6c 79 20 77 68 61 74 20 69 73 20 65 78 70 65 63 74 65 64 20 62 79 20 74 68 65 .exactly.what.is.expected.by.the
1d360 20 67 69 76 65 6e 20 64 65 76 69 63 65 2e 20 49 66 20 75 6e 73 75 72 65 2c 20 61 6e 20 61 6c 74 .given.device..If.unsure,.an.alt
1d380 65 72 6e 61 74 69 76 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 69 73 20 74 6f 20 67 72 61 62 ernative..........///.is.to.grab
1d3a0 20 74 68 65 20 73 74 61 74 65 20 61 73 20 61 6e 20 65 76 65 6e 74 20 64 69 72 65 63 74 6c 79 20 .the.state.as.an.event.directly.
1d3c0 66 72 6f 6d 20 74 68 65 20 64 65 76 69 63 65 20 75 73 69 6e 67 20 3c 73 65 65 0d 0a 20 20 20 20 from.the.device.using.<see......
1d3e0 20 20 20 20 2f 2f 2f 20 63 72 65 66 3d 22 53 74 61 74 65 45 76 65 6e 74 2e 46 72 6f 6d 28 49 6e ....///.cref="StateEvent.From(In
1d400 70 75 74 44 65 76 69 63 65 2c 6f 75 74 20 49 6e 70 75 74 45 76 65 6e 74 50 74 72 2c 55 6e 69 74 putDevice,out.InputEventPtr,Unit
1d420 79 2e 43 6f 6c 6c 65 63 74 69 6f 6e 73 2e 41 6c 6c 6f 63 61 74 6f 72 29 22 2f 3e 20 77 68 69 63 y.Collections.Allocator)"/>.whic
1d440 68 20 63 61 6e 20 74 68 65 6e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 62 65 20 71 75 65 75 65 h.can.then..........///.be.queue
1d460 64 20 75 73 69 6e 67 20 3c 73 65 65 20 63 72 65 66 3d 22 51 75 65 75 65 45 76 65 6e 74 28 49 6e d.using.<see.cref="QueueEvent(In
1d480 70 75 74 45 76 65 6e 74 50 74 72 29 22 2f 3e 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 putEventPtr)"/>...........///...
1d4a0 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 2f 2f .......///.<example>..........//
1d4c0 2f 20 3c 63 6f 64 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 2f 2f 20 41 6c 6c 6f 63 61 74 /.<code>..........///.//.Allocat
1d4e0 65 73 20 74 65 6d 70 6f 72 61 72 79 2c 20 75 6e 6d 61 6e 61 67 65 64 20 6d 65 6d 6f 72 79 20 66 es.temporary,.unmanaged.memory.f
1d500 6f 72 20 74 68 65 20 65 76 65 6e 74 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 2f 2f 20 75 73 or.the.event...........///.//.us
1d520 69 6e 67 20 73 74 61 74 65 6d 65 6e 74 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c 79 20 64 69 73 70 ing.statement.automatically.disp
1d540 6f 73 65 73 20 74 68 65 20 6d 65 6d 6f 72 79 20 6f 6e 63 65 20 77 65 20 68 61 76 65 20 71 75 65 oses.the.memory.once.we.have.que
1d560 75 65 64 20 74 68 65 20 65 76 65 6e 74 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 75 73 69 6e ued.the.event...........///.usin
1d580 67 20 28 53 74 61 74 65 45 76 65 6e 74 2e 46 72 6f 6d 28 4d 6f 75 73 65 2e 63 75 72 72 65 6e 74 g.(StateEvent.From(Mouse.current
1d5a0 2c 20 6f 75 74 20 76 61 72 20 65 76 65 6e 74 50 74 72 29 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f ,.out.var.eventPtr))..........//
1d5c0 2f 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 2f 2f 20 55 73 65 20 63 6f 6e 74 /.{..........///.....//.Use.cont
1d5e0 72 6f 6c 73 20 6f 6e 20 6d 6f 75 73 65 20 74 6f 20 77 72 69 74 65 20 76 61 6c 75 65 73 20 69 6e rols.on.mouse.to.write.values.in
1d600 74 6f 20 65 76 65 6e 74 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 4d 6f 75 73 65 to.event...........///.....Mouse
1d620 2e 63 75 72 72 65 6e 74 2e 70 6f 73 69 74 69 6f 6e 2e 57 72 69 74 65 56 61 6c 75 65 49 6e 74 6f .current.position.WriteValueInto
1d640 45 76 65 6e 74 28 6e 65 77 20 56 65 63 74 6f 72 28 31 32 33 2c 20 32 33 34 29 2c 20 65 76 65 6e Event(new.Vector(123,.234),.even
1d660 74 50 74 72 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f tPtr);..........///..........///
1d680 20 20 20 20 20 2f 2f 20 51 75 65 75 65 20 65 76 65 6e 74 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f .....//.Queue.event...........//
1d6a0 2f 20 20 20 20 20 49 6e 70 75 74 53 79 73 74 65 6d 2e 51 75 65 75 65 45 76 65 6e 74 28 65 76 65 /.....InputSystem.QueueEvent(eve
1d6c0 6e 74 50 74 72 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 7d 0d 0a 20 20 20 20 20 20 20 20 ntPtr);..........///.}..........
1d6e0 2f 2f 2f 20 3c 2f 63 6f 64 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 65 78 61 6d 70 ///.</code>..........///.</examp
1d700 6c 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 68 le>..........///..........///.Th
1d720 65 20 65 76 65 6e 74 20 77 69 6c 6c 20 6f 6e 6c 79 20 62 65 20 71 75 65 75 65 64 20 61 6e 64 20 e.event.will.only.be.queued.and.
1d740 6e 6f 74 20 70 72 6f 63 65 73 73 65 64 20 72 69 67 68 74 20 61 77 61 79 2e 20 54 68 69 73 20 6d not.processed.right.away..This.m
1d760 65 61 6e 73 20 74 68 61 74 20 74 68 65 20 73 74 61 74 65 20 6f 66 0d 0a 20 20 20 20 20 20 20 20 eans.that.the.state.of..........
1d780 2f 2f 2f 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 64 65 76 69 63 65 22 2f 3e 20 77 69 ///.<paramref.name="device"/>.wi
1d7a0 6c 6c 20 6e 6f 74 20 63 68 61 6e 67 65 20 69 6d 6d 65 64 69 61 74 65 6c 79 20 61 73 20 61 20 72 ll.not.change.immediately.as.a.r
1d7c0 65 73 75 6c 74 20 6f 66 20 63 61 6c 6c 69 6e 67 20 74 68 69 73 20 6d 65 74 68 6f 64 2e 20 49 6e esult.of.calling.this.method..In
1d7e0 73 74 65 61 64 2c 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 74 68 65 20 65 76 65 6e 74 20 77 69 stead,..........///.the.event.wi
1d800 6c 6c 20 62 65 20 70 72 6f 63 65 73 73 65 64 20 61 73 20 70 61 72 74 20 6f 66 20 74 68 65 20 6e ll.be.processed.as.part.of.the.n
1d820 65 78 74 20 69 6e 70 75 74 20 75 70 64 61 74 65 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a ext.input.update...........///..
1d840 20 20 20 20 20 20 20 20 2f 2f 2f 20 4e 6f 74 65 20 74 68 61 74 20 74 68 69 73 20 6d 65 74 68 6f ........///.Note.that.this.metho
1d860 64 20 75 70 64 61 74 65 73 20 74 68 65 20 63 6f 6d 70 6c 65 74 65 20 69 6e 70 75 74 20 73 74 61 d.updates.the.complete.input.sta
1d880 74 65 20 6f 66 20 74 68 65 20 64 65 76 69 63 65 20 69 6e 63 6c 75 64 69 6e 67 20 61 6c 6c 20 6f te.of.the.device.including.all.o
1d8a0 66 20 69 74 73 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 63 6f 6e 74 72 6f 6c 73 2e 20 54 6f 20 f.its..........///.controls..To.
1d8c0 75 70 64 61 74 65 20 6a 75 73 74 20 70 61 72 74 20 6f 66 20 74 68 65 20 73 74 61 74 65 20 6f 66 update.just.part.of.the.state.of
1d8e0 20 61 20 64 65 76 69 63 65 2c 20 79 6f 75 20 63 61 6e 20 75 73 65 20 3c 73 65 65 20 63 72 65 66 .a.device,.you.can.use.<see.cref
1d900 3d 22 51 75 65 75 65 44 65 6c 74 61 53 74 61 74 65 45 76 65 6e 74 7b 54 44 65 6c 74 61 7d 22 2f ="QueueDeltaStateEvent{TDelta}"/
1d920 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 28 68 6f 77 65 76 65 72 2c 20 6e 6f 74 65 20 74 68 >..........///.(however,.note.th
1d940 61 74 20 74 68 65 72 65 20 61 72 65 20 73 6f 6d 65 20 72 65 73 74 72 69 63 74 69 6f 6e 73 3b 20 at.there.are.some.restrictions;.
1d960 73 65 65 20 64 6f 63 75 6d 65 6e 74 61 74 69 6f 6e 29 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f see.documentation)...........///
1d980 20 3c 65 78 61 6d 70 6c 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 63 6f 64 65 3e 0d 0a .<example>..........///.<code>..
1d9a0 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 6e 70 75 74 53 79 73 74 65 6d 2e 51 75 65 75 65 53 74 61 ........///.InputSystem.QueueSta
1d9c0 74 65 45 76 65 6e 74 28 4d 6f 75 73 65 2e 63 75 72 72 65 6e 74 2c 20 6e 65 77 20 4d 6f 75 73 65 teEvent(Mouse.current,.new.Mouse
1d9e0 53 74 61 74 65 20 7b 20 70 6f 73 69 74 69 6f 6e 20 3d 20 6e 65 77 20 56 65 63 74 6f 72 28 31 32 State.{.position.=.new.Vector(12
1da00 33 2c 20 32 33 34 29 20 7d 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 63 6f 64 65 3e 3,.234).});..........///.</code>
1da20 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 65 78 61 6d 70 6c 65 3e 0d 0a 20 20 20 20 20 20 ..........///.</example>........
1da40 20 20 2f 2f 2f 20 3c 2f 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 ..///.</remarks>..........///.<e
1da60 78 63 65 70 74 69 6f 6e 20 63 72 65 66 3d 22 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 xception.cref="ArgumentNullExcep
1da80 74 69 6f 6e 22 3e 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 64 65 76 69 63 65 22 2f 3e 20 tion"><paramref.name="device"/>.
1daa0 69 73 20 6e 75 6c 6c 2e 3c 2f 65 78 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f is.null.</exception>..........//
1dac0 2f 20 3c 65 78 63 65 70 74 69 6f 6e 20 63 72 65 66 3d 22 49 6e 76 61 6c 69 64 4f 70 65 72 61 74 /.<exception.cref="InvalidOperat
1dae0 69 6f 6e 45 78 63 65 70 74 69 6f 6e 22 3e 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 64 65 ionException"><paramref.name="de
1db00 76 69 63 65 22 2f 3e 20 68 61 73 20 6e 6f 74 20 62 65 65 6e 20 61 64 64 65 64 20 74 6f 20 74 68 vice"/>.has.not.been.added.to.th
1db20 65 20 73 79 73 74 65 6d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 28 3c 73 65 65 20 63 72 65 66 e.system..........///.(<see.cref
1db40 3d 22 41 64 64 44 65 76 69 63 65 28 49 6e 70 75 74 44 65 76 69 63 65 29 22 2f 3e 29 20 61 6e 64 ="AddDevice(InputDevice)"/>).and
1db60 20 74 68 75 73 20 63 61 6e 6e 6f 74 20 72 65 63 65 69 76 65 20 65 76 65 6e 74 73 2e 3c 2f 65 78 .thus.cannot.receive.events.</ex
1db80 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f 6e ception>..........///.<exception
1dba0 20 63 72 65 66 3d 22 41 72 67 75 6d 65 6e 74 45 78 63 65 70 74 69 6f 6e 22 3e 3c 2f 65 78 63 65 .cref="ArgumentException"></exce
1dbc0 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 75 6e ption>..........public.static.un
1dbe0 73 61 66 65 20 76 6f 69 64 20 51 75 65 75 65 53 74 61 74 65 45 76 65 6e 74 3c 54 53 74 61 74 65 safe.void.QueueStateEvent<TState
1dc00 3e 28 49 6e 70 75 74 44 65 76 69 63 65 20 64 65 76 69 63 65 2c 20 54 53 74 61 74 65 20 73 74 61 >(InputDevice.device,.TState.sta
1dc20 74 65 2c 20 64 6f 75 62 6c 65 20 74 69 6d 65 20 3d 20 2d 31 29 0d 0a 20 20 20 20 20 20 20 20 20 te,.double.time.=.-1)...........
1dc40 20 20 20 77 68 65 72 65 20 54 53 74 61 74 65 20 3a 20 73 74 72 75 63 74 2c 20 49 49 6e 70 75 74 ...where.TState.:.struct,.IInput
1dc60 53 74 61 74 65 54 79 70 65 49 6e 66 6f 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 StateTypeInfo..........{........
1dc80 20 20 20 20 20 20 69 66 20 28 64 65 76 69 63 65 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 ......if.(device.==.null).......
1dca0 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 4e 75 6c ...........throw.new.ArgumentNul
1dcc0 6c 45 78 63 65 70 74 69 6f 6e 28 6e 61 6d 65 6f 66 28 64 65 76 69 63 65 29 29 3b 0d 0a 0d 0a 20 lException(nameof(device));.....
1dce0 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4d 61 6b 65 20 73 75 72 65 20 64 65 76 69 63 65 20 69 ...........//.Make.sure.device.i
1dd00 73 20 61 63 74 75 61 6c 6c 79 20 69 6e 20 74 68 65 20 73 79 73 74 65 6d 2e 0d 0a 20 20 20 20 20 s.actually.in.the.system........
1dd20 20 20 20 20 20 20 20 69 66 20 28 64 65 76 69 63 65 2e 6d 5f 44 65 76 69 63 65 49 6e 64 65 78 20 .......if.(device.m_DeviceIndex.
1dd40 3d 3d 20 49 6e 70 75 74 44 65 76 69 63 65 2e 6b 49 6e 76 61 6c 69 64 44 65 76 69 63 65 49 6e 64 ==.InputDevice.kInvalidDeviceInd
1dd60 65 78 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 49 ex)..................throw.new.I
1dd80 6e 76 61 6c 69 64 4f 70 65 72 61 74 69 6f 6e 45 78 63 65 70 74 69 6f 6e 28 0d 0a 20 20 20 20 20 nvalidOperationException(.......
1dda0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 22 43 61 6e 6e 6f 74 20 71 75 65 75 65 20 73 74 ...............$"Cannot.queue.st
1ddc0 61 74 65 20 65 76 65 6e 74 20 66 6f 72 20 64 65 76 69 63 65 20 27 7b 64 65 76 69 63 65 7d 27 20 ate.event.for.device.'{device}'.
1dde0 62 65 63 61 75 73 65 20 64 65 76 69 63 65 20 68 61 73 20 6e 6f 74 20 62 65 65 6e 20 61 64 64 65 because.device.has.not.been.adde
1de00 64 20 74 6f 20 73 79 73 74 65 6d 22 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f d.to.system");................//
1de20 2f 2f 52 45 56 49 45 57 3a 20 64 6f 65 73 20 69 74 20 6d 61 6b 65 20 6d 6f 72 65 20 73 65 6e 73 //REVIEW:.does.it.make.more.sens
1de40 65 20 74 6f 20 67 6f 20 6f 66 66 20 74 68 65 20 27 73 74 61 74 65 42 6c 6f 63 6b 27 20 6f 6e 20 e.to.go.off.the.'stateBlock'.on.
1de60 74 68 65 20 64 65 76 69 63 65 20 61 6e 64 20 6c 65 74 20 74 68 61 74 20 64 65 74 65 72 6d 69 6e the.device.and.let.that.determin
1de80 65 20 73 69 7a 65 3f 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 73 74 61 74 65 e.size?................var.state
1dea0 53 69 7a 65 20 3d 20 28 75 69 6e 74 29 55 6e 73 61 66 65 55 74 69 6c 69 74 79 2e 53 69 7a 65 4f Size.=.(uint)UnsafeUtility.SizeO
1dec0 66 3c 54 53 74 61 74 65 3e 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 74 f<TState>();..............if.(st
1dee0 61 74 65 53 69 7a 65 20 3e 20 53 74 61 74 65 45 76 65 6e 74 42 75 66 66 65 72 2e 6b 4d 61 78 53 ateSize.>.StateEventBuffer.kMaxS
1df00 69 7a 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 ize)..................throw.new.
1df20 41 72 67 75 6d 65 6e 74 45 78 63 65 70 74 69 6f 6e 28 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 ArgumentException(..............
1df40 20 20 20 20 20 20 20 20 24 22 53 69 7a 65 20 6f 66 20 27 7b 74 79 70 65 6f 66 28 54 53 74 61 74 ........$"Size.of.'{typeof(TStat
1df60 65 29 2e 4e 61 6d 65 7d 27 20 65 78 63 65 65 64 73 20 6d 61 78 69 6d 75 6d 20 73 75 70 70 6f 72 e).Name}'.exceeds.maximum.suppor
1df80 74 65 64 20 73 74 61 74 65 20 73 69 7a 65 20 6f 66 20 7b 53 74 61 74 65 45 76 65 6e 74 42 75 66 ted.state.size.of.{StateEventBuf
1dfa0 66 65 72 2e 6b 4d 61 78 53 69 7a 65 7d 22 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 fer.kMaxSize}",.................
1dfc0 20 20 20 20 20 6e 61 6d 65 6f 66 28 73 74 61 74 65 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 .....nameof(state));............
1dfe0 20 20 76 61 72 20 65 76 65 6e 74 53 69 7a 65 20 3d 20 55 6e 73 61 66 65 55 74 69 6c 69 74 79 2e ..var.eventSize.=.UnsafeUtility.
1e000 53 69 7a 65 4f 66 3c 53 74 61 74 65 45 76 65 6e 74 3e 28 29 20 2b 20 73 74 61 74 65 53 69 7a 65 SizeOf<StateEvent>().+.stateSize
1e020 20 2d 20 53 74 61 74 65 45 76 65 6e 74 2e 6b 53 74 61 74 65 44 61 74 61 53 69 7a 65 54 6f 53 75 .-.StateEvent.kStateDataSizeToSu
1e040 62 74 72 61 63 74 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 74 69 6d 65 20 btract;................if.(time.
1e060 3c 20 30 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 69 6d 65 20 3d 20 49 6e 70 <.0)..................time.=.Inp
1e080 75 74 52 75 6e 74 69 6d 65 2e 73 5f 49 6e 73 74 61 6e 63 65 2e 63 75 72 72 65 6e 74 54 69 6d 65 utRuntime.s_Instance.currentTime
1e0a0 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 20 ;..............else.............
1e0c0 20 20 20 20 20 74 69 6d 65 20 2b 3d 20 49 6e 70 75 74 52 75 6e 74 69 6d 65 2e 73 5f 43 75 72 72 .....time.+=.InputRuntime.s_Curr
1e0e0 65 6e 74 54 69 6d 65 4f 66 66 73 65 74 54 6f 52 65 61 6c 74 69 6d 65 53 69 6e 63 65 53 74 61 72 entTimeOffsetToRealtimeSinceStar
1e100 74 75 70 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 53 74 61 74 65 45 76 65 6e 74 42 75 tup;................StateEventBu
1e120 66 66 65 72 20 65 76 65 6e 74 42 75 66 66 65 72 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 ffer.eventBuffer;..............e
1e140 76 65 6e 74 42 75 66 66 65 72 2e 73 74 61 74 65 45 76 65 6e 74 20 3d 0d 0a 20 20 20 20 20 20 20 ventBuffer.stateEvent.=.........
1e160 20 20 20 20 20 20 20 20 20 6e 65 77 20 53 74 61 74 65 45 76 65 6e 74 0d 0a 20 20 20 20 20 20 20 .........new.StateEvent.........
1e180 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 61 73 65 45 76 65 6e .....{..................baseEven
1e1a0 74 20 3d 20 6e 65 77 20 49 6e 70 75 74 45 76 65 6e 74 28 53 74 61 74 65 45 76 65 6e 74 2e 54 79 t.=.new.InputEvent(StateEvent.Ty
1e1c0 70 65 2c 20 28 69 6e 74 29 65 76 65 6e 74 53 69 7a 65 2c 20 64 65 76 69 63 65 2e 64 65 76 69 63 pe,.(int)eventSize,.device.devic
1e1e0 65 49 64 2c 20 74 69 6d 65 29 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 74 61 eId,.time),..................sta
1e200 74 65 46 6f 72 6d 61 74 20 3d 20 73 74 61 74 65 2e 66 6f 72 6d 61 74 0d 0a 20 20 20 20 20 20 20 teFormat.=.state.format.........
1e220 20 20 20 20 20 7d 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 70 74 72 20 3d .....};................var.ptr.=
1e240 20 65 76 65 6e 74 42 75 66 66 65 72 2e 73 74 61 74 65 45 76 65 6e 74 2e 73 74 61 74 65 44 61 74 .eventBuffer.stateEvent.stateDat
1e260 61 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 55 6e 73 61 66 65 55 74 69 6c 69 74 79 2e 4d 65 a;..............UnsafeUtility.Me
1e280 6d 43 70 79 28 70 74 72 2c 20 55 6e 73 61 66 65 55 74 69 6c 69 74 79 2e 41 64 64 72 65 73 73 4f mCpy(ptr,.UnsafeUtility.AddressO
1e2a0 66 28 72 65 66 20 73 74 61 74 65 29 2c 20 73 74 61 74 65 53 69 7a 65 29 3b 0d 0a 0d 0a 20 20 20 f(ref.state),.stateSize);.......
1e2c0 20 20 20 20 20 20 20 20 20 73 5f 4d 61 6e 61 67 65 72 2e 51 75 65 75 65 45 76 65 6e 74 28 72 65 .........s_Manager.QueueEvent(re
1e2e0 66 20 65 76 65 6e 74 42 75 66 66 65 72 2e 73 74 61 74 65 45 76 65 6e 74 29 3b 0d 0a 20 20 20 20 f.eventBuffer.stateEvent);......
1e300 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 75 6e 73 61 66 65 20 ....}............private.unsafe.
1e320 73 74 72 75 63 74 20 44 65 6c 74 61 53 74 61 74 65 45 76 65 6e 74 42 75 66 66 65 72 0d 0a 20 20 struct.DeltaStateEventBuffer....
1e340 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 44 65 6c 74 ......{..............public.Delt
1e360 61 53 74 61 74 65 45 76 65 6e 74 20 73 74 61 74 65 45 76 65 6e 74 3b 0d 0a 20 20 20 20 20 20 20 aStateEvent.stateEvent;.........
1e380 20 20 20 20 20 70 75 62 6c 69 63 20 63 6f 6e 73 74 20 69 6e 74 20 6b 4d 61 78 53 69 7a 65 20 3d .....public.const.int.kMaxSize.=
1e3a0 20 35 31 32 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 66 69 78 65 64 20 .512;..............public.fixed.
1e3c0 62 79 74 65 20 64 61 74 61 5b 6b 4d 61 78 53 69 7a 65 20 2d 20 31 5d 3b 20 2f 2f 20 44 65 6c 74 byte.data[kMaxSize.-.1];.//.Delt
1e3e0 61 53 74 61 74 65 45 76 65 6e 74 20 61 6c 72 65 61 64 79 20 61 64 64 73 20 6f 6e 65 2e 0d 0a 20 aStateEvent.already.adds.one....
1e400 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
1e420 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 51 75 65 75 65 20 61 20 3c 73 65 65 20 63 72 65 66 >..........///.Queue.a.<see.cref
1e440 3d 22 44 65 6c 74 61 53 74 61 74 65 45 76 65 6e 74 22 2f 3e 20 74 6f 20 75 70 64 61 74 65 20 70 ="DeltaStateEvent"/>.to.update.p
1e460 61 72 74 20 6f 66 20 74 68 65 20 69 6e 70 75 74 20 73 74 61 74 65 20 6f 66 20 74 68 65 20 67 69 art.of.the.input.state.of.the.gi
1e480 76 65 6e 20 64 65 76 69 63 65 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 ven.device...........///.</summa
1e4a0 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 63 6f ry>..........///.<param.name="co
1e4c0 6e 74 72 6f 6c 22 3e 43 6f 6e 74 72 6f 6c 20 6f 6e 20 61 20 64 65 76 69 63 65 20 74 6f 20 75 70 ntrol">Control.on.a.device.to.up
1e4e0 64 61 74 65 20 73 74 61 74 65 20 6f 66 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 date.state.of.</param>..........
1e500 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 64 65 6c 74 61 22 3e 4e 65 77 20 73 74 61 74 ///.<param.name="delta">New.stat
1e520 65 20 66 6f 72 20 74 68 65 20 63 6f 6e 74 72 6f 6c 2e 20 54 79 70 65 20 6f 66 20 73 74 61 74 65 e.for.the.control..Type.of.state
1e540 20 6d 75 73 74 20 6d 61 74 63 68 20 74 68 65 20 73 74 61 74 65 20 6f 66 20 74 68 65 20 63 6f 6e .must.match.the.state.of.the.con
1e560 74 72 6f 6c 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 trol.</param>..........///.<para
1e580 6d 20 6e 61 6d 65 3d 22 74 69 6d 65 22 3e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 m.name="time"></param>..........
1e5a0 2f 2f 2f 20 3c 74 79 70 65 70 61 72 61 6d 20 6e 61 6d 65 3d 22 54 44 65 6c 74 61 22 3e 3c 2f 74 ///.<typeparam.name="TDelta"></t
1e5c0 79 70 65 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f ypeparam>..........///.<exceptio
1e5e0 6e 20 63 72 65 66 3d 22 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 22 3e 3c n.cref="ArgumentNullException"><
1e600 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 63 6f 6e 74 72 6f 6c 22 2f 3e 20 69 73 20 6e 75 6c paramref.name="control"/>.is.nul
1e620 6c 2e 3c 2f 65 78 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 l.</exception>..........///.<exc
1e640 65 70 74 69 6f 6e 20 63 72 65 66 3d 22 49 6e 76 61 6c 69 64 4f 70 65 72 61 74 69 6f 6e 45 78 63 eption.cref="InvalidOperationExc
1e660 65 70 74 69 6f 6e 22 3e 3c 2f 65 78 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f eption"></exception>..........//
1e680 2f 20 3c 65 78 63 65 70 74 69 6f 6e 20 63 72 65 66 3d 22 41 72 67 75 6d 65 6e 74 45 78 63 65 70 /.<exception.cref="ArgumentExcep
1e6a0 74 69 6f 6e 22 3e 3c 2f 65 78 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c tion"></exception>..........publ
1e6c0 69 63 20 73 74 61 74 69 63 20 75 6e 73 61 66 65 20 76 6f 69 64 20 51 75 65 75 65 44 65 6c 74 61 ic.static.unsafe.void.QueueDelta
1e6e0 53 74 61 74 65 45 76 65 6e 74 3c 54 44 65 6c 74 61 3e 28 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 20 StateEvent<TDelta>(InputControl.
1e700 63 6f 6e 74 72 6f 6c 2c 20 54 44 65 6c 74 61 20 64 65 6c 74 61 2c 20 64 6f 75 62 6c 65 20 74 69 control,.TDelta.delta,.double.ti
1e720 6d 65 20 3d 20 2d 31 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 77 68 65 72 65 20 54 44 65 6c me.=.-1)..............where.TDel
1e740 74 61 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 ta.:.struct..........{..........
1e760 20 20 20 20 69 66 20 28 63 6f 6e 74 72 6f 6c 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 ....if.(control.==.null)........
1e780 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 4e 75 6c 6c ..........throw.new.ArgumentNull
1e7a0 45 78 63 65 70 74 69 6f 6e 28 6e 61 6d 65 6f 66 28 63 6f 6e 74 72 6f 6c 29 29 3b 0d 0a 0d 0a 20 Exception(nameof(control));.....
1e7c0 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 63 6f 6e 74 72 6f 6c 2e 73 74 61 74 65 42 6c 6f 63 ...........if.(control.stateBloc
1e7e0 6b 2e 62 69 74 4f 66 66 73 65 74 20 21 3d 20 30 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 k.bitOffset.!=.0)...............
1e800 20 20 20 74 68 72 6f 77 20 6e 65 77 20 49 6e 76 61 6c 69 64 4f 70 65 72 61 74 69 6f 6e 45 78 63 ...throw.new.InvalidOperationExc
1e820 65 70 74 69 6f 6e 28 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 22 43 eption(......................$"C
1e840 61 6e 6e 6f 74 20 73 65 6e 64 20 64 65 6c 74 61 20 73 74 61 74 65 20 65 76 65 6e 74 73 20 61 67 annot.send.delta.state.events.ag
1e860 61 69 6e 73 74 20 62 69 74 66 69 65 6c 64 20 63 6f 6e 74 72 6f 6c 73 3a 20 7b 63 6f 6e 74 72 6f ainst.bitfield.controls:.{contro
1e880 6c 7d 22 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4d 61 6b 65 20 73 75 72 l}");................//.Make.sur
1e8a0 65 20 64 65 76 69 63 65 20 69 73 20 61 63 74 75 61 6c 6c 79 20 69 6e 20 74 68 65 20 73 79 73 74 e.device.is.actually.in.the.syst
1e8c0 65 6d 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 64 65 76 69 63 65 20 3d 20 63 6f em...............var.device.=.co
1e8e0 6e 74 72 6f 6c 2e 64 65 76 69 63 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 64 ntrol.device;..............if.(d
1e900 65 76 69 63 65 2e 6d 5f 44 65 76 69 63 65 49 6e 64 65 78 20 3d 3d 20 49 6e 70 75 74 44 65 76 69 evice.m_DeviceIndex.==.InputDevi
1e920 63 65 2e 6b 49 6e 76 61 6c 69 64 44 65 76 69 63 65 49 6e 64 65 78 29 0d 0a 20 20 20 20 20 20 20 ce.kInvalidDeviceIndex).........
1e940 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 49 6e 76 61 6c 69 64 4f 70 65 72 61 74 .........throw.new.InvalidOperat
1e960 69 6f 6e 45 78 63 65 70 74 69 6f 6e 28 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ionException(...................
1e980 20 20 20 24 22 43 61 6e 6e 6f 74 20 71 75 65 75 65 20 73 74 61 74 65 20 65 76 65 6e 74 20 66 6f ...$"Cannot.queue.state.event.fo
1e9a0 72 20 63 6f 6e 74 72 6f 6c 20 27 7b 63 6f 6e 74 72 6f 6c 7d 27 20 6f 6e 20 64 65 76 69 63 65 20 r.control.'{control}'.on.device.
1e9c0 27 7b 64 65 76 69 63 65 7d 27 20 62 65 63 61 75 73 65 20 64 65 76 69 63 65 20 68 61 73 20 6e 6f '{device}'.because.device.has.no
1e9e0 74 20 62 65 65 6e 20 61 64 64 65 64 20 74 6f 20 73 79 73 74 65 6d 22 29 3b 0d 0a 0d 0a 20 20 20 t.been.added.to.system");.......
1ea00 20 20 20 20 20 20 20 20 20 69 66 20 28 74 69 6d 65 20 3c 20 30 29 0d 0a 20 20 20 20 20 20 20 20 .........if.(time.<.0)..........
1ea20 20 20 20 20 20 20 20 20 74 69 6d 65 20 3d 20 49 6e 70 75 74 52 75 6e 74 69 6d 65 2e 73 5f 49 6e ........time.=.InputRuntime.s_In
1ea40 73 74 61 6e 63 65 2e 63 75 72 72 65 6e 74 54 69 6d 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 stance.currentTime;.............
1ea60 20 65 6c 73 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 69 6d 65 20 2b 3d 20 49 .else..................time.+=.I
1ea80 6e 70 75 74 52 75 6e 74 69 6d 65 2e 73 5f 43 75 72 72 65 6e 74 54 69 6d 65 4f 66 66 73 65 74 54 nputRuntime.s_CurrentTimeOffsetT
1eaa0 6f 52 65 61 6c 74 69 6d 65 53 69 6e 63 65 53 74 61 72 74 75 70 3b 0d 0a 0d 0a 20 20 20 20 20 20 oRealtimeSinceStartup;..........
1eac0 20 20 20 20 20 20 76 61 72 20 64 65 6c 74 61 53 69 7a 65 20 3d 20 28 75 69 6e 74 29 55 6e 73 61 ......var.deltaSize.=.(uint)Unsa
1eae0 66 65 55 74 69 6c 69 74 79 2e 53 69 7a 65 4f 66 3c 54 44 65 6c 74 61 3e 28 29 3b 0d 0a 20 20 20 feUtility.SizeOf<TDelta>();.....
1eb00 20 20 20 20 20 20 20 20 20 69 66 20 28 64 65 6c 74 61 53 69 7a 65 20 3e 20 44 65 6c 74 61 53 74 .........if.(deltaSize.>.DeltaSt
1eb20 61 74 65 45 76 65 6e 74 42 75 66 66 65 72 2e 6b 4d 61 78 53 69 7a 65 29 0d 0a 20 20 20 20 20 20 ateEventBuffer.kMaxSize)........
1eb40 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 45 78 63 65 ..........throw.new.ArgumentExce
1eb60 70 74 69 6f 6e 28 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 22 53 69 ption(......................$"Si
1eb80 7a 65 20 6f 66 20 73 74 61 74 65 20 64 65 6c 74 61 20 27 7b 74 79 70 65 6f 66 28 54 44 65 6c 74 ze.of.state.delta.'{typeof(TDelt
1eba0 61 29 2e 4e 61 6d 65 7d 27 20 65 78 63 65 65 64 73 20 6d 61 78 69 6d 75 6d 20 73 75 70 70 6f 72 a).Name}'.exceeds.maximum.suppor
1ebc0 74 65 64 20 73 74 61 74 65 20 73 69 7a 65 20 6f 66 20 7b 44 65 6c 74 61 53 74 61 74 65 45 76 65 ted.state.size.of.{DeltaStateEve
1ebe0 6e 74 42 75 66 66 65 72 2e 6b 4d 61 78 53 69 7a 65 7d 22 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 ntBuffer.kMaxSize}",............
1ec00 20 20 20 20 20 20 20 20 20 20 6e 61 6d 65 6f 66 28 64 65 6c 74 61 29 29 3b 0d 0a 0d 0a 20 20 20 ..........nameof(delta));.......
1ec20 20 20 20 20 20 20 20 20 20 2f 2f 2f 2f 54 4f 44 4f 3a 20 72 65 63 6f 67 6e 69 7a 65 20 61 20 6d .........////TODO:.recognize.a.m
1ec40 61 74 63 68 69 6e 67 20 43 23 20 72 65 70 72 65 73 65 6e 74 61 74 69 6f 6e 20 6f 66 20 61 20 73 atching.C#.representation.of.a.s
1ec60 74 61 74 65 20 66 6f 72 6d 61 74 20 61 6e 64 20 63 6f 6e 76 65 72 74 20 74 6f 20 77 68 61 74 20 tate.format.and.convert.to.what.
1ec80 77 65 20 65 78 70 65 63 74 20 66 6f 72 20 74 72 69 76 69 61 6c 20 63 61 73 65 73 0d 0a 20 20 20 we.expect.for.trivial.cases.....
1eca0 20 20 20 20 20 20 20 20 20 69 66 20 28 64 65 6c 74 61 53 69 7a 65 20 21 3d 20 63 6f 6e 74 72 6f .........if.(deltaSize.!=.contro
1ecc0 6c 2e 73 74 61 74 65 42 6c 6f 63 6b 2e 61 6c 69 67 6e 65 64 53 69 7a 65 49 6e 42 79 74 65 73 29 l.stateBlock.alignedSizeInBytes)
1ece0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 41 72 67 75 ..................throw.new.Argu
1ed00 6d 65 6e 74 45 78 63 65 70 74 69 6f 6e 28 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 mentException(..................
1ed20 20 20 20 20 24 22 53 69 7a 65 20 7b 64 65 6c 74 61 53 69 7a 65 7d 20 6f 66 20 64 65 6c 74 61 20 ....$"Size.{deltaSize}.of.delta.
1ed40 73 74 61 74 65 20 6f 66 20 74 79 70 65 20 7b 74 79 70 65 6f 66 28 54 44 65 6c 74 61 29 2e 4e 61 state.of.type.{typeof(TDelta).Na
1ed60 6d 65 7d 20 70 72 6f 76 69 64 65 64 20 66 6f 72 20 63 6f 6e 74 72 6f 6c 20 27 7b 63 6f 6e 74 72 me}.provided.for.control.'{contr
1ed80 6f 6c 7d 27 20 64 6f 65 73 20 6e 6f 74 20 6d 61 74 63 68 20 73 69 7a 65 20 7b 63 6f 6e 74 72 6f ol}'.does.not.match.size.{contro
1eda0 6c 2e 73 74 61 74 65 42 6c 6f 63 6b 2e 61 6c 69 67 6e 65 64 53 69 7a 65 49 6e 42 79 74 65 73 7d l.stateBlock.alignedSizeInBytes}
1edc0 20 6f 66 20 63 6f 6e 74 72 6f 6c 22 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .of.control",...................
1ede0 20 20 20 6e 61 6d 65 6f 66 28 64 65 6c 74 61 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 ...nameof(delta));..............
1ee00 20 20 76 61 72 20 65 76 65 6e 74 53 69 7a 65 20 3d 20 55 6e 73 61 66 65 55 74 69 6c 69 74 79 2e ..var.eventSize.=.UnsafeUtility.
1ee20 53 69 7a 65 4f 66 3c 44 65 6c 74 61 53 74 61 74 65 45 76 65 6e 74 3e 28 29 20 2b 20 64 65 6c 74 SizeOf<DeltaStateEvent>().+.delt
1ee40 61 53 69 7a 65 20 2d 20 31 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 44 65 6c 74 61 53 aSize.-.1;................DeltaS
1ee60 74 61 74 65 45 76 65 6e 74 42 75 66 66 65 72 20 65 76 65 6e 74 42 75 66 66 65 72 3b 0d 0a 20 20 tateEventBuffer.eventBuffer;....
1ee80 20 20 20 20 20 20 20 20 20 20 65 76 65 6e 74 42 75 66 66 65 72 2e 73 74 61 74 65 45 76 65 6e 74 ..........eventBuffer.stateEvent
1eea0 20 3d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6e 65 77 20 44 65 6c 74 61 53 74 61 .=..................new.DeltaSta
1eec0 74 65 45 76 65 6e 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 teEvent..............{..........
1eee0 20 20 20 20 20 20 20 20 62 61 73 65 45 76 65 6e 74 20 3d 20 6e 65 77 20 49 6e 70 75 74 45 76 65 ........baseEvent.=.new.InputEve
1ef00 6e 74 28 44 65 6c 74 61 53 74 61 74 65 45 76 65 6e 74 2e 54 79 70 65 2c 20 28 69 6e 74 29 65 76 nt(DeltaStateEvent.Type,.(int)ev
1ef20 65 6e 74 53 69 7a 65 2c 20 64 65 76 69 63 65 2e 64 65 76 69 63 65 49 64 2c 20 74 69 6d 65 29 2c entSize,.device.deviceId,.time),
1ef40 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 74 61 74 65 46 6f 72 6d 61 74 20 3d 20 ..................stateFormat.=.
1ef60 64 65 76 69 63 65 2e 73 74 61 74 65 42 6c 6f 63 6b 2e 66 6f 72 6d 61 74 2c 0d 0a 20 20 20 20 20 device.stateBlock.format,.......
1ef80 20 20 20 20 20 20 20 20 20 20 20 73 74 61 74 65 4f 66 66 73 65 74 20 3d 20 63 6f 6e 74 72 6f 6c ...........stateOffset.=.control
1efa0 2e 6d 5f 53 74 61 74 65 42 6c 6f 63 6b 2e 62 79 74 65 4f 66 66 73 65 74 20 2d 20 64 65 76 69 63 .m_StateBlock.byteOffset.-.devic
1efc0 65 2e 6d 5f 53 74 61 74 65 42 6c 6f 63 6b 2e 62 79 74 65 4f 66 66 73 65 74 0d 0a 20 20 20 20 20 e.m_StateBlock.byteOffset.......
1efe0 20 20 20 20 20 20 20 7d 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 70 74 72 .......};................var.ptr
1f000 20 3d 20 65 76 65 6e 74 42 75 66 66 65 72 2e 73 74 61 74 65 45 76 65 6e 74 2e 73 74 61 74 65 44 .=.eventBuffer.stateEvent.stateD
1f020 61 74 61 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 55 6e 73 61 66 65 55 74 69 6c 69 74 79 2e ata;..............UnsafeUtility.
1f040 4d 65 6d 43 70 79 28 70 74 72 2c 20 55 6e 73 61 66 65 55 74 69 6c 69 74 79 2e 41 64 64 72 65 73 MemCpy(ptr,.UnsafeUtility.Addres
1f060 73 4f 66 28 72 65 66 20 64 65 6c 74 61 29 2c 20 64 65 6c 74 61 53 69 7a 65 29 3b 0d 0a 0d 0a 20 sOf(ref.delta),.deltaSize);.....
1f080 20 20 20 20 20 20 20 20 20 20 20 73 5f 4d 61 6e 61 67 65 72 2e 51 75 65 75 65 45 76 65 6e 74 28 ...........s_Manager.QueueEvent(
1f0a0 72 65 66 20 65 76 65 6e 74 42 75 66 66 65 72 2e 73 74 61 74 65 45 76 65 6e 74 29 3b 0d 0a 20 20 ref.eventBuffer.stateEvent);....
1f0c0 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>
1f0e0 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 51 75 65 75 65 20 61 20 3c 73 65 65 20 63 72 65 66 3d ..........///.Queue.a.<see.cref=
1f100 22 44 65 76 69 63 65 43 6f 6e 66 69 67 75 72 61 74 69 6f 6e 45 76 65 6e 74 22 2f 3e 20 74 68 61 "DeviceConfigurationEvent"/>.tha
1f120 74 20 73 69 67 6e 61 6c 73 20 74 68 61 74 20 74 68 65 20 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e t.signals.that.the.configuration
1f140 20 6f 66 20 74 68 65 20 67 69 76 65 6e 20 64 65 76 69 63 65 20 68 61 73 20 63 68 61 6e 67 65 64 .of.the.given.device.has.changed
1f160 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 61 6e 64 20 74 68 61 74 20 63 61 63 68 65 64 20 63 6f ..........///.and.that.cached.co
1f180 6e 66 69 67 75 72 61 74 69 6f 6e 20 77 69 6c 6c 20 74 68 75 73 20 68 61 76 65 20 74 6f 20 62 65 nfiguration.will.thus.have.to.be
1f1a0 20 72 65 66 72 65 73 68 65 64 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 .refreshed...........///.</summa
1f1c0 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 64 65 ry>..........///.<param.name="de
1f1e0 76 69 63 65 22 3e 44 65 76 69 63 65 20 77 68 6f 73 65 20 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e vice">Device.whose.configuration
1f200 20 68 61 73 20 63 68 61 6e 67 65 64 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f .has.changed.</param>........../
1f220 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 74 69 6d 65 22 3e 54 69 6d 65 73 74 61 6d 70 20 //.<param.name="time">Timestamp.
1f240 66 6f 72 20 74 68 65 20 65 76 65 6e 74 2e 20 49 66 20 6e 6f 74 20 73 75 70 70 6c 69 65 64 2c 20 for.the.event..If.not.supplied,.
1f260 74 68 65 20 63 75 72 72 65 6e 74 20 74 69 6d 65 20 77 69 6c 6c 20 62 65 20 75 73 65 64 2e 3c 2f the.current.time.will.be.used.</
1f280 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 param>..........///.<remarks>...
1f2a0 20 20 20 20 20 20 20 2f 2f 2f 20 41 6c 6c 20 73 74 61 74 65 20 6f 66 20 61 6e 20 69 6e 70 75 74 .......///.All.state.of.an.input
1f2c0 20 64 65 76 69 63 65 20 74 68 61 74 20 69 73 20 6e 6f 74 20 69 6e 70 75 74 20 6f 72 20 6f 75 74 .device.that.is.not.input.or.out
1f2e0 70 75 74 20 73 74 61 74 65 20 69 73 20 63 6f 6e 73 69 64 65 72 65 64 20 69 74 73 20 22 63 6f 6e put.state.is.considered.its."con
1f300 66 69 67 75 72 61 74 69 6f 6e 22 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 figuration"...........///.......
1f320 20 20 20 2f 2f 2f 20 41 20 73 69 6d 70 6c 65 20 65 78 61 6d 70 6c 65 20 69 73 20 6b 65 79 62 6f ...///.A.simple.example.is.keybo
1f340 61 72 64 20 6c 61 79 6f 75 74 73 2e 20 41 20 3c 73 65 65 20 63 72 65 66 3d 22 4b 65 79 62 6f 61 ard.layouts..A.<see.cref="Keyboa
1f360 72 64 22 2f 3e 20 77 69 6c 6c 20 74 79 70 69 63 61 6c 6c 79 20 68 61 76 65 20 61 6e 20 61 73 73 rd"/>.will.typically.have.an.ass
1f380 6f 63 69 61 74 65 64 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 6b 65 79 62 6f 61 72 64 20 6c 61 ociated..........///.keyboard.la
1f3a0 79 6f 75 74 20 74 68 61 74 20 64 69 63 74 61 74 65 73 20 74 68 65 20 66 75 6e 63 74 69 6f 6e 20 yout.that.dictates.the.function.
1f3c0 6f 66 20 65 61 63 68 20 6b 65 79 20 61 6e 64 20 77 68 69 63 68 20 63 61 6e 20 62 65 20 63 68 61 of.each.key.and.which.can.be.cha
1f3e0 6e 67 65 64 20 62 79 20 74 68 65 20 75 73 65 72 20 61 74 20 74 68 65 0d 0a 20 20 20 20 20 20 20 nged.by.the.user.at.the.........
1f400 20 2f 2f 2f 20 73 79 73 74 65 6d 20 6c 65 76 65 6c 2e 20 49 6e 20 74 68 65 20 69 6e 70 75 74 20 .///.system.level..In.the.input.
1f420 73 79 73 74 65 6d 2c 20 74 68 65 20 63 75 72 72 65 6e 74 20 6b 65 79 62 6f 61 72 64 20 6c 61 79 system,.the.current.keyboard.lay
1f440 6f 75 74 20 63 61 6e 20 62 65 20 71 75 65 72 69 65 64 20 76 69 61 20 3c 73 65 65 20 63 72 65 66 out.can.be.queried.via.<see.cref
1f460 3d 22 4b 65 79 62 6f 61 72 64 2e 6b 65 79 62 6f 61 72 64 4c 61 79 6f 75 74 22 2f 3e 2e 0d 0a 20 ="Keyboard.keyboardLayout"/>....
1f480 20 20 20 20 20 20 20 2f 2f 2f 20 57 68 65 6e 20 74 68 65 20 6c 61 79 6f 75 74 20 63 68 61 6e 67 .......///.When.the.layout.chang
1f4a0 65 73 20 61 74 20 74 68 65 20 73 79 73 74 65 6d 20 6c 65 76 65 6c 2c 20 74 68 65 20 69 6e 70 75 es.at.the.system.level,.the.inpu
1f4c0 74 20 62 61 63 6b 65 6e 64 20 73 65 6e 64 73 20 61 20 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 20 t.backend.sends.a.configuration.
1f4e0 63 68 61 6e 67 65 20 65 76 65 6e 74 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 74 6f 20 73 69 67 change.event..........///.to.sig
1f500 6e 61 6c 20 74 68 61 74 20 74 68 65 20 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 20 6f 66 20 74 68 nal.that.the.configuration.of.th
1f520 65 20 6b 65 79 62 6f 61 72 64 20 68 61 73 20 63 68 61 6e 67 65 64 20 61 6e 64 20 74 68 61 74 20 e.keyboard.has.changed.and.that.
1f540 63 61 63 68 65 64 20 64 61 74 61 20 6d 61 79 20 62 65 20 6f 75 74 64 61 74 65 64 2e 0d 0a 20 20 cached.data.may.be.outdated.....
1f560 20 20 20 20 20 20 2f 2f 2f 20 49 6e 20 72 65 73 70 6f 6e 73 65 2c 20 3c 73 65 65 20 63 72 65 66 ......///.In.response,.<see.cref
1f580 3d 22 4b 65 79 62 6f 61 72 64 22 2f 3e 20 77 69 6c 6c 20 66 6c 75 73 68 20 6f 75 74 20 63 61 63 ="Keyboard"/>.will.flush.out.cac
1f5a0 68 65 64 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 73 75 63 68 20 61 73 20 74 68 65 20 6e 61 6d 65 hed.information.such.as.the.name
1f5c0 20 6f 66 20 74 68 65 20 6b 65 79 62 6f 61 72 64 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 6c 61 .of.the.keyboard..........///.la
1f5e0 79 6f 75 74 20 61 6e 64 20 64 69 73 70 6c 61 79 20 6e 61 6d 65 73 20 28 3c 73 65 65 20 63 72 65 yout.and.display.names.(<see.cre
1f600 66 3d 22 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 2e 64 69 73 70 6c 61 79 4e 61 6d 65 22 2f 3e 29 20 f="InputControl.displayName"/>).
1f620 6f 66 20 69 6e 64 69 76 69 64 75 61 6c 20 6b 65 79 73 20 77 68 69 63 68 20 63 61 75 73 65 73 20 of.individual.keys.which.causes.
1f640 74 68 65 6d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 74 6f 20 62 65 20 66 65 74 63 68 65 64 20 them..........///.to.be.fetched.
1f660 61 67 61 69 6e 20 66 72 6f 6d 20 74 68 65 20 62 61 63 6b 65 6e 64 20 74 68 65 20 6e 65 78 74 20 again.from.the.backend.the.next.
1f680 74 69 6d 65 20 74 68 65 79 20 61 72 65 20 61 63 63 65 73 73 65 64 2e 0d 0a 20 20 20 20 20 20 20 time.they.are.accessed..........
1f6a0 20 2f 2f 2f 20 3c 2f 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 .///.</remarks>..........///.<ex
1f6c0 63 65 70 74 69 6f 6e 20 63 72 65 66 3d 22 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 ception.cref="ArgumentNullExcept
1f6e0 69 6f 6e 22 3e 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 64 65 76 69 63 65 22 2f 3e 20 69 ion"><paramref.name="device"/>.i
1f700 73 20 6e 75 6c 6c 2e 3c 2f 65 78 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f s.null.</exception>..........///
1f720 20 3c 65 78 63 65 70 74 69 6f 6e 20 63 72 65 66 3d 22 49 6e 76 61 6c 69 64 4f 70 65 72 61 74 69 .<exception.cref="InvalidOperati
1f740 6f 6e 45 78 63 65 70 74 69 6f 6e 22 3e 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 64 65 76 onException"><paramref.name="dev
1f760 69 63 65 22 2f 3e 20 68 61 73 20 6e 6f 74 20 62 65 65 6e 20 61 64 64 65 64 0d 0a 20 20 20 20 20 ice"/>.has.not.been.added.......
1f780 20 20 20 2f 2f 2f 20 28 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 44 65 76 69 63 65 2e 61 ...///.(<see.cref="InputDevice.a
1f7a0 64 64 65 64 22 2f 3e 3b 20 3c 73 65 65 20 63 72 65 66 3d 22 41 64 64 44 65 76 69 63 65 28 49 6e dded"/>;.<see.cref="AddDevice(In
1f7c0 70 75 74 44 65 76 69 63 65 29 22 2f 3e 29 20 61 6e 64 20 74 68 75 73 20 63 61 6e 6e 6f 74 0d 0a putDevice)"/>).and.thus.cannot..
1f7e0 20 20 20 20 20 20 20 20 2f 2f 2f 20 72 65 63 65 69 76 65 20 65 76 65 6e 74 73 2e 3c 2f 65 78 63 ........///.receive.events.</exc
1f800 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 76 eption>..........public.static.v
1f820 6f 69 64 20 51 75 65 75 65 43 6f 6e 66 69 67 43 68 61 6e 67 65 45 76 65 6e 74 28 49 6e 70 75 74 oid.QueueConfigChangeEvent(Input
1f840 44 65 76 69 63 65 20 64 65 76 69 63 65 2c 20 64 6f 75 62 6c 65 20 74 69 6d 65 20 3d 20 2d 31 29 Device.device,.double.time.=.-1)
1f860 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 64 65 76 ..........{..............if.(dev
1f880 69 63 65 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 74 68 ice.==.null)..................th
1f8a0 72 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 28 6e 61 row.new.ArgumentNullException(na
1f8c0 6d 65 6f 66 28 64 65 76 69 63 65 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 meof(device));..............if.(
1f8e0 64 65 76 69 63 65 2e 64 65 76 69 63 65 49 64 20 3d 3d 20 49 6e 70 75 74 44 65 76 69 63 65 2e 49 device.deviceId.==.InputDevice.I
1f900 6e 76 61 6c 69 64 44 65 76 69 63 65 49 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 nvalidDeviceId).................
1f920 20 74 68 72 6f 77 20 6e 65 77 20 49 6e 76 61 6c 69 64 4f 70 65 72 61 74 69 6f 6e 45 78 63 65 70 .throw.new.InvalidOperationExcep
1f940 74 69 6f 6e 28 22 44 65 76 69 63 65 20 68 61 73 20 6e 6f 74 20 62 65 65 6e 20 61 64 64 65 64 22 tion("Device.has.not.been.added"
1f960 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 74 69 6d 65 20 3c 20 30 29 0d );................if.(time.<.0).
1f980 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 69 6d 65 20 3d 20 49 6e 70 75 74 52 75 6e .................time.=.InputRun
1f9a0 74 69 6d 65 2e 73 5f 49 6e 73 74 61 6e 63 65 2e 63 75 72 72 65 6e 74 54 69 6d 65 3b 0d 0a 20 20 time.s_Instance.currentTime;....
1f9c0 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..................
1f9e0 74 69 6d 65 20 2b 3d 20 49 6e 70 75 74 52 75 6e 74 69 6d 65 2e 73 5f 43 75 72 72 65 6e 74 54 69 time.+=.InputRuntime.s_CurrentTi
1fa00 6d 65 4f 66 66 73 65 74 54 6f 52 65 61 6c 74 69 6d 65 53 69 6e 63 65 53 74 61 72 74 75 70 3b 0d meOffsetToRealtimeSinceStartup;.
1fa20 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 69 6e 70 75 74 45 76 65 6e 74 20 3d 20 ...............var.inputEvent.=.
1fa40 44 65 76 69 63 65 43 6f 6e 66 69 67 75 72 61 74 69 6f 6e 45 76 65 6e 74 2e 43 72 65 61 74 65 28 DeviceConfigurationEvent.Create(
1fa60 64 65 76 69 63 65 2e 64 65 76 69 63 65 49 64 2c 20 74 69 6d 65 29 3b 0d 0a 20 20 20 20 20 20 20 device.deviceId,.time);.........
1fa80 20 20 20 20 20 73 5f 4d 61 6e 61 67 65 72 2e 51 75 65 75 65 45 76 65 6e 74 28 72 65 66 20 69 6e .....s_Manager.QueueEvent(ref.in
1faa0 70 75 74 45 76 65 6e 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 putEvent);..........}...........
1fac0 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 51 75 65 75 .///.<summary>..........///.Queu
1fae0 65 20 61 20 3c 73 65 65 20 63 72 65 66 3d 22 54 65 78 74 45 76 65 6e 74 22 2f 3e 20 6f 6e 20 74 e.a.<see.cref="TextEvent"/>.on.t
1fb00 68 65 20 67 69 76 65 6e 20 64 65 76 69 63 65 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f he.given.device...........///.</
1fb20 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d summary>..........///.<param.nam
1fb40 65 3d 22 64 65 76 69 63 65 22 3e 44 65 76 69 63 65 20 74 6f 20 71 75 65 75 65 20 74 68 65 20 65 e="device">Device.to.queue.the.e
1fb60 76 65 6e 74 20 6f 6e 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 vent.on.</param>..........///.<p
1fb80 61 72 61 6d 20 6e 61 6d 65 3d 22 63 68 61 72 61 63 74 65 72 22 3e 54 65 78 74 20 63 68 61 72 61 aram.name="character">Text.chara
1fba0 63 74 65 72 20 74 6f 20 69 6e 70 75 74 20 74 68 72 6f 75 67 68 20 74 68 65 20 65 76 65 6e 74 2e cter.to.input.through.the.event.
1fbc0 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d </param>..........///.<param.nam
1fbe0 65 3d 22 74 69 6d 65 22 3e 4f 70 74 69 6f 6e 61 6c 20 65 76 65 6e 74 20 74 69 6d 65 20 73 74 61 e="time">Optional.event.time.sta
1fc00 6d 70 2e 20 49 66 20 6e 6f 74 20 73 75 70 70 6c 69 65 64 2c 20 74 68 65 20 63 75 72 72 65 6e 74 mp..If.not.supplied,.the.current
1fc20 20 74 69 6d 65 20 77 69 6c 6c 20 62 65 20 75 73 65 64 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 .time.will.be.used.</param>.....
1fc40 20 20 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 .....///.<remarks>..........///.
1fc60 54 65 78 74 20 69 6e 70 75 74 20 69 73 20 73 65 6e 74 20 74 6f 20 64 65 76 69 63 65 73 20 63 68 Text.input.is.sent.to.devices.ch
1fc80 61 72 61 63 74 65 72 20 62 79 20 63 68 61 72 61 63 74 65 72 2e 20 54 68 69 73 20 61 6c 6c 6f 77 aracter.by.character..This.allow
1fca0 73 20 73 65 6e 64 69 6e 67 20 73 74 72 69 6e 67 73 20 6f 66 20 61 72 62 69 74 72 61 72 79 0d 0a s.sending.strings.of.arbitrary..
1fcc0 20 20 20 20 20 20 20 20 2f 2f 2f 20 6c 65 6e 67 74 68 20 77 69 74 68 6f 75 74 20 6e 65 63 65 73 ........///.length.without.neces
1fce0 73 61 72 79 20 69 6e 63 75 72 72 69 6e 67 20 47 43 20 6f 76 65 72 68 65 61 64 2e 0d 0a 20 20 20 sary.incurring.GC.overhead......
1fd00 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 46 6f 72 20 74 68 65 20 65 76 .....///..........///.For.the.ev
1fd20 65 6e 74 20 74 6f 20 68 61 76 65 20 61 6e 79 20 65 66 66 65 63 74 20 6f 6e 20 3c 70 61 72 61 6d ent.to.have.any.effect.on.<param
1fd40 72 65 66 20 6e 61 6d 65 3d 22 64 65 76 69 63 65 22 2f 3e 2c 20 74 68 65 20 64 65 76 69 63 65 20 ref.name="device"/>,.the.device.
1fd60 6d 75 73 74 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 69 6d 70 6c 65 6d 65 6e 74 20 3c 73 65 65 must..........///.implement.<see
1fd80 20 63 72 65 66 3d 22 49 54 65 78 74 49 6e 70 75 74 52 65 63 65 69 76 65 72 22 2f 3e 2e 20 49 74 .cref="ITextInputReceiver"/>..It
1fda0 20 77 69 6c 6c 20 73 65 65 20 3c 73 65 65 20 63 72 65 66 3d 22 49 54 65 78 74 49 6e 70 75 74 52 .will.see.<see.cref="ITextInputR
1fdc0 65 63 65 69 76 65 72 2e 4f 6e 54 65 78 74 49 6e 70 75 74 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 eceiver.OnTextInput"/>..........
1fde0 2f 2f 2f 20 62 65 69 6e 67 20 63 61 6c 6c 65 64 20 77 68 65 6e 20 74 68 65 20 65 76 65 6e 74 20 ///.being.called.when.the.event.
1fe00 69 73 20 70 72 6f 63 65 73 73 65 64 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 6d is.processed...........///.</rem
1fe20 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f 6e 20 63 72 arks>..........///.<exception.cr
1fe40 65 66 3d 22 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 22 3e 3c 70 61 72 61 ef="ArgumentNullException"><para
1fe60 6d 72 65 66 20 6e 61 6d 65 3d 22 64 65 76 69 63 65 22 2f 3e 20 69 73 20 6e 75 6c 6c 2e 3c 2f 65 mref.name="device"/>.is.null.</e
1fe80 78 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f xception>..........///.<exceptio
1fea0 6e 20 63 72 65 66 3d 22 49 6e 76 61 6c 69 64 4f 70 65 72 61 74 69 6f 6e 45 78 63 65 70 74 69 6f n.cref="InvalidOperationExceptio
1fec0 6e 22 3e 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 64 65 76 69 63 65 22 2f 3e 20 69 73 20 n"><paramref.name="device"/>.is.
1fee0 61 20 64 65 76 69 63 65 20 74 68 61 74 20 68 61 73 20 6e 6f 74 20 62 65 65 6e 0d 0a 20 20 20 20 a.device.that.has.not.been......
1ff00 20 20 20 20 2f 2f 2f 20 61 64 64 65 64 20 74 6f 20 74 68 65 20 73 79 73 74 65 6d 2e 3c 2f 65 78 ....///.added.to.the.system.</ex
1ff20 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 ception>..........///.<seealso.c
1ff40 72 65 66 3d 22 4b 65 79 62 6f 61 72 64 2e 6f 6e 54 65 78 74 49 6e 70 75 74 22 2f 3e 0d 0a 20 20 ref="Keyboard.onTextInput"/>....
1ff60 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 76 6f 69 64 20 51 75 65 75 65 54 65 ......public.static.void.QueueTe
1ff80 78 74 45 76 65 6e 74 28 49 6e 70 75 74 44 65 76 69 63 65 20 64 65 76 69 63 65 2c 20 63 68 61 72 xtEvent(InputDevice.device,.char
1ffa0 20 63 68 61 72 61 63 74 65 72 2c 20 64 6f 75 62 6c 65 20 74 69 6d 65 20 3d 20 2d 31 29 0d 0a 20 .character,.double.time.=.-1)...
1ffc0 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 64 65 76 69 63 65 .......{..............if.(device
1ffe0 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 74 68 72 6f 77 .==.null)..................throw
20000 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 28 6e 61 6d 65 6f .new.ArgumentNullException(nameo
20020 66 28 64 65 76 69 63 65 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 64 65 76 f(device));..............if.(dev
20040 69 63 65 2e 64 65 76 69 63 65 49 64 20 3d 3d 20 49 6e 70 75 74 44 65 76 69 63 65 2e 49 6e 76 61 ice.deviceId.==.InputDevice.Inva
20060 6c 69 64 44 65 76 69 63 65 49 64 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 lidDeviceId)..................th
20080 72 6f 77 20 6e 65 77 20 49 6e 76 61 6c 69 64 4f 70 65 72 61 74 69 6f 6e 45 78 63 65 70 74 69 6f row.new.InvalidOperationExceptio
200a0 6e 28 22 44 65 76 69 63 65 20 68 61 73 20 6e 6f 74 20 62 65 65 6e 20 61 64 64 65 64 22 29 3b 0d n("Device.has.not.been.added");.
200c0 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 74 69 6d 65 20 3c 20 30 29 0d 0a 20 20 ...............if.(time.<.0)....
200e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 69 6d 65 20 3d 20 49 6e 70 75 74 52 75 6e 74 69 6d ..............time.=.InputRuntim
20100 65 2e 73 5f 49 6e 73 74 61 6e 63 65 2e 63 75 72 72 65 6e 74 54 69 6d 65 3b 0d 0a 20 20 20 20 20 e.s_Instance.currentTime;.......
20120 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 74 69 6d .......else..................tim
20140 65 20 2b 3d 20 49 6e 70 75 74 52 75 6e 74 69 6d 65 2e 73 5f 43 75 72 72 65 6e 74 54 69 6d 65 4f e.+=.InputRuntime.s_CurrentTimeO
20160 66 66 73 65 74 54 6f 52 65 61 6c 74 69 6d 65 53 69 6e 63 65 53 74 61 72 74 75 70 3b 0d 0a 0d 0a ffsetToRealtimeSinceStartup;....
20180 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 69 6e 70 75 74 45 76 65 6e 74 20 3d 20 54 65 78 ............var.inputEvent.=.Tex
201a0 74 45 76 65 6e 74 2e 43 72 65 61 74 65 28 64 65 76 69 63 65 2e 64 65 76 69 63 65 49 64 2c 20 63 tEvent.Create(device.deviceId,.c
201c0 68 61 72 61 63 74 65 72 2c 20 74 69 6d 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 5f haracter,.time);..............s_
201e0 4d 61 6e 61 67 65 72 2e 51 75 65 75 65 45 76 65 6e 74 28 72 65 66 20 69 6e 70 75 74 45 76 65 6e Manager.QueueEvent(ref.inputEven
20200 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 2f 2f 2f 2f 54 4f t);..........}............////TO
20220 44 4f 3a 20 72 65 6e 61 6d 65 20 6f 72 20 6d 6f 76 65 20 74 68 69 73 20 74 6f 20 61 20 6c 65 73 DO:.rename.or.move.this.to.a.les
20240 73 20 6f 62 76 69 6f 75 73 20 70 6c 61 63 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 s.obvious.place..........///.<su
20260 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 52 75 6e 20 61 20 73 69 6e 67 6c 65 mmary>..........///.Run.a.single
20280 20 75 70 64 61 74 65 20 6f 66 20 69 6e 70 75 74 20 73 74 61 74 65 2e 0d 0a 20 20 20 20 20 20 20 .update.of.input.state..........
202a0 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 72 65 .///.</summary>..........///.<re
202c0 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 45 78 63 65 70 74 20 69 6e 20 74 65 marks>..........///.Except.in.te
202e0 73 74 73 20 61 6e 64 20 77 68 65 6e 20 75 73 69 6e 67 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e sts.and.when.using.<see.cref="In
20300 70 75 74 53 65 74 74 69 6e 67 73 2e 55 70 64 61 74 65 4d 6f 64 65 2e 50 72 6f 63 65 73 73 45 76 putSettings.UpdateMode.ProcessEv
20320 65 6e 74 73 4d 61 6e 75 61 6c 6c 79 22 2f 3e 2c 20 74 68 69 73 20 6d 65 74 68 6f 64 20 73 68 6f entsManually"/>,.this.method.sho
20340 75 6c 64 20 6e 6f 74 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 6e 6f 72 6d 61 6c 6c 79 20 62 65 uld.not..........///.normally.be
20360 20 63 61 6c 6c 65 64 2e 20 54 68 65 20 69 6e 70 75 74 20 73 79 73 74 65 6d 20 77 69 6c 6c 20 61 .called..The.input.system.will.a
20380 75 74 6f 6d 61 74 69 63 61 6c 6c 79 20 75 70 64 61 74 65 20 61 73 20 70 61 72 74 20 6f 66 20 74 utomatically.update.as.part.of.t
203a0 68 65 20 70 6c 61 79 65 72 20 6c 6f 6f 70 20 61 73 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 64 he.player.loop.as..........///.d
203c0 65 74 65 72 6d 69 6e 65 64 20 62 79 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 53 65 74 etermined.by.<see.cref="InputSet
203e0 74 69 6e 67 73 2e 75 70 64 61 74 65 4d 6f 64 65 22 2f 3e 2e 20 43 61 6c 6c 69 6e 67 20 74 68 69 tings.updateMode"/>..Calling.thi
20400 73 20 6d 65 74 68 6f 64 20 69 73 20 65 71 75 69 76 61 6c 65 6e 74 20 74 6f 0d 0a 20 20 20 20 20 s.method.is.equivalent.to.......
20420 20 20 20 2f 2f 2f 20 69 6e 73 65 72 74 69 6e 67 20 65 78 74 72 61 20 66 72 61 6d 65 73 2c 20 69 ...///.inserting.extra.frames,.i
20440 2e 65 2e 20 69 74 20 77 69 6c 6c 20 61 64 76 61 6e 63 65 20 74 68 65 20 65 6e 74 69 72 65 20 73 .e..it.will.advance.the.entire.s
20460 74 61 74 65 20 6f 66 20 74 68 65 20 69 6e 70 75 74 20 73 79 73 74 65 6d 20 62 79 20 6f 6e 65 20 tate.of.the.input.system.by.one.
20480 63 6f 6d 70 6c 65 74 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 66 72 61 6d 65 2e 0d 0a 20 20 complete..........///.frame.....
204a0 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 57 68 65 6e 20 75 73 69 6e ......///..........///.When.usin
204c0 67 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 55 70 64 61 74 65 54 79 70 65 2e 4d 61 6e g.<see.cref="InputUpdateType.Man
204e0 75 61 6c 22 2f 3e 2c 20 74 68 69 73 20 6d 65 74 68 6f 64 20 4d 55 53 54 20 62 65 20 63 61 6c 6c ual"/>,.this.method.MUST.be.call
20500 65 64 20 66 6f 72 20 69 6e 70 75 74 20 74 6f 20 75 70 64 61 74 65 20 69 6e 20 74 68 65 0d 0a 20 ed.for.input.to.update.in.the...
20520 20 20 20 20 20 20 20 2f 2f 2f 20 70 6c 61 79 65 72 2e 20 4e 6f 74 20 63 61 6c 6c 69 6e 67 20 74 .......///.player..Not.calling.t
20540 68 65 20 6d 65 74 68 6f 64 20 61 73 20 70 61 72 74 20 6f 66 20 74 68 65 20 70 6c 61 79 65 72 20 he.method.as.part.of.the.player.
20560 6c 6f 6f 70 20 6d 61 79 20 72 65 73 75 6c 74 20 69 6e 20 65 78 63 65 73 73 69 76 65 20 6d 65 6d loop.may.result.in.excessive.mem
20580 6f 72 79 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 63 6f 6e 73 75 6d 70 74 69 6f 6e 20 61 6e 64 ory..........///.consumption.and
205a0 2f 6f 72 20 70 6f 74 65 6e 74 69 61 6c 20 6c 6f 73 73 20 6f 66 20 69 6e 70 75 74 2e 0d 0a 20 20 /or.potential.loss.of.input.....
205c0 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 45 61 63 68 20 75 70 64 61 ......///..........///.Each.upda
205e0 74 65 20 77 69 6c 6c 20 66 6c 75 73 68 20 6f 75 74 20 62 75 66 66 65 72 65 64 20 69 6e 70 75 74 te.will.flush.out.buffered.input
20600 20 65 76 65 6e 74 73 20 61 6e 64 20 63 61 75 73 65 20 74 68 65 6d 20 74 6f 20 62 65 20 70 72 6f .events.and.cause.them.to.be.pro
20620 63 65 73 73 65 64 2e 20 54 68 69 73 20 69 6e 20 74 75 72 6e 0d 0a 20 20 20 20 20 20 20 20 2f 2f cessed..This.in.turn..........//
20640 2f 20 77 69 6c 6c 20 75 70 64 61 74 65 20 74 68 65 20 73 74 61 74 65 20 6f 66 20 69 6e 70 75 74 /.will.update.the.state.of.input
20660 20 64 65 76 69 63 65 73 20 28 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 44 65 76 69 63 65 .devices.(<see.cref="InputDevice
20680 22 2f 3e 29 20 61 6e 64 20 74 72 69 67 67 65 72 20 61 63 74 69 6f 6e 73 20 28 3c 73 65 65 20 63 "/>).and.trigger.actions.(<see.c
206a0 72 65 66 3d 22 49 6e 70 75 74 41 63 74 69 6f 6e 22 2f 3e 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f ref="InputAction"/>)..........//
206c0 2f 20 74 68 61 74 20 6d 6f 6e 69 74 6f 72 20 61 66 66 65 63 74 65 64 20 64 65 76 69 63 65 20 73 /.that.monitor.affected.device.s
206e0 74 61 74 65 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 0a 20 tate...........///.</remarks>...
20700 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 49 6e 70 75 74 55 .......///.<seealso.cref="InputU
20720 70 64 61 74 65 54 79 70 65 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c pdateType"/>..........///.<seeal
20740 73 6f 20 63 72 65 66 3d 22 49 6e 70 75 74 53 65 74 74 69 6e 67 73 2e 75 70 64 61 74 65 4d 6f 64 so.cref="InputSettings.updateMod
20760 65 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 76 6f 69 64 e"/>..........public.static.void
20780 20 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 .Update()..........{............
207a0 20 20 73 5f 4d 61 6e 61 67 65 72 2e 55 70 64 61 74 65 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d ..s_Manager.Update();..........}
207c0 0d 0a 0d 0a 20 20 20 20 20 20 20 20 69 6e 74 65 72 6e 61 6c 20 73 74 61 74 69 63 20 76 6f 69 64 ............internal.static.void
207e0 20 55 70 64 61 74 65 28 49 6e 70 75 74 55 70 64 61 74 65 54 79 70 65 20 75 70 64 61 74 65 54 79 .Update(InputUpdateType.updateTy
20800 70 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 69 66 20 28 pe)..........{..............if.(
20820 75 70 64 61 74 65 54 79 70 65 20 21 3d 20 49 6e 70 75 74 55 70 64 61 74 65 54 79 70 65 2e 4e 6f updateType.!=.InputUpdateType.No
20840 6e 65 20 26 26 20 28 73 5f 4d 61 6e 61 67 65 72 2e 75 70 64 61 74 65 4d 61 73 6b 20 26 20 75 70 ne.&&.(s_Manager.updateMask.&.up
20860 64 61 74 65 54 79 70 65 29 20 3d 3d 20 30 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 dateType).==.0).................
20880 20 74 68 72 6f 77 20 6e 65 77 20 49 6e 76 61 6c 69 64 4f 70 65 72 61 74 69 6f 6e 45 78 63 65 70 .throw.new.InvalidOperationExcep
208a0 74 69 6f 6e 28 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 22 27 7b 75 tion(......................$"'{u
208c0 70 64 61 74 65 54 79 70 65 7d 27 20 75 70 64 61 74 65 73 20 61 72 65 20 6e 6f 74 20 65 6e 61 62 pdateType}'.updates.are.not.enab
208e0 6c 65 64 3b 20 49 6e 70 75 74 53 79 73 74 65 6d 2e 73 65 74 74 69 6e 67 73 2e 75 70 64 61 74 65 led;.InputSystem.settings.update
20900 4d 6f 64 65 20 69 73 20 73 65 74 20 74 6f 20 27 7b 73 65 74 74 69 6e 67 73 2e 75 70 64 61 74 65 Mode.is.set.to.'{settings.update
20920 4d 6f 64 65 7d 27 22 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 4d 61 6e 61 67 65 72 Mode}'");..............s_Manager
20940 2e 55 70 64 61 74 65 28 75 70 64 61 74 65 54 79 70 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d .Update(updateType);..........}.
20960 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>........
20980 20 20 2f 2f 2f 20 45 76 65 6e 74 20 74 68 61 74 20 69 73 20 66 69 72 65 64 20 62 65 66 6f 72 65 ..///.Event.that.is.fired.before
209a0 20 74 68 65 20 69 6e 70 75 74 20 73 79 73 74 65 6d 20 75 70 64 61 74 65 73 2e 0d 0a 20 20 20 20 .the.input.system.updates.......
209c0 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 ....///.</summary>..........///.
209e0 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 68 65 20 69 6e 70 75 74 <remarks>..........///.The.input
20a00 20 73 79 73 74 65 6d 20 75 70 64 61 74 65 73 20 69 6e 20 73 79 6e 63 20 77 69 74 68 20 70 6c 61 .system.updates.in.sync.with.pla
20a20 79 65 72 20 6c 6f 6f 70 20 61 6e 64 20 65 64 69 74 6f 72 20 75 70 64 61 74 65 73 2e 20 49 6e 70 yer.loop.and.editor.updates..Inp
20a40 75 74 20 75 70 64 61 74 65 73 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 61 72 65 20 72 75 6e 20 ut.updates..........///.are.run.
20a60 72 69 67 68 74 20 62 65 66 6f 72 65 20 74 68 65 20 72 65 73 70 65 63 74 69 76 65 20 73 63 72 69 right.before.the.respective.scri
20a80 70 74 20 75 70 64 61 74 65 2e 20 46 6f 72 20 65 78 61 6d 70 6c 65 2c 20 61 6e 20 69 6e 70 75 74 pt.update..For.example,.an.input
20aa0 20 75 70 64 61 74 65 20 66 6f 72 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 20 63 72 .update.for..........///.<see.cr
20ac0 65 66 3d 22 49 6e 70 75 74 55 70 64 61 74 65 54 79 70 65 2e 44 79 6e 61 6d 69 63 22 2f 3e 20 69 ef="InputUpdateType.Dynamic"/>.i
20ae0 73 20 72 75 6e 20 62 65 66 6f 72 65 20 3c 63 3e 4d 6f 6e 6f 42 65 68 61 76 69 6f 75 72 2e 55 70 s.run.before.<c>MonoBehaviour.Up
20b00 64 61 74 65 3c 2f 63 3e 20 6d 65 74 68 6f 64 73 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 61 72 date</c>.methods..........///.ar
20b20 65 20 65 78 65 63 75 74 65 64 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 e.executed...........///........
20b40 20 20 2f 2f 2f 20 54 68 65 20 75 70 64 61 74 65 20 63 61 6c 6c 62 61 63 6b 20 69 74 73 65 6c 66 ..///.The.update.callback.itself
20b60 20 69 73 20 74 72 69 67 67 65 72 65 64 20 62 65 66 6f 72 65 20 74 68 65 20 69 6e 70 75 74 20 73 .is.triggered.before.the.input.s
20b80 79 73 74 65 6d 20 72 75 6e 73 20 69 74 73 20 6f 77 6e 20 75 70 64 61 74 65 20 61 6e 64 0d 0a 20 ystem.runs.its.own.update.and...
20ba0 20 20 20 20 20 20 20 2f 2f 2f 20 62 65 66 6f 72 65 20 69 74 20 66 6c 75 73 68 65 73 20 6f 75 74 .......///.before.it.flushes.out
20bc0 20 69 74 73 20 65 76 65 6e 74 20 71 75 65 75 65 2e 20 54 68 69 73 20 6d 65 61 6e 73 20 74 68 61 .its.event.queue..This.means.tha
20be0 74 20 65 76 65 6e 74 73 20 71 75 65 75 65 64 20 66 72 6f 6d 20 61 20 63 61 6c 6c 62 61 63 6b 20 t.events.queued.from.a.callback.
20c00 77 69 6c 6c 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 62 65 20 66 65 64 20 72 69 67 68 74 20 69 will..........///.be.fed.right.i
20c20 6e 74 6f 20 74 68 65 20 75 70 63 6f 6d 69 6e 67 20 75 70 64 61 74 65 2e 0d 0a 20 20 20 20 20 20 nto.the.upcoming.update.........
20c40 20 20 2f 2f 2f 20 3c 2f 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 ..///.</remarks>..........///.<s
20c60 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 6f 6e 41 66 74 65 72 55 70 64 61 74 65 22 2f 3e 0d 0a 20 eealso.cref="onAfterUpdate"/>...
20c80 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 55 70 64 61 74 65 .......///.<seealso.cref="Update
20ca0 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 65 76 65 6e 74 "/>..........public.static.event
20cc0 20 41 63 74 69 6f 6e 20 6f 6e 42 65 66 6f 72 65 55 70 64 61 74 65 0d 0a 20 20 20 20 20 20 20 20 .Action.onBeforeUpdate..........
20ce0 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 61 64 64 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 {..............add..............
20d00 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6c 6f 63 6b 20 28 73 5f 4d 61 6e 61 67 {..................lock.(s_Manag
20d20 65 72 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 4d 61 6e 61 67 er)......................s_Manag
20d40 65 72 2e 6f 6e 42 65 66 6f 72 65 55 70 64 61 74 65 20 2b 3d 20 76 61 6c 75 65 3b 0d 0a 20 20 20 er.onBeforeUpdate.+=.value;.....
20d60 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 6d 6f 76 65 0d 0a .........}..............remove..
20d80 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 6c ............{..................l
20da0 6f 63 6b 20 28 73 5f 4d 61 6e 61 67 65 72 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ock.(s_Manager).................
20dc0 20 20 20 20 20 73 5f 4d 61 6e 61 67 65 72 2e 6f 6e 42 65 66 6f 72 65 55 70 64 61 74 65 20 2d 3d .....s_Manager.onBeforeUpdate.-=
20de0 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 20 .value;..............}..........
20e00 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>......
20e20 20 20 20 20 2f 2f 2f 20 45 76 65 6e 74 20 74 68 61 74 20 69 73 20 66 69 72 65 64 20 61 66 74 65 ....///.Event.that.is.fired.afte
20e40 72 20 74 68 65 20 69 6e 70 75 74 20 73 79 73 74 65 6d 20 68 61 73 20 63 6f 6d 70 6c 65 74 65 64 r.the.input.system.has.completed
20e60 20 61 6e 20 75 70 64 61 74 65 20 61 6e 64 20 70 72 6f 63 65 73 73 65 64 20 61 6c 6c 20 70 65 6e .an.update.and.processed.all.pen
20e80 64 69 6e 67 20 65 76 65 6e 74 73 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d ding.events...........///.</summ
20ea0 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d ary>..........///.<seealso.cref=
20ec0 22 6f 6e 42 65 66 6f 72 65 55 70 64 61 74 65 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 "onBeforeUpdate"/>..........///.
20ee0 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 55 70 64 61 74 65 22 2f 3e 0d 0a 20 20 20 20 20 20 <seealso.cref="Update"/>........
20f00 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 65 76 65 6e 74 20 41 63 74 69 6f 6e 20 6f 6e 41 ..public.static.event.Action.onA
20f20 66 74 65 72 55 70 64 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 fterUpdate..........{...........
20f40 20 20 20 61 64 64 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 ...add..............{...........
20f60 20 20 20 20 20 20 20 6c 6f 63 6b 20 28 73 5f 4d 61 6e 61 67 65 72 29 0d 0a 20 20 20 20 20 20 20 .......lock.(s_Manager).........
20f80 20 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 4d 61 6e 61 67 65 72 2e 6f 6e 41 66 74 65 72 55 70 .............s_Manager.onAfterUp
20fa0 64 61 74 65 20 2b 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 date.+=.value;..............}...
20fc0 20 20 20 20 20 20 20 20 20 20 20 72 65 6d 6f 76 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b ...........remove..............{
20fe0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6c 6f 63 6b 20 28 73 5f 4d 61 6e 61 67 65 ..................lock.(s_Manage
21000 72 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 4d 61 6e 61 67 65 r)......................s_Manage
21020 72 2e 6f 6e 41 66 74 65 72 55 70 64 61 74 65 20 2d 3d 20 76 61 6c 75 65 3b 0d 0a 20 20 20 20 20 r.onAfterUpdate.-=.value;.......
21040 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 23 .......}..........}............#
21060 65 6e 64 72 65 67 69 6f 6e 0d 0a 0d 0a 20 20 20 20 20 20 20 20 23 72 65 67 69 6f 6e 20 53 65 74 endregion............#region.Set
21080 74 69 6e 67 73 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 tings............///.<summary>..
210a0 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 68 65 20 63 75 72 72 65 6e 74 20 63 6f 6e 66 69 67 75 72 ........///.The.current.configur
210c0 61 74 69 6f 6e 20 6f 66 20 74 68 65 20 69 6e 70 75 74 20 73 79 73 74 65 6d 2e 0d 0a 20 20 20 20 ation.of.the.input.system.......
210e0 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 ....///.</summary>..........///.
21100 3c 76 61 6c 75 65 3e 47 6c 6f 62 61 6c 20 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 20 6f 62 6a 65 <value>Global.configuration.obje
21120 63 74 20 66 6f 72 20 74 68 65 20 69 6e 70 75 74 20 73 79 73 74 65 6d 2e 3c 2f 76 61 6c 75 65 3e ct.for.the.input.system.</value>
21140 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 ..........///.<remarks>.........
21160 20 2f 2f 2f 20 54 68 65 20 69 6e 70 75 74 20 73 79 73 74 65 6d 20 63 61 6e 20 62 65 20 63 6f 6e .///.The.input.system.can.be.con
21180 66 69 67 75 72 65 64 20 6f 6e 20 61 20 70 65 72 2d 70 72 6f 6a 65 63 74 20 62 61 73 69 73 2e 20 figured.on.a.per-project.basis..
211a0 53 65 74 74 69 6e 67 73 20 63 61 6e 20 65 69 74 68 65 72 20 62 65 20 63 72 65 61 74 65 64 20 61 Settings.can.either.be.created.a
211c0 6e 64 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 69 6e 73 74 61 6c 6c 65 64 20 6f 6e 20 74 68 65 nd..........///.installed.on.the
211e0 20 66 6c 79 20 6f 72 20 70 65 72 73 69 73 74 65 64 20 61 73 20 61 73 73 65 74 73 20 69 6e 20 74 .fly.or.persisted.as.assets.in.t
21200 68 65 20 70 72 6f 6a 65 63 74 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 6d 61 72 he.project...........///.</remar
21220 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f 6e 20 63 72 65 66 ks>..........///.<exception.cref
21240 3d 22 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 22 3e 56 61 6c 75 65 20 69 ="ArgumentNullException">Value.i
21260 73 20 6e 75 6c 6c 20 77 68 65 6e 20 73 65 74 74 69 6e 67 20 74 68 65 20 70 72 6f 70 65 72 74 79 s.null.when.setting.the.property
21280 2e 3c 2f 65 78 63 65 70 74 69 6f 6e 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 .</exception>..........public.st
212a0 61 74 69 63 20 49 6e 70 75 74 53 65 74 74 69 6e 67 73 20 73 65 74 74 69 6e 67 73 0d 0a 20 20 20 atic.InputSettings.settings.....
212c0 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 67 65 74 20 3d 3e 20 73 5f 4d 61 6e .....{..............get.=>.s_Man
212e0 61 67 65 72 2e 73 65 74 74 69 6e 67 73 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 65 74 0d ager.settings;..............set.
21300 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 .............{..................
21320 69 66 20 28 76 61 6c 75 65 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 if.(value.==.null)..............
21340 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 ........throw.new.ArgumentNullEx
21360 63 65 70 74 69 6f 6e 28 6e 61 6d 65 6f 66 28 76 61 6c 75 65 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 ception(nameof(value));.........
21380 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 5f 4d 61 6e 61 67 65 72 2e 6d 5f 53 65 74 74 69 ...........if.(s_Manager.m_Setti
213a0 6e 67 73 20 3d 3d 20 76 61 6c 75 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ngs.==.value)...................
213c0 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 2f 2f ...return;....................//
213e0 20 49 6e 20 74 68 65 20 65 64 69 74 6f 72 2c 20 77 65 20 6b 65 65 70 20 74 72 61 63 6b 20 6f 66 .In.the.editor,.we.keep.track.of
21400 20 74 68 65 20 73 65 74 74 69 6e 67 73 20 61 73 73 65 74 20 74 68 72 6f 75 67 68 20 45 64 69 74 .the.settings.asset.through.Edit
21420 6f 72 42 75 69 6c 64 53 65 74 74 69 6e 67 73 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 orBuildSettings.................
21440 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..............
21460 20 20 20 20 69 66 20 28 21 73 74 72 69 6e 67 2e 49 73 4e 75 6c 6c 4f 72 45 6d 70 74 79 28 41 73 ....if.(!string.IsNullOrEmpty(As
21480 73 65 74 44 61 74 61 62 61 73 65 2e 47 65 74 41 73 73 65 74 50 61 74 68 28 76 61 6c 75 65 29 29 setDatabase.GetAssetPath(value))
214a0 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 )..................{............
214c0 20 20 20 20 20 20 20 20 20 20 45 64 69 74 6f 72 42 75 69 6c 64 53 65 74 74 69 6e 67 73 2e 41 64 ..........EditorBuildSettings.Ad
214e0 64 43 6f 6e 66 69 67 4f 62 6a 65 63 74 28 49 6e 70 75 74 53 65 74 74 69 6e 67 73 50 72 6f 76 69 dConfigObject(InputSettingsProvi
21500 64 65 72 2e 6b 45 64 69 74 6f 72 42 75 69 6c 64 53 65 74 74 69 6e 67 73 43 6f 6e 66 69 67 4b 65 der.kEditorBuildSettingsConfigKe
21520 79 2c 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 76 61 6c 75 y,..........................valu
21540 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 20 7d 0d 0a 20 20 e,.true);..................}....
21560 20 20 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............
21580 20 20 20 20 20 20 20 20 73 5f 4d 61 6e 61 67 65 72 2e 73 65 74 74 69 6e 67 73 20 3d 20 76 61 6c ........s_Manager.settings.=.val
215a0 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 20 7d 0d 0a 0d ue;..............}..........}...
215c0 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>..........
215e0 2f 2f 2f 20 45 76 65 6e 74 20 74 68 61 74 20 69 73 20 74 72 69 67 67 65 72 65 64 20 69 66 20 61 ///.Event.that.is.triggered.if.a
21600 6e 79 20 6f 66 20 74 68 65 20 70 72 6f 70 65 72 74 69 65 73 20 69 6e 20 3c 73 65 65 20 63 72 65 ny.of.the.properties.in.<see.cre
21620 66 3d 22 73 65 74 74 69 6e 67 73 22 2f 3e 20 63 68 61 6e 67 65 73 20 6f 72 20 69 66 0d 0a 20 20 f="settings"/>.changes.or.if....
21640 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 20 63 72 65 66 3d 22 73 65 74 74 69 6e 67 73 22 2f 3e ......///.<see.cref="settings"/>
21660 20 69 73 20 72 65 70 6c 61 63 65 64 20 65 6e 74 69 72 65 6c 79 20 77 69 74 68 20 61 20 6e 65 77 .is.replaced.entirely.with.a.new
21680 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 53 65 74 74 69 6e 67 73 22 2f 3e 20 6f 62 6a .<see.cref="InputSettings"/>.obj
216a0 65 63 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 ect...........///.</summary>....
216c0 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 73 65 74 74 69 6e 67 ......///.<seealso.cref="setting
216e0 73 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d s"/>..........///.<seealso.cref=
21700 22 49 6e 70 75 74 53 65 74 74 69 6e 67 73 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 "InputSettings"/>..........publi
21720 63 20 73 74 61 74 69 63 20 65 76 65 6e 74 20 41 63 74 69 6f 6e 20 6f 6e 53 65 74 74 69 6e 67 73 c.static.event.Action.onSettings
21740 43 68 61 6e 67 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 61 Change..........{..............a
21760 64 64 20 3d 3e 20 73 5f 4d 61 6e 61 67 65 72 2e 6f 6e 53 65 74 74 69 6e 67 73 43 68 61 6e 67 65 dd.=>.s_Manager.onSettingsChange
21780 20 2b 3d 20 76 61 6c 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 6d 6f 76 65 20 3d .+=.value;..............remove.=
217a0 3e 20 73 5f 4d 61 6e 61 67 65 72 2e 6f 6e 53 65 74 74 69 6e 67 73 43 68 61 6e 67 65 20 2d 3d 20 >.s_Manager.onSettingsChange.-=.
217c0 76 61 6c 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 23 65 6e value;..........}............#en
217e0 64 72 65 67 69 6f 6e 0d 0a 0d 0a 20 20 20 20 20 20 20 20 23 72 65 67 69 6f 6e 20 41 63 74 69 6f dregion............#region.Actio
21800 6e 73 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 ns............///.<summary>.....
21820 20 20 20 20 20 2f 2f 2f 20 45 76 65 6e 74 20 74 68 61 74 20 69 73 20 73 69 67 6e 61 6c 6c 65 64 .....///.Event.that.is.signalled
21840 20 77 68 65 6e 20 74 68 65 20 73 74 61 74 65 20 6f 66 20 65 6e 61 62 6c 65 64 20 61 63 74 69 6f .when.the.state.of.enabled.actio
21860 6e 73 20 69 6e 20 74 68 65 20 73 79 73 74 65 6d 20 63 68 61 6e 67 65 73 20 6f 72 0d 0a 20 20 20 ns.in.the.system.changes.or.....
21880 20 20 20 20 20 2f 2f 2f 20 77 68 65 6e 20 61 63 74 69 6f 6e 73 20 61 72 65 20 74 72 69 67 67 65 .....///.when.actions.are.trigge
218a0 72 65 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 20 20 red...........///.</summary>....
218c0 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f ......///.<remarks>..........///
218e0 20 54 68 65 20 6f 62 6a 65 63 74 20 72 65 63 65 69 76 65 64 20 62 79 20 74 68 65 20 63 61 6c 6c .The.object.received.by.the.call
21900 62 61 63 6b 20 69 73 20 65 69 74 68 65 72 20 61 6e 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 back.is.either.an.<see.cref="Inp
21920 75 74 41 63 74 69 6f 6e 22 2f 3e 2c 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 20 63 utAction"/>,..........///.<see.c
21940 72 65 66 3d 22 49 6e 70 75 74 41 63 74 69 6f 6e 4d 61 70 22 2f 3e 2c 20 6f 72 20 3c 73 65 65 20 ref="InputActionMap"/>,.or.<see.
21960 63 72 65 66 3d 22 49 6e 70 75 74 41 63 74 69 6f 6e 41 73 73 65 74 22 2f 3e 20 64 65 70 65 6e 64 cref="InputActionAsset"/>.depend
21980 69 6e 67 20 6f 6e 20 77 68 65 74 68 65 72 20 74 68 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 ing.on.whether.the..........///.
219a0 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 41 63 74 69 6f 6e 43 68 61 6e 67 65 22 2f 3e 20 <see.cref="InputActionChange"/>.
219c0 61 66 66 65 63 74 73 20 61 20 73 69 6e 67 6c 65 20 61 63 74 69 6f 6e 2c 20 61 6e 20 65 6e 74 69 affects.a.single.action,.an.enti
219e0 72 65 20 61 63 74 69 6f 6e 20 6d 61 70 2c 20 6f 72 20 61 6e 0d 0a 20 20 20 20 20 20 20 20 2f 2f re.action.map,.or.an..........//
21a00 2f 20 65 6e 74 69 72 65 20 61 63 74 69 6f 6e 20 61 73 73 65 74 2e 0d 0a 20 20 20 20 20 20 20 20 /.entire.action.asset...........
21a20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 46 6f 72 20 3c 73 65 65 20 63 72 65 66 3d 22 ///..........///.For.<see.cref="
21a40 49 6e 70 75 74 41 63 74 69 6f 6e 43 68 61 6e 67 65 2e 42 6f 75 6e 64 43 6f 6e 74 72 6f 6c 73 41 InputActionChange.BoundControlsA
21a60 62 6f 75 74 54 6f 43 68 61 6e 67 65 22 2f 3e 20 61 6e 64 20 3c 73 65 65 20 63 72 65 66 3d 22 49 boutToChange"/>.and.<see.cref="I
21a80 6e 70 75 74 41 63 74 69 6f 6e 43 68 61 6e 67 65 2e 42 6f 75 6e 64 43 6f 6e 74 72 6f 6c 73 43 68 nputActionChange.BoundControlsCh
21aa0 61 6e 67 65 64 22 2f 3e 2c 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 74 68 65 20 67 69 76 65 6e anged"/>,..........///.the.given
21ac0 20 6f 62 6a 65 63 74 20 69 73 20 61 6e 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 41 63 .object.is.an.<see.cref="InputAc
21ae0 74 69 6f 6e 22 2f 3e 20 69 66 20 74 68 65 20 61 63 74 69 6f 6e 20 69 73 20 6e 6f 74 20 70 61 72 tion"/>.if.the.action.is.not.par
21b00 74 20 6f 66 20 61 6e 20 61 63 74 69 6f 6e 20 6d 61 70 2c 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f t.of.an.action.map,..........///
21b20 20 61 6e 20 3c 73 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 41 63 74 69 6f 6e 4d 61 70 22 2f 3e .an.<see.cref="InputActionMap"/>
21b40 20 69 66 20 74 68 65 20 74 68 65 20 61 63 74 69 6f 6e 73 20 61 72 65 20 70 61 72 74 20 6f 66 20 .if.the.the.actions.are.part.of.
21b60 61 20 6d 61 70 20 62 75 74 20 6e 6f 74 20 70 61 72 74 20 6f 66 20 61 6e 20 61 73 73 65 74 2c 20 a.map.but.not.part.of.an.asset,.
21b80 61 6e 64 20 61 6e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 20 63 72 65 66 3d 22 49 and.an..........///.<see.cref="I
21ba0 6e 70 75 74 41 63 74 69 6f 6e 41 73 73 65 74 22 2f 3e 20 69 66 20 74 68 65 20 61 63 74 69 6f 6e nputActionAsset"/>.if.the.action
21bc0 73 20 61 72 65 20 70 61 72 74 20 6f 66 20 61 6e 20 61 73 73 65 74 2e 20 49 6e 20 6f 74 68 65 72 s.are.part.of.an.asset..In.other
21be0 20 77 6f 72 64 73 2c 20 74 68 65 20 6e 6f 74 69 66 69 63 61 74 69 6f 6e 20 69 73 0d 0a 20 20 20 .words,.the.notification.is.....
21c00 20 20 20 20 20 2f 2f 2f 20 73 65 6e 74 20 66 6f 72 20 74 68 65 20 74 6f 70 6d 6f 73 74 20 6f 62 .....///.sent.for.the.topmost.ob
21c20 6a 65 63 74 20 69 6e 20 74 68 65 20 68 69 65 72 61 72 63 68 79 2e 0d 0a 20 20 20 20 20 20 20 20 ject.in.the.hierarchy...........
21c40 2f 2f 2f 20 3c 2f 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 65 78 61 ///.</remarks>..........///.<exa
21c60 6d 70 6c 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 63 6f 64 65 3e 0d 0a 20 20 20 20 20 mple>..........///.<code>.......
21c80 20 20 20 2f 2f 2f 20 49 6e 70 75 74 53 79 73 74 65 6d 2e 6f 6e 41 63 74 69 6f 6e 43 68 61 6e 67 ...///.InputSystem.onActionChang
21ca0 65 20 2b 3d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 28 6f 62 6a 2c 20 63 68 61 6e e.+=..........///.....(obj,.chan
21cc0 67 65 29 20 3d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 ge).=>..........///.....{.......
21ce0 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 69 66 20 28 63 68 61 6e 67 65 20 3d 3d 20 49 6e 70 ...///.........if.(change.==.Inp
21d00 75 74 41 63 74 69 6f 6e 43 68 61 6e 67 65 2e 41 63 74 69 6f 6e 50 65 72 66 6f 72 6d 65 64 29 0d utActionChange.ActionPerformed).
21d20 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 .........///.........{..........
21d40 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 61 63 74 69 6f 6e 20 3d 20 28 49 6e ///.............var.action.=.(In
21d60 70 75 74 41 63 74 69 6f 6e 29 6f 62 6a 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 putAction)obj;..........///.....
21d80 20 20 20 20 20 20 20 20 76 61 72 20 63 6f 6e 74 72 6f 6c 20 3d 20 61 63 74 69 6f 6e 2e 61 63 74 ........var.control.=.action.act
21da0 69 76 65 43 6f 6e 74 72 6f 6c 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 iveControl;..........///........
21dc0 20 20 20 20 20 2f 2f 2e 2e 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 .....//.............///.........
21de0 7d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 65 6c 73 65 20 69 66 20 28 }..........///.........else.if.(
21e00 63 68 61 6e 67 65 20 3d 3d 20 49 6e 70 75 74 41 63 74 69 6f 6e 43 68 61 6e 67 65 2e 41 63 74 69 change.==.InputActionChange.Acti
21e20 6f 6e 4d 61 70 45 6e 61 62 6c 65 64 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 onMapEnabled)..........///......
21e40 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 ...{..........///.............va
21e60 72 20 61 63 74 69 6f 6e 4d 61 70 20 3d 20 28 49 6e 70 75 74 41 63 74 69 6f 6e 4d 61 70 29 6f 62 r.actionMap.=.(InputActionMap)ob
21e80 6a 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2e 2e j;..........///.............//..
21ea0 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 ...........///.........}........
21ec0 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 65 6c 73 65 20 69 66 20 28 63 68 61 6e 67 65 20 3d 3d ..///.........else.if.(change.==
21ee0 20 49 6e 70 75 74 41 63 74 69 6f 6e 43 68 61 6e 67 65 2e 42 6f 75 6e 64 43 6f 6e 74 72 6f 6c 73 .InputActionChange.BoundControls
21f00 43 68 61 6e 67 65 64 29 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 7b 0d Changed)..........///.........{.
21f20 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 54 68 69 73 .........///.............//.This
21f40 20 69 73 20 6f 6e 65 20 77 61 79 20 74 6f 20 64 65 61 6c 20 77 69 74 68 20 74 68 65 20 66 61 63 .is.one.way.to.deal.with.the.fac
21f60 74 20 74 68 61 74 20 6f 62 6a 20 6d 61 79 20 62 65 20 61 6e 20 49 6e 70 75 74 41 63 74 69 6f 6e t.that.obj.may.be.an.InputAction
21f80 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 6e 70 ..........///.............//.Inp
21fa0 75 74 41 63 74 69 6f 6e 4d 61 70 2c 20 6f 72 20 49 6e 70 75 74 41 63 74 69 6f 6e 41 73 73 65 74 utActionMap,.or.InputActionAsset
21fc0 20 61 6e 64 20 6d 61 79 20 62 65 20 70 61 72 74 20 6f 66 20 61 6e 20 49 6e 70 75 74 41 63 74 69 .and.may.be.part.of.an.InputActi
21fe0 6f 6e 41 73 73 65 74 20 6f 72 20 6e 6f 74 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 onAsset.or.not...........///....
22000 20 20 20 20 20 20 20 20 20 76 61 72 20 61 63 74 69 6f 6e 20 3d 20 6f 62 6a 20 61 73 20 49 6e 70 .........var.action.=.obj.as.Inp
22020 75 74 41 63 74 69 6f 6e 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 utAction;..........///..........
22040 20 20 20 76 61 72 20 61 63 74 69 6f 6e 4d 61 70 20 3d 20 61 63 74 69 6f 6e 3f 2e 61 63 74 69 6f ...var.actionMap.=.action?.actio
22060 6e 4d 61 70 20 3f 3f 20 6f 62 6a 20 61 73 20 49 6e 70 75 74 41 63 74 69 6f 6e 4d 61 70 3b 0d 0a nMap.??.obj.as.InputActionMap;..
22080 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 61 63 74 69 ........///.............var.acti
220a0 6f 6e 41 73 73 65 74 20 3d 20 61 63 74 69 6f 6e 4d 61 70 3f 2e 61 73 73 65 74 20 3f 3f 20 6f 62 onAsset.=.actionMap?.asset.??.ob
220c0 6a 20 61 73 20 49 6e 70 75 74 41 63 74 69 6f 6e 41 73 73 65 74 3b 0d 0a 20 20 20 20 20 20 20 20 j.as.InputActionAsset;..........
220e0 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 ///..........///.............//.
22100 4e 6f 74 65 20 74 68 61 74 20 69 66 20 62 6f 75 6e 64 20 63 6f 6e 74 72 6f 6c 73 20 61 72 65 20 Note.that.if.bound.controls.are.
22120 63 68 61 6e 67 65 64 20 6f 6e 20 61 6e 79 20 6d 61 70 20 69 6e 20 61 6e 20 61 73 73 65 74 2c 20 changed.on.any.map.in.an.asset,.
22140 74 68 65 72 65 20 2a 77 69 6c 6c 2a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 there.*will*..........///.......
22160 20 20 20 20 20 20 2f 2f 20 62 65 20 61 20 42 6f 75 6e 64 43 6f 6e 74 72 6f 6c 73 43 68 61 6e 67 ......//.be.a.BoundControlsChang
22180 65 64 20 6e 6f 74 69 66 69 63 61 74 69 6f 6e 20 66 6f 72 20 74 68 65 20 65 6e 74 69 72 65 20 61 ed.notification.for.the.entire.a
221a0 73 73 65 74 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 sset...........///..........///.
221c0 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2e 2e 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 ............//.............///..
221e0 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 7d 3b 0d 0a 20 20 .......}..........///.....};....
22200 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 2f 2f 2f 20 3c ......///.</code>..........///.<
22220 2f 65 78 61 6d 70 6c 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 /example>..........///.<seealso.
22240 63 72 65 66 3d 22 49 6e 70 75 74 41 63 74 69 6f 6e 2e 63 6f 6e 74 72 6f 6c 73 22 2f 3e 0d 0a 20 cref="InputAction.controls"/>...
22260 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 65 76 65 6e 74 20 41 63 74 69 6f .......public.static.event.Actio
22280 6e 3c 6f 62 6a 65 63 74 2c 20 49 6e 70 75 74 41 63 74 69 6f 6e 43 68 61 6e 67 65 3e 20 6f 6e 41 n<object,.InputActionChange>.onA
222a0 63 74 69 6f 6e 43 68 61 6e 67 65 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 ctionChange..........{..........
222c0 20 20 20 20 61 64 64 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 ....add..............{..........
222e0 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 20 20 20 ........if.(value.==.null)......
22300 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 ................throw.new.Argume
22320 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 28 6e 61 6d 65 6f 66 28 76 61 6c 75 65 29 29 3b 0d ntNullException(nameof(value));.
22340 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6c 6f 63 6b 20 28 73 5f 4d 61 6e 61 67 65 72 .................lock.(s_Manager
22360 29 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 49 6e 70 75 )......................if.(!Inpu
22380 74 41 63 74 69 6f 6e 53 74 61 74 65 2e 73 5f 4f 6e 41 63 74 69 6f 6e 43 68 61 6e 67 65 2e 43 6f tActionState.s_OnActionChange.Co
223a0 6e 74 61 69 6e 73 28 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 ntains(value))..................
223c0 20 20 20 20 20 20 20 20 49 6e 70 75 74 41 63 74 69 6f 6e 53 74 61 74 65 2e 73 5f 4f 6e 41 63 74 ........InputActionState.s_OnAct
223e0 69 6f 6e 43 68 61 6e 67 65 2e 41 70 70 65 6e 64 28 76 61 6c 75 65 29 3b 0d 0a 20 20 20 20 20 20 ionChange.Append(value);........
22400 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 6d 6f 76 65 0d 0a 20 20 20 ......}..............remove.....
22420 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.(
22440 76 61 6c 75 65 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 value.==.null)..................
22460 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 ....throw.new.ArgumentNullExcept
22480 69 6f 6e 28 6e 61 6d 65 6f 66 28 76 61 6c 75 65 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ion(nameof(value));.............
224a0 20 20 20 20 20 6c 6f 63 6b 20 28 73 5f 4d 61 6e 61 67 65 72 29 0d 0a 20 20 20 20 20 20 20 20 20 .....lock.(s_Manager)...........
224c0 20 20 20 20 20 20 20 20 20 20 20 49 6e 70 75 74 41 63 74 69 6f 6e 53 74 61 74 65 2e 73 5f 4f 6e ...........InputActionState.s_On
224e0 41 63 74 69 6f 6e 43 68 61 6e 67 65 2e 52 65 6d 6f 76 65 28 76 61 6c 75 65 29 3b 0d 0a 20 20 20 ActionChange.Remove(value);.....
22500 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 20 .........}..........}...........
22520 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 67 69 .///.<summary>..........///.Regi
22540 73 74 65 72 20 61 20 6e 65 77 20 74 79 70 65 20 6f 66 20 69 6e 74 65 72 61 63 74 69 6f 6e 20 77 ster.a.new.type.of.interaction.w
22560 69 74 68 20 74 68 65 20 73 79 73 74 65 6d 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 ith.the.system...........///.</s
22580 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 ummary>..........///.<param.name
225a0 3d 22 74 79 70 65 22 3e 54 79 70 65 20 74 68 61 74 20 69 6d 70 6c 65 6d 65 6e 74 73 20 74 68 65 ="type">Type.that.implements.the
225c0 20 69 6e 74 65 72 61 63 74 69 6f 6e 2e 20 4d 75 73 74 20 73 75 70 70 6f 72 74 20 3c 73 65 65 20 .interaction..Must.support.<see.
225e0 63 72 65 66 3d 22 49 6e 70 75 74 49 6e 74 65 72 61 63 74 69 6f 6e 22 2f 3e 2e 3c 2f 70 61 72 61 cref="InputInteraction"/>.</para
22600 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 61 6d 20 6e 61 6d 65 3d 22 6e 61 6d m>..........///.<param.name="nam
22620 65 22 3e 4e 61 6d 65 20 74 6f 20 72 65 67 69 73 74 65 72 20 74 68 65 20 69 6e 74 65 72 61 63 74 e">Name.to.register.the.interact
22640 69 6f 6e 20 77 69 74 68 2e 20 54 68 69 73 20 69 73 20 75 73 65 64 20 69 6e 20 62 69 6e 64 69 6e ion.with..This.is.used.in.bindin
22660 67 73 20 74 6f 20 72 65 66 65 72 20 74 6f 20 74 68 65 20 69 6e 74 65 72 61 63 74 69 6f 6e 0d 0a gs.to.refer.to.the.interaction..
22680 20 20 20 20 20 20 20 20 2f 2f 2f 20 28 65 2e 67 2e 20 61 6e 20 69 6e 74 65 72 61 63 74 69 6f 6e ........///.(e.g..an.interaction
226a0 73 20 63 61 6c 6c 65 64 20 22 54 61 70 22 20 63 61 6e 20 62 65 20 61 64 64 65 64 20 74 6f 20 61 s.called."Tap".can.be.added.to.a
226c0 20 62 69 6e 64 69 6e 67 20 62 79 20 6c 69 73 74 69 6e 67 20 69 74 20 69 6e 20 69 74 73 20 3c 73 .binding.by.listing.it.in.its.<s
226e0 65 65 20 63 72 65 66 3d 22 49 6e 70 75 74 42 69 6e 64 69 6e 67 2e 69 6e 74 65 72 61 63 74 69 6f ee.cref="InputBinding.interactio
22700 6e 73 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 70 72 6f 70 65 72 74 79 29 2e 20 49 66 ns"/>..........///.property)..If
22720 20 6e 6f 20 6e 61 6d 65 20 69 73 20 73 75 70 70 6c 69 65 64 2c 20 74 68 65 20 73 68 6f 72 74 20 .no.name.is.supplied,.the.short.
22740 6e 61 6d 65 20 6f 66 20 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 74 79 70 65 22 2f 3e 20 name.of.<paramref.name="type"/>.
22760 69 73 20 75 73 65 64 20 28 77 69 74 68 20 22 49 6e 74 65 72 61 63 74 69 6f 6e 22 20 63 6c 69 70 is.used.(with."Interaction".clip
22780 70 65 64 20 6f 66 66 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 74 68 65 20 6e 61 6d 65 20 69 66 ped.off..........///.the.name.if
227a0 20 74 68 65 20 74 79 70 65 20 6e 61 6d 65 20 65 6e 64 73 20 69 6e 20 74 68 61 74 29 2e 3c 2f 70 .the.type.name.ends.in.that).</p
227c0 61 72 61 6d 3e 0d 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 aram>..........///.<example>....
227e0 20 20 20 20 20 20 2f 2f 2f 20 3c 63 6f 64 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 2f 2f ......///.<code>..........///.//
22800 20 49 6e 74 65 72 61 63 74 69 6f 6e 20 74 68 61 74 20 69 73 20 70 65 72 66 6f 72 6d 65 64 20 77 .Interaction.that.is.performed.w
22820 68 65 6e 20 63 6f 6e 74 72 6f 6c 20 72 65 73 65 74 73 20 74 6f 20 64 65 66 61 75 6c 74 20 73 74 hen.control.resets.to.default.st
22840 61 74 65 2e 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 52 ate...........///.public.class.R
22860 65 73 65 74 49 6e 74 65 72 61 63 74 69 6f 6e 20 3a 20 49 6e 70 75 74 49 6e 74 65 72 61 63 74 69 esetInteraction.:.InputInteracti
22880 6f 6e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 on..........///.{..........///..
228a0 20 20 20 70 75 62 6c 69 63 20 76 6f 69 64 20 50 72 6f 63 65 73 73 28 72 65 66 20 49 6e 70 75 74 ...public.void.Process(ref.Input
228c0 49 6e 74 65 72 61 63 74 69 6f 6e 43 6f 6e 74 65 78 74 20 63 6f 6e 74 65 78 74 29 0d 0a 20 20 20 InteractionContext.context).....
228e0 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 .....///.....{..........///.....
22900 20 20 20 20 69 66 20 28 63 6f 6e 74 65 78 74 2e 69 73 57 61 69 74 69 6e 67 20 26 26 20 21 63 6f ....if.(context.isWaiting.&&.!co
22920 6e 74 65 78 74 2e 63 6f 6e 74 72 6f 6c 48 61 73 44 65 66 61 75 6c 74 56 61 6c 75 65 29 0d 0a 20 ntext.controlHasDefaultValue)...
22940 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 65 78 74 2e 53 .......///.............context.S
22960 74 61 72 74 65 64 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 65 tarted();..........///.........e
22980 6c 73 65 20 69 66 20 28 63 6f 6e 74 65 78 74 2e 69 73 53 74 61 72 74 65 64 20 26 26 20 63 6f 6e lse.if.(context.isStarted.&&.con
229a0 74 65 78 74 2e 63 6f 6e 74 72 6f 6c 48 61 73 44 65 66 61 75 6c 74 56 61 6c 75 65 29 0d 0a 20 20 text.controlHasDefaultValue)....
229c0 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 65 78 74 2e 50 65 ......///.............context.Pe
229e0 72 66 6f 72 6d 65 64 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 20 20 20 20 7d 0d 0a 20 rformed();..........///.....}...
22a00 20 20 20 20 20 20 20 2f 2f 2f 20 7d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 0d 0a 20 20 20 20 20 .......///.}..........///.......
22a20 20 20 20 2f 2f 2f 20 2f 2f 20 4d 61 6b 65 20 69 6e 74 65 72 61 63 74 69 6f 6e 20 67 6c 6f 62 61 ...///.//.Make.interaction.globa
22a40 6c 6c 79 20 61 76 61 69 6c 61 62 6c 65 20 6f 6e 20 62 69 6e 64 69 6e 67 73 2e 0d 0a 20 20 20 20 lly.available.on.bindings.......
22a60 20 20 20 20 2f 2f 2f 20 2f 2f 20 22 49 6e 74 65 72 61 63 74 69 6f 6e 22 20 73 75 66 66 69 78 20 ....///.//."Interaction".suffix.
22a80 69 6e 20 74 79 70 65 20 6e 61 6d 65 20 77 69 6c 6c 20 67 65 74 20 64 72 6f 70 70 65 64 20 61 75 in.type.name.will.get.dropped.au
22aa0 74 6f 6d 61 74 69 63 61 6c 6c 79 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 6e 70 75 74 53 tomatically...........///.InputS
22ac0 79 73 74 65 6d 2e 52 65 67 69 73 74 65 72 49 6e 74 65 72 61 63 74 69 6f 6e 28 74 79 70 65 6f 66 ystem.RegisterInteraction(typeof
22ae0 28 52 65 73 65 74 49 6e 74 65 72 61 63 74 69 6f 6e 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f (ResetInteraction));..........//
22b00 2f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 2f 2f 20 53 65 74 20 75 70 20 61 63 74 69 6f 6e 20 /..........///.//.Set.up.action.
22b20 77 69 74 68 20 62 69 6e 64 69 6e 67 20 74 68 61 74 20 68 61 73 20 74 68 65 20 27 72 65 73 65 74 with.binding.that.has.the.'reset
22b40 27 20 69 6e 74 65 72 61 63 74 69 6f 6e 20 61 70 70 6c 69 65 64 20 74 6f 20 69 74 2e 0d 0a 20 20 '.interaction.applied.to.it.....
22b60 20 20 20 20 20 20 2f 2f 2f 20 76 61 72 20 61 63 74 69 6f 6e 20 3d 20 6e 65 77 20 49 6e 70 75 74 ......///.var.action.=.new.Input
22b80 41 63 74 69 6f 6e 28 62 69 6e 64 69 6e 67 3a 20 22 2f 26 6c 74 3b 47 61 6d 65 70 61 64 3e 2f 62 Action(binding:."/&lt;Gamepad>/b
22ba0 75 74 74 6f 6e 53 6f 75 74 68 22 2c 20 69 6e 74 65 72 61 63 74 69 6f 6e 73 3a 20 22 72 65 73 65 uttonSouth",.interactions:."rese
22bc0 74 22 29 3b 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 t");..........///.</code>.......
22be0 20 20 20 2f 2f 2f 20 3c 2f 65 78 61 6d 70 6c 65 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c ...///.</example>..........///.<
22c00 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 49 49 6e 70 75 74 49 6e 74 65 72 61 63 74 69 6f 6e 22 seealso.cref="IInputInteraction"
22c20 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 52 />..........///.<seealso.cref="R
22c40 65 67 69 73 74 65 72 49 6e 74 65 72 61 63 74 69 6f 6e 7b 54 7d 22 2f 3e 0d 0a 20 20 20 20 20 20 egisterInteraction{T}"/>........
22c60 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 76 6f 69 64 20 52 65 67 69 73 74 65 72 49 6e 74 ..public.static.void.RegisterInt
22c80 65 72 61 63 74 69 6f 6e 28 54 79 70 65 20 74 79 70 65 2c 20 73 74 72 69 6e 67 20 6e 61 6d 65 20 eraction(Type.type,.string.name.
22ca0 3d 20 6e 75 6c 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 =.null)..........{..............
22cc0 69 66 20 28 74 79 70 65 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 if.(type.==.null)...............
22ce0 20 20 20 74 68 72 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 ...throw.new.ArgumentNullExcepti
22d00 6f 6e 28 6e 61 6d 65 6f 66 28 74 79 70 65 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 on(nameof(type));...............
22d20 20 69 66 20 28 73 74 72 69 6e 67 2e 49 73 4e 75 6c 6c 4f 72 45 6d 70 74 79 28 6e 61 6d 65 29 29 .if.(string.IsNullOrEmpty(name))
22d40 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 ..............{.................
22d60 20 6e 61 6d 65 20 3d 20 74 79 70 65 2e 4e 61 6d 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 .name.=.type.Name;..............
22d80 20 20 20 20 69 66 20 28 6e 61 6d 65 2e 45 6e 64 73 57 69 74 68 28 22 49 6e 74 65 72 61 63 74 69 ....if.(name.EndsWith("Interacti
22da0 6f 6e 22 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6e 61 6d 65 20 on"))......................name.
22dc0 3d 20 6e 61 6d 65 2e 53 75 62 73 74 72 69 6e 67 28 30 2c 20 6e 61 6d 65 2e 4c 65 6e 67 74 68 20 =.name.Substring(0,.name.Length.
22de0 2d 20 22 49 6e 74 65 72 61 63 74 69 6f 6e 22 2e 4c 65 6e 67 74 68 29 3b 0d 0a 20 20 20 20 20 20 -."Interaction".Length);........
22e00 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 4d 61 6e 61 67 65 72 ......}................s_Manager
22e20 2e 69 6e 74 65 72 61 63 74 69 6f 6e 73 2e 41 64 64 54 79 70 65 52 65 67 69 73 74 72 61 74 69 6f .interactions.AddTypeRegistratio
22e40 6e 28 6e 61 6d 65 2c 20 74 79 70 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 n(name,.type);..........}.......
22e60 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 76 6f 69 64 20 52 65 67 69 73 74 65 72 .....public.static.void.Register
22e80 49 6e 74 65 72 61 63 74 69 6f 6e 3c 54 3e 28 73 74 72 69 6e 67 20 6e 61 6d 65 20 3d 20 6e 75 6c Interaction<T>(string.name.=.nul
22ea0 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 52 65 67 69 73 l)..........{..............Regis
22ec0 74 65 72 49 6e 74 65 72 61 63 74 69 6f 6e 28 74 79 70 65 6f 66 28 54 29 2c 20 6e 61 6d 65 29 3b terInteraction(typeof(T),.name);
22ee0 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 2f 52 45 56 49 45 ..........}............////REVIE
22f00 57 3a 20 63 61 6e 20 77 65 20 6d 6f 76 65 20 74 68 65 20 67 65 74 74 65 72 73 20 61 6e 64 20 6c W:.can.we.move.the.getters.and.l
22f20 69 73 74 65 72 73 20 73 6f 6d 65 77 68 65 72 65 20 65 6c 73 65 3f 20 6d 61 79 62 65 20 60 69 6e isters.somewhere.else?.maybe.`in
22f40 74 65 72 61 63 74 69 6f 6e 73 60 20 61 6e 64 20 60 70 72 6f 63 65 73 73 6f 72 73 60 20 70 72 6f teractions`.and.`processors`.pro
22f60 70 65 72 74 69 65 73 20 61 6e 64 20 73 75 63 68 3f 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 perties.and.such?............pub
22f80 6c 69 63 20 73 74 61 74 69 63 20 54 79 70 65 20 54 72 79 47 65 74 49 6e 74 65 72 61 63 74 69 6f lic.static.Type.TryGetInteractio
22fa0 6e 28 73 74 72 69 6e 67 20 6e 61 6d 65 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 n(string.name)..........{.......
22fc0 20 20 20 20 20 20 20 69 66 20 28 73 74 72 69 6e 67 2e 49 73 4e 75 6c 6c 4f 72 45 6d 70 74 79 28 .......if.(string.IsNullOrEmpty(
22fe0 6e 61 6d 65 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 name))..................throw.ne
23000 77 20 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 28 6e 61 6d 65 6f 66 28 6e w.ArgumentNullException(nameof(n
23020 61 6d 65 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 73 5f 4d 61 6e ame));..............return.s_Man
23040 61 67 65 72 2e 69 6e 74 65 72 61 63 74 69 6f 6e 73 2e 4c 6f 6f 6b 75 70 54 79 70 65 52 65 67 69 ager.interactions.LookupTypeRegi
23060 73 74 72 61 74 69 6f 6e 28 6e 61 6d 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 stration(name);..........}......
23080 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 49 45 6e 75 6d 65 72 61 62 6c 65 3c ......public.static.IEnumerable<
230a0 73 74 72 69 6e 67 3e 20 4c 69 73 74 49 6e 74 65 72 61 63 74 69 6f 6e 73 28 29 0d 0a 20 20 20 20 string>.ListInteractions()......
230c0 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 73 5f 4d 61 6e 61 ....{..............return.s_Mana
230e0 67 65 72 2e 69 6e 74 65 72 61 63 74 69 6f 6e 73 2e 6e 61 6d 65 73 3b 0d 0a 20 20 20 20 20 20 20 ger.interactions.names;.........
23100 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 76 6f 69 64 .}............public.static.void
23120 20 52 65 67 69 73 74 65 72 42 69 6e 64 69 6e 67 43 6f 6d 70 6f 73 69 74 65 28 54 79 70 65 20 74 .RegisterBindingComposite(Type.t
23140 79 70 65 2c 20 73 74 72 69 6e 67 20 6e 61 6d 65 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 ype,.string.name)..........{....
23160 20 20 20 20 20 20 20 20 20 20 69 66 20 28 74 79 70 65 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 ..........if.(type.==.null).....
23180 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 4e .............throw.new.ArgumentN
231a0 75 6c 6c 45 78 63 65 70 74 69 6f 6e 28 6e 61 6d 65 6f 66 28 74 79 70 65 29 29 3b 0d 0a 0d 0a 20 ullException(nameof(type));.....
231c0 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 74 72 69 6e 67 2e 49 73 4e 75 6c 6c 4f 72 45 6d ...........if.(string.IsNullOrEm
231e0 70 74 79 28 6e 61 6d 65 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 pty(name))..............{.......
23200 20 20 20 20 20 20 20 20 20 20 20 6e 61 6d 65 20 3d 20 74 79 70 65 2e 4e 61 6d 65 3b 0d 0a 20 20 ...........name.=.type.Name;....
23220 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6e 61 6d 65 2e 45 6e 64 73 57 69 74 68 28 ..............if.(name.EndsWith(
23240 22 43 6f 6d 70 6f 73 69 74 65 22 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 "Composite"))...................
23260 20 20 20 6e 61 6d 65 20 3d 20 6e 61 6d 65 2e 53 75 62 73 74 72 69 6e 67 28 30 2c 20 6e 61 6d 65 ...name.=.name.Substring(0,.name
23280 2e 4c 65 6e 67 74 68 20 2d 20 22 43 6f 6d 70 6f 73 69 74 65 22 2e 4c 65 6e 67 74 68 29 3b 0d 0a .Length.-."Composite".Length);..
232a0 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 5f 4d ............}................s_M
232c0 61 6e 61 67 65 72 2e 63 6f 6d 70 6f 73 69 74 65 73 2e 41 64 64 54 79 70 65 52 65 67 69 73 74 72 anager.composites.AddTypeRegistr
232e0 61 74 69 6f 6e 28 6e 61 6d 65 2c 20 74 79 70 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d ation(name,.type);..........}...
23300 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 76 6f 69 64 20 52 65 67 69 .........public.static.void.Regi
23320 73 74 65 72 42 69 6e 64 69 6e 67 43 6f 6d 70 6f 73 69 74 65 3c 54 3e 28 73 74 72 69 6e 67 20 6e sterBindingComposite<T>(string.n
23340 61 6d 65 20 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 ame.=.null)..........{..........
23360 20 20 20 20 52 65 67 69 73 74 65 72 42 69 6e 64 69 6e 67 43 6f 6d 70 6f 73 69 74 65 28 74 79 70 ....RegisterBindingComposite(typ
23380 65 6f 66 28 54 29 2c 20 6e 61 6d 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 eof(T),.name);..........}.......
233a0 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 54 79 70 65 20 54 72 79 47 65 74 42 69 .....public.static.Type.TryGetBi
233c0 6e 64 69 6e 67 43 6f 6d 70 6f 73 69 74 65 28 73 74 72 69 6e 67 20 6e 61 6d 65 29 0d 0a 20 20 20 ndingComposite(string.name).....
233e0 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 74 72 69 6e 67 2e 49 .....{..............if.(string.I
23400 73 4e 75 6c 6c 4f 72 45 6d 70 74 79 28 6e 61 6d 65 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 sNullOrEmpty(name)).............
23420 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 .....throw.new.ArgumentNullExcep
23440 74 69 6f 6e 28 6e 61 6d 65 6f 66 28 6e 61 6d 65 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 tion(nameof(name));.............
23460 20 72 65 74 75 72 6e 20 73 5f 4d 61 6e 61 67 65 72 2e 63 6f 6d 70 6f 73 69 74 65 73 2e 4c 6f 6f .return.s_Manager.composites.Loo
23480 6b 75 70 54 79 70 65 52 65 67 69 73 74 72 61 74 69 6f 6e 28 6e 61 6d 65 29 3b 0d 0a 20 20 20 20 kupTypeRegistration(name);......
234a0 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a ....}............///.<summary>..
234c0 20 20 20 20 20 20 20 20 2f 2f 2f 20 44 69 73 61 62 6c 65 20 61 6c 6c 20 61 63 74 69 6f 6e 73 20 ........///.Disable.all.actions.
234e0 28 61 6e 64 20 69 6d 70 6c 69 63 69 74 6c 79 20 61 6c 6c 20 61 63 74 69 6f 6e 20 73 65 74 73 29 (and.implicitly.all.action.sets)
23500 20 74 68 61 74 20 61 72 65 20 63 75 72 72 65 6e 74 6c 79 20 65 6e 61 62 6c 65 64 2e 0d 0a 20 20 .that.are.currently.enabled.....
23520 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f ......///.</summary>..........//
23540 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 3d 22 4c 69 73 74 45 6e 61 62 6c 65 64 41 63 74 69 /.<seealso.cref="ListEnabledActi
23560 6f 6e 73 28 29 22 2f 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 ons()"/>..........///.<seealso.c
23580 72 65 66 3d 22 49 6e 70 75 74 41 63 74 69 6f 6e 2e 44 69 73 61 62 6c 65 22 2f 3e 0d 0a 20 20 20 ref="InputAction.Disable"/>.....
235a0 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 76 6f 69 64 20 44 69 73 61 62 6c 65 41 .....public.static.void.DisableA
235c0 6c 6c 45 6e 61 62 6c 65 64 41 63 74 69 6f 6e 73 28 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 llEnabledActions()..........{...
235e0 20 20 20 20 20 20 20 20 20 20 20 49 6e 70 75 74 41 63 74 69 6f 6e 53 74 61 74 65 2e 44 69 73 61 ...........InputActionState.Disa
23600 62 6c 65 41 6c 6c 41 63 74 69 6f 6e 73 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 bleAllActions();..........}.....
23620 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>..........//
23640 2f 20 52 65 74 75 72 6e 20 61 20 6c 69 73 74 20 6f 66 20 61 6c 6c 20 74 68 65 20 61 63 74 69 6f /.Return.a.list.of.all.the.actio
23660 6e 73 20 74 68 61 74 20 61 72 65 20 63 75 72 72 65 6e 74 6c 79 20 65 6e 61 62 6c 65 64 20 69 6e ns.that.are.currently.enabled.in
23680 20 74 68 65 20 73 79 73 74 65 6d 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 73 75 6d 6d .the.system...........///.</summ
236a0 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 74 75 72 6e 73 3e 41 20 6e 65 77 ary>..........///.<returns>A.new
236c0 20 6c 69 73 74 20 69 6e 73 74 61 6e 63 65 20 63 6f 6e 74 61 69 6e 69 6e 67 20 61 6c 6c 20 63 75 .list.instance.containing.all.cu
236e0 72 72 65 6e 74 6c 79 20 65 6e 61 62 6c 65 64 20 61 63 74 69 6f 6e 73 2e 3c 2f 72 65 74 75 72 6e rrently.enabled.actions.</return
23700 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 s>..........///.<remarks>.......
23720 20 20 20 2f 2f 2f 20 54 6f 20 61 76 6f 69 64 20 61 6c 6c 6f 63 61 74 69 6f 6e 73 2c 20 75 73 65 ...///.To.avoid.allocations,.use
23740 20 3c 73 65 65 20 63 72 65 66 3d 22 4c 69 73 74 45 6e 61 62 6c 65 64 41 63 74 69 6f 6e 73 28 4c .<see.cref="ListEnabledActions(L
23760 69 73 74 7b 55 6e 69 74 79 45 6e 67 69 6e 65 2e 49 6e 70 75 74 53 79 73 74 65 6d 2e 49 6e 70 75 ist{UnityEngine.InputSystem.Inpu
23780 74 41 63 74 69 6f 6e 7d 29 22 2f 3e 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 6d tAction})"/>...........///.</rem
237a0 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 65 65 61 6c 73 6f 20 63 72 65 66 arks>..........///.<seealso.cref
237c0 3d 22 49 6e 70 75 74 41 63 74 69 6f 6e 2e 65 6e 61 62 6c 65 64 22 2f 3e 0d 0a 20 20 20 20 20 20 ="InputAction.enabled"/>........
237e0 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 4c 69 73 74 3c 49 6e 70 75 74 41 63 74 69 6f 6e ..public.static.List<InputAction
23800 3e 20 4c 69 73 74 45 6e 61 62 6c 65 64 41 63 74 69 6f 6e 73 28 29 0d 0a 20 20 20 20 20 20 20 20 >.ListEnabledActions()..........
23820 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 72 65 73 75 6c 74 20 3d 20 6e 65 77 20 {..............var.result.=.new.
23840 4c 69 73 74 3c 49 6e 70 75 74 41 63 74 69 6f 6e 3e 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 List<InputAction>();............
23860 20 20 4c 69 73 74 45 6e 61 62 6c 65 64 41 63 74 69 6f 6e 73 28 72 65 73 75 6c 74 29 3b 0d 0a 20 ..ListEnabledActions(result);...
23880 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 72 65 73 75 6c 74 3b 0d 0a 20 20 20 20 20 ...........return.result;.......
238a0 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 ...}............///.<summary>...
238c0 20 20 20 20 20 20 20 2f 2f 2f 20 41 64 64 20 61 6c 6c 20 61 63 74 69 6f 6e 73 20 74 68 61 74 20 .......///.Add.all.actions.that.
238e0 61 72 65 20 63 75 72 72 65 6e 74 6c 79 20 65 6e 61 62 6c 65 64 20 69 6e 20 74 68 65 20 73 79 73 are.currently.enabled.in.the.sys
23900 74 65 6d 20 74 6f 20 74 68 65 20 67 69 76 65 6e 20 6c 69 73 74 2e 0d 0a 20 20 20 20 20 20 20 20 tem.to.the.given.list...........
23920 2f 2f 2f 20 3c 2f 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 70 61 72 ///.</summary>..........///.<par
23940 61 6d 20 6e 61 6d 65 3d 22 61 63 74 69 6f 6e 73 22 3e 4c 69 73 74 20 74 6f 20 61 64 64 20 61 63 am.name="actions">List.to.add.ac
23960 74 69 6f 6e 73 20 74 6f 2e 3c 2f 70 61 72 61 6d 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c tions.to.</param>..........///.<
23980 72 65 74 75 72 6e 73 3e 54 68 65 20 6e 75 6d 62 65 72 20 6f 66 20 61 63 74 69 6f 6e 73 20 61 64 returns>The.number.of.actions.ad
239a0 64 65 64 20 74 6f 20 74 68 65 20 6c 69 73 74 2e 3c 2f 72 65 74 75 72 6e 73 3e 0d 0a 20 20 20 20 ded.to.the.list.</returns>......
239c0 20 20 20 20 2f 2f 2f 20 3c 65 78 63 65 70 74 69 6f 6e 20 63 72 65 66 3d 22 41 72 67 75 6d 65 6e ....///.<exception.cref="Argumen
239e0 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 22 3e 3c 70 61 72 61 6d 72 65 66 20 6e 61 6d 65 3d 22 tNullException"><paramref.name="
23a00 61 63 74 69 6f 6e 73 22 2f 3e 20 69 73 20 6e 75 6c 6c 2e 3c 2f 65 78 63 65 70 74 69 6f 6e 3e 0d actions"/>.is.null.</exception>.
23a20 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 .........///.<remarks>..........
23a40 2f 2f 2f 20 49 66 20 74 68 65 20 63 61 70 61 63 69 74 79 20 6f 66 20 74 68 65 20 67 69 76 65 6e ///.If.the.capacity.of.the.given
23a60 20 6c 69 73 74 20 69 73 20 6c 61 72 67 65 20 65 6e 6f 75 67 68 2c 20 74 68 69 73 20 6d 65 74 68 .list.is.large.enough,.this.meth
23a80 6f 64 20 77 69 6c 6c 20 6e 6f 74 20 61 6c 6c 6f 63 61 74 65 20 6d 65 6d 6f 72 79 2e 0d 0a 20 20 od.will.not.allocate.memory.....
23aa0 20 20 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 ......///.</remarks>..........pu
23ac0 62 6c 69 63 20 73 74 61 74 69 63 20 69 6e 74 20 4c 69 73 74 45 6e 61 62 6c 65 64 41 63 74 69 6f blic.static.int.ListEnabledActio
23ae0 6e 73 28 4c 69 73 74 3c 49 6e 70 75 74 41 63 74 69 6f 6e 3e 20 61 63 74 69 6f 6e 73 29 0d 0a 20 ns(List<InputAction>.actions)...
23b00 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 61 63 74 69 6f 6e .......{..............if.(action
23b20 73 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 74 68 72 6f s.==.null)..................thro
23b40 77 20 6e 65 77 20 41 72 67 75 6d 65 6e 74 4e 75 6c 6c 45 78 63 65 70 74 69 6f 6e 28 6e 61 6d 65 w.new.ArgumentNullException(name
23b60 6f 66 28 61 63 74 69 6f 6e 73 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 of(actions));..............retur
23b80 6e 20 49 6e 70 75 74 41 63 74 69 6f 6e 53 74 61 74 65 2e 46 69 6e 64 41 6c 6c 45 6e 61 62 6c 65 n.InputActionState.FindAllEnable
23ba0 64 41 63 74 69 6f 6e 73 28 61 63 74 69 6f 6e 73 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d dActions(actions);..........}...
23bc0 0a 20 20 20 20 20 20 20 20 23 65 6e 64 72 65 67 69 6f 6e 0d 0a 0d 0a 20 20 20 20 20 20 20 20 23 .........#endregion............#
23be0 72 65 67 69 6f 6e 20 52 65 6d 6f 74 69 6e 67 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c region.Remoting............///.<
23c00 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 6c 6f 63 61 6c 20 summary>..........///.The.local.
23c20 49 6e 70 75 74 52 65 6d 6f 74 69 6e 67 20 69 6e 73 74 61 6e 63 65 20 77 68 69 63 68 20 63 61 6e InputRemoting.instance.which.can
23c40 20 6d 69 72 72 6f 72 20 6c 6f 63 61 6c 20 69 6e 70 75 74 20 74 6f 20 61 20 72 65 6d 6f 74 65 0d .mirror.local.input.to.a.remote.
23c60 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 69 6e 70 75 74 20 73 79 73 74 65 6d 20 6f 72 20 63 61 6e .........///.input.system.or.can
23c80 20 6d 61 6b 65 20 69 6e 70 75 74 20 69 6e 20 61 20 72 65 6d 6f 74 65 20 73 79 73 74 65 6d 20 61 .make.input.in.a.remote.system.a
23ca0 76 61 69 6c 61 62 6c 65 20 6c 6f 63 61 6c 6c 79 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c vailable.locally...........///.<
23cc0 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 72 6b 73 3e /summary>..........///.<remarks>
23ce0 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 49 6e 20 74 68 65 20 65 64 69 74 6f 72 2c 20 74 68 69 ..........///.In.the.editor,.thi
23d00 73 20 69 73 20 61 6c 77 61 79 73 20 69 6e 69 74 69 61 6c 69 7a 65 64 2e 20 49 6e 20 70 6c 61 79 s.is.always.initialized..In.play
23d20 65 72 73 2c 20 74 68 69 73 20 77 69 6c 6c 20 62 65 20 6e 75 6c 6c 0d 0a 20 20 20 20 20 20 20 20 ers,.this.will.be.null..........
23d40 2f 2f 2f 20 69 66 20 72 65 6d 6f 74 69 6e 67 20 69 73 20 64 69 73 61 62 6c 65 64 20 28 77 68 69 ///.if.remoting.is.disabled.(whi
23d60 63 68 20 69 74 20 69 73 20 62 79 20 64 65 66 61 75 6c 74 20 69 6e 20 72 65 6c 65 61 73 65 20 70 ch.it.is.by.default.in.release.p
23d80 6c 61 79 65 72 73 29 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 layers)...........///.</remarks>
23da0 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 49 6e 70 75 74 52 65 6d ..........public.static.InputRem
23dc0 6f 74 69 6e 67 20 72 65 6d 6f 74 69 6e 67 20 3d 3e 20 73 5f 52 65 6d 6f 74 65 3b 0d 0a 0d 0a 20 oting.remoting.=>.s_Remote;.....
23de0 20 20 20 20 20 20 20 23 65 6e 64 72 65 67 69 6f 6e 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f .......#endregion............///
23e00 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 63 75 72 72 .<summary>..........///.The.curr
23e20 65 6e 74 20 76 65 72 73 69 6f 6e 20 6f 66 20 74 68 65 20 69 6e 70 75 74 20 73 79 73 74 65 6d 20 ent.version.of.the.input.system.
23e40 70 61 63 6b 61 67 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 package...........///.</summary>
23e60 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 76 61 6c 75 65 3e 43 75 72 72 65 6e 74 20 76 65 72 ..........///.<value>Current.ver
23e80 73 69 6f 6e 20 6f 66 20 74 68 65 20 69 6e 70 75 74 20 73 79 73 74 65 6d 2e 3c 2f 76 61 6c 75 65 sion.of.the.input.system.</value
23ea0 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 56 65 72 73 69 6f 6e >..........public.static.Version
23ec0 20 76 65 72 73 69 6f 6e 20 3d 3e 20 41 73 73 65 6d 62 6c 79 2e 47 65 74 45 78 65 63 75 74 69 6e .version.=>.Assembly.GetExecutin
23ee0 67 41 73 73 65 6d 62 6c 79 28 29 2e 47 65 74 4e 61 6d 65 28 29 2e 56 65 72 73 69 6f 6e 3b 0d 0a gAssembly().GetName().Version;..
23f00 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 2f 52 45 56 49 45 57 3a 20 72 65 73 74 72 69 63 74 20 6d ..........////REVIEW:.restrict.m
23f20 65 74 72 69 63 73 20 74 6f 20 65 64 69 74 6f 72 20 61 6e 64 20 64 65 76 65 6c 6f 70 6d 65 6e 74 etrics.to.editor.and.development
23f40 20 62 75 69 6c 64 73 3f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d .builds?..........///.<summary>.
23f60 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 47 65 74 20 76 61 72 69 6f 75 73 20 75 70 2d 74 6f 2d 64 .........///.Get.various.up-to-d
23f80 61 74 65 20 6d 65 74 72 69 63 73 20 61 62 6f 75 74 20 74 68 65 20 69 6e 70 75 74 20 73 79 73 74 ate.metrics.about.the.input.syst
23fa0 65 6d 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 em...........///.</summary>.....
23fc0 20 20 20 20 20 2f 2f 2f 20 3c 76 61 6c 75 65 3e 55 70 2d 74 6f 2d 64 61 74 65 20 6d 65 74 72 69 .....///.<value>Up-to-date.metri
23fe0 63 73 20 6f 6e 20 69 6e 70 75 74 20 73 79 73 74 65 6d 20 61 63 74 69 76 69 74 79 2e 3c 2f 76 61 cs.on.input.system.activity.</va
24000 6c 75 65 3e 0d 0a 20 20 20 20 20 20 20 20 70 75 62 6c 69 63 20 73 74 61 74 69 63 20 49 6e 70 75 lue>..........public.static.Inpu
24020 74 4d 65 74 72 69 63 73 20 6d 65 74 72 69 63 73 20 3d 3e 20 73 5f 4d 61 6e 61 67 65 72 2e 6d 65 tMetrics.metrics.=>.s_Manager.me
24040 74 72 69 63 73 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 69 6e 74 65 72 6e 61 6c 20 73 74 61 74 69 trics;............internal.stati
24060 63 20 49 6e 70 75 74 4d 61 6e 61 67 65 72 20 73 5f 4d 61 6e 61 67 65 72 3b 0d 0a 20 20 20 20 20 c.InputManager.s_Manager;.......
24080 20 20 20 69 6e 74 65 72 6e 61 6c 20 73 74 61 74 69 63 20 49 6e 70 75 74 52 65 6d 6f 74 69 6e 67 ...internal.static.InputRemoting
240a0 20 73 5f 52 65 6d 6f 74 65 3b 0d 0a 0d 0a 23 69 66 20 44 45 56 45 4c 4f 50 4d 45 4e 54 5f 42 55 .s_Remote;....#if.DEVELOPMENT_BU
240c0 49 4c 44 20 7c 7c 20 55 4e 49 54 59 5f 45 44 49 54 4f 52 0d 0a 20 20 20 20 20 20 20 20 69 6e 74 ILD.||.UNITY_EDITOR..........int
240e0 65 72 6e 61 6c 20 73 74 61 74 69 63 20 52 65 6d 6f 74 65 49 6e 70 75 74 50 6c 61 79 65 72 43 6f ernal.static.RemoteInputPlayerCo
24100 6e 6e 65 63 74 69 6f 6e 20 73 5f 52 65 6d 6f 74 65 43 6f 6e 6e 65 63 74 69 6f 6e 3b 0d 0a 0d 0a nnection.s_RemoteConnection;....
24120 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 73 74 61 74 69 63 20 76 6f 69 64 20 53 65 74 55 ........private.static.void.SetU
24140 70 52 65 6d 6f 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 pRemoting()..........{..........
24160 20 20 20 20 44 65 62 75 67 2e 41 73 73 65 72 74 28 73 5f 4d 61 6e 61 67 65 72 20 21 3d 20 6e 75 ....Debug.Assert(s_Manager.!=.nu
24180 6c 6c 29 3b 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 5f 45 44 ll);................#if.UNITY_ED
241a0 49 54 4f 52 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 52 65 6d 6f 74 65 20 3d 20 6e 65 77 ITOR..............s_Remote.=.new
241c0 20 49 6e 70 75 74 52 65 6d 6f 74 69 6e 67 28 73 5f 4d 61 6e 61 67 65 72 29 3b 0d 0a 20 20 20 20 .InputRemoting(s_Manager);......
241e0 20 20 20 20 20 20 20 20 2f 2f 20 4e 4f 54 45 3a 20 57 65 20 75 73 65 20 64 65 6c 61 79 43 61 6c ........//.NOTE:.We.use.delayCal
24200 6c 20 61 73 20 6f 75 72 20 69 6e 69 74 69 61 6c 20 73 74 61 72 74 75 70 20 77 69 6c 6c 20 72 75 l.as.our.initial.startup.will.ru
24220 6e 20 69 6e 20 65 64 69 74 6f 72 20 69 6e 69 74 69 61 6c 69 7a 61 74 69 6f 6e 20 62 65 66 6f 72 n.in.editor.initialization.befor
24240 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 50 6c 61 79 65 72 43 6f e..............//.......PlayerCo
24260 6e 6e 65 63 74 69 6f 6e 20 69 73 20 69 74 73 65 6c 66 20 72 65 61 64 79 2e 20 49 66 20 77 65 20 nnection.is.itself.ready..If.we.
24280 63 61 6c 6c 20 42 69 6e 64 28 29 20 64 69 72 65 63 74 6c 79 20 68 65 72 65 2c 20 77 65 20 77 6f call.Bind().directly.here,.we.wo
242a0 6e 27 74 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 73 65 65 20 61 6e n't..............//.......see.an
242c0 79 20 65 72 72 6f 72 73 20 62 75 74 20 74 68 65 20 63 61 6c 6c 62 61 63 6b 73 20 77 65 20 72 65 y.errors.but.the.callbacks.we.re
242e0 67 69 73 74 65 72 20 66 6f 72 20 77 69 6c 6c 20 6e 6f 74 20 74 72 69 67 67 65 72 2e 0d 0a 20 20 gister.for.will.not.trigger.....
24300 20 20 20 20 20 20 20 20 20 20 45 64 69 74 6f 72 41 70 70 6c 69 63 61 74 69 6f 6e 2e 64 65 6c 61 ..........EditorApplication.dela
24320 79 43 61 6c 6c 20 2b 3d 20 53 65 74 55 70 52 65 6d 6f 74 69 6e 67 49 6e 74 65 72 6e 61 6c 3b 0d yCall.+=.SetUpRemotingInternal;.
24340 0a 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 20 20 20 .............#else..............
24360 73 5f 52 65 6d 6f 74 65 20 3d 20 6e 65 77 20 49 6e 70 75 74 52 65 6d 6f 74 69 6e 67 28 73 5f 4d s_Remote.=.new.InputRemoting(s_M
24380 61 6e 61 67 65 72 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 53 65 74 55 70 52 65 6d 6f 74 anager);..............SetUpRemot
243a0 69 6e 67 49 6e 74 65 72 6e 61 6c 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 23 65 6e 64 ingInternal();..............#end
243c0 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 61 74 65 if..........}............private
243e0 20 73 74 61 74 69 63 20 76 6f 69 64 20 53 65 74 55 70 52 65 6d 6f 74 69 6e 67 49 6e 74 65 72 6e .static.void.SetUpRemotingIntern
24400 61 6c 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 20 al()..........{..............if.
24420 28 73 5f 52 65 6d 6f 74 65 43 6f 6e 6e 65 63 74 69 6f 6e 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 (s_RemoteConnection.==.null)....
24440 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 23 69 66 ..........{..................#if
24460 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 20 20 20 20 73 .UNITY_EDITOR..................s
24480 5f 52 65 6d 6f 74 65 43 6f 6e 6e 65 63 74 69 6f 6e 20 3d 20 52 65 6d 6f 74 65 49 6e 70 75 74 50 _RemoteConnection.=.RemoteInputP
244a0 6c 61 79 65 72 43 6f 6e 6e 65 63 74 69 6f 6e 2e 69 6e 73 74 61 6e 63 65 3b 0d 0a 20 20 20 20 20 layerConnection.instance;.......
244c0 20 20 20 20 20 20 20 20 20 20 20 73 5f 52 65 6d 6f 74 65 43 6f 6e 6e 65 63 74 69 6f 6e 2e 42 69 ...........s_RemoteConnection.Bi
244e0 6e 64 28 45 64 69 74 6f 72 43 6f 6e 6e 65 63 74 69 6f 6e 2e 69 6e 73 74 61 6e 63 65 2c 20 66 61 nd(EditorConnection.instance,.fa
24500 6c 73 65 29 3b 0d 0a 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 lse);..................#else....
24520 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 52 65 6d 6f 74 65 43 6f 6e 6e 65 63 74 69 6f 6e ..............s_RemoteConnection
24540 20 3d 20 53 63 72 69 70 74 61 62 6c 65 4f 62 6a 65 63 74 2e 43 72 65 61 74 65 49 6e 73 74 61 6e .=.ScriptableObject.CreateInstan
24560 63 65 3c 52 65 6d 6f 74 65 49 6e 70 75 74 50 6c 61 79 65 72 43 6f 6e 6e 65 63 74 69 6f 6e 3e 28 ce<RemoteInputPlayerConnection>(
24580 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 52 65 6d 6f 74 65 43 6f 6e 6e );..................s_RemoteConn
245a0 65 63 74 69 6f 6e 2e 42 69 6e 64 28 50 6c 61 79 65 72 43 6f 6e 6e 65 63 74 69 6f 6e 2e 69 6e 73 ection.Bind(PlayerConnection.ins
245c0 74 61 6e 63 65 2c 20 50 6c 61 79 65 72 43 6f 6e 6e 65 63 74 69 6f 6e 2e 69 6e 73 74 61 6e 63 65 tance,.PlayerConnection.instance
245e0 2e 69 73 43 6f 6e 6e 65 63 74 65 64 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .isConnected);..................
24600 23 65 6e 64 69 66 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 #endif..............}...........
24620 20 20 20 20 20 73 5f 52 65 6d 6f 74 65 2e 53 75 62 73 63 72 69 62 65 28 73 5f 52 65 6d 6f 74 65 .....s_Remote.Subscribe(s_Remote
24640 43 6f 6e 6e 65 63 74 69 6f 6e 29 3b 20 2f 2f 20 46 65 65 64 20 6d 65 73 73 61 67 65 73 20 66 72 Connection);.//.Feed.messages.fr
24660 6f 6d 20 70 6c 61 79 65 72 73 20 69 6e 74 6f 20 65 64 69 74 6f 72 2e 0d 0a 20 20 20 20 20 20 20 om.players.into.editor..........
24680 20 20 20 20 20 73 5f 52 65 6d 6f 74 65 43 6f 6e 6e 65 63 74 69 6f 6e 2e 53 75 62 73 63 72 69 62 .....s_RemoteConnection.Subscrib
246a0 65 28 73 5f 52 65 6d 6f 74 65 29 3b 20 2f 2f 20 46 65 65 64 20 6d 65 73 73 61 67 65 73 20 66 72 e(s_Remote);.//.Feed.messages.fr
246c0 6f 6d 20 65 64 69 74 6f 72 20 69 6e 74 6f 20 70 6c 61 79 65 72 73 2e 0d 0a 20 20 20 20 20 20 20 om.editor.into.players..........
246e0 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 23 69 66 20 21 55 4e 49 54 59 5f 45 44 49 54 4f 52 0d .}............#if.!UNITY_EDITOR.
24700 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 73 74 61 74 69 63 20 62 6f 6f 6c 20 53 68 6f .........private.static.bool.Sho
24720 75 6c 64 45 6e 61 62 6c 65 52 65 6d 6f 74 69 6e 67 28 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a uldEnableRemoting()..........{..
24740 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 2f 46 49 58 4d 45 3a 20 69 73 20 74 68 65 72 65 20 ............////FIXME:.is.there.
24760 61 20 62 65 74 74 65 72 20 77 61 79 20 74 6f 20 64 65 74 65 63 74 20 77 68 65 74 68 65 72 20 77 a.better.way.to.detect.whether.w
24780 65 20 61 72 65 20 72 75 6e 6e 69 6e 67 20 74 65 73 74 73 3f 0d 0a 20 20 20 20 20 20 20 20 20 20 e.are.running.tests?............
247a0 20 20 76 61 72 20 69 73 52 75 6e 6e 69 6e 67 54 65 73 74 73 20 3d 20 41 70 70 6c 69 63 61 74 69 ..var.isRunningTests.=.Applicati
247c0 6f 6e 2e 70 72 6f 64 75 63 74 4e 61 6d 65 20 3d 3d 20 22 55 6e 69 74 79 54 65 73 74 46 72 61 6d on.productName.==."UnityTestFram
247e0 65 77 6f 72 6b 22 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 69 73 52 75 6e 6e 69 ework";..............if.(isRunni
24800 6e 67 54 65 73 74 73 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 ngTests)..................return
24820 20 66 61 6c 73 65 3b 20 2f 2f 20 44 6f 6e 27 74 20 72 65 6d 6f 74 65 20 77 68 69 6c 65 20 72 75 .false;.//.Don't.remote.while.ru
24840 6e 6e 69 6e 67 20 74 65 73 74 73 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e nning.tests...............return
24860 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 23 65 6e .true;..........}............#en
24880 64 69 66 0d 0a 23 65 6e 64 69 66 20 2f 2f 20 44 45 56 45 4c 4f 50 4d 45 4e 54 5f 42 55 49 4c 44 dif..#endif.//.DEVELOPMENT_BUILD
248a0 20 7c 7c 20 55 4e 49 54 59 5f 45 44 49 54 4f 52 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 54 .||.UNITY_EDITOR............//.T
248c0 68 65 20 72 65 73 74 20 68 65 72 65 20 69 73 20 69 6e 74 65 72 6e 61 6c 20 73 74 75 66 66 20 74 he.rest.here.is.internal.stuff.t
248e0 6f 20 6d 61 6e 61 67 65 20 73 69 6e 67 6c 65 74 6f 6e 73 2c 20 73 75 72 76 69 76 65 20 64 6f 6d o.manage.singletons,.survive.dom
24900 61 69 6e 20 72 65 6c 6f 61 64 73 2c 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 61 6e 64 20 74 6f 20 ain.reloads,..........//.and.to.
24920 73 75 70 70 6f 72 74 20 74 68 65 20 72 65 73 65 74 20 61 62 69 6c 69 74 79 20 66 6f 72 20 74 65 support.the.reset.ability.for.te
24940 73 74 73 2e 0d 0a 20 20 20 20 20 20 20 20 73 74 61 74 69 63 20 49 6e 70 75 74 53 79 73 74 65 6d sts...........static.InputSystem
24960 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 23 69 66 20 55 ()..........{..............#if.U
24980 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 49 6e 69 74 69 61 6c NITY_EDITOR..............Initial
249a0 69 7a 65 49 6e 45 64 69 74 6f 72 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 23 65 6c 73 izeInEditor();..............#els
249c0 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 49 6e 69 74 69 61 6c 69 7a 65 49 6e 50 6c 61 79 65 e..............InitializeInPlaye
249e0 72 28 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 r();..............#endif........
24a00 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 2f 46 49 58 4d 45 3a 20 55 6e 69 74 79 20 ..}............////FIXME:.Unity.
24a20 69 73 20 6e 6f 74 20 63 61 6c 6c 69 6e 67 20 74 68 69 73 20 6d 65 74 68 6f 64 20 69 66 20 69 74 is.not.calling.this.method.if.it
24a40 27 73 20 69 6e 73 69 64 65 20 61 6e 20 23 69 66 20 62 6c 6f 63 6b 20 74 68 61 74 20 69 73 20 6e 's.inside.an.#if.block.that.is.n
24a60 6f 74 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 2f 20 20 20 20 20 20 20 76 69 73 69 62 6c 65 20 74 ot..........////.......visible.t
24a80 6f 20 74 68 65 20 65 64 69 74 6f 72 3b 20 74 68 61 74 20 73 68 6f 75 6c 64 6e 27 74 20 62 65 20 o.the.editor;.that.shouldn't.be.
24aa0 74 68 65 20 63 61 73 65 0d 0a 20 20 20 20 20 20 20 20 5b 52 75 6e 74 69 6d 65 49 6e 69 74 69 61 the.case..........[RuntimeInitia
24ac0 6c 69 7a 65 4f 6e 4c 6f 61 64 4d 65 74 68 6f 64 28 6c 6f 61 64 54 79 70 65 3a 20 52 75 6e 74 69 lizeOnLoadMethod(loadType:.Runti
24ae0 6d 65 49 6e 69 74 69 61 6c 69 7a 65 4c 6f 61 64 54 79 70 65 2e 42 65 66 6f 72 65 53 63 65 6e 65 meInitializeLoadType.BeforeScene
24b00 4c 6f 61 64 29 5d 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 73 74 61 74 69 63 20 76 Load)]..........private.static.v
24b20 6f 69 64 20 52 75 6e 49 6e 69 74 69 61 6c 69 7a 65 49 6e 50 6c 61 79 65 72 28 29 0d 0a 20 20 20 oid.RunInitializeInPlayer().....
24b40 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 57 65 27 72 65 20 75 73 69 .....{..............//.We're.usi
24b60 6e 67 20 74 68 69 73 20 6d 65 74 68 6f 64 20 6a 75 73 74 20 74 6f 20 6d 61 6b 65 20 73 75 72 65 ng.this.method.just.to.make.sure
24b80 20 74 68 65 20 63 6c 61 73 73 20 63 6f 6e 73 74 72 75 63 74 6f 72 20 69 73 20 63 61 6c 6c 65 64 .the.class.constructor.is.called
24ba0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 73 6f 20 77 65 20 64 6f 6e 27 74 20 6e 65 65 ..............//.so.we.don't.nee
24bc0 64 20 61 6e 79 20 63 6f 64 65 20 69 6e 20 68 65 72 65 2e 20 57 68 65 6e 20 74 68 65 20 65 6e 67 d.any.code.in.here..When.the.eng
24be0 69 6e 65 20 63 61 6c 6c 73 20 74 68 69 73 20 6d 65 74 68 6f 64 2c 20 74 68 65 0d 0a 20 20 20 20 ine.calls.this.method,.the......
24c00 20 20 20 20 20 20 20 20 2f 2f 20 63 6c 61 73 73 20 63 6f 6e 73 74 72 75 63 74 6f 72 20 77 69 6c ........//.class.constructor.wil
24c20 6c 20 62 65 20 72 75 6e 20 69 66 20 69 74 20 68 61 73 6e 27 74 20 62 65 65 6e 20 72 75 6e 20 61 l.be.run.if.it.hasn't.been.run.a
24c40 6c 72 65 61 64 79 2e 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 4c 32 43 50 50 lready.................//.IL2CPP
24c60 20 68 61 73 20 61 20 62 75 67 20 74 68 61 74 20 63 61 75 73 65 73 20 74 68 65 20 63 6c 61 73 73 .has.a.bug.that.causes.the.class
24c80 20 63 6f 6e 73 74 72 75 63 74 6f 72 20 74 6f 20 6e 6f 74 20 62 65 20 72 75 6e 20 77 68 65 6e 0d .constructor.to.not.be.run.when.
24ca0 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 74 68 65 20 52 75 6e 74 69 6d 65 49 6e 69 74 69 .............//.the.RuntimeIniti
24cc0 61 6c 69 7a 65 4f 6e 4c 6f 61 64 4d 65 74 68 6f 64 20 69 73 20 69 6e 76 6f 6b 65 64 2e 20 53 6f alizeOnLoadMethod.is.invoked..So
24ce0 20 77 65 20 6e 65 65 64 20 61 6e 20 65 78 70 6c 69 63 69 74 20 63 68 65 63 6b 0d 0a 20 20 20 20 .we.need.an.explicit.check......
24d00 20 20 20 20 20 20 20 20 2f 2f 20 68 65 72 65 20 75 6e 74 69 6c 20 74 68 61 74 20 69 73 20 66 69 ........//.here.until.that.is.fi
24d20 78 65 64 20 28 63 61 73 65 20 31 30 31 34 32 39 33 29 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 xed.(case.1014293)..............
24d40 20 23 69 66 20 21 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..............
24d60 69 66 20 28 73 5f 4d 61 6e 61 67 65 72 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 if.(s_Manager.==.null)..........
24d80 20 20 20 20 20 20 20 20 49 6e 69 74 69 61 6c 69 7a 65 49 6e 50 6c 61 79 65 72 28 29 3b 0d 0a 20 ........InitializeInPlayer();...
24da0 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..........}....
24dc0 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 69 6e 74 65 72 6e #if.UNITY_EDITOR..........intern
24de0 61 6c 20 73 74 61 74 69 63 20 49 6e 70 75 74 53 79 73 74 65 6d 4f 62 6a 65 63 74 20 73 5f 53 79 al.static.InputSystemObject.s_Sy
24e00 73 74 65 6d 4f 62 6a 65 63 74 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 69 6e 74 65 72 6e 61 6c 20 stemObject;............internal.
24e20 73 74 61 74 69 63 20 76 6f 69 64 20 49 6e 69 74 69 61 6c 69 7a 65 49 6e 45 64 69 74 6f 72 28 49 static.void.InitializeInEditor(I
24e40 49 6e 70 75 74 52 75 6e 74 69 6d 65 20 72 75 6e 74 69 6d 65 20 3d 20 6e 75 6c 6c 29 0d 0a 20 20 InputRuntime.runtime.=.null)....
24e60 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 50 72 6f 66 69 6c 69 6e 67 2e 50 ......{..............Profiling.P
24e80 72 6f 66 69 6c 65 72 2e 42 65 67 69 6e 53 61 6d 70 6c 65 28 22 49 6e 70 75 74 53 79 73 74 65 6d rofiler.BeginSample("InputSystem
24ea0 2e 49 6e 69 74 69 61 6c 69 7a 65 49 6e 45 64 69 74 6f 72 22 29 3b 0d 0a 20 20 20 20 20 20 20 20 .InitializeInEditor");..........
24ec0 20 20 20 20 52 65 73 65 74 28 72 75 6e 74 69 6d 65 3a 20 72 75 6e 74 69 6d 65 29 3b 0d 0a 0d 0a ....Reset(runtime:.runtime);....
24ee0 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 65 78 69 73 74 69 6e 67 53 79 73 74 65 6d 4f 62 ............var.existingSystemOb
24f00 6a 65 63 74 73 20 3d 20 52 65 73 6f 75 72 63 65 73 2e 46 69 6e 64 4f 62 6a 65 63 74 73 4f 66 54 jects.=.Resources.FindObjectsOfT
24f20 79 70 65 41 6c 6c 3c 49 6e 70 75 74 53 79 73 74 65 6d 4f 62 6a 65 63 74 3e 28 29 3b 0d 0a 20 20 ypeAll<InputSystemObject>();....
24f40 20 20 20 20 20 20 20 20 20 20 69 66 20 28 65 78 69 73 74 69 6e 67 53 79 73 74 65 6d 4f 62 6a 65 ..........if.(existingSystemObje
24f60 63 74 73 20 21 3d 20 6e 75 6c 6c 20 26 26 20 65 78 69 73 74 69 6e 67 53 79 73 74 65 6d 4f 62 6a cts.!=.null.&&.existingSystemObj
24f80 65 63 74 73 2e 4c 65 6e 67 74 68 20 3e 20 30 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d ects.Length.>.0)..............{.
24fa0 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 2f 46 49 58 4d 45 3a 20 64 6f 65 73 .................////FIXME:.does
24fc0 20 6e 6f 74 20 70 72 65 73 65 72 76 65 20 61 63 74 69 6f 6e 20 6d 61 70 20 73 74 61 74 65 0d 0a .not.preserve.action.map.state..
24fe0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 57 65 27 72 65 20 63 6f 6d 69 6e ..................//.We're.comin
25000 67 20 62 61 63 6b 20 6f 75 74 20 6f 66 20 61 20 64 6f 6d 61 69 6e 20 72 65 6c 6f 61 64 2e 20 57 g.back.out.of.a.domain.reload..W
25020 65 27 72 65 20 72 65 73 74 6f 72 69 6e 67 20 70 61 72 74 20 6f 66 20 74 68 65 0d 0a 20 20 20 20 e're.restoring.part.of.the......
25040 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 6e 70 75 74 4d 61 6e 61 67 65 72 20 73 74 61 74 ............//.InputManager.stat
25060 65 20 68 65 72 65 20 62 75 74 20 77 65 27 72 65 20 73 74 69 6c 6c 20 77 61 69 74 69 6e 67 20 66 e.here.but.we're.still.waiting.f
25080 72 6f 6d 20 6c 61 79 6f 75 74 20 72 65 67 69 73 74 72 61 74 69 6f 6e 73 0d 0a 20 20 20 20 20 20 rom.layout.registrations........
250a0 20 20 20 20 20 20 20 20 20 20 2f 2f 20 74 68 61 74 20 68 61 70 70 65 6e 20 64 75 72 69 6e 67 20 ..........//.that.happen.during.
250c0 64 6f 6d 61 69 6e 20 69 6e 69 74 69 61 6c 69 7a 61 74 69 6f 6e 2e 0d 0a 0d 0a 20 20 20 20 20 20 domain.initialization...........
250e0 20 20 20 20 20 20 20 20 20 20 73 5f 53 79 73 74 65 6d 4f 62 6a 65 63 74 20 3d 20 65 78 69 73 74 ..........s_SystemObject.=.exist
25100 69 6e 67 53 79 73 74 65 6d 4f 62 6a 65 63 74 73 5b 30 5d 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 ingSystemObjects[0];............
25120 20 20 20 20 20 20 73 5f 4d 61 6e 61 67 65 72 2e 52 65 73 74 6f 72 65 53 74 61 74 65 57 69 74 68 ......s_Manager.RestoreStateWith
25140 6f 75 74 44 65 76 69 63 65 73 28 73 5f 53 79 73 74 65 6d 4f 62 6a 65 63 74 2e 73 79 73 74 65 6d outDevices(s_SystemObject.system
25160 53 74 61 74 65 2e 6d 61 6e 61 67 65 72 53 74 61 74 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 State.managerState);............
25180 20 20 20 20 20 20 49 6e 70 75 74 44 65 62 75 67 67 65 72 57 69 6e 64 6f 77 2e 52 65 76 69 76 65 ......InputDebuggerWindow.Revive
251a0 41 66 74 65 72 44 6f 6d 61 69 6e 52 65 6c 6f 61 64 28 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 AfterDomainReload();............
251c0 20 20 20 20 20 20 20 20 2f 2f 20 52 65 73 74 6f 72 65 20 72 65 6d 6f 74 69 6e 67 20 73 74 61 74 ........//.Restore.remoting.stat
251e0 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 52 65 6d 6f 74 65 43 6f 6e 6e e...................s_RemoteConn
25200 65 63 74 69 6f 6e 20 3d 20 73 5f 53 79 73 74 65 6d 4f 62 6a 65 63 74 2e 73 79 73 74 65 6d 53 74 ection.=.s_SystemObject.systemSt
25220 61 74 65 2e 72 65 6d 6f 74 65 43 6f 6e 6e 65 63 74 69 6f 6e 3b 0d 0a 20 20 20 20 20 20 20 20 20 ate.remoteConnection;...........
25240 20 20 20 20 20 20 20 53 65 74 55 70 52 65 6d 6f 74 69 6e 67 28 29 3b 0d 0a 20 20 20 20 20 20 20 .......SetUpRemoting();.........
25260 20 20 20 20 20 20 20 20 20 73 5f 52 65 6d 6f 74 65 2e 52 65 73 74 6f 72 65 53 74 61 74 65 28 73 .........s_Remote.RestoreState(s
25280 5f 53 79 73 74 65 6d 4f 62 6a 65 63 74 2e 73 79 73 74 65 6d 53 74 61 74 65 2e 72 65 6d 6f 74 69 _SystemObject.systemState.remoti
252a0 6e 67 53 74 61 74 65 2c 20 73 5f 4d 61 6e 61 67 65 72 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 ngState,.s_Manager);............
252c0 20 20 20 20 20 20 20 20 2f 2f 20 47 65 74 20 6d 61 6e 61 67 65 72 20 74 6f 20 72 65 73 74 6f 72 ........//.Get.manager.to.restor
252e0 65 20 64 65 76 69 63 65 73 20 6f 6e 20 66 69 72 73 74 20 69 6e 70 75 74 20 75 70 64 61 74 65 2e e.devices.on.first.input.update.
25300 20 42 79 20 74 68 61 74 20 74 69 6d 65 20 77 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .By.that.time.we................
25320 20 20 2f 2f 20 73 68 6f 75 6c 64 20 68 61 76 65 20 61 6c 6c 20 28 70 6f 73 73 69 62 6c 79 20 75 ..//.should.have.all.(possibly.u
25340 70 64 61 74 65 64 29 20 6c 61 79 6f 75 74 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 69 6e 20 70 6c pdated).layout.information.in.pl
25360 61 63 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 4d 61 6e 61 67 65 72 2e ace...................s_Manager.
25380 6d 5f 53 61 76 65 64 44 65 76 69 63 65 53 74 61 74 65 73 20 3d 20 73 5f 53 79 73 74 65 6d 4f 62 m_SavedDeviceStates.=.s_SystemOb
253a0 6a 65 63 74 2e 73 79 73 74 65 6d 53 74 61 74 65 2e 6d 61 6e 61 67 65 72 53 74 61 74 65 2e 64 65 ject.systemState.managerState.de
253c0 76 69 63 65 73 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 4d 61 6e 61 67 65 vices;..................s_Manage
253e0 72 2e 6d 5f 53 61 76 65 64 41 76 61 69 6c 61 62 6c 65 44 65 76 69 63 65 73 20 3d 20 73 5f 53 79 r.m_SavedAvailableDevices.=.s_Sy
25400 73 74 65 6d 4f 62 6a 65 63 74 2e 73 79 73 74 65 6d 53 74 61 74 65 2e 6d 61 6e 61 67 65 72 53 74 stemObject.systemState.managerSt
25420 61 74 65 2e 61 76 61 69 6c 61 62 6c 65 44 65 76 69 63 65 73 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 ate.availableDevices;...........
25440 20 20 20 20 20 20 20 20 20 2f 2f 20 52 65 73 74 6f 72 65 20 65 64 69 74 6f 72 20 73 65 74 74 69 .........//.Restore.editor.setti
25460 6e 67 73 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 49 6e 70 75 74 45 64 69 74 6f ngs...................InputEdito
25480 72 55 73 65 72 53 65 74 74 69 6e 67 73 2e 73 5f 53 65 74 74 69 6e 67 73 20 3d 20 73 5f 53 79 73 rUserSettings.s_Settings.=.s_Sys
254a0 74 65 6d 4f 62 6a 65 63 74 2e 73 79 73 74 65 6d 53 74 61 74 65 2e 75 73 65 72 53 65 74 74 69 6e temObject.systemState.userSettin
254c0 67 73 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 47 65 74 20 72 69 gs;....................//.Get.ri
254e0 64 20 6f 66 20 73 61 76 65 64 20 73 74 61 74 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 d.of.saved.state................
25500 20 20 20 73 5f 53 79 73 74 65 6d 4f 62 6a 65 63 74 2e 73 79 73 74 65 6d 53 74 61 74 65 20 3d 20 ...s_SystemObject.systemState.=.
25520 6e 65 77 20 53 74 61 74 65 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 new.State();..............}.....
25540 20 20 20 20 20 20 20 20 20 65 6c 73 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 .........else..............{....
25560 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 53 79 73 74 65 6d 4f 62 6a 65 63 74 20 3d 20 53 ..............s_SystemObject.=.S
25580 63 72 69 70 74 61 62 6c 65 4f 62 6a 65 63 74 2e 43 72 65 61 74 65 49 6e 73 74 61 6e 63 65 3c 49 criptableObject.CreateInstance<I
255a0 6e 70 75 74 53 79 73 74 65 6d 4f 62 6a 65 63 74 3e 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 nputSystemObject>();............
255c0 20 20 20 20 20 20 73 5f 53 79 73 74 65 6d 4f 62 6a 65 63 74 2e 68 69 64 65 46 6c 61 67 73 20 3d ......s_SystemObject.hideFlags.=
255e0 20 48 69 64 65 46 6c 61 67 73 2e 48 69 64 65 41 6e 64 44 6f 6e 74 53 61 76 65 3b 0d 0a 0d 0a 20 .HideFlags.HideAndDontSave;.....
25600 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 53 65 65 20 69 66 20 77 65 20 68 61 76 65 ...............//.See.if.we.have
25620 20 61 20 72 65 6d 65 6d 62 65 72 65 64 20 73 65 74 74 69 6e 67 73 20 6f 62 6a 65 63 74 2e 0d 0a .a.remembered.settings.object...
25640 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 45 64 69 74 6f 72 42 75 69 6c 64 53 ................if.(EditorBuildS
25660 65 74 74 69 6e 67 73 2e 54 72 79 47 65 74 43 6f 6e 66 69 67 4f 62 6a 65 63 74 28 49 6e 70 75 74 ettings.TryGetConfigObject(Input
25680 53 65 74 74 69 6e 67 73 50 72 6f 76 69 64 65 72 2e 6b 45 64 69 74 6f 72 42 75 69 6c 64 53 65 74 SettingsProvider.kEditorBuildSet
256a0 74 69 6e 67 73 43 6f 6e 66 69 67 4b 65 79 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 tingsConfigKey,.................
256c0 20 20 20 20 20 6f 75 74 20 49 6e 70 75 74 53 65 74 74 69 6e 67 73 20 73 65 74 74 69 6e 67 73 41 .....out.InputSettings.settingsA
256e0 73 73 65 74 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 20 sset))..................{.......
25700 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 5f 4d 61 6e 61 67 65 72 2e 6d 5f 53 ...............if.(s_Manager.m_S
25720 65 74 74 69 6e 67 73 2e 68 69 64 65 46 6c 61 67 73 20 3d 3d 20 48 69 64 65 46 6c 61 67 73 2e 48 ettings.hideFlags.==.HideFlags.H
25740 69 64 65 41 6e 64 44 6f 6e 74 53 61 76 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ideAndDontSave).................
25760 20 20 20 20 20 20 20 20 20 53 63 72 69 70 74 61 62 6c 65 4f 62 6a 65 63 74 2e 44 65 73 74 72 6f .........ScriptableObject.Destro
25780 79 49 6d 6d 65 64 69 61 74 65 28 73 5f 4d 61 6e 61 67 65 72 2e 6d 5f 53 65 74 74 69 6e 67 73 29 yImmediate(s_Manager.m_Settings)
257a0 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 4d 61 6e 61 67 65 72 ;......................s_Manager
257c0 2e 6d 5f 53 65 74 74 69 6e 67 73 20 3d 20 73 65 74 74 69 6e 67 73 41 73 73 65 74 3b 0d 0a 20 20 .m_Settings.=.settingsAsset;....
257e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 4d 61 6e 61 67 65 72 2e 41 70 70 6c ..................s_Manager.Appl
25800 79 53 65 74 74 69 6e 67 73 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d ySettings();..................}.
25820 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 49 6e 70 75 74 45 64 69 74 6f 72 55 73 ...................InputEditorUs
25840 65 72 53 65 74 74 69 6e 67 73 2e 4c 6f 61 64 28 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 erSettings.Load();..............
25860 20 20 20 20 20 20 53 65 74 55 70 52 65 6d 6f 74 69 6e 67 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 ......SetUpRemoting();..........
25880 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 44 65 62 75 67 2e 41 73 73 65 72 ....}................Debug.Asser
258a0 74 28 73 65 74 74 69 6e 67 73 20 21 3d 20 6e 75 6c 6c 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 t(settings.!=.null);............
258c0 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..............
258e0 44 65 62 75 67 2e 41 73 73 65 72 74 28 45 64 69 74 6f 72 55 74 69 6c 69 74 79 2e 49 6e 73 74 61 Debug.Assert(EditorUtility.Insta
25900 6e 63 65 49 44 54 6f 4f 62 6a 65 63 74 28 73 65 74 74 69 6e 67 73 2e 47 65 74 49 6e 73 74 61 6e nceIDToObject(settings.GetInstan
25920 63 65 49 44 28 29 29 20 21 3d 20 6e 75 6c 6c 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ceID()).!=.null,................
25940 20 20 22 49 6e 70 75 74 53 65 74 74 69 6e 67 73 20 68 61 73 20 6c 6f 73 74 20 69 74 73 20 6e 61 .."InputSettings.has.lost.its.na
25960 74 69 76 65 20 6f 62 6a 65 63 74 22 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 23 65 6e 64 tive.object");..............#end
25980 69 66 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 49 66 20 6e 61 74 69 76 65 20 62 if................//.If.native.b
259a0 61 63 6b 65 6e 64 73 20 66 6f 72 20 6e 65 77 20 69 6e 70 75 74 20 73 79 73 74 65 6d 20 61 72 65 ackends.for.new.input.system.are
259c0 6e 27 74 20 65 6e 61 62 6c 65 64 2c 20 61 73 6b 20 75 73 65 72 20 77 68 65 74 68 65 72 20 77 65 n't.enabled,.ask.user.whether.we
259e0 20 73 68 6f 75 6c 64 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 65 6e 61 62 6c 65 20 74 .should..............//.enable.t
25a00 68 65 6d 20 28 72 65 71 75 69 72 65 73 20 72 65 73 74 61 72 74 29 2e 20 57 65 20 6f 6e 6c 79 20 hem.(requires.restart)..We.only.
25a20 61 73 6b 20 6f 6e 63 65 20 70 65 72 20 73 65 73 73 69 6f 6e 20 61 6e 64 20 64 6f 6e 27 74 20 61 ask.once.per.session.and.don't.a
25a40 73 6b 20 77 68 65 6e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 72 75 6e 6e 69 6e 67 20 sk.when..............//.running.
25a60 69 6e 20 62 61 74 63 68 20 6d 6f 64 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 in.batch.mode...............if.(
25a80 21 73 5f 53 79 73 74 65 6d 4f 62 6a 65 63 74 2e 6e 65 77 49 6e 70 75 74 42 61 63 6b 65 6e 64 73 !s_SystemObject.newInputBackends
25aa0 43 68 65 63 6b 65 64 41 73 45 6e 61 62 6c 65 64 20 26 26 0d 0a 20 20 20 20 20 20 20 20 20 20 20 CheckedAsEnabled.&&.............
25ac0 20 20 20 20 20 21 45 64 69 74 6f 72 50 6c 61 79 65 72 53 65 74 74 69 6e 67 48 65 6c 70 65 72 73 .....!EditorPlayerSettingHelpers
25ae0 2e 6e 65 77 53 79 73 74 65 6d 42 61 63 6b 65 6e 64 73 45 6e 61 62 6c 65 64 20 26 26 0d 0a 20 20 .newSystemBackendsEnabled.&&....
25b00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 21 73 5f 4d 61 6e 61 67 65 72 2e 6d 5f 52 75 6e 74 69 ..............!s_Manager.m_Runti
25b20 6d 65 2e 69 73 49 6e 42 61 74 63 68 4d 6f 64 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b me.isInBatchMode)..............{
25b40 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 73 74 20 73 74 72 69 6e 67 20 64 ..................const.string.d
25b60 69 61 6c 6f 67 54 65 78 74 20 3d 20 22 54 68 69 73 20 70 72 6f 6a 65 63 74 20 69 73 20 75 73 69 ialogText.=."This.project.is.usi
25b80 6e 67 20 74 68 65 20 6e 65 77 20 69 6e 70 75 74 20 73 79 73 74 65 6d 20 70 61 63 6b 61 67 65 20 ng.the.new.input.system.package.
25ba0 62 75 74 20 74 68 65 20 6e 61 74 69 76 65 20 70 6c 61 74 66 6f 72 6d 20 62 61 63 6b 65 6e 64 73 but.the.native.platform.backends
25bc0 20 66 6f 72 20 74 68 65 20 6e 65 77 20 69 6e 70 75 74 20 73 79 73 74 65 6d 20 61 72 65 20 6e 6f .for.the.new.input.system.are.no
25be0 74 20 65 6e 61 62 6c 65 64 20 69 6e 20 74 68 65 20 70 6c 61 79 65 72 20 73 65 74 74 69 6e 67 73 t.enabled.in.the.player.settings
25c00 2e 20 22 20 2b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 22 54 68 69 73 ..".+......................"This
25c20 20 6d 65 61 6e 73 20 74 68 61 74 20 6e 6f 20 69 6e 70 75 74 20 66 72 6f 6d 20 6e 61 74 69 76 65 .means.that.no.input.from.native
25c40 20 64 65 76 69 63 65 73 20 77 69 6c 6c 20 63 6f 6d 65 20 74 68 72 6f 75 67 68 2e 22 20 2b 0d 0a .devices.will.come.through.".+..
25c60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 22 5c 6e 5c 6e 44 6f 20 79 6f 75 20 ...................."\n\nDo.you.
25c80 77 61 6e 74 20 74 6f 20 65 6e 61 62 6c 65 20 74 68 65 20 62 61 63 6b 65 6e 64 73 3f 20 44 6f 69 want.to.enable.the.backends?.Doi
25ca0 6e 67 20 73 6f 20 72 65 71 75 69 72 65 73 20 61 20 72 65 73 74 61 72 74 20 6f 66 20 74 68 65 20 ng.so.requires.a.restart.of.the.
25cc0 65 64 69 74 6f 72 2e 22 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 editor.";....................if.
25ce0 28 45 64 69 74 6f 72 55 74 69 6c 69 74 79 2e 44 69 73 70 6c 61 79 44 69 61 6c 6f 67 28 22 57 61 (EditorUtility.DisplayDialog("Wa
25d00 72 6e 69 6e 67 22 2c 20 64 69 61 6c 6f 67 54 65 78 74 2c 20 22 59 65 73 22 2c 20 22 4e 6f 22 29 rning",.dialogText,."Yes",."No")
25d20 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 45 64 69 74 6f 72 50 6c 61 )......................EditorPla
25d40 79 65 72 53 65 74 74 69 6e 67 48 65 6c 70 65 72 73 2e 6e 65 77 53 79 73 74 65 6d 42 61 63 6b 65 yerSettingHelpers.newSystemBacke
25d60 6e 64 73 45 6e 61 62 6c 65 64 20 3d 20 74 72 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 ndsEnabled.=.true;..............
25d80 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 53 79 73 74 65 6d 4f 62 6a 65 63 74 2e 6e 65 }..............s_SystemObject.ne
25da0 77 49 6e 70 75 74 42 61 63 6b 65 6e 64 73 43 68 65 63 6b 65 64 41 73 45 6e 61 62 6c 65 64 20 3d wInputBackendsCheckedAsEnabled.=
25dc0 20 74 72 75 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 52 75 6e 49 6e 69 74 69 61 6c .true;................RunInitial
25de0 55 70 64 61 74 65 28 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 50 72 6f 66 69 6c 69 Update();................Profili
25e00 6e 67 2e 50 72 6f 66 69 6c 65 72 2e 45 6e 64 53 61 6d 70 6c 65 28 29 3b 0d 0a 20 20 20 20 20 20 ng.Profiler.EndSample();........
25e20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 69 6e 74 65 72 6e 61 6c 20 73 74 61 74 69 63 20 76 ..}............internal.static.v
25e40 6f 69 64 20 4f 6e 50 6c 61 79 4d 6f 64 65 43 68 61 6e 67 65 28 50 6c 61 79 4d 6f 64 65 53 74 61 oid.OnPlayModeChange(PlayModeSta
25e60 74 65 43 68 61 6e 67 65 20 63 68 61 6e 67 65 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 teChange.change)..........{.....
25e80 20 20 20 20 20 20 20 20 20 2f 2f 2f 2f 52 45 56 49 45 57 3a 20 73 68 6f 75 6c 64 20 77 65 20 70 .........////REVIEW:.should.we.p
25ea0 61 75 73 65 20 68 61 70 74 69 63 73 20 77 68 65 6e 20 70 6c 61 79 20 6d 6f 64 65 20 69 73 20 70 ause.haptics.when.play.mode.is.p
25ec0 61 75 73 65 64 20 61 6e 64 20 73 74 6f 70 20 68 61 70 74 69 63 73 20 77 68 65 6e 20 70 6c 61 79 aused.and.stop.haptics.when.play
25ee0 20 6d 6f 64 65 20 69 73 20 65 78 69 74 65 64 3f 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 .mode.is.exited?................
25f00 73 77 69 74 63 68 20 28 63 68 61 6e 67 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a switch.(change)..............{..
25f20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 73 65 20 50 6c 61 79 4d 6f 64 65 53 74 61 ................case.PlayModeSta
25f40 74 65 43 68 61 6e 67 65 2e 45 78 69 74 69 6e 67 45 64 69 74 4d 6f 64 65 3a 0d 0a 20 20 20 20 20 teChange.ExitingEditMode:.......
25f60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 53 79 73 74 65 6d 4f 62 6a 65 63 74 2e 73 65 ...............s_SystemObject.se
25f80 74 74 69 6e 67 73 20 3d 20 4a 73 6f 6e 55 74 69 6c 69 74 79 2e 54 6f 4a 73 6f 6e 28 73 65 74 74 ttings.=.JsonUtility.ToJson(sett
25fa0 69 6e 67 73 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 53 79 ings);......................s_Sy
25fc0 73 74 65 6d 4f 62 6a 65 63 74 2e 65 78 69 74 45 64 69 74 4d 6f 64 65 54 69 6d 65 20 3d 20 49 6e stemObject.exitEditModeTime.=.In
25fe0 70 75 74 52 75 6e 74 69 6d 65 2e 73 5f 49 6e 73 74 61 6e 63 65 2e 63 75 72 72 65 6e 74 54 69 6d putRuntime.s_Instance.currentTim
26000 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 53 79 73 74 65 6d e;......................s_System
26020 4f 62 6a 65 63 74 2e 65 6e 74 65 72 50 6c 61 79 4d 6f 64 65 54 69 6d 65 20 3d 20 30 3b 0d 0a 20 Object.enterPlayModeTime.=.0;...
26040 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 0d 0a 20 20 20 ...................break;.......
26060 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 73 65 20 50 6c 61 79 4d 6f 64 65 53 74 61 74 65 43 .............case.PlayModeStateC
26080 68 61 6e 67 65 2e 45 6e 74 65 72 65 64 50 6c 61 79 4d 6f 64 65 3a 0d 0a 20 20 20 20 20 20 20 20 hange.EnteredPlayMode:..........
260a0 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 53 79 73 74 65 6d 4f 62 6a 65 63 74 2e 65 6e 74 65 72 ............s_SystemObject.enter
260c0 50 6c 61 79 4d 6f 64 65 54 69 6d 65 20 3d 20 49 6e 70 75 74 52 75 6e 74 69 6d 65 2e 73 5f 49 6e PlayModeTime.=.InputRuntime.s_In
260e0 73 74 61 6e 63 65 2e 63 75 72 72 65 6e 74 54 69 6d 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 stance.currentTime;.............
26100 20 20 20 20 20 20 20 20 20 62 72 65 61 6b 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 .........break;.................
26120 20 20 20 2f 2f 2f 2f 54 4f 44 4f 3a 20 61 6c 73 6f 20 6e 75 6b 65 20 61 6c 6c 20 63 61 6c 6c 62 ...////TODO:.also.nuke.all.callb
26140 61 63 6b 73 20 69 6e 73 74 61 6c 6c 65 64 20 6f 6e 20 49 6e 70 75 74 41 63 74 69 6f 6e 73 20 61 acks.installed.on.InputActions.a
26160 6e 64 20 49 6e 70 75 74 41 63 74 69 6f 6e 4d 61 70 73 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 nd.InputActionMaps..............
26180 20 20 20 20 2f 2f 2f 2f 52 45 56 49 45 57 3a 20 69 73 20 74 68 65 72 65 20 61 6e 79 20 6f 74 68 ....////REVIEW:.is.there.any.oth
261a0 65 72 20 63 6c 65 61 6e 75 70 20 77 6f 72 6b 20 77 65 20 77 61 6e 74 20 74 6f 20 62 65 66 6f 72 er.cleanup.work.we.want.to.befor
261c0 65 3f 20 73 68 6f 75 6c 64 20 77 65 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c 79 20 6e 75 6b 65 0d e?.should.we.automatically.nuke.
261e0 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 2f 20 20 20 20 20 20 20 20 49 6e 70 .................////........Inp
26200 75 74 44 65 76 69 63 65 73 20 74 68 61 74 20 68 61 76 65 20 62 65 65 6e 20 63 72 65 61 74 65 64 utDevices.that.have.been.created
26220 20 77 69 74 68 20 41 64 64 44 65 76 69 63 65 3c 3e 20 64 75 72 69 6e 67 20 70 6c 61 79 20 6d 6f .with.AddDevice<>.during.play.mo
26240 64 65 3f 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 73 65 20 50 6c 61 79 4d 6f de?..................case.PlayMo
26260 64 65 53 74 61 74 65 43 68 61 6e 67 65 2e 45 6e 74 65 72 65 64 45 64 69 74 4d 6f 64 65 3a 0d 0a deStateChange.EnteredEditMode:..
26280 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 4e 75 6b 65 20 61 6c ......................//.Nuke.al
262a0 6c 20 49 6e 70 75 74 41 63 74 69 6f 6e 4d 61 70 53 74 61 74 65 73 2e 20 52 65 6c 65 61 73 65 73 l.InputActionMapStates..Releases
262c0 20 74 68 65 69 72 20 75 6e 6d 61 6e 61 67 65 64 20 6d 65 6d 6f 72 79 2e 0d 0a 20 20 20 20 20 20 .their.unmanaged.memory.........
262e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 49 6e 70 75 74 41 63 74 69 6f 6e 53 74 61 74 65 2e 44 ..............InputActionState.D
26300 65 73 74 72 6f 79 41 6c 6c 41 63 74 69 6f 6e 4d 61 70 53 74 61 74 65 73 28 29 3b 0d 0a 0d 0a 20 estroyAllActionMapStates();.....
26320 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 52 65 73 74 6f 72 65 20 73 65 ...................//.Restore.se
26340 74 74 69 6e 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 69 66 20 ttings.......................if.
26360 28 21 73 74 72 69 6e 67 2e 49 73 4e 75 6c 6c 4f 72 45 6d 70 74 79 28 73 5f 53 79 73 74 65 6d 4f (!string.IsNullOrEmpty(s_SystemO
26380 62 6a 65 63 74 2e 73 65 74 74 69 6e 67 73 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 bject.settings))................
263a0 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 ......{.........................
263c0 20 4a 73 6f 6e 55 74 69 6c 69 74 79 2e 46 72 6f 6d 4a 73 6f 6e 4f 76 65 72 77 72 69 74 65 28 73 .JsonUtility.FromJsonOverwrite(s
263e0 5f 53 79 73 74 65 6d 4f 62 6a 65 63 74 2e 73 65 74 74 69 6e 67 73 2c 20 73 65 74 74 69 6e 67 73 _SystemObject.settings,.settings
26400 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 73 5f 53 79 );..........................s_Sy
26420 73 74 65 6d 4f 62 6a 65 63 74 2e 73 65 74 74 69 6e 67 73 20 3d 20 6e 75 6c 6c 3b 0d 0a 20 20 20 stemObject.settings.=.null;.....
26440 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 65 74 74 69 6e 67 73 2e 4f 6e .....................settings.On
26460 43 68 61 6e 67 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 7d Change();......................}
26480 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 72 65 61 6b 3b 0d 0a ........................break;..
264a0 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 20 20 20 20 ............}..........}........
264c0 20 20 20 20 70 72 69 76 61 74 65 20 73 74 61 74 69 63 20 76 6f 69 64 20 4f 6e 50 72 6f 6a 65 63 ....private.static.void.OnProjec
264e0 74 43 68 61 6e 67 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 tChange()..........{............
26500 20 20 2f 2f 2f 2f 54 4f 44 4f 3a 20 75 73 65 20 64 69 72 74 79 20 63 6f 75 6e 74 20 74 6f 20 66 ..////TODO:.use.dirty.count.to.f
26520 69 6e 64 20 77 68 65 74 68 65 72 20 73 65 74 74 69 6e 67 73 20 68 61 76 65 20 61 63 74 75 61 6c ind.whether.settings.have.actual
26540 6c 79 20 63 68 61 6e 67 65 64 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4d 61 79 20 68 ly.changed..............//.May.h
26560 61 76 65 20 61 64 64 65 64 2c 20 72 65 6d 6f 76 65 64 2c 20 6d 6f 76 65 64 2c 20 6f 72 20 72 65 ave.added,.removed,.moved,.or.re
26580 6e 61 6d 65 64 20 73 65 74 74 69 6e 67 73 20 61 73 73 65 74 2e 20 46 6f 72 63 65 20 61 20 72 65 named.settings.asset..Force.a.re
265a0 66 72 65 73 68 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 6f 66 20 74 68 65 20 55 49 2e fresh..............//.of.the.UI.
265c0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 49 6e 70 75 74 53 65 74 74 69 6e 67 73 50 72 6f 76 69 ..............InputSettingsProvi
265e0 64 65 72 2e 46 6f 72 63 65 52 65 6c 6f 61 64 28 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 der.ForceReload();..............
26600 20 20 2f 2f 20 41 6c 73 6f 2c 20 69 66 20 74 68 65 20 61 73 73 65 74 20 68 6f 6c 64 69 6e 67 20 ..//.Also,.if.the.asset.holding.
26620 6f 75 72 20 63 75 72 72 65 6e 74 20 73 65 74 74 69 6e 67 73 20 67 6f 74 20 64 65 6c 65 74 65 64 our.current.settings.got.deleted
26640 2c 20 73 77 69 74 63 68 20 62 61 63 6b 20 74 6f 20 61 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 ,.switch.back.to.a..............
26660 2f 2f 20 74 65 6d 70 6f 72 61 72 79 20 73 65 74 74 69 6e 67 73 20 6f 62 6a 65 63 74 2e 0d 0a 20 //.temporary.settings.object....
26680 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4e 4f 54 45 3a 20 57 65 20 61 63 63 65 73 73 20 6d 5f ...........//.NOTE:.We.access.m_
266a0 53 65 74 74 69 6e 67 73 20 64 69 72 65 63 74 6c 79 20 68 65 72 65 20 74 6f 20 6d 61 6b 65 20 73 Settings.directly.here.to.make.s
266c0 75 72 65 20 77 65 27 72 65 20 6e 6f 74 20 72 75 6e 6e 69 6e 67 20 69 6e 74 6f 20 61 73 73 65 72 ure.we're.not.running.into.asser
266e0 74 73 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 66 72 6f 6d 20 74 68 ts..............//.......from.th
26700 65 20 73 65 74 74 69 6e 67 73 20 67 65 74 74 65 72 20 63 68 65 63 6b 69 6e 67 20 69 74 20 68 61 e.settings.getter.checking.it.ha
26720 73 20 61 20 76 61 6c 69 64 20 6f 62 6a 65 63 74 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 s.a.valid.object...............i
26740 66 20 28 45 64 69 74 6f 72 55 74 69 6c 69 74 79 2e 49 6e 73 74 61 6e 63 65 49 44 54 6f 4f 62 6a f.(EditorUtility.InstanceIDToObj
26760 65 63 74 28 73 5f 4d 61 6e 61 67 65 72 2e 6d 5f 53 65 74 74 69 6e 67 73 2e 47 65 74 49 6e 73 74 ect(s_Manager.m_Settings.GetInst
26780 61 6e 63 65 49 44 28 29 29 20 3d 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 anceID()).==.null)..............
267a0 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 6e 65 77 53 65 74 74 69 6e {..................var.newSettin
267c0 67 73 20 3d 20 53 63 72 69 70 74 61 62 6c 65 4f 62 6a 65 63 74 2e 43 72 65 61 74 65 49 6e 73 74 gs.=.ScriptableObject.CreateInst
267e0 61 6e 63 65 3c 49 6e 70 75 74 53 65 74 74 69 6e 67 73 3e 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 ance<InputSettings>();..........
26800 20 20 20 20 20 20 20 20 6e 65 77 53 65 74 74 69 6e 67 73 2e 68 69 64 65 46 6c 61 67 73 20 3d 20 ........newSettings.hideFlags.=.
26820 48 69 64 65 46 6c 61 67 73 2e 48 69 64 65 41 6e 64 44 6f 6e 74 53 61 76 65 3b 0d 0a 20 20 20 20 HideFlags.HideAndDontSave;......
26840 20 20 20 20 20 20 20 20 20 20 20 20 73 65 74 74 69 6e 67 73 20 3d 20 6e 65 77 53 65 74 74 69 6e ............settings.=.newSettin
26860 67 73 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 gs;..............}..........}...
26880 0a 23 65 6c 73 65 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 73 74 61 74 69 63 20 76 .#else..........private.static.v
268a0 6f 69 64 20 49 6e 69 74 69 61 6c 69 7a 65 49 6e 50 6c 61 79 65 72 28 49 49 6e 70 75 74 52 75 6e oid.InitializeInPlayer(IInputRun
268c0 74 69 6d 65 20 72 75 6e 74 69 6d 65 20 3d 20 6e 75 6c 6c 2c 20 49 6e 70 75 74 53 65 74 74 69 6e time.runtime.=.null,.InputSettin
268e0 67 73 20 73 65 74 74 69 6e 67 73 20 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 7b 0d 0a gs.settings.=.null)..........{..
26900 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 65 74 74 69 6e 67 73 20 3d 3d 20 6e 75 6c 6c ............if.(settings.==.null
26920 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 65 74 74 69 6e 67 73 20 3d 20 52 65 )..................settings.=.Re
26940 73 6f 75 72 63 65 73 2e 46 69 6e 64 4f 62 6a 65 63 74 73 4f 66 54 79 70 65 41 6c 6c 3c 49 6e 70 sources.FindObjectsOfTypeAll<Inp
26960 75 74 53 65 74 74 69 6e 67 73 3e 28 29 2e 46 69 72 73 74 4f 72 44 65 66 61 75 6c 74 28 29 20 3f utSettings>().FirstOrDefault().?
26980 3f 20 53 63 72 69 70 74 61 62 6c 65 4f 62 6a 65 63 74 2e 43 72 65 61 74 65 49 6e 73 74 61 6e 63 ?.ScriptableObject.CreateInstanc
269a0 65 3c 49 6e 70 75 74 53 65 74 74 69 6e 67 73 3e 28 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 e<InputSettings>();.............
269c0 20 20 20 2f 2f 20 4e 6f 20 64 6f 6d 61 69 6e 20 72 65 6c 6f 61 64 73 20 69 6e 20 74 68 65 20 70 ...//.No.domain.reloads.in.the.p
269e0 6c 61 79 65 72 20 73 6f 20 77 65 20 64 6f 6e 27 74 20 6e 65 65 64 20 74 6f 20 6c 6f 6f 6b 20 66 layer.so.we.don't.need.to.look.f
26a00 6f 72 20 65 78 69 73 74 69 6e 67 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 69 6e 73 74 or.existing..............//.inst
26a20 61 6e 63 65 73 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 4d 61 6e 61 67 65 72 20 3d 20 ances...............s_Manager.=.
26a40 6e 65 77 20 49 6e 70 75 74 4d 61 6e 61 67 65 72 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 new.InputManager();.............
26a60 20 73 5f 4d 61 6e 61 67 65 72 2e 49 6e 69 74 69 61 6c 69 7a 65 28 72 75 6e 74 69 6d 65 20 3f 3f .s_Manager.Initialize(runtime.??
26a80 20 4e 61 74 69 76 65 49 6e 70 75 74 52 75 6e 74 69 6d 65 2e 69 6e 73 74 61 6e 63 65 2c 20 73 65 .NativeInputRuntime.instance,.se
26aa0 74 74 69 6e 67 73 29 3b 0d 0a 0d 0a 23 69 66 20 21 55 4e 49 54 59 5f 44 49 53 41 42 4c 45 5f 44 ttings);....#if.!UNITY_DISABLE_D
26ac0 45 46 41 55 4c 54 5f 49 4e 50 55 54 5f 50 4c 55 47 49 4e 5f 49 4e 49 54 49 41 4c 49 5a 41 54 49 EFAULT_INPUT_PLUGIN_INITIALIZATI
26ae0 4f 4e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 50 65 72 66 6f 72 6d 44 65 66 61 75 6c 74 50 6c ON..............PerformDefaultPl
26b00 75 67 69 6e 49 6e 69 74 69 61 6c 69 7a 61 74 69 6f 6e 28 29 3b 0d 0a 23 65 6e 64 69 66 0d 0a 0d uginInitialization();..#endif...
26b20 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 41 75 74 6f 6d 61 74 69 63 61 6c 6c 79 20 65 6e .............//.Automatically.en
26b40 61 62 6c 65 20 72 65 6d 6f 74 69 6e 67 20 69 6e 20 64 65 76 65 6c 6f 70 6d 65 6e 74 20 70 6c 61 able.remoting.in.development.pla
26b60 79 65 72 73 2e 0d 0a 23 69 66 20 44 45 56 45 4c 4f 50 4d 45 4e 54 5f 42 55 49 4c 44 0d 0a 20 20 yers...#if.DEVELOPMENT_BUILD....
26b80 20 20 20 20 20 20 20 20 20 20 69 66 20 28 53 68 6f 75 6c 64 45 6e 61 62 6c 65 52 65 6d 6f 74 69 ..........if.(ShouldEnableRemoti
26ba0 6e 67 28 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 53 65 74 55 70 52 65 6d 6f ng())..................SetUpRemo
26bc0 74 69 6e 67 28 29 3b 0d 0a 23 65 6e 64 69 66 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 52 ting();..#endif................R
26be0 75 6e 49 6e 69 74 69 61 6c 55 70 64 61 74 65 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d unInitialUpdate();..........}...
26c00 0a 23 65 6e 64 69 66 20 2f 2f 20 55 4e 49 54 59 5f 45 44 49 54 4f 52 0d 0a 0d 0a 20 20 20 20 20 .#endif.//.UNITY_EDITOR.........
26c20 20 20 20 70 72 69 76 61 74 65 20 73 74 61 74 69 63 20 76 6f 69 64 20 52 75 6e 49 6e 69 74 69 61 ...private.static.void.RunInitia
26c40 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()..........{............
26c60 20 20 2f 2f 20 52 65 71 75 65 73 74 20 61 6e 20 69 6e 69 74 69 61 6c 20 55 70 64 61 74 65 20 73 ..//.Request.an.initial.Update.s
26c80 6f 20 74 68 61 74 20 75 73 65 72 20 6d 65 74 68 6f 64 73 20 73 75 63 68 20 61 73 20 53 74 61 72 o.that.user.methods.such.as.Star
26ca0 74 20 61 6e 64 20 41 77 61 6b 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 63 61 6e 20 t.and.Awake..............//.can.
26cc0 61 63 63 65 73 73 20 74 68 65 20 69 6e 70 75 74 20 64 65 76 69 63 65 73 2e 0d 0a 20 20 20 20 20 access.the.input.devices........
26ce0 20 20 20 20 20 20 20 2f 2f 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4e 4f 54 45 3a 20 .......//..............//.NOTE:.
26d00 57 65 20 75 73 65 20 49 6e 70 75 74 55 70 64 61 74 65 54 79 70 65 2e 4e 6f 6e 65 20 68 65 72 65 We.use.InputUpdateType.None.here
26d20 20 74 6f 20 72 75 6e 20 61 20 22 6e 75 6c 6c 22 20 75 70 64 61 74 65 2e 20 49 6e 70 75 74 4d 61 .to.run.a."null".update..InputMa
26d40 6e 61 67 65 72 2e 4f 6e 42 65 66 6f 72 65 55 70 64 61 74 65 28 29 0d 0a 20 20 20 20 20 20 20 20 nager.OnBeforeUpdate()..........
26d60 20 20 20 20 2f 2f 20 20 20 20 20 20 20 61 6e 64 20 49 6e 70 75 74 4d 61 6e 61 67 65 72 2e 4f 6e ....//.......and.InputManager.On
26d80 55 70 64 61 74 65 28 29 20 77 69 6c 6c 20 62 6f 74 68 20 65 61 72 6c 79 20 6f 75 74 20 77 68 65 Update().will.both.early.out.whe
26da0 6e 20 63 6f 6d 70 61 72 69 6e 67 20 74 68 69 73 20 74 6f 20 74 68 65 69 72 20 75 70 64 61 74 65 n.comparing.this.to.their.update
26dc0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 6d 61 73 6b 20 62 75 74 20 ..............//.......mask.but.
26de0 77 69 6c 6c 20 73 74 69 6c 6c 20 72 65 73 74 6f 72 65 20 64 65 76 69 63 65 73 2e 20 54 68 69 73 will.still.restore.devices..This
26e00 20 6d 65 61 6e 73 20 77 65 27 72 65 20 6e 6f 74 20 61 63 74 75 61 6c 6c 79 20 70 72 6f 63 65 73 .means.we're.not.actually.proces
26e20 73 69 6e 67 20 69 6e 70 75 74 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 sing.input,..............//.....
26e40 20 20 62 75 74 20 77 65 20 77 69 6c 6c 20 66 6f 72 63 65 20 74 68 65 20 72 75 6e 74 69 6d 65 20 ..but.we.will.force.the.runtime.
26e60 74 6f 20 70 75 73 68 20 69 74 73 20 64 65 76 69 63 65 73 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 to.push.its.devices.............
26e80 20 20 55 70 64 61 74 65 28 49 6e 70 75 74 55 70 64 61 74 65 54 79 70 65 2e 4e 6f 6e 65 29 3b 0d ..Update(InputUpdateType.None);.
26ea0 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 23 69 66 20 21 55 4e 49 54 59 5f 44 49 53 41 42 4c 45 .........}....#if.!UNITY_DISABLE
26ec0 5f 44 45 46 41 55 4c 54 5f 49 4e 50 55 54 5f 50 4c 55 47 49 4e 5f 49 4e 49 54 49 41 4c 49 5a 41 _DEFAULT_INPUT_PLUGIN_INITIALIZA
26ee0 54 49 4f 4e 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 74 65 20 73 74 61 74 69 63 20 76 6f 69 TION..........private.static.voi
26f00 64 20 50 65 72 66 6f 72 6d 44 65 66 61 75 6c 74 50 6c 75 67 69 6e 49 6e 69 74 69 61 6c 69 7a 61 d.PerformDefaultPluginInitializa
26f20 74 69 6f 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 55 tion()..........{..............U
26f40 49 53 75 70 70 6f 72 74 2e 49 6e 69 74 69 61 6c 69 7a 65 28 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 ISupport.Initialize();..........
26f60 20 20 20 20 20 20 23 69 66 20 55 4e 49 54 59 5f 45 44 49 54 4f 52 20 7c 7c 20 55 4e 49 54 59 5f ......#if.UNITY_EDITOR.||.UNITY_
26f80 53 54 41 4e 44 41 4c 4f 4e 45 20 7c 7c 20 55 4e 49 54 59 5f 57 53 41 20 7c 7c 20 55 4e 49 54 59 STANDALONE.||.UNITY_WSA.||.UNITY
26fa0 5f 49 4f 53 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 58 49 6e 70 75 74 53 75 70 70 6f 72 74 2e _IOS..............XInputSupport.
26fc0 49 6e 69 74 69 61 6c 69 7a 65 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 23 65 6e 64 69 Initialize();..............#endi
26fe0 66 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 5f 45 44 49 54 4f f................#if.UNITY_EDITO
27000 52 20 7c 7c 20 55 4e 49 54 59 5f 53 54 41 4e 44 41 4c 4f 4e 45 20 7c 7c 20 55 4e 49 54 59 5f 50 R.||.UNITY_STANDALONE.||.UNITY_P
27020 53 34 20 7c 7c 20 55 4e 49 54 59 5f 57 53 41 20 7c 7c 20 55 4e 49 54 59 5f 49 4f 53 0d 0a 20 20 S4.||.UNITY_WSA.||.UNITY_IOS....
27040 20 20 20 20 20 20 20 20 20 20 44 75 61 6c 53 68 6f 63 6b 53 75 70 70 6f 72 74 2e 49 6e 69 74 69 ..........DualShockSupport.Initi
27060 61 6c 69 7a 65 28 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 0a alize();..............#endif....
27080 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 20 7c 7c 20 ............#if.UNITY_EDITOR.||.
270a0 55 4e 49 54 59 5f 53 54 41 4e 44 41 4c 4f 4e 45 20 7c 7c 20 55 4e 49 54 59 5f 57 53 41 0d 0a 20 UNITY_STANDALONE.||.UNITY_WSA...
270c0 20 20 20 20 20 20 20 20 20 20 20 48 49 44 53 75 70 70 6f 72 74 2e 49 6e 69 74 69 61 6c 69 7a 65 ...........HIDSupport.Initialize
270e0 28 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 0a 20 20 20 20 20 ();..............#endif.........
27100 20 20 20 20 20 20 20 23 69 66 20 55 4e 49 54 59 5f 45 44 49 54 4f 52 20 7c 7c 20 55 4e 49 54 59 .......#if.UNITY_EDITOR.||.UNITY
27120 5f 41 4e 44 52 4f 49 44 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 41 6e 64 72 6f 69 64 2e 41 6e _ANDROID..............Android.An
27140 64 72 6f 69 64 53 75 70 70 6f 72 74 2e 49 6e 69 74 69 61 6c 69 7a 65 28 29 3b 0d 0a 20 20 20 20 droidSupport.Initialize();......
27160 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 23 69 ........#endif................#i
27180 66 20 55 4e 49 54 59 5f 45 44 49 54 4f 52 20 7c 7c 20 55 4e 49 54 59 5f 49 4f 53 20 7c 7c 20 55 f.UNITY_EDITOR.||.UNITY_IOS.||.U
271a0 4e 49 54 59 5f 54 56 4f 53 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 4f 53 2e 69 4f 53 53 75 NITY_TVOS..............iOS.iOSSu
271c0 70 70 6f 72 74 2e 49 6e 69 74 69 61 6c 69 7a 65 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 pport.Initialize();.............
271e0 20 23 65 6e 64 69 66 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 .#endif................#if.UNITY
27200 5f 45 44 49 54 4f 52 20 7c 7c 20 55 4e 49 54 59 5f 57 45 42 47 4c 0d 0a 20 20 20 20 20 20 20 20 _EDITOR.||.UNITY_WEBGL..........
27220 20 20 20 20 57 65 62 47 4c 2e 57 65 62 47 4c 53 75 70 70 6f 72 74 2e 49 6e 69 74 69 61 6c 69 7a ....WebGL.WebGLSupport.Initializ
27240 65 28 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 0a 20 20 20 20 e();..............#endif........
27260 20 20 20 20 20 20 20 20 23 69 66 20 55 4e 49 54 59 5f 45 44 49 54 4f 52 20 7c 7c 20 55 4e 49 54 ........#if.UNITY_EDITOR.||.UNIT
27280 59 5f 53 54 41 4e 44 41 4c 4f 4e 45 5f 4f 53 58 20 7c 7c 20 55 4e 49 54 59 5f 53 54 41 4e 44 41 Y_STANDALONE_OSX.||.UNITY_STANDA
272a0 4c 4f 4e 45 5f 57 49 4e 20 7c 7c 20 55 4e 49 54 59 5f 57 53 41 0d 0a 20 20 20 20 20 20 20 20 20 LONE_WIN.||.UNITY_WSA...........
272c0 20 20 20 53 77 69 74 63 68 2e 53 77 69 74 63 68 53 75 70 70 6f 72 74 48 49 44 2e 49 6e 69 74 69 ...Switch.SwitchSupportHID.Initi
272e0 61 6c 69 7a 65 28 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 0a alize();..............#endif....
27300 20 20 20 20 20 20 20 20 20 20 20 20 23 69 66 20 28 55 4e 49 54 59 5f 45 44 49 54 4f 52 20 7c 7c ............#if.(UNITY_EDITOR.||
27320 20 55 4e 49 54 59 5f 53 54 41 4e 44 41 4c 4f 4e 45 20 7c 7c 20 55 4e 49 54 59 5f 41 4e 44 52 4f .UNITY_STANDALONE.||.UNITY_ANDRO
27340 49 44 20 7c 7c 20 55 4e 49 54 59 5f 49 4f 53 20 7c 7c 20 55 4e 49 54 59 5f 57 53 41 29 20 26 26 ID.||.UNITY_IOS.||.UNITY_WSA).&&
27360 20 55 4e 49 54 59 5f 49 4e 50 55 54 5f 53 59 53 54 45 4d 5f 45 4e 41 42 4c 45 5f 58 52 0d 0a 20 .UNITY_INPUT_SYSTEM_ENABLE_XR...
27380 20 20 20 20 20 20 20 20 20 20 20 58 52 2e 58 52 53 75 70 70 6f 72 74 2e 49 6e 69 74 69 61 6c 69 ...........XR.XRSupport.Initiali
273a0 7a 65 28 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 0a 20 20 20 ze();..............#endif.......
273c0 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 20 7c 7c 20 55 4e 49 .........#if.UNITY_EDITOR.||.UNI
273e0 54 59 5f 53 54 41 4e 44 41 4c 4f 4e 45 5f 4c 49 4e 55 58 0d 0a 20 20 20 20 20 20 20 20 20 20 20 TY_STANDALONE_LINUX.............
27400 20 4c 69 6e 75 78 2e 4c 69 6e 75 78 53 75 70 70 6f 72 74 2e 49 6e 69 74 69 61 6c 69 7a 65 28 29 .Linux.LinuxSupport.Initialize()
27420 3b 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 ;..............#endif...........
27440 20 20 20 20 20 23 69 66 20 55 4e 49 54 59 5f 45 44 49 54 4f 52 20 7c 7c 20 55 4e 49 54 59 5f 41 .....#if.UNITY_EDITOR.||.UNITY_A
27460 4e 44 52 4f 49 44 20 7c 7c 20 55 4e 49 54 59 5f 49 4f 53 20 7c 7c 20 55 4e 49 54 59 5f 54 56 4f NDROID.||.UNITY_IOS.||.UNITY_TVO
27480 53 20 7c 7c 20 55 4e 49 54 59 5f 57 53 41 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 4f 6e 53 63 S.||.UNITY_WSA..............OnSc
274a0 72 65 65 6e 2e 4f 6e 53 63 72 65 65 6e 53 75 70 70 6f 72 74 2e 49 6e 69 74 69 61 6c 69 7a 65 28 reen.OnScreenSupport.Initialize(
274c0 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 0a 20 20 20 20 20 20 );..............#endif..........
274e0 20 20 20 20 20 20 23 69 66 20 28 55 4e 49 54 59 5f 45 44 49 54 4f 52 20 7c 7c 20 55 4e 49 54 59 ......#if.(UNITY_EDITOR.||.UNITY
27500 5f 53 54 41 4e 44 41 4c 4f 4e 45 29 20 26 26 20 55 4e 49 54 59 5f 45 4e 41 42 4c 45 5f 53 54 45 _STANDALONE).&&.UNITY_ENABLE_STE
27520 41 4d 5f 43 4f 4e 54 52 4f 4c 4c 45 52 5f 53 55 50 50 4f 52 54 0d 0a 20 20 20 20 20 20 20 20 20 AM_CONTROLLER_SUPPORT...........
27540 20 20 20 53 74 65 61 6d 2e 53 74 65 61 6d 53 75 70 70 6f 72 74 2e 49 6e 69 74 69 61 6c 69 7a 65 ...Steam.SteamSupport.Initialize
27560 28 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 ();..............#endif.........
27580 20 7d 0d 0a 0d 0a 23 65 6e 64 69 66 20 2f 2f 20 55 4e 49 54 59 5f 44 49 53 41 42 4c 45 5f 44 45 .}....#endif.//.UNITY_DISABLE_DE
275a0 46 41 55 4c 54 5f 49 4e 50 55 54 5f 50 4c 55 47 49 4e 5f 49 4e 49 54 49 41 4c 49 5a 41 54 49 4f FAULT_INPUT_PLUGIN_INITIALIZATIO
275c0 4e 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 46 6f 72 20 74 65 73 74 69 6e 67 2c 20 77 65 20 N............//.For.testing,.we.
275e0 77 61 6e 74 20 74 68 65 20 61 62 69 6c 69 74 79 20 74 6f 20 70 75 73 68 2f 70 6f 70 20 73 79 73 want.the.ability.to.push/pop.sys
27600 74 65 6d 20 73 74 61 74 65 20 65 76 65 6e 20 69 6e 20 74 68 65 20 70 6c 61 79 65 72 2e 0d 0a 20 tem.state.even.in.the.player....
27620 20 20 20 20 20 20 20 2f 2f 20 48 6f 77 65 76 65 72 2c 20 77 65 20 64 6f 6e 27 74 20 77 61 6e 74 .......//.However,.we.don't.want
27640 20 69 74 20 69 6e 20 72 65 6c 65 61 73 65 20 70 6c 61 79 65 72 73 2e 0d 0a 23 69 66 20 44 45 56 .it.in.release.players...#if.DEV
27660 45 4c 4f 50 4d 45 4e 54 5f 42 55 49 4c 44 20 7c 7c 20 55 4e 49 54 59 5f 45 44 49 54 4f 52 0d 0a ELOPMENT_BUILD.||.UNITY_EDITOR..
27680 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>........../
276a0 2f 2f 20 52 65 74 75 72 6e 20 74 68 65 20 69 6e 70 75 74 20 73 79 73 74 65 6d 20 74 6f 20 69 74 //.Return.the.input.system.to.it
276c0 73 20 64 65 66 61 75 6c 74 20 73 74 61 74 65 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 2f s.default.state...........///.</
276e0 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 73 74 61 74 69 63 summary>..........private.static
27700 20 76 6f 69 64 20 52 65 73 65 74 28 62 6f 6f 6c 20 65 6e 61 62 6c 65 52 65 6d 6f 74 69 6e 67 20 .void.Reset(bool.enableRemoting.
27720 3d 20 66 61 6c 73 65 2c 20 49 49 6e 70 75 74 52 75 6e 74 69 6d 65 20 72 75 6e 74 69 6d 65 20 3d =.false,.IInputRuntime.runtime.=
27740 20 6e 75 6c 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 50 .null)..........{..............P
27760 72 6f 66 69 6c 69 6e 67 2e 50 72 6f 66 69 6c 65 72 2e 42 65 67 69 6e 53 61 6d 70 6c 65 28 22 49 rofiling.Profiler.BeginSample("I
27780 6e 70 75 74 53 79 73 74 65 6d 2e 52 65 73 65 74 22 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 nputSystem.Reset");.............
277a0 20 20 20 2f 2f 20 53 6f 6d 65 20 64 65 76 69 63 65 73 20 6b 65 65 70 20 67 6c 6f 62 61 6c 73 2e ...//.Some.devices.keep.globals.
277c0 20 47 65 74 20 72 69 64 20 6f 66 20 74 68 65 6d 20 62 79 20 70 72 65 74 65 6e 64 69 6e 67 20 74 .Get.rid.of.them.by.pretending.t
277e0 68 65 20 64 65 76 69 63 65 73 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 61 72 65 20 72 he.devices..............//.are.r
27800 65 6d 6f 76 65 64 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 5f 4d 61 6e 61 67 emoved...............if.(s_Manag
27820 65 72 20 21 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 er.!=.null)..............{......
27840 20 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 65 61 63 68 20 28 76 61 72 20 64 65 76 69 63 65 20 ............foreach.(var.device.
27860 69 6e 20 73 5f 4d 61 6e 61 67 65 72 2e 64 65 76 69 63 65 73 29 0d 0a 20 20 20 20 20 20 20 20 20 in.s_Manager.devices)...........
27880 20 20 20 20 20 20 20 20 20 20 20 64 65 76 69 63 65 2e 4e 6f 74 69 66 79 52 65 6d 6f 76 65 64 28 ...........device.NotifyRemoved(
278a0 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 4d 61 6e 61 67 65 72 2e );....................s_Manager.
278c0 55 6e 69 6e 73 74 61 6c 6c 47 6c 6f 62 61 6c 73 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 UninstallGlobals();.............
278e0 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 43 72 65 61 74 65 20 74 65 6d 70 .}................//.Create.temp
27900 6f 72 61 72 79 20 73 65 74 74 69 6e 67 73 2e 20 49 6e 20 74 68 65 20 74 65 73 74 73 2c 20 74 68 orary.settings..In.the.tests,.th
27920 69 73 20 69 73 20 61 6c 6c 20 77 65 20 6e 65 65 64 2e 20 42 75 74 20 6f 75 74 73 69 64 65 20 6f is.is.all.we.need..But.outside.o
27940 66 20 74 65 73 74 73 2c 64 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 74 68 69 73 20 73 f.tests,d..............//.this.s
27960 68 6f 75 6c 64 20 67 65 74 20 72 65 70 6c 61 63 65 64 20 77 69 74 68 20 61 6e 20 61 63 74 75 61 hould.get.replaced.with.an.actua
27980 6c 20 49 6e 70 75 74 53 65 74 74 69 6e 67 73 20 61 73 73 65 74 2e 0d 0a 20 20 20 20 20 20 20 20 l.InputSettings.asset...........
279a0 20 20 20 20 76 61 72 20 73 65 74 74 69 6e 67 73 20 3d 20 53 63 72 69 70 74 61 62 6c 65 4f 62 6a ....var.settings.=.ScriptableObj
279c0 65 63 74 2e 43 72 65 61 74 65 49 6e 73 74 61 6e 63 65 3c 49 6e 70 75 74 53 65 74 74 69 6e 67 73 ect.CreateInstance<InputSettings
279e0 3e 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 65 74 74 69 6e 67 73 2e 68 69 64 65 46 >();..............settings.hideF
27a00 6c 61 67 73 20 3d 20 48 69 64 65 46 6c 61 67 73 2e 48 69 64 65 41 6e 64 44 6f 6e 74 53 61 76 65 lags.=.HideFlags.HideAndDontSave
27a20 3b 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 5f 45 44 49 54 4f ;................#if.UNITY_EDITO
27a40 52 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 4d 61 6e 61 67 65 72 20 3d 20 6e 65 77 20 49 R..............s_Manager.=.new.I
27a60 6e 70 75 74 4d 61 6e 61 67 65 72 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 4d 61 nputManager();..............s_Ma
27a80 6e 61 67 65 72 2e 49 6e 69 74 69 61 6c 69 7a 65 28 72 75 6e 74 69 6d 65 20 3f 3f 20 4e 61 74 69 nager.Initialize(runtime.??.Nati
27aa0 76 65 49 6e 70 75 74 52 75 6e 74 69 6d 65 2e 69 6e 73 74 61 6e 63 65 2c 20 73 65 74 74 69 6e 67 veInputRuntime.instance,.setting
27ac0 73 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 4d 61 6e 61 67 65 72 2e 6d 5f 52 s);................s_Manager.m_R
27ae0 75 6e 74 69 6d 65 2e 6f 6e 50 6c 61 79 4d 6f 64 65 43 68 61 6e 67 65 64 20 3d 20 4f 6e 50 6c 61 untime.onPlayModeChanged.=.OnPla
27b00 79 4d 6f 64 65 43 68 61 6e 67 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 4d 61 6e 61 yModeChange;..............s_Mana
27b20 67 65 72 2e 6d 5f 52 75 6e 74 69 6d 65 2e 6f 6e 50 72 6f 6a 65 63 74 43 68 61 6e 67 65 20 3d 20 ger.m_Runtime.onProjectChange.=.
27b40 4f 6e 50 72 6f 6a 65 63 74 43 68 61 6e 67 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 OnProjectChange;................
27b60 49 6e 70 75 74 45 64 69 74 6f 72 55 73 65 72 53 65 74 74 69 6e 67 73 2e 73 5f 53 65 74 74 69 6e InputEditorUserSettings.s_Settin
27b80 67 73 20 3d 20 6e 65 77 20 49 6e 70 75 74 45 64 69 74 6f 72 55 73 65 72 53 65 74 74 69 6e 67 73 gs.=.new.InputEditorUserSettings
27ba0 2e 53 65 72 69 61 6c 69 7a 65 64 53 74 61 74 65 28 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 .SerializedState();.............
27bc0 20 20 20 69 66 20 28 65 6e 61 62 6c 65 52 65 6d 6f 74 69 6e 67 29 0d 0a 20 20 20 20 20 20 20 20 ...if.(enableRemoting)..........
27be0 20 20 20 20 20 20 20 20 53 65 74 55 70 52 65 6d 6f 74 69 6e 67 28 29 3b 0d 0a 0d 0a 20 20 20 20 ........SetUpRemoting();........
27c00 20 20 20 20 20 20 20 20 23 69 66 20 21 55 4e 49 54 59 5f 44 49 53 41 42 4c 45 5f 44 45 46 41 55 ........#if.!UNITY_DISABLE_DEFAU
27c20 4c 54 5f 49 4e 50 55 54 5f 50 4c 55 47 49 4e 5f 49 4e 49 54 49 41 4c 49 5a 41 54 49 4f 4e 0d 0a LT_INPUT_PLUGIN_INITIALIZATION..
27c40 20 20 20 20 20 20 20 20 20 20 20 20 50 65 72 66 6f 72 6d 44 65 66 61 75 6c 74 50 6c 75 67 69 6e ............PerformDefaultPlugin
27c60 49 6e 69 74 69 61 6c 69 7a 61 74 69 6f 6e 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 23 Initialization();..............#
27c80 65 6e 64 69 66 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 23 65 6c 73 65 0d 0a 20 20 20 20 endif................#else......
27ca0 20 20 20 20 20 20 20 20 49 6e 69 74 69 61 6c 69 7a 65 49 6e 50 6c 61 79 65 72 28 72 75 6e 74 69 ........InitializeInPlayer(runti
27cc0 6d 65 2c 20 73 65 74 74 69 6e 67 73 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 23 65 6e 64 me,.settings);..............#end
27ce0 69 66 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 49 6e 70 75 74 55 73 65 72 2e 52 65 73 65 if................InputUser.Rese
27d00 74 47 6c 6f 62 61 6c 73 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 50 72 6f 66 69 6c 69 tGlobals();..............Profili
27d20 6e 67 2e 50 72 6f 66 69 6c 65 72 2e 45 6e 64 53 61 6d 70 6c 65 28 29 3b 0d 0a 20 20 20 20 20 20 ng.Profiler.EndSample();........
27d40 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 3c 73 75 6d 6d 61 72 79 3e 0d 0a 20 20 ..}............///.<summary>....
27d60 20 20 20 20 20 20 2f 2f 2f 20 44 65 73 74 72 6f 79 20 74 68 65 20 63 75 72 72 65 6e 74 20 73 65 ......///.Destroy.the.current.se
27d80 74 75 70 20 6f 66 20 74 68 65 20 69 6e 70 75 74 20 73 79 73 74 65 6d 2e 0d 0a 20 20 20 20 20 20 tup.of.the.input.system.........
27da0 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 72 ..///.</summary>..........///.<r
27dc0 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 4e 4f 54 45 3a 20 54 68 69 73 20 emarks>..........///.NOTE:.This.
27de0 61 6c 73 6f 20 64 65 2d 61 6c 6c 6f 63 61 74 65 73 20 64 61 74 61 20 77 65 27 72 65 20 6b 65 65 also.de-allocates.data.we're.kee
27e00 70 69 6e 67 20 69 6e 20 75 6e 6d 61 6e 61 67 65 64 20 6d 65 6d 6f 72 79 21 0d 0a 20 20 20 20 20 ping.in.unmanaged.memory!.......
27e20 20 20 20 2f 2f 2f 20 3c 2f 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 70 72 69 76 61 ...///.</remarks>..........priva
27e40 74 65 20 73 74 61 74 69 63 20 76 6f 69 64 20 44 65 73 74 72 6f 79 28 29 0d 0a 20 20 20 20 20 20 te.static.void.Destroy()........
27e60 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4e 4f 54 45 3a 20 44 6f 65 73 20 6e ..{..............//.NOTE:.Does.n
27e80 6f 74 20 64 65 73 74 72 6f 79 20 49 6e 70 75 74 53 79 73 74 65 6d 4f 62 6a 65 63 74 2e 20 57 65 ot.destroy.InputSystemObject..We
27ea0 20 77 61 6e 74 20 74 6f 20 64 65 73 74 72 6f 79 20 69 6e 70 75 74 20 73 79 73 74 65 6d 0d 0a 20 .want.to.destroy.input.system...
27ec0 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 73 74 61 74 65 20 72 65 70 65 61 74 ...........//.......state.repeat
27ee0 65 64 6c 79 20 64 75 72 69 6e 67 20 74 65 73 74 73 20 62 75 74 20 77 65 20 77 61 6e 74 20 74 6f edly.during.tests.but.we.want.to
27f00 20 6e 6f 74 20 63 72 65 61 74 65 20 49 6e 70 75 74 53 79 73 74 65 6d 4f 62 6a 65 63 74 0d 0a 20 .not.create.InputSystemObject...
27f20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 6f 76 65 72 20 61 6e 64 20 6f 76 65 ...........//.......over.and.ove
27f40 72 2e 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 49 6e 70 75 74 41 63 74 69 6f 6e 53 74 61 r.................InputActionSta
27f60 74 65 2e 52 65 73 65 74 47 6c 6f 62 61 6c 73 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 te.ResetGlobals();..............
27f80 73 5f 4d 61 6e 61 67 65 72 2e 44 65 73 74 72 6f 79 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 s_Manager.Destroy();............
27fa0 20 20 69 66 20 28 73 5f 52 65 6d 6f 74 65 43 6f 6e 6e 65 63 74 69 6f 6e 20 21 3d 20 6e 75 6c 6c ..if.(s_RemoteConnection.!=.null
27fc0 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4f 62 6a 65 63 74 2e 44 65 73 74 72 6f )..................Object.Destro
27fe0 79 49 6d 6d 65 64 69 61 74 65 28 73 5f 52 65 6d 6f 74 65 43 6f 6e 6e 65 63 74 69 6f 6e 29 3b 0d yImmediate(s_RemoteConnection);.
28000 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 20 .............#if.UNITY_EDITOR...
28020 20 20 20 20 20 20 20 20 20 20 20 45 64 69 74 6f 72 49 6e 70 75 74 43 6f 6e 74 72 6f 6c 4c 61 79 ...........EditorInputControlLay
28040 6f 75 74 43 61 63 68 65 2e 43 6c 65 61 72 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 49 outCache.Clear();..............I
28060 6e 70 75 74 44 65 76 69 63 65 44 65 62 75 67 67 65 72 57 69 6e 64 6f 77 2e 73 5f 4f 6e 54 6f 6f nputDeviceDebuggerWindow.s_OnToo
28080 6c 62 61 72 47 55 49 41 63 74 69 6f 6e 73 2e 43 6c 65 61 72 28 29 3b 0d 0a 20 20 20 20 20 20 20 lbarGUIActions.Clear();.........
280a0 20 20 20 20 20 49 6e 70 75 74 45 64 69 74 6f 72 55 73 65 72 53 65 74 74 69 6e 67 73 2e 73 5f 53 .....InputEditorUserSettings.s_S
280c0 65 74 74 69 6e 67 73 20 3d 20 6e 65 77 20 49 6e 70 75 74 45 64 69 74 6f 72 55 73 65 72 53 65 74 ettings.=.new.InputEditorUserSet
280e0 74 69 6e 67 73 2e 53 65 72 69 61 6c 69 7a 65 64 53 74 61 74 65 28 29 3b 0d 0a 20 20 20 20 20 20 tings.SerializedState();........
28100 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 73 5f 4d 61 ......#endif................s_Ma
28120 6e 61 67 65 72 20 3d 20 6e 75 6c 6c 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 52 65 6d nager.=.null;..............s_Rem
28140 6f 74 65 43 6f 6e 6e 65 63 74 69 6f 6e 20 3d 20 6e 75 6c 6c 3b 0d 0a 20 20 20 20 20 20 20 20 20 oteConnection.=.null;...........
28160 20 20 20 73 5f 52 65 6d 6f 74 65 20 3d 20 6e 75 6c 6c 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a ...s_Remote.=.null;..........}..
28180 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>.........
281a0 20 2f 2f 2f 20 53 6e 61 70 73 68 6f 74 20 6f 66 20 74 68 65 20 73 74 61 74 65 20 75 73 65 64 20 .///.Snapshot.of.the.state.used.
281c0 62 79 20 74 68 65 20 69 6e 70 75 74 20 73 79 73 74 65 6d 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f by.the.input.system...........//
281e0 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 72 /.</summary>..........///.<remar
28200 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 43 61 6e 20 62 65 20 74 61 6b 65 6e 20 61 63 ks>..........///.Can.be.taken.ac
28220 72 6f 73 73 20 64 6f 6d 61 69 6e 20 72 65 6c 6f 61 64 73 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f ross.domain.reloads...........//
28240 2f 20 3c 2f 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 5b 53 65 72 69 61 6c 69 7a 61 /.</remarks>..........[Serializa
28260 62 6c 65 5d 0d 0a 20 20 20 20 20 20 20 20 69 6e 74 65 72 6e 61 6c 20 73 74 72 75 63 74 20 53 74 ble]..........internal.struct.St
28280 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 20 5b 4e 6f 6e ate..........{..............[Non
282a0 53 65 72 69 61 6c 69 7a 65 64 5d 20 70 75 62 6c 69 63 20 49 6e 70 75 74 4d 61 6e 61 67 65 72 20 Serialized].public.InputManager.
282c0 6d 61 6e 61 67 65 72 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 5b 4e 6f 6e 53 65 72 69 61 6c manager;..............[NonSerial
282e0 69 7a 65 64 5d 20 70 75 62 6c 69 63 20 49 6e 70 75 74 52 65 6d 6f 74 69 6e 67 20 72 65 6d 6f 74 ized].public.InputRemoting.remot
28300 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 5b 53 65 72 69 61 6c 69 7a 65 46 69 65 6c 64 5d e;..............[SerializeField]
28320 20 70 75 62 6c 69 63 20 52 65 6d 6f 74 65 49 6e 70 75 74 50 6c 61 79 65 72 43 6f 6e 6e 65 63 74 .public.RemoteInputPlayerConnect
28340 69 6f 6e 20 72 65 6d 6f 74 65 43 6f 6e 6e 65 63 74 69 6f 6e 3b 0d 0a 20 20 20 20 20 20 20 20 20 ion.remoteConnection;...........
28360 20 20 20 5b 53 65 72 69 61 6c 69 7a 65 46 69 65 6c 64 5d 20 70 75 62 6c 69 63 20 49 6e 70 75 74 ...[SerializeField].public.Input
28380 4d 61 6e 61 67 65 72 2e 53 65 72 69 61 6c 69 7a 65 64 53 74 61 74 65 20 6d 61 6e 61 67 65 72 53 Manager.SerializedState.managerS
283a0 74 61 74 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 5b 53 65 72 69 61 6c 69 7a 65 46 69 65 tate;..............[SerializeFie
283c0 6c 64 5d 20 70 75 62 6c 69 63 20 49 6e 70 75 74 52 65 6d 6f 74 69 6e 67 2e 53 65 72 69 61 6c 69 ld].public.InputRemoting.Seriali
283e0 7a 65 64 53 74 61 74 65 20 72 65 6d 6f 74 69 6e 67 53 74 61 74 65 3b 0d 0a 20 20 20 20 20 20 20 zedState.remotingState;.........
28400 20 20 20 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 .....#if.UNITY_EDITOR...........
28420 20 20 20 5b 53 65 72 69 61 6c 69 7a 65 46 69 65 6c 64 5d 20 70 75 62 6c 69 63 20 49 6e 70 75 74 ...[SerializeField].public.Input
28440 45 64 69 74 6f 72 55 73 65 72 53 65 74 74 69 6e 67 73 2e 53 65 72 69 61 6c 69 7a 65 64 53 74 61 EditorUserSettings.SerializedSta
28460 74 65 20 75 73 65 72 53 65 74 74 69 6e 67 73 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 5b 53 te.userSettings;..............[S
28480 65 72 69 61 6c 69 7a 65 46 69 65 6c 64 5d 20 70 75 62 6c 69 63 20 73 74 72 69 6e 67 20 73 79 73 erializeField].public.string.sys
284a0 74 65 6d 4f 62 6a 65 63 74 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 23 65 6e 64 69 66 0d 0a temObject;..............#endif..
284c0 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 2f 52 45 56 49 45 57 3a 20 70 72 65 73 65 72 76 65 ............////REVIEW:.preserve
284e0 20 49 6e 70 75 74 55 73 65 72 20 73 74 61 74 65 3f 20 28 69 66 20 65 76 65 6e 20 70 6f 73 73 69 .InputUser.state?.(if.even.possi
28500 62 6c 65 29 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 ble)..........}............priva
28520 74 65 20 73 74 61 74 69 63 20 53 74 61 63 6b 3c 53 74 61 74 65 3e 20 73 5f 53 61 76 65 64 53 74 te.static.Stack<State>.s_SavedSt
28540 61 74 65 53 74 61 63 6b 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 69 6e 74 65 72 6e 61 6c 20 73 74 ateStack;............internal.st
28560 61 74 69 63 20 53 74 61 74 65 20 47 65 74 53 61 76 65 64 53 74 61 74 65 28 29 0d 0a 20 20 20 20 atic.State.GetSavedState()......
28580 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 73 5f 53 61 76 65 ....{..............return.s_Save
285a0 64 53 74 61 74 65 53 74 61 63 6b 2e 50 65 65 6b 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a dStateStack.Peek();..........}..
285c0 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>.........
285e0 20 2f 2f 2f 20 50 75 73 68 20 74 68 65 20 63 75 72 72 65 6e 74 20 73 74 61 74 65 20 6f 66 20 74 .///.Push.the.current.state.of.t
28600 68 65 20 69 6e 70 75 74 20 73 79 73 74 65 6d 20 6f 6e 74 6f 20 61 20 73 74 61 63 6b 20 61 6e 64 he.input.system.onto.a.stack.and
28620 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 72 65 73 65 74 20 74 68 65 20 73 79 73 74 65 6d 20 74 ..........///.reset.the.system.t
28640 6f 20 69 74 73 20 64 65 66 61 75 6c 74 20 73 74 61 74 65 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f o.its.default.state...........//
28660 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 72 /.</summary>..........///.<remar
28680 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 20 54 68 65 20 73 61 76 65 20 73 74 61 63 6b 20 ks>..........///.The.save.stack.
286a0 69 73 20 6e 6f 74 20 61 62 6c 65 20 74 6f 20 73 75 72 76 69 76 65 20 64 6f 6d 61 69 6e 20 72 65 is.not.able.to.survive.domain.re
286c0 6c 6f 61 64 73 2e 20 49 74 20 69 73 20 69 6e 74 65 6e 64 65 64 20 73 6f 6c 65 6c 79 0d 0a 20 20 loads..It.is.intended.solely....
286e0 20 20 20 20 20 20 2f 2f 2f 20 66 6f 72 20 75 73 65 20 69 6e 20 74 65 73 74 73 2e 0d 0a 20 20 20 ......///.for.use.in.tests......
28700 20 20 20 20 20 2f 2f 2f 20 3c 2f 72 65 6d 61 72 6b 73 3e 0d 0a 20 20 20 20 20 20 20 20 69 6e 74 .....///.</remarks>..........int
28720 65 72 6e 61 6c 20 73 74 61 74 69 63 20 76 6f 69 64 20 53 61 76 65 41 6e 64 52 65 73 65 74 28 62 ernal.static.void.SaveAndReset(b
28740 6f 6f 6c 20 65 6e 61 62 6c 65 52 65 6d 6f 74 69 6e 67 20 3d 20 66 61 6c 73 65 2c 20 49 49 6e 70 ool.enableRemoting.=.false,.IInp
28760 75 74 52 75 6e 74 69 6d 65 20 72 75 6e 74 69 6d 65 20 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 20 utRuntime.runtime.=.null).......
28780 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 5f 53 61 76 65 64 53 74 61 ...{..............if.(s_SavedSta
287a0 74 65 53 74 61 63 6b 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 teStack.==.null)................
287c0 20 20 73 5f 53 61 76 65 64 53 74 61 74 65 53 74 61 63 6b 20 3d 20 6e 65 77 20 53 74 61 63 6b 3c ..s_SavedStateStack.=.new.Stack<
287e0 53 74 61 74 65 3e 28 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 2f 2f 46 49 58 State>();................////FIX
28800 4d 45 3a 20 64 6f 65 73 20 6e 6f 74 20 70 72 65 73 65 72 76 65 20 67 6c 6f 62 61 6c 20 73 74 61 ME:.does.not.preserve.global.sta
28820 74 65 20 69 6e 20 49 6e 70 75 74 41 63 74 69 6f 6e 53 74 61 74 65 0d 0a 20 20 20 20 20 20 20 20 te.in.InputActionState..........
28840 20 20 20 20 2f 2f 2f 2f 54 4f 44 4f 3a 20 70 72 65 73 65 72 76 65 20 49 6e 70 75 74 55 73 65 72 ....////TODO:.preserve.InputUser
28860 20 73 74 61 74 65 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 53 61 76 65 64 53 74 61 .state................s_SavedSta
28880 74 65 53 74 61 63 6b 2e 50 75 73 68 28 6e 65 77 20 53 74 61 74 65 0d 0a 20 20 20 20 20 20 20 20 teStack.Push(new.State..........
288a0 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 61 6e 61 67 65 72 20 3d ....{..................manager.=
288c0 20 73 5f 4d 61 6e 61 67 65 72 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 6d .s_Manager,..................rem
288e0 6f 74 65 20 3d 20 73 5f 52 65 6d 6f 74 65 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ote.=.s_Remote,.................
28900 20 72 65 6d 6f 74 65 43 6f 6e 6e 65 63 74 69 6f 6e 20 3d 20 73 5f 52 65 6d 6f 74 65 43 6f 6e 6e .remoteConnection.=.s_RemoteConn
28920 65 63 74 69 6f 6e 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 61 6e 61 67 65 72 ection,..................manager
28940 53 74 61 74 65 20 3d 20 73 5f 4d 61 6e 61 67 65 72 2e 53 61 76 65 53 74 61 74 65 28 29 2c 0d 0a State.=.s_Manager.SaveState(),..
28960 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 6d 6f 74 69 6e 67 53 74 61 74 65 20 3d 20 ................remotingState.=.
28980 73 5f 52 65 6d 6f 74 65 3f 2e 53 61 76 65 53 74 61 74 65 28 29 20 3f 3f 20 6e 65 77 20 49 6e 70 s_Remote?.SaveState().??.new.Inp
289a0 75 74 52 65 6d 6f 74 69 6e 67 2e 53 65 72 69 61 6c 69 7a 65 64 53 74 61 74 65 28 29 2c 0d 0a 20 utRemoting.SerializedState(),...
289c0 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 45 44 49 54 4f 52 0d ...............#if.UNITY_EDITOR.
289e0 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 75 73 65 72 53 65 74 74 69 6e 67 73 20 3d 20 .................userSettings.=.
28a00 49 6e 70 75 74 45 64 69 74 6f 72 55 73 65 72 53 65 74 74 69 6e 67 73 2e 73 5f 53 65 74 74 69 6e InputEditorUserSettings.s_Settin
28a20 67 73 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 79 73 74 65 6d 4f 62 6a 65 63 gs,..................systemObjec
28a40 74 20 3d 20 4a 73 6f 6e 55 74 69 6c 69 74 79 2e 54 6f 4a 73 6f 6e 28 73 5f 53 79 73 74 65 6d 4f t.=.JsonUtility.ToJson(s_SystemO
28a60 62 6a 65 63 74 29 2c 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 bject),..................#endif.
28a80 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 .............});................
28aa0 52 65 73 65 74 28 65 6e 61 62 6c 65 52 65 6d 6f 74 69 6e 67 2c 20 72 75 6e 74 69 6d 65 20 3f 3f Reset(enableRemoting,.runtime.??
28ac0 20 49 6e 70 75 74 52 75 6e 74 69 6d 65 2e 73 5f 49 6e 73 74 61 6e 63 65 29 3b 20 2f 2f 20 4b 65 .InputRuntime.s_Instance);.//.Ke
28ae0 65 70 20 63 75 72 72 65 6e 74 20 72 75 6e 74 69 6d 65 2e 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a ep.current.runtime...........}..
28b00 0d 0a 20 20 20 20 20 20 20 20 2f 2f 2f 2f 46 49 58 4d 45 3a 20 74 68 69 73 20 6d 65 74 68 6f 64 ..........////FIXME:.this.method
28b20 20 64 6f 65 73 6e 27 74 20 72 65 73 74 6f 72 65 20 74 68 69 6e 67 73 20 6c 69 6b 65 20 49 6e 70 .doesn't.restore.things.like.Inp
28b40 75 74 44 65 76 69 63 65 44 65 62 75 67 67 65 72 57 69 6e 64 6f 77 2e 6f 6e 54 6f 6f 6c 62 61 72 utDeviceDebuggerWindow.onToolbar
28b60 47 55 49 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 GUI..........///.<summary>......
28b80 20 20 20 20 2f 2f 2f 20 52 65 73 74 6f 72 65 20 74 68 65 20 73 74 61 74 65 20 6f 66 20 74 68 65 ....///.Restore.the.state.of.the
28ba0 20 73 79 73 74 65 6d 20 66 72 6f 6d 20 74 68 65 20 6c 61 73 74 20 73 74 61 74 65 20 70 75 73 68 .system.from.the.last.state.push
28bc0 65 64 20 77 69 74 68 20 3c 73 65 65 20 63 72 65 66 3d 22 53 61 76 65 41 6e 64 52 65 73 65 74 22 ed.with.<see.cref="SaveAndReset"
28be0 2f 3e 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 />...........///.</summary>.....
28c00 20 20 20 20 20 69 6e 74 65 72 6e 61 6c 20 73 74 61 74 69 63 20 76 6f 69 64 20 52 65 73 74 6f 72 .....internal.static.void.Restor
28c20 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 20 44 65 62 75 e()..........{..............Debu
28c40 67 2e 41 73 73 65 72 74 28 73 5f 53 61 76 65 64 53 74 61 74 65 53 74 61 63 6b 20 21 3d 20 6e 75 g.Assert(s_SavedStateStack.!=.nu
28c60 6c 6c 20 26 26 20 73 5f 53 61 76 65 64 53 74 61 74 65 53 74 61 63 6b 2e 43 6f 75 6e 74 20 3e 20 ll.&&.s_SavedStateStack.Count.>.
28c80 30 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4e 75 6b 65 20 77 68 61 74 20 0);................//.Nuke.what.
28ca0 77 65 20 68 61 76 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 44 65 73 74 72 6f 79 28 29 3b we.have...............Destroy();
28cc0 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4c 6f 61 64 20 62 61 63 6b 20 70 72 65 ................//.Load.back.pre
28ce0 76 69 6f 75 73 20 73 74 61 74 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 61 72 20 73 74 vious.state...............var.st
28d00 61 74 65 20 3d 20 73 5f 53 61 76 65 64 53 74 61 74 65 53 74 61 63 6b 2e 50 6f 70 28 29 3b 0d 0a ate.=.s_SavedStateStack.Pop();..
28d20 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 4d 61 6e 61 67 65 72 20 3d 20 73 74 61 74 65 2e 6d 61 ............s_Manager.=.state.ma
28d40 6e 61 67 65 72 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 52 65 6d 6f 74 65 20 3d 20 73 nager;..............s_Remote.=.s
28d60 74 61 74 65 2e 72 65 6d 6f 74 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 52 65 6d 6f tate.remote;..............s_Remo
28d80 74 65 43 6f 6e 6e 65 63 74 69 6f 6e 20 3d 20 73 74 61 74 65 2e 72 65 6d 6f 74 65 43 6f 6e 6e 65 teConnection.=.state.remoteConne
28da0 63 74 69 6f 6e 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 49 6e 70 75 74 55 70 64 61 74 ction;................InputUpdat
28dc0 65 2e 52 65 73 74 6f 72 65 28 73 74 61 74 65 2e 6d 61 6e 61 67 65 72 53 74 61 74 65 2e 75 70 64 e.Restore(state.managerState.upd
28de0 61 74 65 53 74 61 74 65 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 4d 61 6e 61 ateState);................s_Mana
28e00 67 65 72 2e 49 6e 73 74 61 6c 6c 52 75 6e 74 69 6d 65 28 73 5f 4d 61 6e 61 67 65 72 2e 6d 5f 52 ger.InstallRuntime(s_Manager.m_R
28e20 75 6e 74 69 6d 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 5f 4d 61 6e 61 67 65 72 2e untime);..............s_Manager.
28e40 49 6e 73 74 61 6c 6c 47 6c 6f 62 61 6c 73 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 InstallGlobals();..............s
28e60 5f 4d 61 6e 61 67 65 72 2e 41 70 70 6c 79 53 65 74 74 69 6e 67 73 28 29 3b 0d 0a 0d 0a 20 20 20 _Manager.ApplySettings();.......
28e80 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 20 20 20 20 20 .........#if.UNITY_EDITOR.......
28ea0 20 20 20 20 20 20 20 49 6e 70 75 74 45 64 69 74 6f 72 55 73 65 72 53 65 74 74 69 6e 67 73 2e 73 .......InputEditorUserSettings.s
28ec0 5f 53 65 74 74 69 6e 67 73 20 3d 20 73 74 61 74 65 2e 75 73 65 72 53 65 74 74 69 6e 67 73 3b 0d _Settings.=.state.userSettings;.
28ee0 0a 20 20 20 20 20 20 20 20 20 20 20 20 4a 73 6f 6e 55 74 69 6c 69 74 79 2e 46 72 6f 6d 4a 73 6f .............JsonUtility.FromJso
28f00 6e 4f 76 65 72 77 72 69 74 65 28 73 74 61 74 65 2e 73 79 73 74 65 6d 4f 62 6a 65 63 74 2c 20 73 nOverwrite(state.systemObject,.s
28f20 5f 53 79 73 74 65 6d 4f 62 6a 65 63 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 23 65 6e _SystemObject);..............#en
28f40 64 69 66 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 47 65 74 20 64 65 76 69 63 65 dif................//.Get.device
28f60 73 20 74 68 61 74 20 6b 65 65 70 20 67 6c 6f 62 61 6c 20 6c 69 73 74 73 20 28 6c 69 6b 65 20 47 s.that.keep.global.lists.(like.G
28f80 61 6d 65 70 61 64 29 20 74 6f 20 72 65 2d 69 6e 69 74 69 61 6c 69 7a 65 20 74 68 65 6d 0d 0a 20 amepad).to.re-initialize.them...
28fa0 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 62 79 20 70 72 65 74 65 6e 64 69 6e 67 20 74 68 65 20 ...........//.by.pretending.the.
28fc0 64 65 76 69 63 65 73 20 68 61 76 65 20 62 65 65 6e 20 61 64 64 65 64 2e 0d 0a 20 20 20 20 20 20 devices.have.been.added.........
28fe0 20 20 20 20 20 20 66 6f 72 65 61 63 68 20 28 76 61 72 20 64 65 76 69 63 65 20 69 6e 20 64 65 76 ......foreach.(var.device.in.dev
29000 69 63 65 73 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 64 65 76 69 63 65 2e 4e 6f ices)..................device.No
29020 74 69 66 79 41 64 64 65 64 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 23 65 6e 64 69 tifyAdded();..........}....#endi
29040 66 0d 0a 20 20 20 20 7d 0d 0a 7d 0d 0a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f......}..}.....................
29060 00 00 00 00 0b 00 00 00 49 6e 70 75 74 53 79 73 74 65 6d 00 17 00 00 00 55 6e 69 74 79 45 6e 67 ........InputSystem.....UnityEng
29080 69 6e 65 2e 49 6e 70 75 74 53 79 73 74 65 6d 00 ine.InputSystem.