Hey!
HideFlags are not working in Edit Mode with my [ExecuteInEditMode] script correctly. This is my code:
// for hiding
MyGameObject.gameObject.hideFlags = MyGameObject.gameObject.hideFlags | HideFlags.HideInHierarchy;
// for unhiding
MyGameObject.gameObject.hideFlags = MyGameObject.gameObject.hideFlags & ~HideFlags.HideInHierarchy;
In Unity 5.0.0, everything is fine, MyGameObject is hidden when it should be, and unhidden the same way.
In Unity 5.4.0 however, there are the strangest bugs. Sometimes nothing happens. Sometimes when I click inside the Hierarchy after something is being hidden, there are duplicates of the GameObject and other, non-affected GameObjects are missing, until I unhide the original GameObject, and everything goes back to normal.
I am working on an Editor extension which I created in 5.0.0, and I am about to release, so I really need to know what I am doing wrong here Any ideas?