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
- Host: GitHub
- URL: https://github.com/destiny5420/nintendo-joycon-patch
- Owner: destiny5420
- Created: 2019-06-15T06:35:30.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-06-25T16:45:22.000Z (about 7 years ago)
- Last Synced: 2024-11-13T10:02:38.626Z (over 1 year ago)
- Topics: joycon, nintendo-switch, unity3d
- Language: C#
- Size: 1.45 MB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.