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)并且如果他保存在一个资源中,不显示在项目视图。
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
void Start() {
int i = 0;
while (i < 5) {
GameObject createdGO = GameObject.CreatePrimitive(PrimitiveType.Plane);
createdGO.hideFlags = HideFlags.HideInHierarchy;
i++;
}
}
}
// 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