示例#1
0
        private void Awake()
        {
            destination    = new Vector3(0f, 0f, 0f);
            navigationMesh = navigationMeshObject?.GetComponent <NavigationMeshComponent>()
                             ?? throw new UnityException("Navigation mesh is missing required Navigation Mesh Component");

            pathMapper = new AStarPathMapper(navigationMesh);
        }
示例#2
0
 public override void ComponentAwake()
 {
     navigationMesh = GetRequiredComponent <NavigationMeshComponent>(GetRequiredChild("NavigationMesh", FindLevelObject()));
     pathMapper     = new AStarPathMapper(navigationMesh);
     base.ComponentAwake();
 }