Beispiel #1
0
 // Token: 0x0600039B RID: 923 RVA: 0x00032AE9 File Offset: 0x00030CE9
 private void OnToolsMemoryUsageExecute(GUIToolbarMenuItem sender)
 {
     this._memoryUsage.Visible = !this._memoryUsage.Visible;
     if (this._memoryUsage.Visible)
     {
         this.UpdateMemoryUsage();
     }
 }
Beispiel #2
0
        // Token: 0x060003A4 RID: 932 RVA: 0x00032C44 File Offset: 0x00030E44
        private void OnToolsAbout(GUIToolbarMenuItem sender)
        {
            AboutWindow window = EditorWindow.GetWindow <AboutWindow>(true, "About " + Globals.ProductTitle, true);

            window.ProductName   = Globals.ProductName;
            window.FeedbackUrl   = Globals.ProductFeedbackUrl;
            window.AssetStoreUrl = Globals.ProductAssetStoreUrl;
            window.Show();
        }
Beispiel #3
0
        // Token: 0x060003A0 RID: 928 RVA: 0x00032BA0 File Offset: 0x00030DA0
        private GUIControlStatus OnWarningsLossyCompressedSourceTextureQuery(GUIToolbarMenuItem sender)
        {
            GUIControlStatus guicontrolStatus = GUIControlStatus.Enable | GUIControlStatus.Visible;

            if (Globals.WarnLossyCompressedSourceTexture)
            {
                guicontrolStatus |= GUIControlStatus.Checked;
            }
            return(guicontrolStatus);
        }
Beispiel #4
0
        // Token: 0x060003A6 RID: 934 RVA: 0x00032CAC File Offset: 0x00030EAC
        private GUIControlStatus OnToolsGpuExpandRgb24ToRgba32Query(GUIToolbarMenuItem sender)
        {
            GUIControlStatus guicontrolStatus = GUIControlStatus.Enable | GUIControlStatus.Visible;

            if (Globals.GpuExpandRgb24ToRgba32)
            {
                guicontrolStatus |= GUIControlStatus.Checked;
            }
            return(guicontrolStatus);
        }
Beispiel #5
0
        // Token: 0x0600039E RID: 926 RVA: 0x00032B68 File Offset: 0x00030D68
        private GUIControlStatus OnWarningsCompressionFailQuery(GUIToolbarMenuItem sender)
        {
            GUIControlStatus guicontrolStatus = GUIControlStatus.Enable | GUIControlStatus.Visible;

            if (Globals.WarnCompressionFail)
            {
                guicontrolStatus |= GUIControlStatus.Checked;
            }
            return(guicontrolStatus);
        }
Beispiel #6
0
        // Token: 0x060003A8 RID: 936 RVA: 0x00032CD8 File Offset: 0x00030ED8
        private GUIControlStatus OnToolsCountRendererQuery(GUIToolbarMenuItem sender)
        {
            GUIControlStatus guicontrolStatus = GUIControlStatus.Enable | GUIControlStatus.Visible;

            if (Globals.CountRendererInSceneMode)
            {
                guicontrolStatus |= GUIControlStatus.Checked;
            }
            return(guicontrolStatus);
        }
Beispiel #7
0
        // Token: 0x060003AC RID: 940 RVA: 0x00032D48 File Offset: 0x00030F48
        private GUIControlStatus OnToolsShowPackageAssetsQuery(GUIToolbarMenuItem sender)
        {
            GUIControlStatus guicontrolStatus = GUIControlStatus.Enable | GUIControlStatus.Visible;

            if (Globals.ShowPackageAssets)
            {
                guicontrolStatus |= GUIControlStatus.Checked;
            }
            return(guicontrolStatus);
        }
Beispiel #8
0
        // Token: 0x060003B8 RID: 952 RVA: 0x0003334C File Offset: 0x0003154C
        private GUIControlStatus OnQueryTypeFilter(GUIToolbarMenuItem sender)
        {
            GUIControlStatus guicontrolStatus = GUIControlStatus.Enable | GUIControlStatus.Visible;

            if (this._listview.HasTypeFilter(sender.Tag as Listbox.TypeFilter))
            {
                guicontrolStatus |= GUIControlStatus.Checked;
            }
            return(guicontrolStatus);
        }
Beispiel #9
0
        // Token: 0x060003A2 RID: 930 RVA: 0x00032BD8 File Offset: 0x00030DD8
        private GUIControlStatus OnWarningsLegacyCubemapQuery(GUIToolbarMenuItem sender)
        {
            GUIControlStatus guicontrolStatus = GUIControlStatus.Enable | GUIControlStatus.Visible;

            if (Globals.WarnLegacyCubemap)
            {
                guicontrolStatus |= GUIControlStatus.Checked;
            }
            return(guicontrolStatus);
        }
Beispiel #10
0
        // Token: 0x060003A3 RID: 931 RVA: 0x00032BF4 File Offset: 0x00030DF4
        private void OnToolsRebuildCacheExecute(GUIToolbarMenuItem sender)
        {
            string text = "Rebuilding the Texture Overview Cache often helps if Texture Overview displays invalid/non-sense data, that could occur when switching between different Unity versions or installing/uninstalling Platform modules.\n\nRebuilding the Cache might take a while to complete, but can be canceled and resumed at any time.\n\nDo you want to continue?";

            if (!EditorUtility.DisplayDialog(Globals.ProductTitle, text, "Rebuild", "Cancel"))
            {
                return;
            }
            this._listview.DeleteCacheFile();
            this._listview.ReadCacheFile();
            this.DoPickModeChange(this._pickmode, true);
        }
Beispiel #11
0
        // Token: 0x0600039C RID: 924 RVA: 0x00032B18 File Offset: 0x00030D18
        private GUIControlStatus OnToolsMemoryUsageQuery(GUIToolbarMenuItem sender)
        {
            GUIControlStatus guicontrolStatus = GUIControlStatus.Visible;

            if (this._listview.Platform != null)
            {
                guicontrolStatus |= GUIControlStatus.Enable;
            }
            if (this._memoryUsage.Visible)
            {
                guicontrolStatus |= GUIControlStatus.Checked;
            }
            return(guicontrolStatus);
        }
Beispiel #12
0
 // Token: 0x060003B7 RID: 951 RVA: 0x000332DC File Offset: 0x000314DC
 private void OnTypeFilterExecute(GUIToolbarMenuItem sender)
 {
     this._listview.BeginChangeFilter();
     try
     {
         Listbox.TypeFilter filter = sender.Tag as Listbox.TypeFilter;
         if (this._listview.HasTypeFilter(filter))
         {
             this._listview.RemoveTypeFilter(filter);
         }
         else
         {
             this._listview.AddTypeFilter(filter);
         }
         base.Repaint();
     }
     finally
     {
         this._listview.EndChangeFilter();
     }
 }
Beispiel #13
0
 // Token: 0x0600039D RID: 925 RVA: 0x00032B4A File Offset: 0x00030D4A
 private void OnWarningsCompressionFailExecute(GUIToolbarMenuItem sender)
 {
     Globals.WarnCompressionFail = !Globals.WarnCompressionFail;
     this.DoPickModeChange(this._pickmode, false);
 }
Beispiel #14
0
 // Token: 0x060003AB RID: 939 RVA: 0x00032D2B File Offset: 0x00030F2B
 private void OnToolsShowPackageAssetsExecute(GUIToolbarMenuItem sender)
 {
     Globals.ShowPackageAssets = !Globals.ShowPackageAssets;
     this.DoPickModeChange(this._pickmode, false);
 }
Beispiel #15
0
 // Token: 0x060003A7 RID: 935 RVA: 0x00032CC7 File Offset: 0x00030EC7
 private void OnToolsCountRendererExecute(GUIToolbarMenuItem sender)
 {
     Globals.CountRendererInSceneMode = !Globals.CountRendererInSceneMode;
 }
Beispiel #16
0
 // Token: 0x0600039F RID: 927 RVA: 0x00032B83 File Offset: 0x00030D83
 private void OnWarningsLossyCompressedSourceTextureExecute(GUIToolbarMenuItem sender)
 {
     Globals.WarnLossyCompressedSourceTexture = !Globals.WarnLossyCompressedSourceTexture;
     this.DoPickModeChange(this._pickmode, false);
 }
