赞
踩
与物体绑定好:
public class location : MonoBehaviour { // Start is called before the first frame update public GameObject A; public Vector3 localPosition; void Start() { } // Update is called once per frame void Update() { print("位置坐标" + this.transform.localPosition); print("X坐标为:" + this.transform.localPosition.x); } }
这样就可以实时获取当前物体坐标。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。