Git Product home page Git Product logo

cs6457's Introduction

CS6457

This Repository contains the input manager to make setting up and using game controllers easy to use with Unity in Windows and Mac OSx environment. Linux support has also been added. But Dpad controls are supported only for wired controllers on Linux. For Mac OSx Dpad values will be returned as a float value. The values will -1 for left, 1 for right, -1 for up and 1 for down. This is done to match the way Windows reads the data for Dpad.

  1. There is an InputManager.asset file which has to be copied to the following path under "Unity_project"/ProjectSettings.

  2. ControlInputWrapper.cs script file needs to be put in your Assets folder. ControlInputWrapper is a static class which contains helper functions to get control data from a XBox controller.

    Functions:

    a. GetButtonDown Given a button name and joystick number returns true or false on key down. Joystick number is optional. Default value is 0 which selects data from All joystick.

    b. GetButtonUp Given a button name and joystick number returns true or false on key up. Joystick number is optional. Default value is 0 which selects data from All joystick.

    c. GetButton Given a button name and joystick number returns true or false. Joystick number is optional. Default value is 0 which selects data from All joystick.

    d. GetAxis Given an axis name returns the float value of that axis. Setting optional parameter rawInput to true allows fetching of data using GetAxisRaw.

    e. GetTrigger Given a trigger name returns the float value of that axis. Setting optional parameter rawInput to true allows fetching of data using GetAxisRaw.

    f. GetKeyCode Given a button name and joystick number returns the KeyCode relevant to the operating system.

cs6457's People

Contributors

virtuahost avatar

Watchers

 avatar  avatar  avatar

cs6457's Issues

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.