Пример #1
0
        /// <summary>
        ///     Returns true if the asset at the given path should be ignored.
        /// </summary>
        /// <returns><c>true</c>, if path should be ignored, <c>false</c> otherwise.</returns>
        /// <param name="path">Path.</param>
        private static bool IgnorePath(string path)
        {
            if (!MaintenanceUtils.InAssetsDir(path))
            {
                return(true);
            }

            string ext = Path.GetExtension(path);

            if (Array.Exists(s_ExtIgnore, element => element == ext))
            {
                return(true);
            }

            for (int index = 0; index < s_DirIgnore.Length; index++)
            {
                string dirName = s_DirIgnore[index];
                if (MaintenanceUtils.ContainsDirName(path, dirName))
                {
                    return(true);
                }
            }

            return(false);
        }
Пример #2
0
        /// <summary>
        ///     Adds the header to new scripts.
        /// </summary>
        /// <param name="imported">Imported.</param>
        /// <param name="deleted">Deleted.</param>
        /// <param name="moved">Moved.</param>
        /// <param name="movedFromAssetPaths">Moved from asset paths.</param>
        private static void OnPostprocessAllAssets(string[] imported, string[] deleted, string[] moved,
                                                   string[] movedFromAssetPaths)
        {
            for (int index = 0; index < imported.Length; index++)
            {
                string path = imported[index];
                if (!MaintenanceUtils.ContainsDirName(path, "Hydra"))
                {
                    continue;
                }

                string ext = Path.GetExtension(path);
                if (ext != ".cs")
                {
                    continue;
                }

                WriteHeader(imported[index]);
            }
        }