Version: 2022.3
LanguageEnglish
  • C#
Method group is Obsolete

EditorUtility.SetSelectedWireframeHidden

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Obsolete Use EditorUtility.SetSelectedRenderState.

Declaration

public static void SetSelectedWireframeHidden(Renderer renderer, bool enabled);

Description

Sets whether the selected Renderer's wireframe will be hidden when the GameObject it is attached to is selected.


Cube with the wireframe hidden/shown.

using UnityEngine;
using UnityEditor;

// Shows / hides the wireframe of the objects in the Scene.

class ShowHideWireFrame : Editor { [MenuItem("Examples/Show WireFrame %s")] static void Show() { foreach (GameObject obj in Selection.gameObjects) { Renderer rend = obj.GetComponent<Renderer>();

if (rend) { EditorUtility.SetSelectedWireframeHidden(rend, false); } } }

[MenuItem("Examples/Show WireFrame %s", true)] static bool CheckShow() { return Selection.activeGameObject != null; }

[MenuItem("Examples/Hide WireFrame %h")] static void Hide() { foreach (GameObject obj in Selection.gameObjects) { var rend = obj.GetComponent<Renderer>();

if (rend) { EditorUtility.SetSelectedWireframeHidden(rend, true); } } }

[MenuItem("Examples/Hide WireFrame %h", true)] static bool CheckHide() { return Selection.activeGameObject != null; } }