android+unity游戏开发之求物体间的距离
不卖关子,还是老样子,把代码奉上~~~
using UnityEngine;
using System.Collections;
public class test : MonoBehaviour {
public GameObject a;
public GameObject b;
public Vector3 m;
public Vector3 n;
void Start () {}
void Update (){
m=a.transform.position;
n=b.transform.position;
print(Vector3.Distance(m,n));
}
}
摘自 dlnuchunge的专栏
补充:移动开发 , Android ,