/// <summary>
 /// Native call to draw the provided property.
 /// </summary>
 /// <param name="position"></param>
 /// <param name="property"></param>
 /// <param name="label"></param>
 public override sealed void OnGUI(Rect position, SerializedProperty property, GUIContent label)
 {
     if (IsPropertyValid(property))
     {
         OnGUISafe(position, property, label);
     }
     else
     {
         var warningContent = new GUIContent(property.displayName + " has invalid property drawer");
         ToolboxEditorLog.WrongAttributeUsageWarning(attribute, property);
         ToolboxEditorGui.DrawEmptyProperty(position, property, warningContent);
     }
 }
예제 #2
0
        /// <summary>
        /// Native call to draw the provided property.
        /// </summary>
        public override sealed void OnGUI(Rect position, SerializedProperty property, GUIContent label)
        {
            if (IsPropertyValid(property))
            {
                OnGUISafe(position, property, label);
                return;
            }

            var warningContent = new GUIContent(property.displayName + " has invalid property drawer");

            //create additional warning log to the console window
            ToolboxEditorLog.WrongAttributeUsageWarning(attribute, property);
            //create additional warning label based on the property name
            ToolboxEditorGui.DrawEmptyProperty(position, property, warningContent);
        }
        public void OnGui(SerializedProperty property, GUIContent label, T attribute)
        {
            if (attribute == null)
            {
                return;
            }

            if (IsPropertyValid(property))
            {
                OnGuiSafe(property, label, attribute);
            }
            else
            {
                var warningContent = new GUIContent(property.displayName + " has invalid property drawer");
                //create additional warning log to the console window
                ToolboxEditorLog.WrongAttributeUsageWarning(attribute, property);
                //create additional warning label based on the property name
                ToolboxEditorGui.DrawEmptyProperty(property, warningContent);
            }
        }