public static Foldout Foldout <TProperty, TContainer, TValue>(TProperty property, ref TContainer container, ref TValue value, InspectorContext context, string name = null) where TProperty : IProperty <TContainer, TValue> { var hasTooltip = property.Attributes?.HasAttribute <TooltipAttribute>() ?? false; var propertyName = property.GetName(); var foldout = new Foldout { name = propertyName, text = name ?? propertyName, bindingPath = propertyName, tooltip = hasTooltip ? property.Attributes.GetAttribute <TooltipAttribute>().Tooltip : string.Empty, }; GuiConstructFactory.SetTooltip(property, foldout); if (!context.GetParent(out var parent)) { return(foldout); } if (property.IsContainer) { parent.Add(foldout); context.PushParent(foldout); } return(foldout); }
public static DoubleField DoubleField <TProperty, TContainer>(TProperty property, ref TContainer container, ref double value, InspectorContext context) where TProperty : IProperty <TContainer, double> { return(GuiConstructFactory.Construct <TProperty, DoubleField, TContainer, double>(property, ref container, ref value, context)); }
public static FloatField FloatField <TProperty, TContainer>(TProperty property, ref TContainer container, ref float value, InspectorContext context) where TProperty : IProperty <TContainer, float> => GuiConstructFactory.Construct <TProperty, FloatField, TContainer, float>(property, ref container, ref value, context);