Unityに浮気。 キー入力をとる。
こんな感じのプログラムで、キー入力を取得できるかテスト。
イベントシステムに紐づけた。
取りあえず、期待通りプログラムは終了。
using UnityEngine;
using System.Collections;public class KeyHandler : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
if (Input.GetKey(KeyCode.F))
{
Application.Quit();
}
}
}
ありがとうございました。
キーボードによる操作(1/5):C#ではじめるUnityプログラミング入門