Пример #1
0
        void CreateVoxels()
        {
            try
            {
                if (GenerateVoxels.Count > 0)
                {
                    //Create the voxel data
                    //order the chunks before creation so that oonly chunks closest to player get created first
                    //had to copy to another array before ordering as it caused errors otherwise
                    //use first chunk in the orderered list to create meshes
                    VoxelChunk chunk = GenerateVoxels.Dequeue();
                    //createmeshes using voxel data
                    chunk.CreateVoxels();


                    //catch all exceptions and display message in console
                }
            }catch (Exception e) {
                Debug.LogError(e.StackTrace + e.Message);
            }
        }