Search Unity

  1. We are migrating the Unity Forums to Unity Discussions by the end of July. Read our announcement for more information and let us know if you have any questions.
    Dismiss Notice
  2. Dismiss Notice

Exception thrown when unsliced sprite is dragged into the Palette

Discussion in '2D Experimental Preview' started by johnsietsma, Jul 1, 2016.

  1. johnsietsma

    johnsietsma

    Unity Technologies

    Joined:
    Jul 1, 2016
    Posts:
    8
    A very minor bug for you.

    Mark a sprite as multiple, don't slice the sprite up, drag it onto the palette and the following exception gets thrown.

    Code (csharp):
    1. InvalidOperationException: Operation is not valid due to the current state of the object
    2. System.Linq.Enumerable.Iterate[Vector2Int,Int32] (IEnumerable`1 source, Int32 initValue, System.Func`3 selector)
    3. System.Linq.Enumerable.Min[Vector2Int] (IEnumerable`1 source, System.Func`2 selector)
    4. TileDragAndDrop.GetMinMaxRect (System.Collections.Generic.List`1 positions) (at C:/buildslave/unity/build/Editor/Src/TileMap/Managed/Grid/TileDragAndDrop.cs:362)
    5. UnityEditor.GridPaintPaletteClipboard.HandleDragAndDrop () (at C:/buildslave/unity/build/Editor/Src/TileMap/Managed/Grid/GridPaintPaletteClipboard.cs:292)
    6. UnityEditor.GridPaintPaletteClipboard.OnGUI () (at C:/buildslave/unity/build/Editor/Src/TileMap/Managed/Grid/GridPaintPaletteClipboard.cs:53)
    7. UnityEditor.GridPaintPaletteWindow.OnClipboardGUI (Rect position) (at C:/buildslave/unity/build/Editor/Src/TileMap/Managed/Grid/GridPaintPaletteWindow.cs:430)
    8. UnityEditor.GridPaintPaletteWindow.OnGUI () (at C:/buildslave/unity/build/Editor/Src/TileMap/Managed/Grid/GridPaintPaletteWindow.cs:107)
    9. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
     
  2. Johaness_Reuben

    Johaness_Reuben

    Joined:
    Jan 27, 2016
    Posts:
    253
    If you don't slice, there's no sprite defined. We should have a warning or something when dragging that onto the palette.