转载:http://blog.csdn.net/liqiangeastsun/article/details/42173513
使用Unity编辑器类控制部分区域不可操作
bool isTrue;
public static void OnInspectorGUI()
{
EditorGUI.BeginDisabledGroup(nextPath == null); //如果nextPath == null 为真,在Inspector面板上显示,承灰色(即不可操作)
EditorGUILayout.LabelField("Interpolate", GUILayout.Width(70));
EditorGUILayout.Toggle(isTrue, GUILayout.Width(30));
EditorGUI.EndDisabledGroup();
}