public static string GetInspectorLabel(object[] attributes) { object[] objArray = attributes; for (int i = 0; i < (int)objArray.Length; i++) { InspectorLabelAttribute inspectorLabelAttribute = objArray[i] as InspectorLabelAttribute; if (inspectorLabelAttribute != null) { return(inspectorLabelAttribute.Label); } } return(string.Empty); }
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { InspectorLabelAttribute inspectorLabel = (InspectorLabelAttribute)attribute; EditorGUI.PropertyField(position, property, new GUIContent(inspectorLabel.Label)); }