从今天开始自学Unity3D啦,用博客记录我的学习历程
角色需要Nav Meth Agent 组件
需要在Navigation中设置cube,Plane 是固定不动的
游戏的执行脚本如下:
public class myAutomaticRouting : MonoBehaviour {
// Use this for initialization
private NavMeshAgent man;
void Start () {
man=this.gameObject.GetComponent<NavMeshAgent>();
}
// Update is called once per frame
void Update () {
if (Input.GetMouseButtonDown(0))
{
Ray ray = Camera.ma