表示テーマ
PlayerInput
PlayerInputは入力で使用する型です。下記にゲームコードから利用できる宣言を掲載します。
型の情報
- 名前空間:
NEMEngine - 型:
NEMEngine.PlayerInput(Class)
GetGamepadAxis
csharp
public static float GetGamepadAxis(int playerIndex, GamepadAxis axis)指定ゲームパッドのスティックまたはトリガーの値を取得します。
| 引数 | 型 | 既定値 |
|---|---|---|
playerIndex | int | 必須 |
axis | NEMEngine.GamepadAxis | 必須 |
戻り値:float。
GetGamepadButton
csharp
public static bool GetGamepadButton(int playerIndex, GamepadButton button)ゲームパッドの指定ボタンの押下状態です。
| 引数 | 型 | 既定値 |
|---|---|---|
playerIndex | int | 必須 |
button | NEMEngine.GamepadButton | 必須 |
戻り値:bool。
GetGamepadButtonDown
csharp
public static bool GetGamepadButtonDown(int playerIndex, GamepadButton button)このframeで押されたゲームパッドのボタンを判定します。
| 引数 | 型 | 既定値 |
|---|---|---|
playerIndex | int | 必須 |
button | NEMEngine.GamepadButton | 必須 |
戻り値:bool。
GetGamepadButtonUp
csharp
public static bool GetGamepadButtonUp(int playerIndex, GamepadButton button)このframeで離されたゲームパッドのボタンを判定します。
| 引数 | 型 | 既定値 |
|---|---|---|
playerIndex | int | 必須 |
button | NEMEngine.GamepadButton | 必須 |
戻り値:bool。
GetGamepadIndex
csharp
public static int GetGamepadIndex(int playerIndex)このPlayerへ割り当てられたゲームパッド番号です。
| 引数 | 型 | 既定値 |
|---|---|---|
playerIndex | int | 必須 |
戻り値:int。
GetKey
csharp
public static bool GetKey(int playerIndex, KeyCode key)指定キーが現在押されているかを取得します。
| 引数 | 型 | 既定値 |
|---|---|---|
playerIndex | int | 必須 |
key | NEMEngine.KeyCode | 必須 |
戻り値:bool。
GetKeyDown
csharp
public static bool GetKeyDown(int playerIndex, KeyCode key)このframeで押されたキーを判定します。
| 引数 | 型 | 既定値 |
|---|---|---|
playerIndex | int | 必須 |
key | NEMEngine.KeyCode | 必須 |
戻り値:bool。
GetKeyUp
csharp
public static bool GetKeyUp(int playerIndex, KeyCode key)このframeで離されたキーを判定します。
| 引数 | 型 | 既定値 |
|---|---|---|
playerIndex | int | 必須 |
key | NEMEngine.KeyCode | 必須 |
戻り値:bool。
GetMouseButton
csharp
public static bool GetMouseButton(int playerIndex, int button)指定したマウスボタンが押されているかを取得します。
| 引数 | 型 | 既定値 |
|---|---|---|
playerIndex | int | 必須 |
button | int | 必須 |
戻り値:bool。
GetMouseButtonDown
csharp
public static bool GetMouseButtonDown(int playerIndex, int button)このframeで押したマウスボタンを判定します。
| 引数 | 型 | 既定値 |
|---|---|---|
playerIndex | int | 必須 |
button | int | 必須 |
戻り値:bool。
GetMouseButtonUp
csharp
public static bool GetMouseButtonUp(int playerIndex, int button)このframeで離したマウスボタンを判定します。
| 引数 | 型 | 既定値 |
|---|---|---|
playerIndex | int | 必須 |
button | int | 必須 |
戻り値:bool。
IsAvailable
csharp
public static bool IsAvailable(int playerIndex)Playerの操作機器が利用できるかを調べます。
| 引数 | 型 | 既定値 |
|---|---|---|
playerIndex | int | 必須 |
戻り値:bool。
MaxPlayers
csharp
public const int MaxPlayers同時に扱えるPlayer数の上限です。
操作:読取専用。
定義値:4。
PlayVibration
csharp
public static uint PlayVibration(int playerIndex, float left, float right, float duration, float attack = 0, float release = 0)Playerに割り当てられたゲームパッドを振動させます。
| 引数 | 型 | 既定値 |
|---|---|---|
playerIndex | int | 必須 |
left | float | 必須 |
right | float | 必須 |
duration | float | 必須 |
attack | float | 0 |
release | float | 0 |
戻り値:uint。
StopVibration
csharp
public static void StopVibration(int playerIndex, uint handle)Playerのゲームパッド振動を停止します。
| 引数 | 型 | 既定値 |
|---|---|---|
playerIndex | int | 必須 |
handle | uint | 必須 |
実行時の扱い
Nativeと接続する操作は、Scriptが実行される有効なWorld内で使用します。破棄したGameObjectやComponentへのアクセスは避けてください。設定Snapshotは取得・編集・反映を1組で扱います。