Created
January 7, 2015 15:49
-
-
Save kazuooooo/a1ba3dc7d52d31d8f3cf to your computer and use it in GitHub Desktop.
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; | |
| using System.Collections; | |
| public class KeyCodePra : MonoBehaviour { | |
| // Use this for initialization | |
| void Start () { | |
| } | |
| // Update is called once per frame | |
| void Update () { | |
| if (Input.GetKey (KeyCode.UpArrow)) { | |
| transform.Translate (transform.forward * 0.1f); | |
| } | |
| if (Input.GetKey (KeyCode.DownArrow)) { | |
| transform.Translate (transform.forward * -0.1f); | |
| } | |
| if (Input.GetKey (KeyCode.RightArrow)) { | |
| transform.Translate (transform.right * 0.1f); | |
| } | |
| if (Input.GetKey (KeyCode.LeftArrow)) { | |
| transform.Translate (transform.right * -0.1f); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment