Skip to content

Latest commit

 

History

History
78 lines (65 loc) · 2.6 KB

README.md

File metadata and controls

78 lines (65 loc) · 2.6 KB

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.
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);
    }
}

NINTENDO_KEY_TYPE

This tool have support for the following button events.