Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions Assets/Plugins/Editor/Vexe/Drawers/API/Core/MethodDrawer.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//#define DBG

using System;
using System.Reflection;
using System.Collections;
using System.Reflection;
using UnityEngine;
using Vexe.Editor.GUIs;
using Vexe.Editor.Types;
Expand All @@ -11,9 +11,8 @@
using Vexe.Runtime.Types;
using UnityObject = UnityEngine.Object;

namespace Vexe.Editor.Drawers
{
public class MethodDrawer
namespace Vexe.Editor.Drawers {
public class MethodDrawer
{
private EditorMember[] argMembers;
private MethodCaller<object, object> invoke;
Expand Down Expand Up @@ -51,7 +50,7 @@ public void Initialize(MethodInfo method, object rawTarget, UnityObject unityTar

isCoroutine = method.ReturnType == typeof(IEnumerator);

var commentAttr = method.GetCustomAttribute<CommentAttribute>();
var commentAttr = MemberInfoExtensions.GetCustomAttribute<CommentAttribute>(method);
if (commentAttr != null)
comment = commentAttr.comment;

Expand Down
14 changes: 7 additions & 7 deletions Assets/Plugins/Editor/Vexe/Drawers/API/Core/RecursiveDrawer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ public class RecursiveDrawer : ObjectDrawer<object>
private bool _isToStringImpl;
private Type _polymorphicType;
private string _nullString;
private Tab[] _tabs;
private Vexe.Editor.Windows.Tab[] _tabs;
private Predicate<UnityObject[]> _isDropAccepted;
private Func<UnityObject[], UnityObject> _getDraggedObject;
private Func<Func<Type[]>, Action<Type>, string, Tab> _newTypeTab;
private Func<Func<UnityObject[]>, string, Tab> _newUnityTab;
private Func<Func<Type[]>, Action<Type>, string, Vexe.Editor.Windows.Tab> _newTypeTab;
private Func<Func<UnityObject[]>, string, Vexe.Editor.Windows.Tab> _newUnityTab;
private bool _disablePicker, _autoAlloc;

protected override void Initialize()
Expand Down Expand Up @@ -69,7 +69,7 @@ protected override void Initialize()
_isDropAccepted = objs => _getDraggedObject(objs) != null;

_newTypeTab = (getValues, create, title) =>
new Tab<Type>(
new Vexe.Editor.Windows.Tab<Type>(
@getValues: getValues,
@getCurrent: () => { var x = memberValue; return x == null ? null : x.GetType(); },
@setTarget: newType => { if (newType == null) memberValue = memberType.GetDefaultValueEmptyIfString(); else create(newType); },
Expand All @@ -78,7 +78,7 @@ protected override void Initialize()
);

_newUnityTab = (getValues, title) =>
new Tab<UnityObject>(
new Vexe.Editor.Windows.Tab<UnityObject>(
@getValues: getValues,
@getCurrent: member.As<UnityObject>,
@setTarget: member.Set,
Expand All @@ -89,7 +89,7 @@ protected override void Initialize()
int idx = 0;
if (memberType.IsInterface)
{
_tabs = new Tab[4];
_tabs = new Vexe.Editor.Windows.Tab[4];

_tabs[idx++] = _newUnityTab(() => UnityObject.FindObjectsOfType<UnityObject>()
.OfType(memberType)
Expand All @@ -102,7 +102,7 @@ protected override void Initialize()
.Where(t => t.IsA<MonoBehaviour>() && !t.IsAbstract)
.ToArray(), TryCreateInstanceInGO, "New Behaviour");
}
else _tabs = new Tab[1];
else _tabs = new Vexe.Editor.Windows.Tab[1];

var systemTypes = ReflectionHelper.GetAllUserTypesOf(memberType)
.Where(t => !t.IsA<UnityObject>() && !t.IsAbstract)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
using Vexe.Runtime.Types;
using MembersList = System.Collections.Generic.List<System.Reflection.MemberInfo>;

namespace Vexe.Editor.Internal
{
namespace Vexe.Editor.Internal {
/// <summary>
/// Responsible for the resolution of a category definition (what members are categorized in that cateogry)
/// and determining how the members are combined in that category (united or intersected)
Expand All @@ -29,10 +28,10 @@ public CategoryDefinitionResolver()
var output = new MembersList();
output.AddRange(input.Where(m =>
{
var caetgory = m.GetCustomAttribute<CategoryAttribute>();
var caetgory = MemberInfoExtensions.GetCustomAttribute<CategoryAttribute>(m);
if (caetgory != null && caetgory.name == def.FullPath)
return true;
var show = m.GetCustomAttribute<ShowAttribute>();
var show = MemberInfoExtensions.GetCustomAttribute<ShowAttribute>(m);
return show != null && show.Category == def.FullPath;
}));
return output;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public static bool IsVisible(MemberInfo member, object target)
{
//Debug.Log("Building delegate for conditionally visible member: " + member.Name);

var attr = member.GetCustomAttribute<VisibleWhenAttribute>();
var attr = MemberInfoExtensions.GetCustomAttribute<VisibleWhenAttribute>(member);
if (attr == null)
{
_isVisibleCache[member] = AlwaysVisible;
Expand Down
17 changes: 8 additions & 9 deletions Assets/Plugins/Editor/Vexe/Visibility/VisibilityLogic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
using Vexe.Runtime.Types;
using UnityObject = UnityEngine.Object;

namespace Vexe.Editor.Visibility
{
namespace Vexe.Editor.Visibility {
public static class VisibilityLogic
{
public static readonly VisibilityAttributes Attributes;
Expand All @@ -36,7 +35,7 @@ static VisibilityLogic()

public static float GetMemberDisplayOrder(MemberInfo member)
{
var attribute = member.GetCustomAttribute<DisplayAttribute>();
var attribute = MemberInfoExtensions.GetCustomAttribute<DisplayAttribute>(member);
if (attribute != null && attribute.DisplayOrder.HasValue)
return attribute.Order;

Expand All @@ -60,15 +59,15 @@ public static float GetMemberDisplayOrder(MemberInfo member)
public static bool IsVisibleMember(MemberInfo member)
{
if (member is MethodInfo)
return Attributes.Show.Any(member.IsDefined);
return Attributes.Show.Any((t) => MemberInfoExtensions.IsDefined(member, t));

var field = member as FieldInfo;
if (field != null)
{
if (Attributes.Hide.Any(field.IsDefined))
if (Attributes.Hide.Any((t) => MemberInfoExtensions.IsDefined(field, t)))
return false;

if (Attributes.Show.Any(field.IsDefined))
if (Attributes.Show.Any((t) => MemberInfoExtensions.IsDefined(field, t)))
return true;

if (field.IsDefined<SerializeField>())
Expand All @@ -78,7 +77,7 @@ public static bool IsVisibleMember(MemberInfo member)
}

var property = member as PropertyInfo;
if (property == null || Attributes.Hide.Any(property.IsDefined))
if (property == null || Attributes.Hide.Any((t) => MemberInfoExtensions.IsDefined(property, t)))
return false;

// accept properties such as transform.position, rigidbody.mass, etc
Expand All @@ -90,7 +89,7 @@ public static bool IsVisibleMember(MemberInfo member)
if (unityProp)
return true;

if (Attributes.Show.Any(property.IsDefined))
if (Attributes.Show.Any((t) => MemberInfoExtensions.IsDefined(property, t)))
return true;

return false;
Expand All @@ -103,7 +102,7 @@ public static bool IsVisibleMember(MemberInfo member)

public static bool IsSerializableType(Type type)
{
if (type.IsPrimitive || type.IsEnum || type == typeof(string)
if (type.GetTypeInfo().IsPrimitive || type.GetTypeInfo().IsEnum || type == typeof(string)
|| type.IsA<UnityObject>()
|| IsUnityStructType(type))
return true;
Expand Down
9 changes: 0 additions & 9 deletions Assets/Plugins/Vexe/Runtime/FastSave.meta

This file was deleted.

9 changes: 0 additions & 9 deletions Assets/Plugins/Vexe/Runtime/FastSave/Core.meta

This file was deleted.

59 changes: 0 additions & 59 deletions Assets/Plugins/Vexe/Runtime/FastSave/Core/FSCommon.cs

This file was deleted.

8 changes: 0 additions & 8 deletions Assets/Plugins/Vexe/Runtime/FastSave/Core/FSCommon.cs.meta

This file was deleted.

Loading