HideFlags.HideInHierarchy 在层级面板隐藏

HideFlags.HideInHierarchy

Description描述

The object will not appear in the hierarchy and will not show up in the project view if it is stored in an asset

该物体将不会出现在层级面板(hierarchy)并且如果他保存在一个资源中,不显示在项目视图。

// Creates 5 planes and hides them from the Hierarchy in the Editor.
//创建5个平面并在编辑器层级面板中隐藏它们
function Start() {
	for(var i : int = 0; i < 5; i++) {
		var createdGO : GameObject = GameObject.CreatePrimitive(PrimitiveType.Plane);
		createdGO.hideFlags = HideFlags.HideInHierarchy;
	}
}
最后修改:2011年5月10日 Tuesday 9:26

本脚本参考基于Unity 3.4.1f5

英文部分版权属©Unity公司所有,中文部分© Unity圣典 版权所有,未经许可,严禁转载 。