Created
April 26, 2018 03:15
-
-
Save ninpl/15733c2bf71da825f39a5e1f124efe8b to your computer and use it in GitHub Desktop.
Detectar cualquier tecla o botón presionado. Unity3D.
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
| #region Librerias | |
| using UnityEngine; | |
| using System; | |
| #endregion | |
| namespace MoonAntonio | |
| { | |
| public class UDetectKey : MonoBehaviour | |
| { | |
| private void Update() | |
| { | |
| DeteccionTeclaBtnPresionada(); | |
| } | |
| public void DeteccionTeclaBtnPresionada() | |
| { | |
| foreach (KeyCode kcode in Enum.GetValues(typeof(KeyCode))) | |
| { | |
| if (Input.GetKeyDown(kcode)) Debug.Log("KeyCode down: " + kcode); | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment