36 lines
863 B
C#
36 lines
863 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class Test : MonoBehaviour
|
|
{
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
#region 测试代码
|
|
if (Input.GetKey(KeyCode.W))
|
|
{
|
|
transform.Translate(new Vector3(0, 0, 1) * Time.deltaTime);
|
|
}
|
|
else if (Input.GetKey(KeyCode.S))
|
|
{
|
|
transform.Translate(new Vector3(0, 0, -1) * Time.deltaTime);
|
|
}
|
|
else if (Input.GetKey(KeyCode.A))
|
|
{
|
|
transform.Translate(new Vector3(-1, 0, 0) * Time.deltaTime);
|
|
}
|
|
else if (Input.GetKey(KeyCode.D))
|
|
{
|
|
transform.Translate(new Vector3(1, 0, 0) * Time.deltaTime);
|
|
}
|
|
#endregion
|
|
}
|
|
}
|