Skip to content

Conversation

vvnurmi
Copy link
Contributor

@vvnurmi vvnurmi commented Apr 15, 2022

Until now, SuperObjectProperties were lost when a Tiled object got replaced by a prefab. This also meant that the special properties unity:tag and unity:layer didn't set the tag or layer of the new prefab instances.

This pull request fixes that.

@vvnurmi
Copy link
Contributor Author

vvnurmi commented Apr 15, 2022

There's a null reference problem in the PR. Fix incoming.

@vvnurmi
Copy link
Contributor Author

vvnurmi commented Apr 15, 2022

Added the fix to null reference when importing Tiled assets.

Also changed it so that prefab replacements don't get to inherit the Unity layer from their parent.

  • They didn't do it before
  • Inheriting the parent's layer overrides any layer set in the prefab
  • Inheriting the layer from the parent is a feature used for objects that have a super tile(?)

The function AssignUnityLayer got a nasty-looking bool parameter, which could perhaps be better refactored out by splitting the function into two parts, one assigning the Unity layer from super properties, and the other inheriting the layer from the parent if a layer isn't set already. 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant