Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    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.