Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

TilePalette-like EditorWindow

Discussion in '2D Experimental Preview' started by Puggy, Dec 2, 2017.

  1. Puggy

    Puggy

    Joined:
    Jun 10, 2015
    Posts:
    6
    I'd like to create an editor tool that will interact with Tilemaps and I've got a couple questions.

    1. In an editor window, how can I find the currently selected tiles on a Tilemap? ie. the user has used the Tile Palette's select tool to select one or more tiles. I want to be able to use Tilemap.GetTilesBlock() with the selected bounds.

    2. How can I display a Grid and Tilemap in an EditorWindow, similar to how the TilePalette shows the palette? I want to display the selected content from my first question inside my EditorWindow.

    My end goal is to create something similar to a prefab made from a bunch of tiles, so the same design can be reused multiple times across a project, or can be dynamically placed procedurally. The intention of this EditorWindow is to display this "prefab" in a "sandbox" and let the user edit it.