public void AddTriangles(NavMeshGenerator generators)
        {
            List <NavMeshTriangle> collectedTriangles = new List <NavMeshTriangle>();

            collectedTriangles.AddRange(triangles);
            collectedTriangles.AddRange(generators.Triangles);
            triangles = collectedTriangles.ToArray();
            int counter = 0;

            for (int i = 0; i < triangles.Length; i++)
            {
                //triangles[i].ID = counter++;
            }
        }
        public void AddVertexes(NavMeshGenerator generators)
        {
            List <Vertex> collectedVertexes = new List <Vertex>();

            collectedVertexes.AddRange(vertexes);
            collectedVertexes.AddRange(generators.Vertexes);
            vertexes = collectedVertexes.ToArray();
            int counter = 0;

            for (int i = 0; i < vertexes.Length; i++)
            {
                //vertexes[i].ID = counter++;
            }
        }
Beispiel #3
0
 private void OnEnable()
 {
     navMesh        = (NavMeshGenerator)target;
     triangles      = serializedObject.FindProperty("triangles");
     entrancePoints = serializedObject.FindProperty("entrancePoints");
 }
 public void AddNavMesh(NavMeshGenerator meshGenerator)
 {
     AddTriangles(meshGenerator);
     AddVertexes(meshGenerator);
     Notify();
 }