SetPreviewTextureCacheSize() 공개 정적인 메소드

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.
리턴 void
예제 #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);
        }
예제 #2
0
 public void OnEnable()
 {
     GridPaintPaletteWindow.instances.Add(this);
     if (this.clipboardView == null)
     {
         this.clipboardView           = ScriptableObject.CreateInstance <GridPaintPaletteClipboard>();
         this.clipboardView.owner     = this;
         this.clipboardView.hideFlags = HideFlags.HideAndDontSave;
         this.clipboardView.unlocked  = false;
     }
     if (this.m_PaintableSceneViewGrid == null)
     {
         this.m_PaintableSceneViewGrid           = ScriptableObject.CreateInstance <PaintableSceneViewGrid>();
         this.m_PaintableSceneViewGrid.hideFlags = HideFlags.HideAndDontSave;
     }
     GridPaletteBrushes.FlushCache();
     EditorApplication.globalEventHandler = (EditorApplication.CallbackFunction)Delegate.Combine(EditorApplication.globalEventHandler, new EditorApplication.CallbackFunction(this.HotkeyHandler));
     EditMode.editModeStarted            += new Action <IToolModeOwner, EditMode.SceneViewEditMode>(this.OnEditModeStart);
     EditMode.editModeEnded             += new Action <IToolModeOwner>(this.OnEditModeEnd);
     GridSelection.gridSelectionChanged += new Action(this.OnGridSelectionChanged);
     GridPaintingState.RegisterPainterInterest(this);
     GridPaintingState.scenePaintTargetChanged += new Action <GameObject>(this.OnScenePaintTargetChanged);
     GridPaintingState.brushChanged            += new Action <GridBrushBase>(this.OnBrushChanged);
     SceneView.onSceneGUIDelegate        = (SceneView.OnSceneFunc)Delegate.Combine(SceneView.onSceneGUIDelegate, new SceneView.OnSceneFunc(this.OnSceneViewGUI));
     PrefabUtility.prefabInstanceUpdated = (PrefabUtility.PrefabInstanceUpdated)Delegate.Combine(PrefabUtility.prefabInstanceUpdated, new PrefabUtility.PrefabInstanceUpdated(this.PrefabInstanceUpdated));
     AssetPreview.SetPreviewTextureCacheSize(256, base.GetInstanceID());
     base.wantsMouseMove             = true;
     base.wantsMouseEnterLeaveWindow = true;
     if (this.m_PreviewResizer == null)
     {
         this.m_PreviewResizer = new PreviewResizer();
         this.m_PreviewResizer.Init("TilemapBrushInspector");
     }
     base.minSize = new Vector2(240f, 200f);
     if (this.palette == null && TilemapEditorUserSettings.lastUsedPalette != null && GridPalettes.palettes.Contains(TilemapEditorUserSettings.lastUsedPalette))
     {
         this.palette = TilemapEditorUserSettings.lastUsedPalette;
     }
     Tools.onToolChanged = (Tools.OnToolChangedFunc)Delegate.Combine(Tools.onToolChanged, new Tools.OnToolChangedFunc(this.ToolChanged));
 }
예제 #3
0
 /// <summary>
 ///   <para>Set the asset preview cache to a size that can hold all visible previews on the screen at once.</para>
 /// </summary>
 /// <param name="size">The number of previews that can be loaded into the cache before the least used previews are being unloaded.</param>
 public static void SetPreviewTextureCacheSize(int size)
 {
     AssetPreview.SetPreviewTextureCacheSize(size, 0);
 }