jacobdufault / fullinspector

Full Inspector supercharges Unity's inspector
MIT License
111 stars 27 forks source link

'Duplicate' on an array item creates a 'cycle' where the new item references the original #170

Open hymerman opened 7 years ago

hymerman commented 7 years ago

With the Unity inspector, I can right click an array element and choose 'duplicate', which does what it says.

If I do the same with Full Inspector, a new element is added to the array but it displays as 'cycle'. If I then switch to the inspector's debug view, I can see there is a duplicate item there, but modifying it modifies the original too - the array contains two references to the same object. This is not what I would expect!

Interestingly, if I then duplicate another element in the debug view, the first duplicate I created turns into a distinct object and stops being a reference to an existing object - I guess Unity serializes and deserializes the whole array whilst duplicating which removes the reference?

One last thing to note is that there isn't actually a cycle in my class structure; it's a DAG.