A downloadable tool



TileMap Auto Rule is a little tool to speed up your workflow if importing new Tilemap using Rule Tile in Unity. 

You just have to follow the template included to create a new one



The Tilemap template (you can scale to the resolution you want)

Example of a Tilemap with the template

Now you just have to download the unity package and import it to your project. Instead of creating a new Rule Tile, you can choose Terrain Auto Rule Tile and new options will appear in the inspector.


The new options. Insert your Tilemap and choose your template or leave the default one.

Click Build Rule Tile and voilà ! Your new Rule Tile is already configured.




Here's what it looks with the template and the tilemap included :



Download

Download
TileMapAutoRule.unitypackage 64 kB

Comments

Log in with itch.io to leave a comment.

(1 edit)

Awesome work man!  Works perfectly for me, have to make sure to uncheck the 2d extras folders and get the 2d extras preview package through the package manager, and then only import the tilemapautorule folder from this package.  

Update : build error because the %if UNITY_EDITOR's #end_region is inside the class rather than outside it.

(2 edits)

thanks man

it seems cool and i want to use it but i keep getting errors when i open it the error is:

Assets\TileMap Auto Rule\2d-extras-master\Assets\Tilemap\Brushes\Coordinate Brush\Scripts\Editor\CoordinateBrush.cs(9,36): error CS0246: The type or namespace name 'GridBrush' could not be found (are you missing a using directive or an assembly reference?)

it appears 29 times at different spots in the script, im on version 2019.4.6f1 of unity, is there a fix?

I had the same problem.

I found a fix! delete the included 2d-extras master, and then download the 2d-extras from https://github.com/Unity-Technologies/2d-extras. After you put this in the packages file, it should work!

(1 edit) (+2)

This is a great tool! It's saved us a lot of time.  However, something in TerrainAutoRuleTile.cs is keeping us from making a build of the game.

Here is the error:

Assets\TileMap Auto Rule\Scripts\TerrainAutoRuleTile.cs(62,1): error CS1022: Type or namespace definition, or end-of-file expected

It's probably a simple fix, it's just that my smol brain is having a bit of trouble.  We are in Unity 2019.4.5f1.

I found a fix!

In the TerrainAutoRuleTile.cs script, there's this:

(some code)}

#endif

}

Just switch the "#endif" with the bracket at the bottom.

}

#endif

Like that!  Working without a hitch now.  Thanks for the awesome tool!

(+1)

Oh Jesus Thanks!!!!!!!

If u wouldn't write this message i would explode!!!

Thanks a ton, really cool!!!

(+1)

Awesome asset!  I've been using this for awhile, but I will say that alot of folks buying/making art for tiles are going to wind up with some of your RPG Maker standard 1232 animation tiles.  Since this doesn't reconcile that I've added a bit of code.  Since Unity slices sprites left to right, top to bottom you build your animated tilesets vertically rather than horizontally (which most artists do).  So frame 1 animations go at the top, frame 2 animations below ALL of the frame 1 animations, and so on.

To TerrainAutoRuleTile.cs class add these:

[SerializeField]
bool use1232Animation;
[SerializeField]
int spritesPerAnimationSet;

And in the for loop in the OverrideRuleTile() method add this to the bottom of the for loop:

if(use1232Animation && RuleTileTemplate.m_TilingRules[i].m_Sprites.Length == 4)
{
  _new.m_TilingRules[i].m_Sprites[1] = sprites[i + spritesPerAnimationSet];
  _new.m_TilingRules[i].m_Sprites[2] = sprites[i + (spritesPerAnimationSet * 2)];
  _new.m_TilingRules[i].m_Sprites[3] = sprites[i + spritesPerAnimationSet];
}

Wow - that's a huge time saver. I also wanted to create my one script to just do that.

Thanks!!

Awesome!  I was just about to write my own when I thought "Maybe some excellent person has already done this?"

Good job ;D

Beautiful tool bro👌