Beispiel #1
0
    public void UpdateAroundPlayer()
    {
        if (playerRb.velocity.magnitude > 0)
        {
            p           = player.position / voxelResolution;
            playerCoord = new Vector2Int(Mathf.RoundToInt(p.x), Mathf.RoundToInt(p.y));

            voxelMesh.CreateBuffers();

            RemoveOutOfBoundsChunks();

            CreateNewChunksInRange();

            UpdateNewChunks();

            RecreateUpdatedChunkMeshes();
        }
    }