using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class HideFlagsTest : MonoBehaviour {
public GameObject test;
// Use this for initialization
void Start ()
{
//整个对象的inspector面板在运行时都不可编辑
// test.hideFlags = HideFlags.NotEditable;
//对象上的某个属性在运行时不可编辑
// test.GetComponent<Transform>().hideFlags = HideFlags.NotEditable;
//运行时该对象不会出现在hierarchy面板上,但是scene视图和game视图上还能看到
// test.hideFlags = HideFlags.HideInHierarchy;
//在运行时该对象的inspector面板属性不可见
// test.hideFlags = HideFlags.HideInInspector;
//在运行时该对象在inspector的某个属性不可见
//test.GetComponent<Transform>().hideFlags = HideFlags.HideInInspector;
}
}
物体的inspector面板不可编辑:
物体的inspector面板上某一属性不可编辑:
物体的inspector面板所有属性不可见:
物体的inspector面板上某一属性(Transform)不可见: