Custom property overrides in RuleOverrideTiles based on customized RuleTiles

Hello,

I experienced a minor bug (in my opinion) in the RuleOverrideTile. I am using Unity 2021.2.10. You can use the tiles for overidding sprites of other RuleTiles. In my case I extended the RuleTile and added certain properties to these customized tile. Example:

  [CreateAssetMenu(menuName = "2D/Tiles/Complex Rule Tile", fileName = "CRT_")]
  public class ComplexRuleTile : RuleTile<ComplexRuleTile.Neighbor>
  {
    [SerializeField]
    private List<TileBase> group1 = new();
    // ...
  }

Then I created an instances of these ComplexRuleTiles and filled the properties like group1 accordingly. Thereafter I created several RuleOverrideTiles which are based on the just created ComplexRuleTile. It is great that the properties of the ComplexRuleTile can also be overridden within the RuleOverrideTile. But every time I do changes on the based ComplexRuleTile, all defined property overrides e.g. of group1 are gone and the initial states of the ComplexRuleTile are in place again. In my case this is not desired and will cause that I have to adjust every RuleOverideTile when changing the based ComplexRuleTile.

So I would appreciate that changing the properties of a customized RuleTile will not reset the properties in the RuleOverrideTiles based on that tile by default. Even when changing the affected property itself, I prefer maintining the overriden values of the properties to be consistent.

But there may be usecases of synchronizing a overriden property to the the original values. So that some sort of a synchronizing feature may be of use.

A picture for explaining my issue:

Hi, we will check this bug out. To clarify my understanding for this issue:

  • You have created a custom Rule Tile, Complex Rule Tile, and have a RuleOverrideTile which overrides a Complex Rule Tile.
  • The RuleOverrideTiles has different values for the custom properties of the Complex Rule Tile.
  • After changing the properties of the base Complex Rule Tile, you find that the values for the custom properties of the RuleOverrideTile has changed, which is the bug.

Let us know if this is correct and you have any more details about this! Could you also share the package version of the Tilemap Extras package? Thanks!

Hello ChuanXin,

yes, your brief summary is correct. I don’t have anymore relevant details. I am using Unity 2021.2.10 and the “2D Tilemap Extras” package in version 2.2.1. Thanks for looking into this issue!

Hi, this issue should be fixed with the following script change at -Clone Tile into temporary tile when preparing overrides · Unity-Technologies/2d-extras@d19d23d · GitHub , if you need to resolve it immediately. We may take some time to update the 2D Tilemap Extras package with the fix.

Hello ChuanXin,

the fix works perfectly. This will save me some time now working with the RuleOverrideTile. Thank you for providing the fix this fast!