freezy / VisualPinball.Engine

:video_game: Visual Pinball Engine for Unity
https://docs.visualpinball.org
GNU General Public License v3.0
398 stars 62 forks source link

Add support for On Screen Input System buttons #373

Closed jsm174 closed 2 years ago

jsm174 commented 2 years ago

Unity's Input System has support for On Screen Controls. On Screen Controls can simulate device input. For example, an OnScreenButton can trigger a keypress. This is great, but you have to specify which key to listen for.

VPE has Input Actions defined such as Left Flipper. To make it easier to associate an OnScreenButton with Left Flipper, we added a new OnScreenInputSystemButton class. It extends OnScreenButton and uses the first binding found for the specified Action Map / Action.

Here is a video:

https://user-images.githubusercontent.com/1197137/150619707-0b94b843-fe19-48ce-a9b9-5268306e1aee.mp4

In addition, this PR updates the following:

PRs for VPE.PinMame, and VPE.VisualScripting will follow and can only be merged after this PR.

codecov[bot] commented 2 years ago

Codecov Report

Merging #373 (068221f) into master (a89537f) will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #373   +/-   ##
=======================================
  Coverage   84.13%   84.13%           
=======================================
  Files         128      128           
  Lines        6973     6973           
=======================================
  Hits         5867     5867           
  Misses       1106     1106           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update a89537f...068221f. Read the comment docs.

jsm174 commented 2 years ago

I can work on some docs. I don't know if it's bleeding edge. We don't really know how we are going to do a UI yet.

This can be more of a debug thing when testing on mobile devices.