Firstborn/Assets/Scripts/ShowNavmesh.cs
Schaken-Mods 959e80cf72 assets upload
assets upload description.
2023-03-28 12:16:30 -05:00

22 lines
357 B
C#

using UnityEngine;
using UnityEngine.AI;
public class ShowNavmesh : MonoBehaviour
{
void Start()
{
ShowMesh();
}
void ShowMesh()
{
NavMeshTriangulation meshData = NavMesh.CalculateTriangulation();
Mesh mesh = new Mesh();
mesh.vertices = meshData.vertices;
mesh.triangles = meshData.indices;
GetComponent<MeshFilter>().mesh = mesh;
}
}