用户工具

站点工具


侧边栏



Unity3D中文文档

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面板中。
HideInInspectorIt is not possible to view it in the inspector.
它不可能在inspector上去浏览。
DontSaveInEditorThe object will not be saved to the scene in the editor.
该对象在编辑器中将不会被保存到场景。
NotEditableThe object is not be editable in the inspector.
该对象在inspector面板上不是可编辑的。
DontSaveInBuildThe object will not be saved when building a player.
该对象将不会保存到玩家的创建中。
DontUnloadUnusedAssetThe object will not be unloaded by Resources.UnloadUnusedAssets.
该对象将不会被Resources.UnloadUnusedAssets卸载。
DontSaveThe object will not be saved to the scene. It will not be destroyed when a new scene is loaded. It is a shortcut for HideFlags.DontSaveInBuild | HideFlags.DontSaveInEditor | HideFlags.DontUnloadUnusedAsset.
该对象将不会保存到场景。当新场景被加载时它将不会被销毁。它是HideFlags.DontSaveInBuild和HideFlags.DontSaveInEditor和HideFlags.DontUnloadUnusedAsset 的构造。
HideAndDontSaveA combination of not shown in the hierarchy, not saved to to scenes and not unloaded by The object will not be unloaded by Resources.UnloadUnusedAssets.
不显示在hierarchy面板中的组合,不保存到场景并且卸载Resources.UnloadUnusedAssets不卸载的对象。
script/unityengine/enumerations/hideflags/hideflags.txt · 最后更改: 2016/10/10 02:26 由 hulang