Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

Commit

Permalink
Fix PropertyField build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
neon-age committed Jul 9, 2021
1 parent 4bfad0f commit c4b6b72
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 28 deletions.
3 changes: 2 additions & 1 deletion Runtime/Fluent UITK/Extensions/PropertyFieldExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ namespace AV.UITK
{
public static class PropertyFieldExtension
{
/*
public static SerializedProperty Property(this PropertyField field)
{
return null;
}
}*/
}
}
33 changes: 13 additions & 20 deletions Runtime/Fluent UITK/FluentElement.Bindings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,48 +37,41 @@ public FluentElement<T> Bind(SerializedProperty property)
{
Bind(property.propertyPath); return x;
}
#else
public FluentElement<T> Bind(object property) => x;
#endif

#if UNITY_EDITOR
public FluentElement<T> Bind(SerializedObject serializedObject) { x.Bind(serializedObject); return x; }
#else
public FluentElement<T> Bind(object serializedObject) => x;
public FluentElement<T> Bind(object nothing) => x;
#endif

#if UNITY_EDITOR
public void Unbind() => x.Unbind();
#endif


#if UNITY_EDITOR
public FluentElement<PropertyField> NewField(SerializedProperty property, string label = null)
{
#if UNITY_EDITOR
return new PropertyField(property) { label = label };
#else
return null;
#endif
}
#else
public FluentElement<T> NewField(object property, string label = null) => x;
#endif

#if UNITY_EDITOR
public FluentElement<PropertyField> NewField(string bindingPath, string label = null)
{
#if UNITY_EDITOR
return new PropertyField { bindingPath = bindingPath, label = label };
#else
return null;
#endif
}
#else
public FluentElement<T> NewField(string bindingPath, string label = null) => x;
#endif

#if UNITY_EDITOR
public FluentElement<PropertyField> NewField<TSource>(Expression<Func<TSource, object>> member, string label = null)
{
#if UNITY_EDITOR
var bindingPath = FluentUITK.GetMemberPath(member);

return new PropertyField { bindingPath = bindingPath, label = label };
#else
return null;
#endif
}
#else
public FluentElement<T> NewField<TSource>(Expression<Func<TSource, object>> member, string label = null) => x;
#endif
}
}
7 changes: 0 additions & 7 deletions Runtime/Fluent UITK/FluentUITK.Styles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,6 @@ public enum Styles

public static partial class FluentUITK
{
static MethodInfo setToolbarStyleSheet =
#if UNITY_EDITOR
typeof(Toolbar).GetMethod("SetToolbarStyleSheet", BindingFlags.NonPublic | BindingFlags.Static);
#else
null;
#endif

/// <summary> Setup pre-defined styles to VisualElement. </summary>
public static void DefineStyle(VisualElement x, Styles styles)
{
Expand Down

0 comments on commit c4b6b72

Please sign in to comment.