Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SuperCustomProperties and their Unity effects persist over object prefab replacement #210

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

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