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
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

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:
    967
    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! :)