예제 #1
0
        public void LoadCheckFilter()
        {
            string path = CheckerConfigManager.configRootPath + CheckerConfigManager.predefineFilterCfgPath + "/" + checkerName + ".asset";

            predefineFilterGroup = AssetDatabase.LoadAssetAtPath <PredefineFilterGroup>(path);
            CreateCheckFilter(predefineFilterGroup);
        }
예제 #2
0
        public PredefineFilterGroup SaveAsFilterGroup()
        {
            PredefineFilterGroup filterGroup = ScriptableObject.CreateInstance <PredefineFilterGroup>();
            List <FilterItemCfg> cfgList     = new List <FilterItemCfg>();

            SaveFilterAsCfg(cfgList);
            filterGroup.filterCfgGroup = cfgList.ToArray();
            return(filterGroup);
        }
예제 #3
0
 public void CreateFromFilterGroup(PredefineFilterGroup filterGroup)
 {
     Clear(true);
     //首先设置自身,然后设置子节点
     if (filterGroup != null && filterGroup.filterCfgGroup != null && filterGroup.filterCfgGroup.Length > 0)
     {
         FilterItemCfg cfg = filterGroup.filterCfgGroup[0];
         InitFilterByCfg(this, cfg);
         CreateFilterFromCfg(this, filterGroup, 1);
     }
 }
예제 #4
0
        public void SaveCheckFilter()
        {
            predefineFilterGroup = filterItem.SaveAsFilterGroup();
            predefineFilterGroup.filterGroupName = checkerName;
            string path = CheckerConfigManager.configRootPath + CheckerConfigManager.predefineFilterCfgPath;

            if (!ResourceCheckerHelper.isFolder(path))
            {
                AssetDatabase.CreateFolder(CheckerConfigManager.configRootPath, "FilterCfg");
            }
            AssetDatabase.CreateAsset(predefineFilterGroup, path + "/" + predefineFilterGroup.filterGroupName + ".asset");
        }
예제 #5
0
        //不用反射获取原生风格的搜索框了,在多个检查器切换时,数据切换了,显示得不对,怀疑是static实现?
        //public string SearchField(string value, params GUILayoutOption[] options)
        //{
        //    MethodInfo info = typeof(EditorGUILayout).GetMethod("ToolbarSearchField", BindingFlags.NonPublic | BindingFlags.Static, null, new System.Type[] { typeof(string), typeof(GUILayoutOption[]) }, null);
        //    if (info != null)
        //    {
        //        value = (string)info.Invoke(null, new object[] { value, options });
        //    }
        //    return value;
        //}

        public void CreateFilterFromCfg(FilterItem item, PredefineFilterGroup filterGroup, int index)
        {
            FilterItemCfg cfg = null;

            if (index < filterGroup.filterCfgGroup.Length)
            {
                cfg = filterGroup.filterCfgGroup[index];
            }
            else
            {
                return;
            }
            FilterItem newItem = new FilterItem(checker);

            if (InitFilterByCfg(newItem, cfg))
            {
                item.AddFilterNode(newItem);
            }
            CreateFilterFromCfg(newItem, filterGroup, ++index);
        }
예제 #6
0
 public void CreateCheckFilter(PredefineFilterGroup filterGroup)
 {
     filterItem.CreateFromFilterGroup(filterGroup);
     RefreshCheckResult();
 }