Input (入力) 設定 (Edit > Project Settings の順に移動してから Input カテゴリを選択) を使用して 入力軸とゲーム動作を定義 します。
入力軸を追加するには、Size プロパティの値を増やします。
各入力軸には以下のプロパティがあります。
プロパティ | 機能 | |
---|---|---|
Name | ゲームランチャーやスクリプトを通して、軸を参照する文字列を入力します。 | |
Descriptive Name | ゲームランチャーに表示される Positive Button 関数の詳細な定義を入力します。 | |
Descriptive Negative Name | ゲームランチャーに表示される Negative Button 関数の詳細な定義を入力します。 | |
Negative Button | 軸に負の値を送信するボタンの名前を入力します。 | |
Positive Button | 軸に正の値を送信するボタンの名前を入力します。 | |
Alt Negative Button | 軸に負の値を送信する代替ボタンの名前を入力します。 | |
Alt Positive Button | 軸に正の値を送信する代替ボタンの名前を入力します。 | |
Gravity | 入力の再センタリングの速さを設定します。このプロパティは、Type が Key or Mouse Button の場合にのみ適用されます。 | |
Dead | 指定した数値未満の正や負の値は 0 として認識されます。ジョイスティックに便利です。 | |
Sensitivity | キーボード入力の場合、この値を大きくすると、応答時間が速くなります。値が低いと、より滑らかになります。マウス移動の場合、この値によって実際のマウスの移動差分がスケールされます。 | |
Snap | 有効にすると、反対の入力を受け取った直後に、軸の値が 0 にリセットされます。このプロパティは、Type が Key or Mouse Button の場合にのみ適用されます。 | |
Invert | これを有効にすると、正のボタンが負の値を軸に送信、また、その逆を行います。 | |
Type | この軸がどんな種類の入力を取得するかを選択します。 | |
Key/Mouse Button | 任意のボタン | |
Mouse Movement | マウスのデルタとスクロールホイール | |
Window Movement | ユーザーがウィンドウを揺さぶること | |
Joystick Axis | アナログジョイスティックの軸 | |
Axis | デバイスからの入力軸 (ジョイスティック、マウス、ゲームパッドなど) を選択します。デフォルトは X 軸です。 | |
Joy Num | 使用するジョイスティックを選択します。デフォルトでは、すべてのジョイスティックからの入力を受け付けます。 ノート: これは入力軸にのみ使用され、ボタンには使用されません。 |
Input 設定で設定したすべての軸には 2 つの目的があります。
定義された軸はすべてゲームランチャーに表示され、そこでは、各軸の名前、詳細な説明、デフォルトのボタンが表示されます。ここから、軸で定義されたどのボタンでも変更することができます。したがって、ゲームのボタンをカスタマイズしたいプレイヤーのために、個々のボタンではなく、軸を使用するようなスクリプトを作成すると良いでしょう。
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.