-
Notifications
You must be signed in to change notification settings - Fork 340
Expand file tree
/
Copy pathHideScriptObjectNameInspector.cs
More file actions
47 lines (41 loc) · 1.23 KB
/
HideScriptObjectNameInspector.cs
File metadata and controls
47 lines (41 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#define SLN
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
namespace ToolKits
{
[CustomEditor(typeof(HideScriptObjectName), true)]
public class HideScriptObjectNameInspector : Editor
{
public override void OnInspectorGUI()
{
#if SLN
EditorGUI.BeginChangeCheck();
serializedObject.Update();
SerializedProperty property = serializedObject.GetIterator();
bool expanded = true;
while (property.NextVisible(expanded))
{
expanded = false;
if (SkipField(property.propertyPath))
continue;
EditorGUILayout.PropertyField(property, true);
}
serializedObject.ApplyModifiedProperties();
EditorGUI.EndChangeCheck();
#else
serializedObject.Update();
DrawPropertiesExcluding(serializedObject, "m_Script");
serializedObject.ApplyModifiedProperties();
#endif
}
public virtual void ApplyChanges()
{
}
static bool SkipField(string fieldName)
{
return fieldName == "m_Script";
}
}
}