Hello, we’re on Unity 2020.2.3, and the package shows up by default as version 1.6.3, but even after using “+” for git URL and adding “com.unity.2d.tilemap.extras” it is still at that version.
Are there going to be breaking changes / deprecations if we begin with 1.6.3 and upgrade later? Is there some other way to force it to find the 2.0.0 version? Thanks!
EDIT: omg I just noticed you said “2021.x” – I’m so used to seeing 2020.x. Don’t mind me, just being dense…
I’m still curious about the question on deprecation as we’d likely upgrade in the future.
For anyone else wondering this, I tried around myself and found you can indeed use the autotile via code!
Here’s a good tutorial on how to set up autotiling. When you’ve done so, you can simply call it at runtime like so:
public class TestSetTile : MonoBehaviour
{
public Tilemap tilemap;
public RuleTile ruleTile;
private void Start()
{
tilemap.SetTile(new Vector3Int(0, 0, 0), ruleTile);
tilemap.SetTile(new Vector3Int(1, 1, 0), ruleTile);
}
}
Thank you for adding this package into Unity! What an absolutely fantastic tool
Ah yes, sorry, it is indeed broken as we have merged in this change to master. Please ignore that link and you can instead retrieve the changes from the master branch (or 19.4 branch depending on the version of Unity you are using).
You should be able to view it from the Unity Package Manager eventually from the “View changelog” link, but that may take sometime before it is posted.
Hello! I need to add a field containing an I.D. number to my IsometricRuleTiles.
I was wondering if I should inherit from IsometricRuleTile<T>, , or if I should effectively redefine my own IsometricRuleTile<T> and just copy the contents of that class into my own (which is this):
public IsometricRuleTile();
public sealed override Type m_NeighborType { get; }
and then just inherit from IsometricRuleTile
and just add in my ID field there. I am confused by what I should inherit from to define my own tile, not for custom rules, but just for a little extra data sprinkled in (I need to network and ‘save to disk’ my tiles, hence the ID number).
Second question: Can you not use [SerializeField]? The field doesn’t appear in the inspector, only public fields do. This is not ideal because it makes exposing interface variables more difficult
You could inherit from IsometricRuleTile directly if you think you will not need custom rules, or create a IsometricRuleTile with Custom Rules (IsometricRuleTile) without defining new Rules, which would be the same as inheriting from IsometricRuleTile with custom rules support. You will be able to add your own fields with both methods.
We will check this out! You should be able to use this for showing the field in the inspector.
Aaah ok, for clarification in your investigation, it definitely does not expose the variable on my setup, which is:
Unity 2020.3.1f1
2D Tilemap Extras 1.6.4-preview
using the following syntax:
public class RedstoneBaseTile : IsometricRuleTile, IHaveUniqueID
{
public uint UniqueID { get => _uniqueID; }
[SerializeField] private uint _uniqueID = 1;
#if UNITY_EDITOR
[ContextMenu("Generate New ID from database")]
public void GetNewGUID()
{
_uniqueID = DatabaseTile.Instance.GetNewID();
UnityEditor.EditorUtility.SetDirty(this);
}
#endif
}
There is one more bug that I found in regards to IsometricRuleTiles.
The MirrorX function still operates on the Cartesian aspect of the, ‘inspector rule setter’
Example,
I would expect the following to mirror the rule to look like this:
Original:
Mirrored:
But what happens is this:
As in, it is mirroring this coordinate system as if it is still cartesian (the “upper left” direction being the “top”)
I’m not worried about the other Mirror functions because they don’t play nice with how Isometric tiles have to be sliced, but a MirrorX would be nice
The Mirror effect is based on the Grid axii, so the X axis would be in the upper right diagonal and the Y axis would be in the upper left diagonal. The icon doesn’t really showcase this unfortunately! Let us see if we can do something about that!
If you want to have the above behaviour, it is possible to override the RuleTile to produce this. Let us know if you need help with this!
Also, is this a bug or a feature? Tiles painted onto the tilemap always face up, regardless of their rotated orientation in the palette. Rotating with .
I guess that is possible if you use the Random Brush as is. You will need to create the different permutations for each combination of A, C, E and B, D, F that you want.