static void RenderGizmo(NavMeshPrefabInstance instance, GizmoType gizmoType) { if (!EditorApplication.isPlaying) { instance.UpdateInstance(); } }
NavMeshData Build(NavMeshPrefabInstance instance) { var root = instance.transform; var sources = new List <NavMeshBuildSource>(); var markups = new List <NavMeshBuildMarkup>(); NavMeshBuilder.CollectSources(root, ~0, NavMeshCollectGeometry.RenderMeshes, 0, markups, sources); var settings = NavMesh.GetSettingsByID(0); var bounds = new Bounds(Vector3.zero, 1000.0f * Vector3.one); var navmesh = NavMeshBuilder.BuildNavMeshData(settings, sources, bounds, root.position, root.rotation); navmesh.name = "Navmesh"; return(navmesh); }
NavMeshData Build(NavMeshPrefabInstance instance) { var root = instance.transform; var sources = new List <NavMeshBuildSource>(); var markups = new List <NavMeshBuildMarkup>(); Debug.Log(instance.gameObject.scene.name); Debug.Log("Test"); UnityEditor.AI.NavMeshBuilder.CollectSourcesInStage( root, ~0, NavMeshCollectGeometry.RenderMeshes, 0, markups, instance.gameObject.scene, sources); var settings = NavMesh.GetSettingsByID(0); var bounds = new Bounds(Vector3.zero, 1000.0f * Vector3.one); var navmesh = NavMeshBuilder.BuildNavMeshData(settings, sources, bounds, root.position, root.rotation); navmesh.name = "Navmesh"; return(navmesh); }