示例#1
0
 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);
 }
示例#2
0
        public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
        {
            InspectorLabelAttribute inspectorLabel = (InspectorLabelAttribute)attribute;

            EditorGUI.PropertyField(position, property, new GUIContent(inspectorLabel.Label));
        }