-
-
Save todorok1/5b692276bbf61e7cc35bc7371ab0790a to your computer and use it in GitHub Desktop.
シンプルRPGチュートリアル第36回 ゲーム内のキー入力を定義するクラス
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
namespace SimpleRpg | |
{ | |
/// <summary> | |
/// ゲーム内のキー入力を定義するクラスです。 | |
/// </summary> | |
public static class InputGameKey | |
{ | |
/// <summary> | |
/// 決定ボタンが押されたかどうかを取得します。 | |
/// </summary> | |
public static bool ConfirmButton() | |
{ | |
return Input.GetKeyDown(KeyCode.Return) | |
|| Input.GetKeyDown(KeyCode.Space) | |
|| Input.GetKeyDown(KeyCode.Z); | |
} | |
/// <summary> | |
/// キャンセルボタンが押されたかどうかを取得します。 | |
/// </summary> | |
public static bool CancelButton() | |
{ | |
return Input.GetKeyDown(KeyCode.Escape) | |
|| Input.GetKeyDown(KeyCode.X); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment