public void DrawMaterials() { scrollPosMaterial = EditorGUILayout.BeginScrollView(scrollPosMaterial); GUILayout.BeginHorizontal(); GUILayout.Space(10); string info = "Materials counts {0}"; GUILayout.Label(string.Format(info, ProjectResource.Instance.materials.Count), GUILayout.Width(100)); DrawPageCnt(ProjectResource.Instance.materials.Count); GUILayout.EndHorizontal(); GUILayout.Space(10); //绘制title GUILayout.BeginHorizontal(); if (GUILayout.Button(LanguageCfg.NAME, GUILayout.Width(150))) { mCurPage = 0; ProjectResource.Instance.SortMaterial(MaterialInfo.SortType.Name); } if (GUILayout.Button(LanguageCfg.ShaderName, GUILayout.Width(500))) { mCurPage = 0; ProjectResource.Instance.SortMaterial(MaterialInfo.SortType.ShaderName); } if (GUILayout.Button(LanguageCfg.PROPOSE, GUILayout.Width(100))) { mCurPage = 0; ProjectResource.Instance.SortMaterial(MaterialInfo.SortType.Propose); } GUILayout.EndHorizontal(); int start = mPageCnt * mCurPage; int end = mPageCnt * (mCurPage + 1); end = end >= ProjectResource.Instance.materials.Count ? ProjectResource.Instance.materials.Count : end; for (int i = start; i < end; i++) { MaterialInfo materialInfo = ProjectResource.Instance.materials[i]; GUILayout.BeginHorizontal(); if (GUILayout.Button(materialInfo.name, GUILayout.Width(150))) { EditTools.PingAssetInProject(materialInfo.path); } GUILayout.Space(10); GUILayout.Label(materialInfo.shaderName.ToString(), GUILayout.MaxWidth(500)); DrawProposeTips(materialInfo); GUILayout.EndHorizontal(); } EditorGUILayout.EndScrollView(); }
protected void DrawProposeTips(ResInfo refInfo) { if (refInfo.proposeTipCount > 0) { if (GUILayout.Button("建议", GUILayout.Width(100))) { EditTools.PingAssetInProject(refInfo.path); EditorUtility.DisplayDialog("Tips", refInfo.GetResInfoDetails(), "OK"); } } }
public void DrawTextures() { GUILayout.Space(10); actSubTypeTexture = (ActiveSubType)GUILayout.Toolbar((int)actSubTypeTexture, textureToolStrings, GUILayout.MaxWidth(200)); GUILayout.Space(10); scrollPosTexture = EditorGUILayout.BeginScrollView(scrollPosTexture); if (actSubTypeTexture == ActiveSubType.Details) { GUILayout.BeginHorizontal(); GUILayout.Label(string.Format(LanguageCfg.PROJECT_TEXTURES_LIST, ProjectResource.Instance.textures.Count), GUILayout.Width(150)); if (GUILayout.Button(LanguageCfg.TEXTURE_SETTING_NO_MINMAP, GUILayout.Width(120))) { ProjectResource.Instance.SetTextureNoMinmap(); } DrawPageCnt(ProjectResource.Instance.textures.Count); GUILayout.EndHorizontal(); GUILayout.Space(10); //绘制title GUILayout.BeginHorizontal(); if (GUILayout.Button(LanguageCfg.NAME, GUILayout.Width(150))) { mCurPage = 0; ProjectResource.Instance.SortTexture(TextureInfo.SortType.Name); } if (GUILayout.Button(LanguageCfg.MemorySize, GUILayout.Width(100))) { mCurPage = 0; ProjectResource.Instance.SortTexture(TextureInfo.SortType.MemorySize); } if (GUILayout.Button(LanguageCfg.PIX_W, GUILayout.Width(50))) { mCurPage = 0; ProjectResource.Instance.SortTexture(TextureInfo.SortType.PixWidth); } if (GUILayout.Button(LanguageCfg.PIX_H, GUILayout.Width(50))) { mCurPage = 0; ProjectResource.Instance.SortTexture(TextureInfo.SortType.PixHeigh); } if (GUILayout.Button(LanguageCfg.IsRW, GUILayout.Width(50))) { mCurPage = 0; ProjectResource.Instance.SortTexture(TextureInfo.SortType.IsRW); } if (GUILayout.Button(LanguageCfg.OverridePlat, GUILayout.Width(100))) { mCurPage = 0; } if (GUILayout.Button(LanguageCfg.Mipmap, GUILayout.Width(100))) { mCurPage = 0; ProjectResource.Instance.SortTexture(TextureInfo.SortType.Mipmap); } if (GUILayout.Button(LanguageCfg.IsLightmap, GUILayout.Width(80))) { mCurPage = 0; ProjectResource.Instance.SortTexture(TextureInfo.SortType.IsLightmap); } if (GUILayout.Button(LanguageCfg.AnisoLevel, GUILayout.Width(80))) { mCurPage = 0; ProjectResource.Instance.SortTexture(TextureInfo.SortType.AnisoLevel); } if (GUILayout.Button(LanguageCfg.PROPOSE, GUILayout.Width(100))) { mCurPage = 0; ProjectResource.Instance.SortTexture(TextureInfo.SortType.Propose); } GUILayout.EndHorizontal(); int start = mPageCnt * mCurPage; int end = mPageCnt * (mCurPage + 1); end = end >= ProjectResource.Instance.textures.Count ? ProjectResource.Instance.textures.Count : end; for (int i = start; i < end; i++) { TextureInfo textureInfo = ProjectResource.Instance.textures[i]; GUILayout.BeginHorizontal(); if (GUILayout.Button(textureInfo.name, GUILayout.Width(150))) { EditTools.PingAssetInProject(textureInfo.path); //Selection.activeObject = textureInfo.texture; } GUILayout.Space(10); GUILayout.Label(textureInfo.GetSize(), GUILayout.MaxWidth(100)); GUILayout.Label(textureInfo.width + "x" + textureInfo.height, GUILayout.MaxWidth(100)); GUILayout.Label(textureInfo.isRW.ToString(), GUILayout.MaxWidth(50)); GUILayout.Label(textureInfo.IsOverridePlatform(), GUILayout.MaxWidth(100)); GUILayout.Label(textureInfo.isMipmap.ToString(), GUILayout.MaxWidth(100)); GUILayout.Label(textureInfo.isLightmap.ToString(), GUILayout.MaxWidth(80)); GUILayout.Label(textureInfo.anisoLevel.ToString(), GUILayout.MaxWidth(80)); DrawProposeTips(textureInfo); GUILayout.EndHorizontal(); } } else if (actSubTypeTexture == ActiveSubType.Settings) { GUILayout.BeginHorizontal(); SettingCfgUI.textureCheckMemSize = GUILayout.Toggle(SettingCfgUI.textureCheckMemSize, "检查内存大小", GUILayout.MaxWidth(100)); SettingCfgUI.textureCheckMemSizeValue = GUILayout.TextField(SettingCfgUI.textureCheckMemSizeValue, GUILayout.MaxWidth(80)); GUILayout.Label("kb", GUILayout.MaxWidth(20)); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); SettingCfgUI.textureCheckPix = GUILayout.Toggle(SettingCfgUI.textureCheckPix, "检查分辨率", GUILayout.MaxWidth(100)); SettingCfgUI.textureCheckPixW = GUILayout.TextField(SettingCfgUI.textureCheckPixW, GUILayout.MaxWidth(80)); GUILayout.Label("x", GUILayout.MaxWidth(20)); SettingCfgUI.textureCheckPixH = GUILayout.TextField(SettingCfgUI.textureCheckPixH, GUILayout.MaxWidth(80)); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); SettingCfgUI.textureCheckPix2Pow = GUILayout.Toggle(SettingCfgUI.textureCheckPix2Pow, "检查2N次幂", GUILayout.MaxWidth(100)); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); SettingCfgUI.textureCheckIsRW = GUILayout.Toggle(SettingCfgUI.textureCheckIsRW, "检查可读写", GUILayout.MaxWidth(100)); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); SettingCfgUI.textureCheckPlatSetting = GUILayout.Toggle(SettingCfgUI.textureCheckPlatSetting, "检查平台设置", GUILayout.MaxWidth(100)); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); SettingCfgUI.textureCheckIsLightmap = GUILayout.Toggle(SettingCfgUI.textureCheckIsLightmap, "检查lightmap格式", GUILayout.MaxWidth(150)); GUILayout.EndHorizontal(); if (GUILayout.Button("应用", GUILayout.MaxWidth(100))) { SettingCfg.Apply(true); ProjectResource.Instance.ReCheckTextures(); } } else { DrawHelpTips(LanguageCfg.HELP_TEXTURE); } EditorGUILayout.EndScrollView(); }
public void DrawModels() { GUILayout.Space(10); actSubTypeModel = (ActiveSubType)GUILayout.Toolbar((int)actSubTypeModel, modelToolStrings, GUILayout.MaxWidth(200)); GUILayout.Space(10); scrollPosModel = EditorGUILayout.BeginScrollView(scrollPosModel); if (actSubTypeModel == ActiveSubType.Details) { GUILayout.BeginHorizontal(); string info = "Model counts1 {0}"; GUILayout.Label(string.Format(info, ProjectResource.Instance.models.Count), GUILayout.Width(200)); if (GUILayout.Button(LanguageCfg.SettingModelDefault, GUILayout.Width(120))) { ProjectResource.Instance.SetModelDefault(); } if (GUILayout.Button(LanguageCfg.SettingMeshCompress, GUILayout.Width(120))) { ProjectResource.Instance.SetModelsMeshCompress(); } if (GUILayout.Button(LanguageCfg.SettingAnimCompress, GUILayout.Width(120))) { ProjectResource.Instance.SetModelsAnimCompress(); } if (GUILayout.Button(LanguageCfg.SettingWriteClose, GUILayout.Width(120))) { ProjectResource.Instance.SetModelsWriteReadClose(); } DrawPageCnt(ProjectResource.Instance.models.Count); GUILayout.EndHorizontal(); GUILayout.Space(10); //绘制title GUILayout.BeginHorizontal(); if (GUILayout.Button(LanguageCfg.NAME, GUILayout.Width(150))) { mCurPage = 0; ProjectResource.Instance.SortModel(ModelInfo.SortType.Name); } if (GUILayout.Button(LanguageCfg.Scale, GUILayout.Width(50))) { mCurPage = 0; ProjectResource.Instance.SortModel(ModelInfo.SortType.Scale); } if (GUILayout.Button(LanguageCfg.MeshCompress, GUILayout.Width(80))) { mCurPage = 0; ProjectResource.Instance.SortModel(ModelInfo.SortType.MeshCompression); } if (GUILayout.Button(LanguageCfg.AnimCompress, GUILayout.Width(180))) { mCurPage = 0; ProjectResource.Instance.SortModel(ModelInfo.SortType.AnimCompression); } if (GUILayout.Button(LanguageCfg.AnimCnt, GUILayout.Width(80))) { mCurPage = 0; ProjectResource.Instance.SortModel(ModelInfo.SortType.AnimationClipCount); } if (GUILayout.Button(LanguageCfg.IsRW, GUILayout.Width(50))) { mCurPage = 0; ProjectResource.Instance.SortModel(ModelInfo.SortType.IsRW); } if (GUILayout.Button(LanguageCfg.Collider, GUILayout.Width(80))) { mCurPage = 0; ProjectResource.Instance.SortModel(ModelInfo.SortType.Collider); } if (GUILayout.Button(LanguageCfg.NormalMode, GUILayout.Width(80))) { mCurPage = 0; ProjectResource.Instance.SortModel(ModelInfo.SortType.NormalImportMode); } if (GUILayout.Button(LanguageCfg.TangentMode, GUILayout.Width(80))) { mCurPage = 0; ProjectResource.Instance.SortModel(ModelInfo.SortType.TangentImportMode); } if (GUILayout.Button(LanguageCfg.BakeIK, GUILayout.Width(80))) { mCurPage = 0; ProjectResource.Instance.SortModel(ModelInfo.SortType.BakeIK); } if (GUILayout.Button(LanguageCfg.FileSize, GUILayout.Width(80))) { mCurPage = 0; ProjectResource.Instance.SortModel(ModelInfo.SortType.FileSize); } if (GUILayout.Button(LanguageCfg.SkinnedMeshCnt, GUILayout.Width(80))) { mCurPage = 0; ProjectResource.Instance.SortModel(ModelInfo.SortType.SkinnedMeshCount); } if (GUILayout.Button(LanguageCfg.MeshFilterCnt, GUILayout.Width(100))) { mCurPage = 0; ProjectResource.Instance.SortModel(ModelInfo.SortType.MeshFilterCount); } if (GUILayout.Button(LanguageCfg.VertexCnt, GUILayout.Width(80))) { mCurPage = 0; ProjectResource.Instance.SortModel(ModelInfo.SortType.VertexCount); } if (GUILayout.Button(LanguageCfg.TriangleCnt, GUILayout.Width(80))) { mCurPage = 0; ProjectResource.Instance.SortModel(ModelInfo.SortType.TriangleCount); } if (GUILayout.Button(LanguageCfg.BoneCnt, GUILayout.Width(80))) { mCurPage = 0; ProjectResource.Instance.SortModel(ModelInfo.SortType.BoneCount); } if (GUILayout.Button(LanguageCfg.PROPOSE, GUILayout.Width(100))) { mCurPage = 0; ProjectResource.Instance.SortModel(ModelInfo.SortType.Propose); } GUILayout.EndHorizontal(); int start = mPageCnt * mCurPage; int end = mPageCnt * (mCurPage + 1); end = end >= ProjectResource.Instance.models.Count ? ProjectResource.Instance.models.Count : end; for (int i = start; i < end; i++) { ModelInfo modelInfo = ProjectResource.Instance.models[i]; GUILayout.BeginHorizontal(); if (GUILayout.Button(modelInfo.name, GUILayout.Width(150))) { EditTools.PingAssetInProject(modelInfo.path); } GUILayout.Space(10); GUILayout.Label(modelInfo.scale.ToString(), GUILayout.MaxWidth(50)); GUILayout.Label(modelInfo.meshCompression.ToString(), GUILayout.MaxWidth(80)); GUILayout.Label(modelInfo.animCompression.ToString(), GUILayout.MaxWidth(180)); GUILayout.Label(modelInfo.animationClipCount.ToString(), GUILayout.MaxWidth(80)); GUILayout.Label(modelInfo.isRW.ToString(), GUILayout.MaxWidth(50)); GUILayout.Label(modelInfo.isAddCollider.ToString(), GUILayout.MaxWidth(80)); GUILayout.Label(modelInfo.normalImportMode.ToString(), GUILayout.MaxWidth(80)); GUILayout.Label(modelInfo.tangentImportMode.ToString(), GUILayout.MaxWidth(80)); GUILayout.Label(modelInfo.isBakeIK.ToString(), GUILayout.MaxWidth(80)); GUILayout.Label(modelInfo.GetFileLenth(), GUILayout.MaxWidth(80)); GUILayout.Label(modelInfo.skinnedMeshCount.ToString(), GUILayout.MaxWidth(80)); GUILayout.Label(modelInfo.meshFilterCount.ToString(), GUILayout.MaxWidth(100)); GUILayout.Label(modelInfo.vertexCount.ToString(), GUILayout.MaxWidth(80)); GUILayout.Label(modelInfo.triangleCount.ToString(), GUILayout.MaxWidth(80)); GUILayout.Label(modelInfo.boneCount.ToString(), GUILayout.MaxWidth(80)); DrawProposeTips(modelInfo); GUILayout.EndHorizontal(); } } else if (actSubTypeModel == ActiveSubType.Settings) { GUILayout.BeginHorizontal(); SettingCfgUI.modelCheckScale = GUILayout.Toggle(SettingCfgUI.modelCheckScale, "检查Scale属性", GUILayout.MaxWidth(100)); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); SettingCfgUI.modelCheckMeshCompression = GUILayout.Toggle(SettingCfgUI.modelCheckMeshCompression, "检查Mesh压缩", GUILayout.MaxWidth(100)); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); SettingCfgUI.modelCheckAnimCompression = GUILayout.Toggle(SettingCfgUI.modelCheckAnimCompression, "检查动画压缩", GUILayout.MaxWidth(100)); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); SettingCfgUI.modelCheckMeshIsRW = GUILayout.Toggle(SettingCfgUI.modelCheckMeshIsRW, "检查可读写", GUILayout.MaxWidth(100)); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); SettingCfgUI.modelCheckCollider = GUILayout.Toggle(SettingCfgUI.modelCheckCollider, "检查是否生成碰撞器", GUILayout.MaxWidth(100)); GUILayout.EndHorizontal(); //GUILayout.BeginHorizontal(); //SettingCfgUI.modelCheckNormals = GUILayout.Toggle(SettingCfgUI.modelCheckNormals, "检查是否存在法线", GUILayout.MaxWidth(100)); //GUILayout.EndHorizontal(); //GUILayout.BeginHorizontal(); //SettingCfgUI.modelCheckTangents = GUILayout.Toggle(SettingCfgUI.modelCheckTangents, "检查是否存在切线", GUILayout.MaxWidth(100)); //GUILayout.EndHorizontal(); //GUILayout.BeginHorizontal(); //SettingCfgUI.modelCheckFileSize = GUILayout.Toggle(SettingCfgUI.modelCheckFileSize, "检查文件大小", GUILayout.MaxWidth(100)); //SettingCfgUI.modelCheckFileSizeValue = GUILayout.TextField(SettingCfgUI.modelCheckFileSizeValue, GUILayout.MaxWidth(80)); //GUILayout.Label("kb", GUILayout.MaxWidth(20)); //GUILayout.EndHorizontal(); if (GUILayout.Button("应用", GUILayout.MaxWidth(100))) { SettingCfg.Apply(true); ProjectResource.Instance.ReCheckModels(); } } else { DrawHelpTips(LanguageCfg.HELP_MODEL); } EditorGUILayout.EndScrollView(); }
public void DrawParticles() { GUILayout.Space(10); actSubTypeTexture = (ActiveSubType)GUILayout.Toolbar((int)actSubTypeTexture, toolStrings, GUILayout.MaxWidth(200)); GUILayout.Space(10); GUILayout.BeginHorizontal(); GUILayout.Label(string.Format(LanguageCfg.PROJECT_PARTICLE_LIST, ProjectResource.Instance.particles.Count), GUILayout.Width(150)); if (GUILayout.Button(LanguageCfg.PARTICLES_REFRESH, GUILayout.Width(120))) { ProjectResource.Instance.CollectParticles(); } DrawPageCnt(ProjectResource.Instance.particles.Count); GUILayout.EndHorizontal(); scrollPosTexture = EditorGUILayout.BeginScrollView(scrollPosTexture); if (actSubTypeTexture == ActiveSubType.Details) { //绘制title GUILayout.BeginHorizontal(); if (GUILayout.Button(LanguageCfg.NAME, GUILayout.Width(150))) { mCurPage = 0; ProjectResource.Instance.SortParticle(ParticleInfo.SortType.Name); } if (GUILayout.Button(LanguageCfg.PARTICLE_SYS_PARENT_IS_PARTICLE, GUILayout.Width(100))) { mCurPage = 0; ProjectResource.Instance.SortParticle(ParticleInfo.SortType.ParentIsParticle); } if (GUILayout.Button(LanguageCfg.PARTICLE_SYS_CNT, GUILayout.Width(100))) { mCurPage = 0; ProjectResource.Instance.SortParticle(ParticleInfo.SortType.ParticleSysCnt); } if (GUILayout.Button(LanguageCfg.PARTICLE_SYS_MAX_DURATION, GUILayout.Width(100))) { mCurPage = 0; ProjectResource.Instance.SortParticle(ParticleInfo.SortType.Duration); } if (GUILayout.Button(LanguageCfg.PARTICLE_SYS_MAX_PARTICLES, GUILayout.Width(100))) { mCurPage = 0; ProjectResource.Instance.SortParticle(ParticleInfo.SortType.MaxParticles); } if (GUILayout.Button(LanguageCfg.PARTICLE_SYS_MIN_PARTICLES, GUILayout.Width(100))) { mCurPage = 0; ProjectResource.Instance.SortParticle(ParticleInfo.SortType.MinParticles); } //if (GUILayout.Button(LanguageCfg.PARTICLE_SYS_MIN_COLIDER, GUILayout.Width(100))) //{ // ProjectResource.Instance.SortParticle(ParticleInfo.SortType.Conllier); //} GUILayout.EndHorizontal(); int start = mPageCnt * mCurPage; int end = mPageCnt * (mCurPage + 1); end = end >= ProjectResource.Instance.particles.Count ? ProjectResource.Instance.particles.Count : end; for (int i = start; i < end; i++) { ParticleInfo info = ProjectResource.Instance.particles[i]; GUILayout.BeginHorizontal(); if (GUILayout.Button(info.name, GUILayout.Width(150))) { EditTools.PingAssetInProject(info.path); } GUILayout.Label(info.parentIsParticle.ToString(), GUILayout.Width(100)); GUILayout.Label(info.particleSysCnt.ToString(), GUILayout.Width(100)); GUILayout.Label(info.duration.ToString(), GUILayout.Width(100)); GUILayout.Label(info.maxParticles.ToString(), GUILayout.Width(100)); GUILayout.Label(info.minParticles.ToString(), GUILayout.Width(100)); //GUILayout.Label(info.conllier.ToString(), GUILayout.Width(100)); GUILayout.EndHorizontal(); } } else if (actSubTypeTexture == ActiveSubType.Helps) { DrawHelpTips(LanguageCfg.HELP_PARTICLE); } EditorGUILayout.EndScrollView(); }