Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Tile Map How would one implement this using scripted tiles?

Discussion in '2D Experimental Preview' started by der_r, Jun 13, 2016.

  1. der_r

    der_r

    Joined:
    Mar 30, 2014
    Posts:
    259
    Is there a way to not make the tiles automatically connect to their neighbouring tiles? It's hard to explain the behaviour I am after, so I made a GIF:



    My hunch is that it requires a seperate paint tool and a corresponding scripted tile. Will the tile tool palette be extensible in the future?
     
  2. keely

    keely

    Joined:
    Sep 9, 2010
    Posts:
    966
    You'd make a custom brush and a custom tile.

    Either the brush would store extra data in another component about where it wants to autotile. Or you could have the brush paint with two different tiles. One would auto-tile and one would not.

    For your brush, you would have a custom inspector with a checkbox/hotkey where you can say if you currently want to paint with autotiling or not. We offer custom inspector for custom brushes with OnPaintInspectorGUI() callback.

    The custom brush stuff was left out of docs (the API docs are still there, look for GridBrush), because it is quite unfinished. You can try to make your own brush by making a new class that inherits GridBrush. When you do that, you should see a brush picker appear below the palette.
     
    der_r likes this.
  3. der_r

    der_r

    Joined:
    Mar 30, 2014
    Posts:
    259
    Thanks! :)