/// <summary>
        /// Loops through all directories in the project and processes all configuration files
        /// </summary>
        /// <param name="path">The root path to search in</param>
        /// <param name="defaultSettings">The settings the current directory is inheriting from. Use this to programatically assign default settings</param>
        /// <returns>A directory structure with all app settings and directories represented</returns>
        private static DirectoryStructure GetImportSettings(string path, ImportSettings defaultSettings = null)
        {
            DirectoryStructure currentDirectory = new DirectoryStructure();

            currentDirectory.settings = HelperFunctions.JsonToClass <ImportSettings>(path, DirectoryInitializer.JsonConfigFileName);

            if (defaultSettings != null)
            {
                currentDirectory.settings.InheritSettings(defaultSettings);
            }

            currentDirectory.childSettings = new List <DirectoryStructure>();

            currentDirectory.path = path;

            List <string> childDirectoryPaths = DirectoryInitializer.FindDirectories(path, false);

            foreach (var currentChildDirectory in childDirectoryPaths)
            {
                DirectoryStructure childDirectoryStructure = new DirectoryStructure();

                childDirectoryStructure = GetImportSettings(currentChildDirectory, currentDirectory.settings);

                currentDirectory.childSettings.Add(childDirectoryStructure);
            }

            return(currentDirectory);
        }
        public static void IgnorePathsFilePicker()
        {
            string excludedPath = EditorUtility.OpenFolderPanel("Select a folder to ignore", "Assets", "");

            DirectoryInitializer.MarkDirectoryAsIgnored(excludedPath);

            AssetDatabase.Refresh(ImportAssetOptions.ForceSynchronousImport);
        }
Exemplo n.º 3
0
        private void OnGUI()
        {
            base.maxSize = new Vector2(260f, 85f);
            base.minSize = base.maxSize;

            GUILayout.Label("Reset Assets", EditorStyles.boldLabel);
            GUILayout.Label("All platform Import Settings will be removed!", EditorStyles.label);
            GUILayout.Label("Directory ignore files are unaffected", EditorStyles.label);

            GUILayout.Space(10f);

            GUI.color = Color.red;
            if (GUILayout.Button("Reset Configuration"))
            {
                DirectoryInitializer.InitializeDirectories(true);
                AssetDatabase.Refresh(ImportAssetOptions.ForceSynchronousImport);
            }
        }
Exemplo n.º 4
0
 static void OnProjectChanged()
 {
     DirectoryInitializer.InitializeDirectories(false);
 }