自动寻路
自动寻路的地图的渲染,根据的是物体的Mesh Renderer组件,根据物体的大小
第一步:勾选Navigation Static
第二步:打开自动控制面板
第三步:移动的物体添加Nav Mesh Agent组件
第四步:编写移动脚本
public class NavMove : MonoBehaviour
{
NavMeshAgent agent;
// Start is called before the first frame update
void Start()
{
agent = GetComponent<NavMeshAgent>();
}
// Update is called once per frame
void Update()
{