Search Issue Tracker

Won't Fix

Votes

0

Found in

4.1.2f1

Issue ID

539169

Regression

No

Custom Editor that uses SerializedProperties works as expected until duplicating an object

IMGUI

-

Steps to reproduce :

- open the SpriteDemo scene.
- select one of the sprites.
- play with the "Texture" property so you can see the script work normally.
- duplicate (Cmd+D) the object.
- changing the "Texture" property on one of the objects will do nothing, on the other object will change both objects.

Explanation :
After some investigation, we found that it actually is caused by the mesh referred in MeshFilter is shared between duplicated objects.

When you change texture setting on the sprite, you change the underlying mesh's uv coordinates in TwoDeeSprite.UpdateMesh() function. And since you are not always creating a new mesh when a TooDeeSprite is instantiated (see TwoDeeSprite.Awake; mesh is retained if there is one), that leads to the phenomenon you've observed.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.