ScriptReference/EditorUtility.SetSelectedRenderState #333
Replies: 1 comment
-
|
Show / hide outline & wireframe of selected object: [MenuItem("Utility/Show WireFrame %h")]
static void Show() {
foreach(GameObject h in Selection.gameObjects) {
var rend = h.GetComponent<Renderer>();
if (rend)
EditorUtility.SetSelectedRenderState(rend, EditorSelectedRenderState.Highlight | EditorSelectedRenderState.Wireframe);
}
}
[MenuItem("Utility/Show WireFrame %h", true)]
static bool CheckShow() {
return Selection.activeGameObject != null;
}
[MenuItem("Utility/Hide WireFrame %h")]
static void Hide() {
foreach(GameObject h in Selection.gameObjects) {
var rend = h.GetComponent<Renderer>();
if (rend)
EditorUtility.SetSelectedRenderState(rend, EditorSelectedRenderState.Hidden);
}
}
[MenuItem("Utility/Hide WireFrame %h", true)]
static bool CheckHide() {
return Selection.activeGameObject != null;
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
ScriptReference/EditorUtility.SetSelectedRenderState
https://docs.unity3d.com/ScriptReference/EditorUtility.SetSelectedRenderState.html
Beta Was this translation helpful? Give feedback.
All reactions