private void BuildNavMeshSurface() { if (navMeshSurface2d != null) { navMeshSurface2d.BuildNavMesh(); } }
void InitGame() { surface = Instantiate(surfacePrefab); (levelRooms, connectedRooms) = levelGenerator.GenerateLevel(); statManager.InitiateStats(levelRooms); gearManager.InitiateGears(levelRooms); currentRoomIndex = new RoomIndex { abs = 0, ord = 0 }; currentRoom = levelRooms[currentRoomIndex]; map = mapController.CreateMap(levelRooms, connectedRooms); map.SetActive(false); playerParam = new UnitParam { id = 0, unitNature = UnitNature.Player, stat = statManager.GenerateStat(UnitNature.Player), gear = new Gear { } }; roomGenerator.SetupRoom(currentRoom, playerSpawn); surface.BuildNavMesh(); }
void InitRoom() { surface = Instantiate(surfacePrefab); currentRoom = GetNextRoom(); mapController.UpdateMap(currentRoom); map.SetActive(false); roomGenerator.SetupRoom(currentRoom, playerSpawn); surface.BuildNavMesh(); }
public void SetupScene(int level) { if (spawnRooms) { SetupRooms(); CloseDoor(RoomPositions); SpawnEnnemies(); } surface2D.BuildNavMesh(); }
void Start() { enemies = new List <GameObject>(); SetupTilesArray(); CreateRooms(); SetTilesValues(); InstantiateTiles(); navMesh.BuildNavMesh(); CreateEnemies(); CreateChests(); }
private IEnumerator buildMesh() { yield return(new WaitForEndOfFrame()); mesh.BuildNavMesh(); yield return(new WaitForEndOfFrame()); newMeshBuild = true; DungeonTracker.instance.finishedLoadingLevel = true; /* * old spawn enemy * * * //turn on all the nav mesh enemy agents * foreach (GameObject room in roomList) * { * RoomPlacementLogic rp = room.GetComponent<RoomPlacementLogic>(); * rp.SpawnEnemies(); * } */ yield return(null); }
public void bakeNavMesh() { gameObject.GetComponent <TilemapCollider2D>().enabled = false; gameObject.GetComponent <TilemapRenderer>().enabled = false; surface.BuildNavMesh(); }
public void LoadNav() { nav = GetComponent <NavMeshSurface2d>(); nav.BuildNavMesh(); }
public static IEnumerator Generate() { nav.BuildNavMesh(); yield return(new WaitForSeconds(.3f)); }