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.
- Import
Tool.unitypackage
to your unity project, and your unity must support .NET Framework 3.5. You can setScripting Runtime Version
to change .NET version in configuration of playersettings.
- You can seet that
InputSetting
andPlugin
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.
class in PaperGmaeStudio.Controller
- First, you must use
NintendoJoyconManager.Init()
in scripts to initialize the nintendojoycon manager. NintendoJoyconManager will automatically generate on the scene.
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.
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);
}
}
This tool have support for the following button events.