📅  最后修改于: 2022-03-11 14:49:13.054000             🧑  作者: Mango
public class LinearTrasnformation : MonoBehaviour {
public GameObject cube1, cube2;
// Use this for initialization
void Start () {
//cube1.transform.position = new Vector3 (cube1.transform.position.x,cube1.transform.position.y,cube1.transform.position.z);
}
// Update is called once per frame
void Update () {
if(Input.GetKey(KeyCode.UpArrow)){
cube1.transform.position = Vector3.Lerp (cube2.transform.position,cube1.transform.position,0.5f*Time.deltaTime);
}
}
}