用户工具

站点工具


侧边栏

script:unityengine:enumerations:hideflags:hideflags

HideFlags 隐藏标志

enumeration

Description 描述

Bit mask that controls object destruction, saving and visibility in inspectors.

小的标记指在面板中控制对象销毁,保存和可见。

See Also: HideFlags.HideAndDontSave, SA.Object.hideFlags.

参考:HideFlags.HideAndDontSave, SA.Object.hideFlags

C#:

using UnityEngine;
using System.Collections;
 
public class ExampleClass : MonoBehaviour {
 
	// Creates a material that is explicitly created & destroyed by the component.
	// Resources.UnloadUnusedAssets will not unload it, and it will not be editable by the inspector.
	private Material ownedMaterial;
	void OnEnable() {
		ownedMaterial = new Material(Shader.Find("Diffuse"));
		ownedMaterial.hideFlags = HideFlags.HideAndDontSave;
		GetComponent<Renderer>().sharedMaterial = ownedMaterial;
	}
 
	// Objects created as hide and don't save must be explicitly destroyed by the owner of the object.
	void OnDisable() {
		DestroyImmediate(ownedMaterial);
	}
}

Variables 变量

NoneA normal, visible object. This is the default.
一个正常,可见的对象。这是默认的。
HideInHierarchyThe object will not appear in the hierarchy.
该对象将不会出现在hierarchy面板中。
script/unityengine/enumerations/hideflags/hideflags.txt · 最后更改: 2016/10/10 02:26 由 hulang