Skip to content

Instantly share code, notes, and snippets.

@kentouemura
Created March 14, 2016 15:37
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save kentouemura/8e492b103c814f8d4842 to your computer and use it in GitHub Desktop.
プレイヤーの操作受け取りクラス
using UnityEngine;
using System.Collections;
/// <summary>
/// プレイヤー操作クラス
/// </summary>
public class PlayerInputHandler : MonoBehaviour
{
/// <summary>
/// 移動コマンド
/// </summary>
[SerializeField]
MoveCommand moveCommand;
/// <summary>
/// 操作
/// </summary>
/// <returns>The handler.</returns>
public PlayerCommand InputHandler()
{
if(Input.GetKey(KeyCode.RightArrow) || Input.GetKey(KeyCode.LeftArrow))
return moveCommand;
return null;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment