示例#1
0
        public override void InitCheckItem()
        {
            checkerName            = "AudioClip";
            checkerFilter          = "t:AudioClip";
            enableReloadCheckItem  = true;
            audioLength            = new CheckItem(this, "长度", 80, CheckType.Float);
            audioChannel           = new CheckItem(this, "声道", 80, CheckType.Int);
            audioType              = new CheckItem(this, "加载类型", 130, CheckType.String);
            audioCompression       = new CheckItem(this, "压缩", 100);
            audioQuality           = new CheckItem(this, "质量", 80, CheckType.Int);
            audioSampleRateSetting = new CheckItem(this, "采样率设置", 100);
            audioSampleRate        = new CheckItem(this, "自定义采样率", 100, CheckType.Int);
            audioPostfix           = new CheckItem(this, "后缀");

            audioAndroidOverride          = new CheckItem(this, "安卓开启");
            audioAndroidLoadType          = new CheckItem(this, "安卓加载类型", 130);
            audioAndroidCompressionFormat = new CheckItem(this, "安卓压缩", 100);
            audioAndroidQuality           = new CheckItem(this, "安卓质量", 80, CheckType.Int);
            audioAndroidSampleRateSetting = new CheckItem(this, "安卓采样率设置", 130);
            audioAndroidSampleRate        = new CheckItem(this, "安卓自定义采样率", 130, CheckType.Int);

            audioIOSOverride          = new CheckItem(this, "IOS开启");
            audioIOSLoadType          = new CheckItem(this, "IOS加载类型", 130);
            audioIOSCompressionFormat = new CheckItem(this, "IOS压缩", 100);
            audioIOSQuality           = new CheckItem(this, "IOS质量", 80, CheckType.Int);
            audioIOSSampleRateSetting = new CheckItem(this, "IOS采样率设置", 130);
            audioIOSSampleRate        = new CheckItem(this, "IOS自定义采样率", 130, CheckType.Int);

            ShowIOS(showIOSPlatformSetting);
            ShowAndroid(showAndroidPlatformSettings);
        }
示例#2
0
        public void CheckDetailSort(CheckItem item, bool positive)
        {
            switch (item.type)
            {
            case CheckType.String:
                FilterList.Sort(delegate(ObjectDetail check1, ObjectDetail check2)
                {
                    if (positive)
                    {
                        return(string.Compare((string)check2.checkMap[item], (string)check1.checkMap[item]));
                    }
                    return(string.Compare((string)check1.checkMap[item], (string)check2.checkMap[item]));
                });
                break;

            case CheckType.Int:
            case CheckType.FormatSize:
                FilterList.Sort(delegate(ObjectDetail check1, ObjectDetail check2)
                {
                    if (positive)
                    {
                        return((int)check1.checkMap[item] - (int)check2.checkMap[item]);
                    }
                    return((int)check2.checkMap[item] - (int)check1.checkMap[item]);
                });
                break;

            case CheckType.Float:
                FilterList.Sort(delegate(ObjectDetail check1, ObjectDetail check2)
                {
                    //float排序,暂时木有找到什么好方法....
                    float val1 = (float)check1.checkMap[item] * 10000;
                    float val2 = (float)check2.checkMap[item] * 10000;
                    if (positive)
                    {
                        return((int)val1 - (int)val2);
                    }
                    return((int)val2 - (int)val1);
                });
                break;

            case CheckType.List:
                FilterList.Sort(delegate(ObjectDetail check1, ObjectDetail check2)
                {
                    List <Object> check1List = check1.checkMap[item] as List <Object>;
                    List <Object> check2List = check2.checkMap[item] as List <Object>;
                    if (positive)
                    {
                        return(check1List.Count - check2List.Count);
                    }
                    return(check2List.Count - check1List.Count);
                });
                break;

            default:
                return;
            }
        }
示例#3
0
 public override void InitCheckItem()
 {
     checkerName           = "Shader";
     checkerFilter         = "t:Shader";
     enableReloadCheckItem = true;
     shaderPropertyCount   = new CheckItem(this, "PropertyCount", 100, CheckType.Int, OnButtonShowPropertyClick);
     shaderMaxLod          = new CheckItem(this, "MaximumLOD", 100, CheckType.Int);
     shaderRenderQueue     = new CheckItem(this, "RenderQueue", 100, CheckType.Int);
     nameItem.width        = 350;
 }
