|
|
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
-
- public class TestMoveController : MonoBehaviour
- {
- public float speed = 100f;
-
- void Update ()
- {
- if (Input.GetKey(KeyCode.S) || Input.GetKey(KeyCode.DownArrow))
- transform.Translate(Vector3.right * Time.deltaTime * speed);
- if (Input.GetKey(KeyCode.A) || Input.GetKey(KeyCode.LeftArrow))
- transform.Translate(Vector3.back * Time.deltaTime * speed);
- if (Input.GetKey(KeyCode.W) || Input.GetKey(KeyCode.UpArrow))
- transform.Translate(Vector3.left * Time.deltaTime * speed);
- if (Input.GetKey(KeyCode.D) || Input.GetKey(KeyCode.RightArrow))
- transform.Translate(Vector3.forward * Time.deltaTime * speed);
- }
- }
|