memomem

備忘録・メモ置き場

UnityでSwitchのJoyconを使う

baba-s.hatenablog.com

github.com

JoyconLib をPackageManagerよりインストールする。Wiimoteも自動でインポートされる。

JoyconLib_scripts/JoyconManager.cs をGameObjectに付ける。

JoyconDemo.cs をGameOjectに付ける。

2018.4.10 では「.Net 4.x Equivalent」ではFormatException: Input string was not in a correct format. エラーがでる。その場合、PlayerSettingsより「.Net 3.5 Equivalent」を選択する。

.Net 4.x でもエラーが起きている箇所をコメントアウトまたは下記に変更することで問題なく動作する

Debug.Log(string.Format("Stick x: {0:N} Stick y: {1:N}", j.GetStick()[0], j.GetStick()[1]));

その他、参考

PCとの接続

hyperts.net