示例#4
0
 public override void InitCheckItem()
 {
     checkerName            = "Particle";
     checkerFilter          = "t:Prefab";
     refItem.show           = false;
     particleComponentCount = new CheckItem(this, "粒子组件数", 80, CheckType.Int, OnButtonChildParticleComClick);
     particleMaxCount       = new CheckItem(this, "粒子数", 80, CheckType.Int);
     particleMaxSize        = new CheckItem(this, "粒子大小", 80, CheckType.Float);
     trailRendererCount     = new CheckItem(this, "拖尾组件数", 80, CheckType.Int, OnButtonChildTrailComClick);
 }
 public override void InitCheckItem()
 {
     checkerName           = "Material";
     checkerFilter         = "t:Material";
     postfix               = ".mat";
     enableReloadCheckItem = true;
     matShaderName         = new CheckItem(this, "Shader", 350);
     matRenderQueue        = new CheckItem(this, "渲染队列", 80, CheckType.Int);
     matPassCount          = new CheckItem(this, "Pass数", 80, CheckType.Int);
 }
 public override void InitCheckItem()
 {
     checkerName   = "AnimClip";
     checkerFilter = "t:AnimationClip";
     animLength    = new CheckItem(this, "时间", 80, CheckType.Float);
     animWrapMode  = new CheckItem(this, "WrapMode");
     animLoop      = new CheckItem(this, "Looping");
     animFrameRate = new CheckItem(this, "FrameRate", 80, CheckType.Float);
     animLegacy    = new CheckItem(this, "IsLegacy");
 }
示例#7
0
        public virtual List <ObjectDetail> CustomDoFilter(List <ObjectDetail> inList)
        {
            CheckItem currentCheckItem = filterArray[currentFliterType];

            if (currentCheckItem == null || string.IsNullOrEmpty(currentFilterStr))
            {
                return(filterType == FilterType.AndFilter || parentFilterNode == null?inList.Where(x => true).ToList() : new List <ObjectDetail>(0));
            }
            else
            {
                return(inList.Where(x => CheckDetailFilterInternal(x.checkMap[currentCheckItem], currentCheckItem, currentFilterStr, positive) == true).ToList());
            }
        }
 public override void InitCheckItem()
 {
     checkerName           = "GameObject";
     checkerFilter         = "t:Prefab";
     enableReloadCheckItem = true;
     goTag           = new CheckItem(this, "Tag", 100);
     goLayer         = new CheckItem(this, "Layer", 100);
     isStatic        = new CheckItem(this, "IsStatic", 100);
     batchStatic     = new CheckItem(this, "BactcStatic", 100);
     lightmapStatic  = new CheckItem(this, "LightMapStatic", 100);
     navigaionStatic = new CheckItem(this, "NavigationStatic", 100);
     staticFlag      = new CheckItem(this, "StaticFlag", 100, CheckType.Int);
 }
示例#9
0
 public void ShowCheckDetail(ObjectDetail tCheck, CheckItem item)
 {
     if (item.show == false || !tCheck.checkMap.ContainsKey(item))
     {
         return;
     }
     if (item.type == CheckType.Texture)
     {
         Texture tex = tCheck.checkMap[item] as Texture;
         if (tex == null)
         {
             GUILayout.Box("null", GUILayout.Width(item.width), GUILayout.Height(item.width));
         }
         else
         {
             GUILayout.Box(tex, GUILayout.Width(item.width), GUILayout.Height(item.width));
         }
     }
     else
     {
         string label = null;
         if (item.type == CheckType.FormatSize)
         {
             label = FormatSizeString((int)tCheck.checkMap[item]);
         }
         else if (item.type == CheckType.List)
         {
             List <Object> list = tCheck.checkMap[item] as List <Object>;
             label = list.Count.ToString();
         }
         else
         {
             label = tCheck.checkMap[item].ToString();
         }
         if (item.clickOption == null)
         {
             GUILayout.Label(label, GUILayout.Width(item.width));
         }
         else
         {
             if (GUILayout.Button(label, GUILayout.Width(item.width)))
             {
                 SelectObjectDetail(tCheck);
                 item.clickOption(tCheck);
             }
         }
     }
 }
示例#10
0
        public ObjectChecker()
        {
            previewItem  = new CheckItem(this, "预览", 40, CheckType.Texture); previewItem.order = -99; //previewItem.show = false;
            nameItem     = new CheckItem(this, "名称", 200, CheckType.String, OnNameButtonClick);
            refItem      = new CheckItem(this, "引用", 80, CheckType.List, OnRefButtonClick);
            totalRefItem = new CheckItem(this, "具体引用", 80, CheckType.List, OnDetailRefButton);
            activeItem   = new CheckItem(this, "引用对象全部激活", 120); activeItem.order = 98;
            pathItem     = new CheckItem(this, "路径", 999); pathItem.order = 99;

            InitCheckItem();
            //根据配置文件反射初始化的扩展项,暂时注掉
            InitCustomCheckItem();

            checkItem.Sort(delegate(CheckItem item1, CheckItem item2) { return(item1.order - item2.order); });
            filterItem = new FilterItem(this);
        }
示例#11
0
        private bool InitFilterByCfg(FilterItem item, FilterItemCfg cfg)
        {
            if (cfg == null)
            {
                return(false);
            }
            CheckItem cItem = checker.GetCheckItemByName(cfg.checkItemName);

            if (cItem != null)
            {
                item.currentFliterType = ArrayUtility.IndexOf(item.filterArray, cItem);
                item.currentFilterStr  = cfg.filterString;
                item.positive          = cfg.positive;
                return(true);
            }
            return(false);
        }
示例#12
0
        private bool CheckDetailFilterInternal(object value, CheckItem item, string filter, bool positive)
        {
            if (string.IsNullOrEmpty(filter))
            {
                return(true);
            }
            switch (item.type)
            {
            case CheckType.String:
            {
                string str = value as string;
                return(positive ? str.ToLower().Contains(filter.ToLower()) : !str.ToLower().Contains(filter.ToLower()));
            }

            case CheckType.Int:
            case CheckType.FormatSize:
            {
                int num = 0;
                int.TryParse(filter, out num);
                return(positive ? (int)value >= num : (int)value <= num);
            }

            case CheckType.Float:
            {
                float num = 0;
                float.TryParse(filter, out num);
                return(positive ? (float)value >= num : (float)value <= num);
            }

            case CheckType.List:
            {
                int num = 0;
                int.TryParse(filter, out num);
                List <Object> list = value as List <Object>;
                return(positive ? list.Count >= num : list.Count <= num);
            }

            case CheckType.Custom:
            {
                return(item.customFilter(value));
            }

            default:
                return(true);
            }
        }
示例#13
0
        public void InitCustomCheckItem()
        {
            CheckerConfig cfg = ResourceCheckerPlus.instance.configManager.GetCheckerConfig(checkerName);

            if (cfg.checkItemCfg == null)
            {
                return;
            }
            foreach (var v in cfg.checkItemCfg)
            {
                CheckItem item = CheckItem.CreateCheckItemFromConfig(this, v);
                if (item != null)
                {
                    customCheckItems.Add(item);
                }
            }
        }
示例#14
0
 private void GenerateDetailLine(ref string line, ObjectDetail detail, CheckItem item)
 {
     if (item.type != CheckType.Texture)
     {
         if (item.type == CheckType.FormatSize)
         {
             line += FormatSizeString((int)detail.checkMap[item]);
         }
         else if (item.type == CheckType.List)
         {
             List <Object> list = detail.checkMap[item] as List <Object>;
             line += list.Count.ToString();
         }
         else
         {
             line += detail.checkMap[item].ToString().Replace("\n", "").Replace(" ", "");
         }
         line += "\t";
     }
 }
