There is such a piece of code
while (key == KeyCode.None) { foreach (ControllerPollingInfo info in ReInput.controllers.Keyboard.PollForAllKeys()) { key = info.keyboardKey; } } Suspends when launching Unity to death. He collects data on keystrokes, and, apparently, does it too quickly.
The obvious solutions that occurred to me -
1) to put this piece of code into a separate method and call it in Update - it should seem to hang less. 2) Add cortina with, say,
yield return new WaitFoSeconds 0.25f, 4 polls per second should be enough for the correct polling of the keyboard and should not be heavily suspended.
Does anyone have a simpler and more elegant solution?
keyvariable is always assigned only the last value from the collection. Nafig this cycle is another - it is not clear. What's insideReInput.controllers.Keyboard.PollForAllKeys()is not clear. What do you want to achieve with this is not clear. What is there outside this piece of code (maybe the problem is not exactly in this piece) - it is not clear - Alexey Shimanskykey? What's the point? - Alexey ShimanskyKeyCone.None!Input.anyKeycondition is true if no key is pressed. - JetFly