1.3.0: Added SerializeReferenceTo as a helper for assigning managed type to fields with SerializeReference

This commit is contained in:
Anders Ejlersen 2021-12-05 13:19:42 +01:00
parent ea849a715d
commit e1d0e0e90b
8 changed files with 216 additions and 8 deletions

View file

@ -0,0 +1,22 @@
using System;
namespace Module.Inspector
{
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public sealed class SerializableReferenceToAttribute : DrawerPropertyAttribute
{
public readonly bool useType;
public readonly Type type;
public SerializableReferenceToAttribute()
{
useType = false;
}
public SerializableReferenceToAttribute(Type type)
{
this.type = type;
useType = true;
}
}
}

View file

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 9480dc4440ae45a0bd31ccbd9ae23977
timeCreated: 1638700753