📜  如何将游戏对象移动到另一个对象 - C# 代码示例

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

代码示例3
// 3D
transform.position = new Vector3(GameObject.Find("Object").transform.position.x, GameObject.Find("Object").transform.position.y, GameObject.Find("Object").transform.position.z);

// 2D
transform.position = new Vector2(GameObject.Find("Object").transform.position.x, GameObject.Find("Object").transform.position.y);