お知らせ

アセットは別ページに分割しました。

概要

  • Input Manager
  • Input System

参考:

一般的なゲーム入力 | Unity 2018.4 マニュアル [公式]

入力 | Unity マニュアル [公式]

使い方

参考:

新しい Input System の使い方 | テラシュールブログ

新しい Input System を動かしてみた | simplestar の技術ブログ

新しい Input System のご紹介 | Unity Technologies Blog [公式]

導入

参考:

キーボードからの入力を判定する | かめくめ

Input で入力を扱う – Qiita

ゲームパッドから複数入力を受け取る方法まとめ | 稲枝の押入れ

ゲームパッドでゲームを動かそう | Unity インターハイブログ

ゲームパッド/コントローラを使う方法 | ねくすとねくすと

Input Manager

メソッド
  • GetKeyDownキーの押下を検出する
  • GetKeyUpキーの上昇を検出する
  • GetKeyキーの押下状態を検出する
  • GetMouseButtonDownマウスボタンの押下を検出する
  • GetMouseButtonUpマウスボタンの上昇を検出する
  • GetMouseButtonマウスボタンの押下状態を検出する
  • GetAxis仮想ジョイスティック軸の現在の位置を返す
  • GetAxisRaw仮想ジョイスティック軸の平滑化されていない生の値を返す
設定
  • Nameスクリプトから使用する名前
  • Descriptive Name軸の説明的な名前/正方向
  • Descriptive Negative Name軸の説明的な名前/負方向
  • Negative Button負方向のボタン
  • Positive Button正方向のボタン
  • Alt Negative Button負方向の副ボタン
  • Alt Positive Button正方向の副ボタン
  • Gravity重力 (入力を中心に戻す速さ/単位ユニット毎秒)
  • Deadアナログスティックのソフトウェア的な遊び (閾値以上の場合に入力ありとみなす)
  • Sensitivity感度 (デジタル入力における入力の最大値、またはマウス移動のスケール/単位ユニット毎秒)
  • Snapスナップ (有効にすると逆入力で即座に入力値をゼロにリセットする)
  • Invert反転 (有効にすると入力の正負が反転する)
  • Type入力のタイプ
    • Key or Mouse Buttonボタン入力
    • Mouse Movementマウスの移動、またはスクロールホイール
    • Joystick Axisジョイスティック入力
  • Axis入力軸
    • X axisX 軸入力
    • Y axisY 軸入力
    • 3rd axisスクロールホイール
    • 4th axis ~ 28th axisその他の軸
  • Joy Num入力軸を受け付けるジョイスティックの指定
    • Get Motion from all Joysticks全てのジョイスティックからの入力
    • Joystick 1 ~ Joystick 16指定した番号のジョイスティックからの入力
メニュー

項目を右クリックして表示されるメニューから項目のコピー/削除ができる。

  • Duplicate Array Element項目を複製する
  • Delete Array Element項目を削除する
ボタン名
  • 文字キーabc、…
  • 数字キー (フルキーボード)123、…
  • テンキー[0][1][2][3]、…、[9][.][/][-][+][=][equals][enter]
  • 矢印キーleftrightupdown
  • 修飾キーleft shiftright shiftleft ctrlright ctrlleft altright altleft cmdright cmd
  • 特殊キーtabescapespacebackspacereturndeleteinserthomeendpage uppage down
  • ファンクションキーf1f2、…、f15
  • マウスボタンmouse 0mouse 1mouse 2
  • 全てのジョイスティックjoystick button 0joystick button 1、…
  • 特定のジョイスティックjoystick 1 button 0joystick 1 button 1、…

参考:

Input クラスの GetKey 系と GetButton 系のどっちを使えば良いの?を調べてみた – Qiita

キーボード/マウス | yttm-work

ゲーム用コントローラーに対応する | かめくめ

Unity の Input Manager の使い方 | ゲームの作り方!

Input Manager の使い方まとめ/PS3 や PS4 のコントローラの入力を取得しよう | おもちゃラボ

Get list of Axes? – Unity Answers

ドキュメント:

Input Manager | Unity マニュアル [公式]

KeyCode | Unity スクリプトリファレンス [公式]

コード:

IMGUI/Event.cs at 61f92bd79a · Unity-Technologies/UnityCsReference – GitHub

マウス入力

参考:

マウス入力を扱う | TASOGARE GAMES BLOG

マウス入力の取得方法 | TECH PROjin

Mouse 入力 (Event / OnMouse / Input) | Unity な日々

GetMouseButtonDown – マウスクリックを検知する方法は? | XR-Hub

マウスが左/右クリックされたときの処理を設定できるメソッド | Unishar

1分でわかる!マウス関連する 3つのメソッド | Unishar

