Set whether the renderer's wireframe will be hidden when the renderer's gameobject is selected.
Cube with the wireframe hidden/shown.
#pragma strict public class ShowHideWireframeExample extends EditorWindow { @MenuItem("Example/Show WireFrame %s") static function ShowWireframe() { for (var s: GameObject in Selection.gameObjects) { var rend: Renderer = s.GetComponent.<Renderer>(); if (rend) EditorUtility.SetSelectedWireframeHidden(rend, false); } } @MenuItem("Example/Show WireFrame %s", true) static function ShowWireframeValidate() { return Selection.activeGameObject != null; } @MenuItem("Example/Hide WireFrame %h") static function HideWireframe() { for (var s: GameObject in Selection.gameObjects) { var rend: Renderer = s.GetComponent.<Renderer>(); if (rend) EditorUtility.SetSelectedWireframeHidden(rend, true); } } @MenuItem("Example/Hide WireFrame %h", true) static function HideWireframeValidate() { return Selection.activeGameObject != null; } }
using UnityEngine; using UnityEditor;
public class ShowHideWireframeExample : EditorWindow { [MenuItem( "Example/Show WireFrame %s" )] static void ShowWireframe( ) { foreach( GameObject s in Selection.gameObjects ) { Renderer rend = s.GetComponent<Renderer>( );
if( rend ) EditorUtility.SetSelectedWireframeHidden( rend, false ); } }
[MenuItem( "Example/Show WireFrame %s", true )] static bool ShowWireframeValidate( ) { return Selection.activeGameObject != null; }
[MenuItem( "Example/Hide WireFrame %h" )] static void HideWireframe( ) { foreach( GameObject s in Selection.gameObjects ) { Renderer rend = s.GetComponent<Renderer>( );
if( rend ) EditorUtility.SetSelectedWireframeHidden( rend, true ); } }
[MenuItem( "Example/Hide WireFrame %h", true )] static bool HideWireframeValidate( ) { return Selection.activeGameObject != null; } }