Coder Social home page Coder Social logo

inputmanager's Introduction

Introduction

InputManager is a custom input manager for Unity that allows you to rebind keys at runtime and abstract input devices(through input configurations) for cross platform input.

Features

  • Very simple to implement. It has the same public methods and variables as Unity's Input class
  • Allows you to customize key bindings at runtime
  • Allows you to convert touch input to axes and buttons on mobile devices
  • Save the key bindings to a file, to PlayerPrefs or anywhere else by implementing a simple interface
  • Seamless transition from keyboard to gamepad with the InputAdapter addon
  • Works with the new Unity 4.6 UI system

Platforms

Compatible with Windows 7, Windows 8 Desktop, Windows 8 Store, Linux, Mac OSX, WebPlayer and Android(not tested on iOS but it might work). Requires the latest version of Unity.

Getting Started

For detailed information on how to get started with this plugin visit the Wiki.

API

The InputManager class provides the following methods and variables, in addition to the ones provided by Unity's Input class:

  • Instance - Use it to check if a InputManager instance exists in the game or to subscribe to the event handlers
  • CurrentConfiguration - A reference to the current input configuration used by the InputManager
  • IsScanning - Use this to check if a scan is already running before starting a new one
  • AnyInput - Returns true if any button or axis is used
  • SetRemoteAxisValue - Allows you to manually set the value of an axis, if the respective axis is of type RemoteAxis
  • SetRemoteButtonValue - Allows you to manually set the state of a button, if the respective button is of type RemoteButton
  • Reinitialize
  • SetInputConfiguration - Switch to another input configuration
  • GetInputConfiguration - Gets a reference to an input configuration
  • CreateInputConfiguration - Allows you to create input configurations at runtime
  • DeleteInputConfiguration - Allows you to delete input configurations at runtime
  • GetAxisConfiguration - Gets a reference to an axis configuration
  • CreateButton - Allows you to create axis configurations at runtime
  • CreateDigitalAxis - Allows you to create axis configurations at runtime
  • CreateMouseAxis - Allows you to create axis configurations at runtime
  • CreateAnalogAxis - Allows you to create axis configurations at runtime
  • CreateAnalogButton - Allows you to create axis configurations at runtime
  • CreateRemoteAxis - Allows you to create axis configurations at runtime
  • CreateRemoteButton - Allows you to create axis configurations at runtime
  • CreateEmptyAxis - Allows you to create axis configurations at runtime
  • DeleteAxisConfiguration - Allows you to delete axis configurations at runtime
  • StartKeyScan - Scans for keyboard keys, mouse buttons and joystick buttons
  • StartMouseAxisScan - Scans for mouse axes. To change a mouse axis when you get the result from StartMouseAxisScan use AxisConfiguraton.SetMouseAxis
  • StartJoystickAxisScan - Scans for joystick axes. To change a joystick axis when you get the result from StartJoystickAxisScan use AxisConfiguration.SetAnalogAxis
  • StartScan - Scans for multiple input types(keyboard keys, joystick buttons, joystick axes, etc) at the same time
  • CancelScan
  • Save - Saves the input configurations to a file(XML by default). Create a class that implements IInputSaver for custom formats
  • Load - Loads input configurations from a file(XML by default). Create a class that implements IInputLoader for custom formats

Visit the Wiki for more scripting tutorials.

Addons

Input Adapter

This addon manages keyboard and XBox controller input and features seamless transition between one and the other during play time.

Joystick Mapping

This addon allows you to map joystick buttons to key codes and axes.

UI Input Modules

Custom standalone input module for the new UI system in Unity 4.6. If you are using a Unity version lower than 4.6 don't import this addon.

For more information about the addons visit the Wiki.

License

This software is released under the MIT license. You can find a copy of the license in the LICENSE file included in the InputManager source distribution.

inputmanager's People

Contributors

daemon3000 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.