public void SetRect(Rect sideBar, Rect mainWindow)
        {
            ResCheckModuleBase module = CurrentCheckModule();

            if (module != null)
            {
                module.SideBarRect = sideBar;
                module.MainRect    = mainWindow;
            }
        }
 public void InitCheckerModule()
 {
     //初始化检查模式
     resCheckModeList.Clear();
     foreach (var v in CheckerConfigManager.checkModuleConfigList)
     {
         ResCheckModuleBase.CreateCheckModule(this, v);
     }
     resCheckModeList.Sort(delegate(ResCheckModuleBase module1, ResCheckModuleBase module2) { return(module1.checkModuleCfg.checkModuleOrder - module2.checkModuleCfg.checkModuleOrder); });
     checkModeListNames = resCheckModeList.Select(x => x.checkModeName).ToArray();
 }
        public static void CreateCheckModule(ResourceCheckerPlus root, CheckModuleConfig cfg)
        {
            System.Type type = System.Type.GetType("ResourceCheckerPlus." + cfg.CheckModuleClassName);
            if (type == null)
            {
                return;
            }
            ResCheckModuleBase checkModule = System.Activator.CreateInstance(type) as ResCheckModuleBase;

            checkModule.InitCheckModule(cfg);
            checkModule.checkModeName = new GUIContent(cfg.CheckModuleTitleName, cfg.CheckModuleDescription);
            root.resCheckModeList.Add(checkModule);
        }
        private void ShowCheckDetail()
        {
            if (checkModeListNames == null)
            {
                return;
            }
            ResCheckModuleBase module = CurrentCheckModule();

            if (module != null)
            {
                module.ShowCurrentCheckDetail();
            }
        }
示例#5
0
        public static void CreateChecker(ResCheckModuleBase module, CheckerCfg cfg)
        {
            System.Type type = System.Type.GetType("ResourceCheckerPlus." + cfg.checkerName);
            if (type == null)
            {
                return;
            }
            ObjectChecker checker = System.Activator.CreateInstance(type) as ObjectChecker;

            checker.checkModule    = module;
            checker.checkerEnabled = cfg.checkerEnabled;
            checker.config         = cfg;
            module.checkerList.Add(checker);
        }
        private void ShowSideBar()
        {
            if (checkModeListNames == null)
            {
                return;
            }
            currentActiveCheckModule = GUILayout.Toolbar(currentActiveCheckModule, checkModeListNames);
            GUILayout.BeginVertical();
            ResCheckModuleBase module = CurrentCheckModule();

            if (module != null)
            {
                module.ShowCurrentSideBar();
            }
            GUILayout.EndVertical();
        }
示例#7
0
        public void OnRefButtonClick(ObjectDetail detail)
        {
            ResCheckModuleBase curCheckModule = ResourceCheckerPlus.instance.CurrentCheckModule();

            if (!(curCheckModule is DirectResCheckModule) && CheckerConfigManager.checkerConfig.autoFilterOnSideBarButtonClick)
            {
                ObjectChecker checker = ResourceCheckerPlus.instance.CurrentCheckModule().CurrentActiveChecker();
                if (checker is ParticleChecker || checker is GameObjectChecker)
                {
                    return;
                }
                RefFilterItem filter = new RefFilterItem(checker);
                checker.filterItem.Clear(true);
                filter.checkObjList = SelectList.Select(x => x.checkObject).ToList();
                checker.filterItem.AddFilterNode(filter);
                checker.RefreshCheckResult();
            }
        }