Input.GetMouseButtonDown | Unity スクリプトリファレンス [公式]

Input System

ドキュメント:

Input System | Unity マニュアル [公式]

Input System | Unity Manual [Official]

Quick Start Guide | Input System 1.1 Manual [Official]

How do I…? | Input System 1.1 Manual [Official]

Migrating from the old input system | Input System 1.1 Manual [Official]

Supported Input Devices | Input System 1.1 Manual [Official]

リンク:

新入力システム Input System を使おう | Unity for Pro [公式]

Introducing the new Input System | Unity Blog [Official]

学習:

セットアップ – Input System | Unity Learn [公式]

参考:

Input System を用いた入力処理の実装 | かいなり

Input System を用いて入力を取得する | aruk

Input Action

ドキュメント:

Actions | Input System 1.19 Manual [Official]

Input Action Assets | Input System 1.19 Manual [Official]

参考:

Player Input を用意しなくても Input Action Asset の入力を取得できる話 – Qiita

Input Action について | 初心者プログラマー

Input Action – 基本的な使い方 | ねこじゃらシティ

Input Action – 3種類のコールバック挙動 | ねこじゃらシティ

Input System の Action が反応しない問題 – Qiita

Xbox One Controller

(出典Xbox Support

Xbox ボタン (図中 5 のボタン) を 2 秒間押し続ける電源を入れる

Xbox ボタン (図中 5 のボタン) を 6 秒間押し続ける電源を切る

ワイヤレス割り当て ボタン (図中 13 のボタン)Bluetooth 接続のペアリングを開始する

参考:

ゲームパッドからの入力したいからまとめてみる | はこねのはこ

XBOX コントローラの左右トリガー入力を別々に取得する – Qiita

HoloLens で Xbox One 用のゲームパッドを使う | littlewing

HoloLens と Unity Editor で簡単に Xbox コントローラーを動作させる | なんかいろいろしてみます

Using an Xbox One Controller with Unity on Windows 10 | Building Blocks

Xbox One ワイヤレス コントローラーの概要 | Xbox Support [公式]

Xbox ワイヤレス コントローラーを Windows デバイスに接続する | Xbox Support [公式]

Xbox ワイヤレス コントローラーでの Bluetooth による接続と問題解決 | Xbox Support [公式]

Xbox ワイヤレス コントローラーの問題解決 | Xbox Support [公式]

ゲームパッドの接続/切断

参考:

ゲームパットの接続/切断時に通知を出してあげる | まともな開発者になりたい

Input.GetJoystickNames | Unity スクリプトリファレンス [公式]

How to correctly reconnect turned off gamepad using new input system? – Unity Answers

iOS Game Controller

参考:

iOS Game Controller への対応 | Unity マニュアル [公式]

WebGL

参考:

WebGL での入力 | Unity マニュアル [公式]

WebGL のブラウザー間での互換性 | Unity マニュアル [公式]

Input in WebGL | Unity Manual [Official]

WebGL Browser Compatibility | Unity Manual [Official]

Does Unity WebGL support Xbox One controllers? – Unity Answers

キーの同時入力を判定する

参考:

Check For Input Combo – Unity Forum

How can I get a combination of keys pressed? – Unity Answers

Detect only a specific Keyboard combination in Unity – Stack Overflow

KeyCode

参考:

KeyCode | Unity スクリプトリファレンス [公式]

モバイル (Mobile)

参考:

モバイル端末の入力 | Unity 2018.4 マニュアル [公式]

Cross Platform Input

参考:

Cross Platform Input を使ってみる – Qiita

Cross Platform Input Manager の使い方 | yamagablog

Cross Platform Input を使う #1 Import 編 | 陰干し中のゲーム開発メモ

Cross Platform Input deprecated? – Unity Forum

How can I use Cross Platform Input in Unity 2019? – Game Development Stack Exchange

ゲームパッドが反応/認識しない

参考:

Controller bindings not working after build – Unity Forum

Input Actions が保存されない

参考:

Project-wide Input Actions are not auto-saved when closing the Project Settings window | Unity Issue Tracker [Official]

New input map is not saved – Unity Discussions [Official]

Custom Input Actions Added to Input System Package Not Saving? – reddit

チュートリアル

Input Action Editor (Official)

Scripting (Official)

How to Convert Input Manager to Input System (Code Monkey)

Standard Input for Cross Platform (Nested Mango)

Introducing the New Input System (Official)

God Touch

リポジトリ:

okamura0510/GodTouch: God Touch – Unity エディタ上でタッチの動作を確認できる – GitHub

参考:

God Touch – エディタ上でタッチの動作を確認できる | てんぷら王国

Unity で iOS / Android / Editor の共通タッチ処理を実装する – Qiita

記事をシェアする:
タグ:

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

Protected by reCAPTCHA