Quantcast
Channel: Questions in topic: "hideflags"
Viewing all articles
Browse latest Browse all 117

Bug with displaying components in Inspector after hideFlags.NotEditable?

$
0
0
Hey everyone! I've been running into a strange bug lately, maybe someone has seen something like it before. In messing around with object hideFlags, (specifically NotEditable), I've managed to break the inspector. What appears is this: ![alt text][1] What I expect is this: ![alt text][2] It seems like toggling the hide flags on and off sometimes fixes the issue, but has anyone else run into this before and have a reliable fix? Here is the code I'm using to do the toggle: private static void ProjectWindowItem_OnGUI(string guid, Rect drawingRect) { GameObject asset = (GameObject)AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath (guid), typeof(GameObject)); if (asset) { if (PrefabEditor.IsEditing()) { // Set the NotEditable flag. (| bitwise or) asset.hideFlags = asset.hideFlags | HideFlags.NotEditable; } else { // Clear the NotEditable flag. (& bitwise and) (~ bitwise negate) asset.hideFlags = asset.hideFlags & ~HideFlags.NotEditable; } } } [1]: /storage/temp/42261-screen-shot-2015-03-10-at-113753-am.png [2]: /storage/temp/42262-screen-shot-2015-03-10-at-113803-am.png

Viewing all articles
Browse latest Browse all 117

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>