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

Where are the brushes and how do I create a custom one?

Discussion in '2D Experimental Preview' started by VinnieH01, Aug 4, 2016.

  1. VinnieH01

    VinnieH01

    Joined:
    Sep 3, 2014
    Posts:
    32
    In the pallet window I expected to see bruses like seen here :


    Where are they? Also how do i create my own?
     
  2. Johaness_Reuben

    Johaness_Reuben

    Joined:
    Jan 27, 2016
    Posts:
    253
    In the Example project we've included two sample scripted tiles. Terrain Tile and Pipe Tile. The TileMapExample02 scene uses these.
    The tile assets can be found in \TileAssets\ScriptedTiles. PBricks, Pebbles and Pipes.
    To create a new Terrain tile or Pipe tile, Right-Click > Create > Brushes > Terrain Tile or Pipeline Tile.

    The editor scripts to create these are in \Scripts\TileScripts.
    There's more information on programmable tiles in the reference guide.
     
  3. VinnieH01

    VinnieH01

    Joined:
    Sep 3, 2014
    Posts:
    32
    @Johaness_Reuben I opened the example project and I cant find any of the scripts, brushes or scenes your talking about. Right-Click > Create dosen't have a brushes option. Am I missing someting?
     
  4. Johaness_Reuben

    Johaness_Reuben

    Joined:
    Jan 27, 2016
    Posts:
    253
  5. VinnieH01

    VinnieH01

    Joined:
    Sep 3, 2014
    Posts:
    32
  6. VinnieH01

    VinnieH01

    Joined:
    Sep 3, 2014
    Posts:
    32
    @Johaness_Reuben Hello again,

    I've ran into a little problem, I copied the PrefabBrush.cs script from the UniteBoston2D branch ; https://bitbucket.org/Unity-Technol...63599adbbf26485eaf432e7c5701bcda3ca9?at=trunk

    It gives me 3 errors and my guess is that you've changes the way you script custom brushes. It gives me these errors :

    'PrefabBrush.Paint(Grid, IntVector2)': no suitable method found to override'

    'The type or namespace name 'IntVector2' could not be found (are you missing a using directive or an assembly reference?)'


    'Grid' does not contain a definition for 'GetCellCenter' and no extension method 'GetCellCenter' accepting a first argument of type 'Grid' could be found (are you missing a using directive or an assembly reference?)'

    Here's the bit of code that has the errors highlighted.

    public override void Paint(Grid grid, IntVector2 position)
    Vector3 newPosition = grid.GetCellCenter(position.x, position.y, zDepth);

    What should I do to fix the errors?
     
  7. VinnieH01

    VinnieH01

    Joined:
    Sep 3, 2014
    Posts:
    32
    Nevermind, I looked in the docs and managed to fix it :)