private void drawAllAssets() { GUILayout.BeginHorizontal(); GUILayout.Label("Asset名称", GUILayout.Width(200)); GUILayout.Label("类型", GUILayout.Width(100)); GUILayout.Label("所属其它AssetBundle"); GUILayout.Label("是否冗余", GUILayout.Width(100)); GUILayout.EndHorizontal(); GUILayoutHelper.DrawSeparator(); scrollPos = GUILayout.BeginScrollView(scrollPos, GUILayout.MinHeight(ABMainChecker.MainChecker.Height * 0.4f)); int indexRow = 0; foreach (ResoucresBean res in resList) { if (string.IsNullOrEmpty(searchFilter) || res.Name.Contains(searchFilter)) { indexRow++; drawRowAsset(res, indexRow); } } GUILayout.EndScrollView(); GUILayout.Space(5); GUILayoutHelper.DrawSeparator(); GUILayout.Space(5); GUILayout.BeginHorizontal(); drawDepdencieBundle(); GUILayout.Space(10); drawBeDepdencieBundle(); GUILayout.EndHorizontal(); }
public void OnGUI() { if (curRes.Dependencies.Count > 0) { drawDependencieAsset(); GUILayoutHelper.DrawSeparator(); } drawAllBundles(); }
private void drawAssetsAttribute(ResPropertyGUI[] propertyArr, string resType) { GUILayout.BeginHorizontal(); foreach (ResPropertyGUI rpg in propertyArr) { if (rpg.GuiWidth > 0) { GUILayout.Label(rpg.Title, GUILayout.MaxWidth(rpg.GuiWidth)); } else { GUILayout.Label(rpg.Title); } } GUILayout.EndHorizontal(); GUILayoutHelper.DrawSeparator(); scrollPos = GUILayout.BeginScrollView(scrollPos); int indexRow = 0; foreach (ResoucresBean res in curBundle.GetAllAssets()) { if (res.ResourceType != resType || (!string.IsNullOrEmpty(searchFilter) && !res.Name.Contains(searchFilter))) { continue; } indexRow++; GUI.backgroundColor = indexRow % 2 == 0 ? Color.white : new Color(0.8f, 0.8f, 0.8f); GUILayout.BeginHorizontal("AS TextArea", GUILayout.MinHeight(20f)); GUI.backgroundColor = Color.white; if (res.RawRes == null) { GUI.color = Color.red; GUILayout.Label(res.Name); GUI.color = Color.white; } else { res.RawRes.SetPropertyGUI(propertyArr); res.RawRes.OnGUI(); } GUILayout.EndHorizontal(); } GUILayout.EndScrollView(); }
public void OnGUI() { GUILayoutHelper.DrawHeader("检测AssetBundle"); GUILayout.BeginHorizontal(); if (GUILayout.Button("Asset Bundles", "DropDown", GUILayout.Width(120))) { string path = EditorUtility.OpenFolderPanel("Select", CurFolderRoot, ""); CurFolderRoot = path; curFolder = path; } if (curFolder.StartsWith(Application.dataPath)) { curFolder = curFolder.Replace(Application.dataPath, "Assets"); } GUILayout.TextField(curFolder); GUILayout.Space(10); GUILayout.EndHorizontal(); GUI.backgroundColor = Color.green; if (GUILayout.Button("Go Check", GUILayout.Height(25))) { bundleArr = null; this.FindAllBundles(); } GUI.backgroundColor = Color.white; //Overview GUILayoutHelper.DrawSeparator(); drawOverview(); switch (curView) { case EView.ALLAsset: drawAllAssetBundle(); break; case EView.RedundancyAssets: drawAllRedundancyAsset(); break; case EView.MissingAsset: drawMissingAsset(); break; } }
private void onAddRuleGUI() { AssetImporterWindow aiw = AssetImporterWindow.Instance; string[] rules = aiw.GetRuleKeys <T>(); defaultRuleIndex = EditorGUILayout.Popup("Rules", defaultRuleIndex, rules); if (defaultRuleIndex != 0) { curRule = aiw.GetRule <T>(rules[defaultRuleIndex]); GUILayoutHelper.DrawSeparator(); EditorGUILayout.BeginVertical("Box"); this.OnRuleGUI(curRule); EditorGUILayout.EndVertical(); GUILayout.FlexibleSpace(); GUILayoutHelper.DrawSeparator(); EditorGUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); if (GUILayout.Button(ImportPreferences.BtnApply, GUILayout.MaxWidth(80))) { ruleTabs.Add(curRule.RuleKey); curRuleTab = curRule.RuleKey; keyRules[curRuleTab] = curRule; string relativePath = this.curSelectFolder.RelativePath; string[] sfr = new string[curRule.Folders.Length + 1]; Array.Copy(curRule.Folders, sfr, curRule.Folders.Length); sfr[sfr.Length - 1] = relativePath; curRule.Folders = sfr; AssetImporterWindow.Instance.AddFolderRule(relativePath, curRule); ApplyFolder(curRule, relativePath); EditorUtility.SetDirty(curRule); } EditorGUILayout.EndHorizontal(); } }
private void drawShaderAssets() { GUILayout.BeginHorizontal(); GUILayout.Label("Shader名称", GUILayout.Width(200)); GUILayout.Label("AB数量", GUILayout.Width(80)); GUILayout.Label("所属AssetBundle"); GUILayout.Label("详情", GUILayout.Width(100)); GUILayout.EndHorizontal(); GUILayoutHelper.DrawSeparator(); scrollPos = GUILayout.BeginScrollView(scrollPos); List <ResoucresBean> resList = curBundle.GetAllAssets(EResoucresTypes.ShaderType); int index = 0; foreach (ResoucresBean res in resList) { if (string.IsNullOrEmpty(searchFilter) || res.Name.Contains(searchFilter)) { drawShaderRowAsset(res, index++); } } GUILayout.EndScrollView(); }
private void OnGUI() { switch (curView) { case EView.OverView: overview.OnGUI(); break; default: GUILayout.BeginHorizontal(); if (GUILayout.Button("< Back", GUILayout.Width(100), GUILayout.Height(30))) { curView = EView.OverView; } GUILayout.Label(subPageTitle, titleLabStyle); GUILayout.Space(100); GUILayout.EndHorizontal(); GUILayout.Space(10); GUILayoutHelper.DrawSeparator(); break; } switch (curView) { case EView.BundleDetailView: bundleDetailView.OnGUI(); break; case EView.AssetDistributeView: assetView.OnGUI(); break; } GUILayout.Space(10); }
public void OnGUI() { if (settings == null) { this.Initizalize(); } GUILayoutHelper.DrawHeader("模型规范设置"); using (new EditorGUILayout.HorizontalScope()) { GUILayout.FlexibleSpace(); if (GUILayout.Button("清空", GUILayout.Width(80))) { if (File.Exists(OverviewSetting.LocalParticleFilePath)) { File.Delete(OverviewSetting.LocalParticleFilePath); } OverviewSetting.LocalParticleFilePath = ""; } if (GUILayout.Button("加载", GUILayout.Width(80))) { string filePath = EditorUtility.OpenFilePanel("打开", Application.dataPath, "xml"); OverviewSetting.LocalParticleFilePath = filePath.Replace(Application.dataPath, "Assets"); OverviewSetting.Instance.ReadParticelEffectSettings(); this.Initizalize(); } GUILayout.Space(10); } GUILayout.Space(5); GUILayoutHelper.DrawSeparator(); if (settings != null) { scrollPos = GUILayout.BeginScrollView(scrollPos); for (int i = 0; i < settings.Count; i++) { GUILayout.Space(5); drawSetting(settings[i]); GUILayoutHelper.DrawSeparator(); } if (removeSettings.Count > 0) { for (int i = 0; i < removeSettings.Count; i++) { settings.Remove(removeSettings[i]); } removeSettings.Clear(); } GUILayout.EndScrollView(); } GUILayout.BeginHorizontal(); if (GUILayout.Button("保存")) { if (string.IsNullOrEmpty(OverviewSetting.LocalParticleFilePath)) { string filePath = EditorUtility.SaveFilePanel("保存", Application.dataPath, "new file", "xml"); OverviewSetting.LocalParticleFilePath = filePath.Replace(Application.dataPath, "Assets"); } this.saveSettingRule(OverviewSetting.LocalParticleFilePath); AssetDatabase.Refresh(); Debug.Log("Save Success !"); } GUILayout.Space(10); if (GUILayout.Button("添加规则")) { ParticleEffectSettingBean msb = new ParticleEffectSettingBean(); msb.Folder.Add(string.Empty); settings.Add(msb); } GUILayout.EndHorizontal(); }