Example #1
0
        /// <summary>
        /// Copies the full contents of the unity library. We want to do this to avoid the lengthy reserialization of the whole project when it opens up the clone.
        /// </summary>
        /// <param name="sourceProject"></param>
        /// <param name="destinationProject"></param>
        public static void CopyLibraryFolder(Project sourceProject, Project destinationProject)
        {
            if (Directory.Exists(destinationProject.libraryPath))
            {
                Debug.LogWarning("Library copy: destination path already exists! ");
                return;
            }

            Debug.Log("Library copy: " + destinationProject.libraryPath);
            ProjectCloner.CopyDirectoryWithProgressBar(sourceProject.libraryPath, destinationProject.libraryPath, "Cloning project '" + sourceProject.name + "'. ");
        }
        /// <summary>
        /// Copies the full contents of the unity library. We want to do this to avoid the lengthy reserialization of the whole project when it opens up the clone.
        /// </summary>
        /// <remarks>
        /// Excludes PackageCache directory, as it can cause long path exceptions on Windows if packages with long names are present.
        /// </remarks>
        /// <param name="sourceProject"></param>
        /// <param name="destinationProject"></param>
        public static void CopyLibraryFolder(Project sourceProject, Project destinationProject)
        {
            if (Directory.Exists(destinationProject.libraryPath))
            {
                Debug.LogWarning("Will not copy Library folder: destination path already exists.");
                return;
            }

            Debug.Log($"Copying Library folder '{destinationProject.libraryPath}'...");
            ProjectCloner.CopyDirectoryWithProgressBar(sourceProject.libraryPath, destinationProject.libraryPath, $"Cloning project '{sourceProject.name}'. ");
            Debug.Log("Copied Library folder.");
        }