Skip to content

UPM package which imports a json string exported from PadCrafter.com into a Unity InputSystem InputActionAsset

License

Notifications You must be signed in to change notification settings

darbotron/PadCrafterJsonImporter

Repository files navigation

PadCrafterJsonImporter

UPM package which imports a json string exported from PadCrafter.com into a Unity InputSystem InputActionAsset

Installing

You can:

Using the importer

Once you've installed the package into your project.

  • go to https://www.padcrafter.com/ and either make a control scheme or choose one of the examples from the dropdown
  • using the 'Options' dropdown choose 'Export as JSON'
  • in the 'Export as JSON' window click the 'Copy to clipboard' button
  • in Unity open the importer from the Unity menu Darbotron -> PadCrafter Json Importer
  • the Padcrafter Json Importer window should now appear
  • click the 'Import Padcrafter Json from Clipboard' button...
  • the json you exported should appear in the text area of the importer window (or an error if something went wrong)
  • assuming there was no error you can click the 'Generate Input Action Asset' button...
  • this will cause a system standard save panel to appear allowing you to choose where to save your asset and what to call it
  • (NOTE: if you try to save outside your project's root folder this will currently cause undefined behaviour)
  • once you've saved the InputActionAsset you should be able to open it & edit it with the normal Unity InputSystem editor

Notes

  • this importer does nothing magic!
  • there is no perfect 1:1 correspondence from PadCrafter to an InputActionAsset
  • you will almost certainly have to manually edit the InputActionAsset it creates
  • what the importer does
  • each Controller Scheme tab from PadCrafter maps to an InputSystem ActionMap
  • each control with a name / description will create an InputSystem Action in that ActionMap
  • the binding paths for each Action will match the button on the Control Scheme
  • other points of note
  • only creates InputActions for named/described PadCrafter controls
  • uses the PadCrafter name/description strings verbatim
  • assigns default InputActionType of InputActionType.Value to Sticks, everything else is InputActionType.Button

Support

This importer was made out of the goodness of my heart for free so I will not be supporting it! The package is licensed under the MIT license see https://opensource.org/license/mit/

Good luck & have fun!

About

UPM package which imports a json string exported from PadCrafter.com into a Unity InputSystem InputActionAsset

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages