diff --git a/Packages/src/Editor/UnityEventDrawerEx.cs b/Packages/src/Editor/UnityEventDrawerEx.cs index d8b9cf8..8228169 100644 --- a/Packages/src/Editor/UnityEventDrawerEx.cs +++ b/Packages/src/Editor/UnityEventDrawerEx.cs @@ -153,7 +153,7 @@ private static void DrawDelegate(Rect position, Delegate del) } else if (target != null) { - EditorGUI.LabelField(r, string.Format("{0} ({1})", target.ToString(), target.GetType()), EditorStyles.miniLabel); + EditorGUI.LabelField(r, GetNameWithoutNameSpace(target.GetType()), EditorStyles.miniLabel); } else { @@ -163,7 +163,7 @@ private static void DrawDelegate(Rect position, Delegate del) // Draw the method name. r.x += r.width; r.width = position.width - r.width; - EditorGUI.LabelField(r, method.ReflectedType + "." + method.Name, EditorStyles.miniLabel); + EditorGUI.LabelField(r, GetNameWithoutNameSpace(method.ReflectedType) + "." + method.Name, EditorStyles.miniLabel); } catch { @@ -171,6 +171,11 @@ private static void DrawDelegate(Rect position, Delegate del) } } + private static string GetNameWithoutNameSpace(Type type) + { + return type.FullName.Substring(type.Namespace.Length + 1); + } + /// /// Gets the runtime call list from SerializedProperty. ///