首页 > 编程语言 > 详细

Unity3D 导航寻路

时间:2015-08-25 23:13:59      阅读:228      评论:0      收藏:0      [点我收藏+]

先选择Window-->Navigation 在新打开的窗口中点击Bake.

待烘焙结束之后。

给需要导航的物体添加NavMeshAgent组件。可以调整速Speed Radius 等。

然后

1 NavMeshAgent agent = this.GetComponent<NavMeshAgent>();
2 //设置目标
3 agent.SetDestination(player.position);
4 //停止
5 agent.Stop();

 

Unity3D 导航寻路

原文:http://www.cnblogs.com/Akishimo/p/4758614.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!