An open API service indexing awesome lists of open source software.

https://github.com/destiny5420/nintendo-joycon-patch


https://github.com/destiny5420/nintendo-joycon-patch

joycon nintendo-switch unity3d

Last synced: about 1 year ago
JSON representation

Awesome Lists containing this project

README

          

# Nintendo Joycon Patch
The repository is custom tool that can help developer pair Nintendo joy-con easily. If you would like to use this tool, selecting latest version at tag.
## How to use this tool
* Import `Tool.unitypackage` to your unity project, and your unity must support .NET Framework 3.5. You can set `Scripting Runtime Version` to change .NET version in configuration of playersettings.





* You can seet that `InputSetting` and `Plugin` folder appear in the project.





* Open Project Settings panel in the edit menu and select Input option. Then left click in preset button on upper right corner.





* Select `NintendoInputManagerAssets`, Input axes will become a custom setting for up to 4 player.





## NintendoJoyconManager
`class in PaperGmaeStudio.Controller`


* First, you must use `NintendoJoyconManager.Init()` in scripts to initialize the nintendojoycon manager. NintendoJoyconManager will automatically generate on the scene.
```C#
using UnityEngine;
using PaperGmaeStudio.Controller;

public class NewBehaviourScript : MonoBehaviour
{
void Start()
{
NintendoJoyconManager.Init();
}
}
```




* You need to register callback with manager if you want to capture the button event.
```C#
using UnityEngine;
using PaperGmaeStudio.Controller;

public class DemoScript : MonoBehaviour
{
void Start()
{
NintendoJoyconManager.Init();
NintendoJoyconManager.RegistCallback(NintendoJoyconManager.NINTENDO_KEY_TYPE.Player01_A, OnClick_A_01);
}

void OnClick_A_01(float v_value)
{
Debug.Log("OnClick_A_01 / value: " + v_value);
}
}
```

## NINTENDO_KEY_TYPE
This tool have support for the following button events.