예제 #1
0
 private void BuildNavMeshSurface()
 {
     if (navMeshSurface2d != null)
     {
         navMeshSurface2d.BuildNavMesh();
     }
 }
예제 #2
0
파일: GameManager.cs 프로젝트: svinot/LJSM
    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();
    }
예제 #3
0
파일: GameManager.cs 프로젝트: svinot/LJSM
 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();
 }
예제 #5
0
    void Start()
    {
        enemies = new List <GameObject>();
        SetupTilesArray();
        CreateRooms();
        SetTilesValues();
        InstantiateTiles();

        navMesh.BuildNavMesh();

        CreateEnemies();

        CreateChests();
    }
예제 #6
0
        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);
        }
예제 #7
0
 public void bakeNavMesh()
 {
     gameObject.GetComponent <TilemapCollider2D>().enabled = false;
     gameObject.GetComponent <TilemapRenderer>().enabled   = false;
     surface.BuildNavMesh();
 }
예제 #8
0
 public void LoadNav()
 {
     nav = GetComponent <NavMeshSurface2d>();
     nav.BuildNavMesh();
 }
예제 #9
0
 public static IEnumerator Generate()
 {
     nav.BuildNavMesh();
     yield return(new WaitForSeconds(.3f));
 }