📜  在两个 vector3 之间很好地转换 - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:13.054000             🧑  作者: Mango

代码示例1
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);
        }
    }
}