Exemple #1
0
    public async Task PlaceInCave(int caveIndex)
    {
        await GenerateNearbyChunksAsync(DestinationChunkCoordinate);

        CaveChunk destinationChunk = await ChunkManager.CreateChunkAsync(DestinationChunkCoordinate);

        await PlaceInCave(destinationChunk.CellData.Hollows[caveIndex]);
    }
Exemple #2
0
    public int ChunkGenerationRadius;     //TODO merge with PlayerChunkTracker

    public async Task PlaceInRandomCave()
    {
        await GenerateNearbyChunksAsync(DestinationChunkCoordinate);

        CaveChunk destinationChunk = await ChunkManager.CreateChunkAsync(DestinationChunkCoordinate);

        int randomCaveIndex = Random.Range(0, destinationChunk.CellData.Hollows.Count - 1);

        await PlaceInCave(destinationChunk.CellData.Hollows[randomCaveIndex]);
    }
Exemple #3
0
        public void Generate(WallGroup wall, CaveChunk chunk)
        {
            _wall = wall;
            Chunk = chunk;

            SetMeshGenerator();

            _data         = GenerateMeshData(out Vector3Int minCoordinate);
            MinCoordinate = minCoordinate;
        }
Exemple #4
0
    public async Task PlaceInCave(HollowGroup cave)     //TODO different placements
    {
        Vector3Int lowestPointChunkPosition = cave.GetLowestPoint();

        await GenerateNearbyChunksAsync(DestinationChunkCoordinate);

        CaveChunk destinationChunk = await ChunkManager.CreateChunkAsync(DestinationChunkCoordinate);

        Vector3 offsetPosition = (Vector3)ChunkManager.MeshSettings.GridSize / 2.0f;
        Vector3 position       = destinationChunk.GetWorldPosition(lowestPointChunkPosition) + offsetPosition;

        transform.position = position;
    }