using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class TestKey : MonoBehaviour {
public TextMesh t;
// Use this for initialization
void Start () {
t = this.GetComponent<TextMesh>();
}
// Update is called once per frame
void Update () {
if (Input.GetKey(KeyCode.A))
{
ergodicEnum1();
}
}
private void ergodicEnum1()
{
foreach (KeyCode suit in Enum.GetValues(typeof(KeyCode)))
{
Debug.Log((int)suit + ":" + suit);
}
}
}
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class TestKey : MonoBehaviour {
public TextMesh t;
// Use this for initialization
void Start () {
t = this.GetComponent<TextMesh>();
}
// Update is called once per frame
void Update () {
//if (Input.GetKey(KeyCode.A))
//{
ergodicEnum1();
//}
}
private void ergodicEnum1()
{
foreach (KeyCode suit in Enum.GetValues(typeof(KeyCode)))
{
if (Input.GetKeyDown(suit))
{
Debug.Log((int)suit + ":" + suit);
t.text = (int)suit + ":" + suit;
}
}
}
}