Legacy Documentation: Version 5.3
LanguageEnglish
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

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

Sumbission failed

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

Close

Cancel

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

Parameters

Description

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; } }
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961