/// <summary>
        /// Creates the instance of the MeshBasedBake class that holds the result of baking.
        /// </summary>
        /// <param name="sources">Mesh sources.</param>
        /// <param name="settings">A settings for the baking process.</param>
        /// <returns>The instance of the MeshBasedBake class that holds the result of baking.</returns>
        public static MeshBasedBake Bake(MeshFilter[] sources, MeshBasedBakeSettings settings)
        {
            var result = new MeshBasedBake(settings);

            int numberOfMeshes = sources.Length;

            for (int i = 0; i < numberOfMeshes; i++)
            {
                result.AddWorldMesh(WorldMesh.Create(sources[i]));
            }
            return(result);
        }
 private MeshBasedBake(MeshBasedBakeSettings settings)
 {
     this.settings = settings ?? new MeshBasedBakeSettings();
     vertices      = new List <Vector3>();
     triangles     = new List <int>();
 }