UnityEditor.AssetPreview.SetPreviewTextureCacheSize C# (CSharp) Method

SetPreviewTextureCacheSize() public static method

Set the asset preview cache to a size that can hold all visible previews on the screen at once.

public static SetPreviewTextureCacheSize ( int size ) : void
size int The number of previews that can be loaded into the cache before the least used previews are being unloaded.
return void
        public static void SetPreviewTextureCacheSize(int size)
        {
            SetPreviewTextureCacheSize(size, 0);
        }

Same methods

AssetPreview::SetPreviewTextureCacheSize ( int size, int clientID ) : void

Usage Example

示例#1
0
        public void OnEnable()
        {
            instances.Add(this);
            if (clipboardView == null)
            {
                clipboardView           = CreateInstance <GridPaintPaletteClipboard>();
                clipboardView.owner     = this;
                clipboardView.hideFlags = HideFlags.HideAndDontSave;
                clipboardView.unlocked  = false;
            }

            if (m_PaintableSceneViewGrid == null)
            {
                m_PaintableSceneViewGrid           = CreateInstance <PaintableSceneViewGrid>();
                m_PaintableSceneViewGrid.hideFlags = HideFlags.HideAndDontSave;
            }

            GridPaletteBrushes.FlushCache();
            EditMode.editModeStarted           += OnEditModeStart;
            EditMode.editModeEnded             += OnEditModeEnd;
            GridSelection.gridSelectionChanged += OnGridSelectionChanged;
            GridPaintingState.RegisterPainterInterest(this);
            GridPaintingState.scenePaintTargetChanged += OnScenePaintTargetChanged;
            GridPaintingState.brushChanged            += OnBrushChanged;
            SceneView.onSceneGUIDelegate        += OnSceneViewGUI;
            PrefabUtility.prefabInstanceUpdated += PrefabInstanceUpdated;

            AssetPreview.SetPreviewTextureCacheSize(256, GetInstanceID());
            wantsMouseMove             = true;
            wantsMouseEnterLeaveWindow = true;

            if (m_PreviewResizer == null)
            {
                m_PreviewResizer = new PreviewResizer();
                m_PreviewResizer.Init("TilemapBrushInspector");
            }

            minSize = new Vector2(240f, 200f);

            if (palette == null && TilemapEditorUserSettings.lastUsedPalette != null && GridPalettes.palettes.Contains(TilemapEditorUserSettings.lastUsedPalette))
            {
                palette = TilemapEditorUserSettings.lastUsedPalette;
            }

            Tools.onToolChanged += ToolChanged;

            ShortcutIntegration.instance.contextManager.RegisterToolContext(m_ShortcutContext);
        }
All Usage Examples Of UnityEditor.AssetPreview::SetPreviewTextureCacheSize