InspectorTitlebar

示例程序
说明生成一个 Inspector 面板中的标题栏

用法

public static bool InspectorTitlebar(bool foldout, Object targetObj);

public static bool InspectorTitlebar(bool foldout, Object[] targetObjs);

参数

foldout

是否为展开状态。

targetObj / targetObjs

标题栏所标记的一个或多个物体,其类型必须继承于 Object 类。

示例

public override void OnInspectorGUI () {
		_show = EditorGUILayout.InspectorTitlebar (_show, _target.transform);
	
		if (_show) {
				_target.transform.position = EditorGUILayout.Vector3Field ("Postion", _target.transform.position);
				_target.transform.localScale = EditorGUILayout.Vector3Field ("Scale", _target.transform.localScale);
		}

}

编译结果如下: