Beispiel #1
0
        private void ShowLllegalFiles()
        {
            if (illegalFiles == null)
            {
                return;
            }

            for (int i = 0; i < illegalFiles.Count; i++)
            {
                //防止加载太多导致很卡
                if (i >= 99)
                {
                    break;
                }

                FileSystemInfo item = illegalFiles[i];

                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.SelectableLabel(Path.GetFileNameWithoutExtension(item.Name));
                if (GUILayout.Button("定位"))
                {
                    string path = FoldersTool.GetLoadPath(item.FullName);

                    Object obj = AssetDatabase.LoadMainAssetAtPath(path);

                    Selection.activeObject = obj;
                }
                if (GUILayout.Button("打开目录"))
                {
                    EditorUtility.RevealInFinder(item.FullName);
                }

                EditorGUILayout.EndHorizontal();
            }

            //GUILayout.Box(new GUIContent("一个200x200的BOX"), new[] { GUILayout.Height(200), GUILayout.Width(200) });

            //GUILayout.BeginArea(new Rect(200, 200, 100, 100), "GroupBox");

            //GUILayout.Button("Click me", "GroupBox");

            //GUILayout.Button("Or me");

            //GUILayout.EndArea();
        }
Beispiel #2
0
        private void ShowOneKeyCheck()
        {
            if (GUILayout.Button("一键检查", GUILayout.MinHeight(100f)))
            {
                illegalFiles = new List <FileSystemInfo>();

                FoldersTool.Folder();//提前初始化 防止线程不能调用unity api

                ThreadPool.QueueUserWorkItem((go) =>
                {
                    FoldersTool.CheckFolderName(FoldersTool.Folder(), illegalFiles, new List <char>(ProjectManagerConfigManager.Get().checkFileName.legal.ToCharArray()));
                });

                //ThreadTask threadTask = new ThreadTask(() =>
                //{
                //    FoldersTool.CheckFolderName(FoldersTool.Folder(), illegalFiles, new List<char>(ProjectManagerConfigManager.Get().checkFileName.legal.ToCharArray()));
                //});

                //FoldersTool.CheckFolderName(FoldersTool.Folder, illegalFiles, new List<char>(ProjectManagerConfigManager.Get().checkFileName.legal.ToCharArray()));
            }
        }