EditorUtility.SetSelectedWireframeHidden 设置选择的线框隐藏

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

Description描述

Set whether the renderer's wireframe will be hidden when the renderer's gameobject is selected

当渲染器的游戏物体被选择,设置渲染器的显卡是否将要隐藏。

EditorUtility.SetSelectedWireframeHidden 设置选择的线框隐藏

Cube with the wireframe hidden/shown.
立方体的线框隐藏/显示。

// Shows / hides the wireframe of the objects in the scene.
// SetSelectedWireFrameHidden
//显示/隐藏物体的线框
class ShowHideWireFrame extends Editor {

	@MenuItem("Examples/Show WireFrame %s")
	static function Show() {
		for (var s : GameObject in Selection.gameObjects)
			if(s.renderer)
				EditorUtility.SetSelectedWireframeHidden(s.renderer, false);
	}
	@MenuItem("Examples/Show WireFrame %s", true)
	static function CheckShow() {
		return Selection.activeGameObject != null;
	}
	@MenuItem("Examples/Hide WireFrame %h")
	static function Hide() {
		for (var h : GameObject in Selection.gameObjects)
			if(h.renderer)
				EditorUtility.SetSelectedWireframeHidden(h.renderer, true);
	}
	@MenuItem("Examples/Hide WireFrame %h", true)
	static function CheckHide() {
		return Selection.activeGameObject != null;
	}
}
Page last updated: 2011-7-16