public override void OnInspectorGUI() { serializedObject.Update(); SerializedProperty uiLockedProperty = HEU_EditorUtility.GetSerializedProperty(serializedObject, "_uiLocked"); if (uiLockedProperty != null) { EditorGUI.BeginChangeCheck(); HEU_EditorUI.DrawSeparator(); GUIStyle labelStyle = new GUIStyle(GUI.skin.label); labelStyle.fontStyle = FontStyle.Bold; labelStyle.wordWrap = true; labelStyle.normal.textColor = HEU_EditorUI.IsEditorDarkSkin() ? Color.yellow : Color.blue; string lockMsg = "This contains the meta data for the HDA." + "\nIt is locked out because it is not recommended to edit it."; EditorGUILayout.LabelField(lockMsg, labelStyle); HEU_EditorUI.DrawSeparator(); uiLockedProperty.boolValue = EditorGUILayout.Toggle("UI Locked", uiLockedProperty.boolValue); if (EditorGUI.EndChangeCheck()) { serializedObject.ApplyModifiedProperties(); } HEU_EditorUI.DrawHorizontalLine(); using (new EditorGUI.DisabledScope(uiLockedProperty.boolValue)) { // Only draw the default if user has unlocked asset UI. DrawDefaultInspector(); } } }