Git Product home page Git Product logo

xboxcontrollerunityintegration's Introduction

XInputDotNet

C# wrapper around XInput, works with any Mono or .NET application (eg. Unity3D).

What is XInput?

XInput is a DirectX API to manage the controllers connected to a PC (the same API is also used on Xbox 360). It allows an Xbox 360 controller to be used on a Windows PC.

What is XInput.NET?

XInput.NET is a .NET library which wraps the functions of XInput. It is different from what you can find inside SlimDX for example because it is designed to be pure CIL. That means you can use it in Unity3D Free (as well as Pro of course). The API was designed to be very similar (if not identical) to the GamePad class from XNA.

Ready to go !

Pre-built binaries are available in the Binaries folder above :

  • XInputDotNetPure.dll, .NET assembly containing the GamePad class
    • You need to add a reference to this one in your C# project for example
  • XInputInterface.dll, utility DLL which makes the calls to XInput
    • You have to copy this one next to your .exe

Examples

Some examples are available in this repository :

  • Binaries/XInputDemo.exe, small console application for the most simple use of the API
    • Tip : use the triggers to test the vibration
  • XInputUnity, Unity 4 project rotating a cube with the pad, awesome stuff I swear
    • Tip : same tip !

Using with Unity

Unity

You can open the XInputUnity from Unity3D to see how it's setup. The main step is to put XInputDotNetPure.dll inside a Assets/Plugins folder (you can create it if missing).

When make a build in Unity, the XInputInterface.dll file won't be properly copied to the build folder, so you have to copy it yourself in the same folder as the executable of your project.

Notes

  • Under Windows XP, you'll need special drivers for your Xbox 360 Controller. You can find them at this address : XBox 360 Controller for Windows Software
  • You'll need the latest DirectX SDK to compile it, the binaries were built with the June 2010 version.

xboxcontrollerunityintegration's People

Contributors

stonneau avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

facybenbook

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.