コード例 #1
0
        public static void FindFolders()
        {
            folders = new List <string>();
            files1  = FindFiles.FindAllFiles(Definitions.SCRIPT_EXTENSION);
            files2  = Directory.GetDirectories(Application.dataPath, "*", SearchOption.AllDirectories);
            files   = files.Add(files1, files2);

            for (int i = 0; i < files.Length; i++)
            {
                string[] folders2 = files[i].Split('/');

                string folderName = folders2[folders2.Length - 2];
                if (!folders.Contains(folderName))
                {
                    //Debug.Log("Foldername = "+folderName);
                    folders.Add(folderName);
                }
            }

            GenerateEnums.GenerateCode("Folders", folders);

            SwitchOnOffMacro.MacroOnOff(GetBuildTargetGroup.GetCorrectBuildTargetGroup(), Definitions.GENERATED_MACRO, MacroAction.On);

            AssetDatabase.Refresh();
        }
コード例 #2
0
        public static void RemoveGenerated()
        {
            string path = Application.dataPath + "/Generated";

            string[] files = Directory.GetFiles(path);
            for (int i = 0; i < files.Length; i++)
            {
                File.Delete(files[i]);
            }
            Directory.Delete(path);

            GameObject[] InHierarchy = Object.FindObjectsOfType <GameObject>();
            for (int i = 0; i < InHierarchy.Length; i++)
            {
                if (InHierarchy[i].name.Equals("ExcludedFoldersList"))
                {
                    DestroyImmediate(InHierarchy[i]);
                }
            }

            SwitchOnOffMacro.MacroOnOff(GetBuildTargetGroup.GetCorrectBuildTargetGroup(), Definitions.GENERATED_MACRO, MacroAction.Off);

            AssetDatabase.Refresh();
        }