1.如果一个对象使用了HideFlags.HideInInspector,择期所有组件将在Inspector中被隐藏,但子类组件依然显示。 2.如果之隐藏对象的某个组件,其他组件不受影响。 None:HideFlags默认值 功能说明 None为HideFlags的默认值,即不改变Object对象的可见性。 NotEditable:对象在Inspector面板中的可编辑性 功能说明 此属性用来设置程...
HideInInspector //不会显示在检视器面板中DontSaveInEditor //编辑器下运行下的修改不会被保存NotEditable //在检视器面板中不可编辑DontSaveInBuild //构建模式下修改不会被保存DontUnloadUnusedAsset //Resources.UnloadUnusedAssets时不会被卸载DontSave //运行时修改不会被保存,切换场景时也不会被卸载 相当于...
transform.parent != null) { //print(1 + obj.name); continue; } //排除 不可编辑的物体 或是 未显示在层次结构中 | 未保存到场景中 | 也未由Resources.UnloadUnusedAssets卸载的物体 if (obj.hideFlags == HideFlags.NotEditable || obj.hideFlags == HideFlags.HideAndDontSave) { //print(2 + obj....
HideFlags.NotEditable Version:2022.3 语言:中文 HideFlags.NotEditable 描述 The object is not editable in the Inspector. using UnityEngine; public class Example :MonoBehaviour{ // Create a plane and dont let it be modificable in the Inspector // nor in the Sceneview....
这个HideFlags是一个enum 。而且其中的作用和DontDestroyOnLoad函数的作用是一致的。HideFlags的枚举成员有 : DontSava , HideAndDontSave , HideInHierarchy , HideInInspector , None(默认),NotEditable。 我的Unity版本是:5.4.0f3。在这个版本测试 :
voidStart () {varc =GameObject.CreatePrimitive(PrimitiveType.Cube); c.hideFlags=HideFlags.HideInHierarchy; c.hideFlags=HideFlags.HideInInspector; c.hideFlags=HideFlags.NotEditable; } HideInInspector:(并不是Inspector视图中没有东西,只是将各组件隐藏)...
Unity3D HideFlags 这个HideFlags是一个enum 。而且其中的作用和DontDestroyOnLoad函数的作用是一致的。HideFlags的枚举成员有 : DontSava , HideAndDontSave , HideInHierarchy , HideInInspector , None(默认),NotEditable。 我的Unity版本是:5.4.0f3。在这个版本测试 :...
HideInInspector = 2, //It is not possible to view it in the inspector. DontSaveInEditor = 4, //The object will not be saved to the Scene in the editor. NotEditable = 8, //The object is not be editable in the inspector.<
// 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 = ...
using UnityEngine;using System.Collections;publicclassExampleClass: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.privateMaterial ownedMaterial;voidOnEnable(){own...