示例#15
0
 public override void InitCheckItem()
 {
     checkerName           = "Model";
     checkerFilter         = "t:Model";
     enableReloadCheckItem = true;
     meshSubMeshCount      = new CheckItem(this, "子网格数", 80, CheckType.Int, OnButtonSubMeshCountClick);
     meshVertexCount       = new CheckItem(this, "顶点数", 80, CheckType.Int);
     meshTrangleCount      = new CheckItem(this, "面数", 80, CheckType.Int);
     meshFormat            = new CheckItem(this, "格式", 200);
     meshReadable          = new CheckItem(this, "Readable");
     meshOptimized         = new CheckItem(this, "Optimize");
     meshNormalSetting     = new CheckItem(this, "Normals", 80);
     meshTanSetting        = new CheckItem(this, "Tangents", 200);
     meshCompression       = new CheckItem(this, "Compression");
     meshScaleFactor       = new CheckItem(this, "ScaleFactor", 80, CheckType.Float);
     meshImortBlendShaps   = new CheckItem(this, "BlendShape");
     meshGenCollider       = new CheckItem(this, "GenCollider");
     meshKeepQuads         = new CheckItem(this, "KeepQuads");
     meshSwapUVs           = new CheckItem(this, "SwapUVs");
     meshGenLightMapUVs    = new CheckItem(this, "GenLightMapUV", 120);
     meshAnimSetting       = new CheckItem(this, "Anim");
 }
示例#16
0
        public override void InitCheckItem()
        {
            checkerName           = "Texture";
            checkerFilter         = "t:Texture";
            enableReloadCheckItem = true;
            texFormat             = new CheckItem(this, "格式", 150);
            texMipmap             = new CheckItem(this, "Mip");
            texReadable           = new CheckItem(this, "Readable");
            texType    = new CheckItem(this, "类型", 100);
            texSize    = new CheckItem(this, "贴图大小", 100, CheckType.Int, null);
            texMemSize = new CheckItem(this, "内存占用", 100, CheckType.FormatSize, null);
            texPostfix = new CheckItem(this, "后缀名");
#if UNITY_5_5_OR_NEWER
            texAlpha       = new CheckItem(this, "Alpha", 100);
            texCompression = new CheckItem(this, "纹理压缩", 100);
#else
            texAlphaFromGray      = new CheckItem(this, "AlphaFromGray");
            texAlphaIsTransparent = new CheckItem(this, "AlphaIsTran");
            texSourceAlpha        = new CheckItem(this, "原始图片Alpha", 100);
#endif
            texIsSquareMap            = new CheckItem(this, "正方形贴图", 100);
            texNonPowerOfTwo          = new CheckItem(this, "2次幂贴图", 100);
            texNpotScale              = new CheckItem(this, "NonPower Of 2", 100);
            texWrapMode               = new CheckItem(this, "WrapMode");
            texFilterMode             = new CheckItem(this, "FilterMode");
            texAnisoLevel             = new CheckItem(this, "AnisoLevel", 100, CheckType.Int);
            texOriSize                = new CheckItem(this, "源图大小", 80, CheckType.Int);
            texAndroidOverride        = new CheckItem(this, "安卓开启", 120);
            texAndroidMaxSize         = new CheckItem(this, "安卓MaxSize", 120, CheckType.Int);
            texAndroidFormat          = new CheckItem(this, "安卓Format", 120);
            texAndroidCompressQuality = new CheckItem(this, "安卓压缩质量", 150);
            texIOSOverride            = new CheckItem(this, "IOS开启", 120);
            texIOSMaxSize             = new CheckItem(this, "IOSMaxSize", 120, CheckType.Int);
            texIOSFormat              = new CheckItem(this, "IOSFormat", 120);
            texIOSCompressQuality     = new CheckItem(this, "IOS压缩质量", 150);

            ShowIOS(showIOSPlatformSetting);
            ShowAndroid(showAndroidPlatformSettings);
        }
示例#17
0
 public override void InitCheckItem()
 {
     checkerName    = "Component";
     checkerFilter  = "t:Script";
     comEnabledItem = new CheckItem(this, "Enabled", 80, CheckType.String);
 }
 public override void InitCheckItem()
 {
     checkerName      = "RefObj";
     isSpecialChecker = true;
     refType          = new CheckItem(this, "类型", 150);
 }