public override void DrawField(UnityEngine.Object target, FieldInfo field) { object value = field.GetValue(target); if (!EditorDrawUtility.DrawLayoutField(value, ObjectNames.NicifyVariableName(field.Name), field.FieldType)) { string warning = string.Format("{0} doesn't support {1} types", typeof(ShowNonSerializedFieldFieldDrawer).Name, field.FieldType.Name); EditorDrawUtility.DrawHelpBox(warning, MessageType.Warning, logToConsole: true, context: target); } }
public override void DrawField(UnityEngine.Object target, FieldInfo field) { object value = field.GetValue(target); if (value == null) { string warning = string.Format("{0} doesn't support {1} types", typeof(ShowNonSerializedFieldFieldDrawer).Name, "Reference"); EditorDrawUtility.DrawHelpBox(warning, MessageType.Warning, context: target); } else if (!EditorDrawUtility.DrawLayoutField(value, field.Name)) { string warning = string.Format("{0} doesn't support {1} types", typeof(ShowNonSerializedFieldFieldDrawer).Name, field.FieldType.Name); EditorDrawUtility.DrawHelpBox(warning, MessageType.Warning, context: target); } }
public override void DrawNativeProperty(UnityEngine.Object target, PropertyInfo property) { object value = property.GetValue(target, null); if (value == null) { string warning = string.Format("{0} doesn't support {1} types", typeof(ShowNativePropertyNativePropertyDrawer).Name, "Reference"); EditorDrawUtility.DrawHelpBox(warning, MessageType.Warning, logToConsole: true, context: target); } else if (!EditorDrawUtility.DrawLayoutField(value, property.Name)) { string warning = string.Format("{0} doesn't support {1} types", typeof(ShowNativePropertyNativePropertyDrawer).Name, property.PropertyType.Name); EditorDrawUtility.DrawHelpBox(warning, MessageType.Warning, logToConsole: true, context: target); } }
public override void DrawNativeProperty(UnityEngine.Object target, PropertyInfo property) { try { object value = property.GetValue(target, null); if (!EditorDrawUtility.DrawLayoutField(value, ObjectNames.NicifyVariableName(property.Name), property.PropertyType)) { string warning = string.Format("{0} doesn't support {1} types", typeof(ShowNativePropertyNativePropertyDrawer).Name, property.PropertyType.Name); EditorDrawUtility.DrawHelpBox(warning, MessageType.Warning, logToConsole: true, context: target); } } catch (Exception e) { EditorDrawUtility.DrawHelpBox("Error: " + e, MessageType.Error, logToConsole: true, context: target); } }