1.3.0: Added SerializeReferenceTo as a helper for assigning managed type to fields with SerializeReference
This commit is contained in:
parent
ea849a715d
commit
e1d0e0e90b
8 changed files with 216 additions and 8 deletions
22
Runtime/Drawers/SerializableReferenceToAttribute.cs
Normal file
22
Runtime/Drawers/SerializableReferenceToAttribute.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Runtime/Drawers/SerializableReferenceToAttribute.cs.meta
Normal file
3
Runtime/Drawers/SerializableReferenceToAttribute.cs.meta
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 9480dc4440ae45a0bd31ccbd9ae23977
|
||||
timeCreated: 1638700753
|
||||
Loading…
Add table
Add a link
Reference in a new issue