Beispiel #17
0
 // Token: 0x060003A5 RID: 933 RVA: 0x00032C8F File Offset: 0x00030E8F
 private void OnToolsGpuExpandRgb24ToRgba32Execute(GUIToolbarMenuItem sender)
 {
     Globals.GpuExpandRgb24ToRgba32 = !Globals.GpuExpandRgb24ToRgba32;
     this._listview.RefreshModels();
 }
Beispiel #18
0
 // Token: 0x060003A1 RID: 929 RVA: 0x00032BBB File Offset: 0x00030DBB
 private void OnWarningsLegacyCubemapExecute(GUIToolbarMenuItem sender)
 {
     Globals.WarnLegacyCubemap = !Globals.WarnLegacyCubemap;
     this.DoPickModeChange(this._pickmode, false);
 }
Beispiel #19
0
        // Token: 0x0600038F RID: 911 RVA: 0x00031F78 File Offset: 0x00030178
        protected override void __OnCreate()
        {
            BuildTargetGroup @int = (BuildTargetGroup)EditorPrefs.GetInt(string.Format("{0}.Platform", Globals.ProductId), 0);

            this._listview = new Listbox(this, null);
            this._listview.EditorPrefsPath = string.Format("{0}.ListView", Globals.ProductId);
            this._listview.LoadPrefs();
            this._listview.EmptyText = "Loading texture importer settings. Please wait...";
            this._listview.SetPlatform(@int);
            this._menu = new GUIToolbar(this, null);
            GUIToolbarMenu guitoolbarMenu = this._menu.AddMenu("Tools", "", null);

            guitoolbarMenu.Add(new GUIToolbarMenuItem("Export as CSV...", new Action <GUIToolbarMenuItem>(this.OnToolsExportCsvExecute)));
            guitoolbarMenu.Add(new GUIToolbarMenuItem("Memory Usage", new Action <GUIToolbarMenuItem>(this.OnToolsMemoryUsageExecute), new Func <GUIToolbarMenuItem, GUIControlStatus>(this.OnToolsMemoryUsageQuery)));
            guitoolbarMenu.Add(new GUIToolbarMenuItem("Issue Detection/Warn Compression Fail", new Action <GUIToolbarMenuItem>(this.OnWarningsCompressionFailExecute), new Func <GUIToolbarMenuItem, GUIControlStatus>(this.OnWarningsCompressionFailQuery)));
            guitoolbarMenu.Add(new GUIToolbarMenuItem("Issue Detection/Warn Lossy Compressed Source Texture", new Action <GUIToolbarMenuItem>(this.OnWarningsLossyCompressedSourceTextureExecute), new Func <GUIToolbarMenuItem, GUIControlStatus>(this.OnWarningsLossyCompressedSourceTextureQuery)));
            guitoolbarMenu.Add(new GUIToolbarMenuItem("Issue Detection/Warn Legacy Cubemap", new Action <GUIToolbarMenuItem>(this.OnWarningsLegacyCubemapExecute), new Func <GUIToolbarMenuItem, GUIControlStatus>(this.OnWarningsLegacyCubemapQuery)));
            guitoolbarMenu.Add(GUIToolbarMenuItem.Separator);
            guitoolbarMenu.Add(new GUIToolbarMenuItem("Advanced/Show assets from Editor directories", new Action <GUIToolbarMenuItem>(this.OnToolsShowEditorAssetsExecute), new Func <GUIToolbarMenuItem, GUIControlStatus>(this.OnToolsShowEditorAssetsQuery)));
            guitoolbarMenu.Add(new GUIToolbarMenuItem("Advanced/Show assets from Packages", new Action <GUIToolbarMenuItem>(this.OnToolsShowPackageAssetsExecute), new Func <GUIToolbarMenuItem, GUIControlStatus>(this.OnToolsShowPackageAssetsQuery)));
            guitoolbarMenu.Add(new GUIToolbarMenuItem("Advanced/Count Renderer (Scene mode only, EXPERIMENTAL)", new Action <GUIToolbarMenuItem>(this.OnToolsCountRendererExecute), new Func <GUIToolbarMenuItem, GUIControlStatus>(this.OnToolsCountRendererQuery)));
            guitoolbarMenu.Add(new GUIToolbarMenuItem("Advanced/Handle RGB24 as RGBA32 on GPU", new Action <GUIToolbarMenuItem>(this.OnToolsGpuExpandRgb24ToRgba32Execute), new Func <GUIToolbarMenuItem, GUIControlStatus>(this.OnToolsGpuExpandRgb24ToRgba32Query)));
            guitoolbarMenu.Add(new GUIToolbarMenuItem("Advanced/Rebuild Texture Overview Cache...", new Action <GUIToolbarMenuItem>(this.OnToolsRebuildCacheExecute)));
            guitoolbarMenu.Add(GUIToolbarMenuItem.Separator);
            guitoolbarMenu.Add(new GUIToolbarMenuItem("About", new Action <GUIToolbarMenuItem>(this.OnToolsAbout)));
            this._pickmode = (MainWindow.PickMode)EditorPrefs.GetInt(string.Format("{0}.PickMode", Globals.ProductId), (int)this._pickmode);
            GUIToolbarPopup guitoolbarPopup = this._menu.AddPopup("", "Select from where to list textures.", new GUIControlExecuteDelegate(this.OnPickModeChange));

            guitoolbarPopup.Items = new GUIToolbarPopupItem[]
            {
                new GUIToolbarPopupItem("Project", MainWindow.PickMode.Project),
                new GUIToolbarPopupItem("Scene", MainWindow.PickMode.Scene),
                new GUIToolbarPopupItem("Selection", MainWindow.PickMode.Selection),
                new GUIToolbarPopupItem("AssetBundle Manifest", MainWindow.PickMode.AssetBundleManifest)
            };
            guitoolbarPopup.SelectTag(this._pickmode);
            this._lockbutton           = this._menu.AddButton("", "Selection changes within the Unity Project or Hierachy window have no impact on the list when it is locked.", null, new GUIControlExecuteDelegate(this.OnLockToggle), new GUIControlQueryStatusDelegate(this.OnQueryLockToggle));
            this._lockbutton.ImageSize = new Vector2(13f, 13f);
            this.SetLock(false);
            GUIToolbarButton guitoolbarButton = this._menu.AddButton("Refresh", "Get new snapshot of all textures used by GameObjects at this moment.", EditorFramework.Images.Refresh16x16, new GUIControlExecuteDelegate(this.OnRefreshScene), new GUIControlQueryStatusDelegate(this.OnQueryRefreshScene));

            guitoolbarButton.ImageSize = new Vector2(13f, 13f);
            this._menu.AddSpace(8f);
            this._menu.AddFlexibleSpace();
            this._searchfield             = this._menu.AddSearchField("", null, new GUIControlExecuteDelegate(this.OnSearchChange), null);
            this._searchfield.SearchModes = new string[]
            {
                "Search in All",
                "Search in Name",
                "Search in Path",
                "Search in Sprite Packing Tag"
            };
            this._searchfield.SearchMode    = EditorPrefs.GetInt(string.Format("{0}.TextFilterMode", Globals.ProductId), 0);
            this._searchfield.LayoutOptions = new GUILayoutOption[]
            {
                GUILayout.MinWidth(50f),
                GUILayout.MaxWidth(5000f),
                GUILayout.ExpandWidth(true)
            };
            this._searchfield.AcceptDrop = true;
            this._typeMenu = this._menu.AddMenu("", "Filter by Type", null);
            foreach (Listbox.TypeFilter typeFilter in new Listbox.TypeFilter[]
            {
                new Listbox.TypeFilter("Default", (TextureImporterType)0, (TextureImporterShape)1),
                new Listbox.TypeFilter("Normal map", (TextureImporterType)1, (TextureImporterShape)1),
                new Listbox.TypeFilter("Editor GUI & Legacy UI", (TextureImporterType)2, (TextureImporterShape)1),
                new Listbox.TypeFilter("Sprite (2D & UI)", (TextureImporterType)8, (TextureImporterShape)1),
                new Listbox.TypeFilter("Cubemap", 0, (TextureImporterShape)2),
                new Listbox.TypeFilter("Cursor", (TextureImporterType)7, (TextureImporterShape)1),
                new Listbox.TypeFilter("Cookie", (TextureImporterType)4, (TextureImporterShape)1),
                new Listbox.TypeFilter("Lightmap", (TextureImporterType)6, (TextureImporterShape)1),
                new Listbox.TypeFilter("Single Channel", (TextureImporterType)10, (TextureImporterShape)1)
            })
            {
                GUIToolbarMenuItem guitoolbarMenuItem = new GUIToolbarMenuItem(typeFilter.Name.Replace("&", "and"), new Action <GUIToolbarMenuItem>(this.OnTypeFilterExecute), new Func <GUIToolbarMenuItem, GUIControlStatus>(this.OnQueryTypeFilter));
                guitoolbarMenuItem.Tag = typeFilter;
                this._typeMenu.Add(guitoolbarMenuItem);
            }
            this._typeMenu.Add(GUIToolbarMenuItem.Separator);
            this._typeMenu.Add(new GUIToolbarMenuItem("Reset Type Filter", new Action <GUIToolbarMenuItem>(this.OnTypeFilterResetExecute))
            {
                Tag = 1
            });
            this._typeMenu.Image = EditorGUIUtility.FindTexture("FilterByType");
            if (this._typeMenu.Image != null)
            {
                this._typeMenu.ImageSize = new Vector2((float)this._typeMenu.Image.width, (float)this._typeMenu.Image.height);
            }
            this._menu.AddSpace(8f);
            GUIToolbarRadioGroup  guitoolbarRadioGroup  = this._menu.AddRadioGroup();
            GUIToolbarRadioButton guitoolbarRadioButton = guitoolbarRadioGroup.AddButton("Default", "Default settings", null, new GUIControlExecuteDelegate(this.OnPlatformChange));

            guitoolbarRadioButton.Tag = 0;
            GUIToolbarRadioButton control        = guitoolbarRadioButton;
            List <BuildPlatform2> validPlatforms = BuildPlayerWindow2.GetValidPlatforms();

            foreach (BuildPlatform2 buildPlatform in validPlatforms)
            {
                GUIToolbarRadioButton guitoolbarRadioButton2 = guitoolbarRadioGroup.AddButton("", buildPlatform.DisplayName + " settings", buildPlatform.SmallIcon as Texture2D, new GUIControlExecuteDelegate(this.OnPlatformChange));
                guitoolbarRadioButton2.Tag = buildPlatform.TargetGroup;
                if (buildPlatform.TargetGroup == @int)
                {
                    control = guitoolbarRadioButton2;
                }
            }
            guitoolbarRadioGroup.OnCheckedControl(control);
            this._bottommenu = new GUIToolbar(this, null);
            this._statslabel = this._bottommenu.AddLabel();
            this._bottommenu.AddFlexibleSpace();
            this._searchlabel = this._bottommenu.AddLabel();
            this._bottommenu.AddSpace(9f);
            this._memoryUsage  = new TextureMemoryUsageOverlay();
            this._issueOverlay = new TextureIssueOverlay();
            this._manifestGUI  = new AssetBundleManifestUI();
            this._manifestGUI.EditorPrefsPath = string.Format("{0}.AssetBundleManifest", Globals.ProductId);
            this._manifestGUI.Init(this);
            this._manifestGUI.SelectionChange = new Action <List <AssetBundleManifest2> >(this.OnShowAssetBundleManifestContent);
        }
Beispiel #20
0
 // Token: 0x060003B9 RID: 953 RVA: 0x00033378 File Offset: 0x00031578
 private void OnTypeFilterResetExecute(GUIToolbarMenuItem sender)
 {
     this._listview.ClearTypeFilter();
 }
Beispiel #21
0
 // Token: 0x0600039A RID: 922 RVA: 0x00032ADC File Offset: 0x00030CDC
 private void OnToolsExportCsvExecute(GUIToolbarMenuItem sender)
 {
     this._listview.SaveCsv();
 }