- Drawer: Added IntToLayerMaskAttribute, if a raw int is wanted instead of LayerMask - Drawer: Added option to either use full or short type name, when using SerializeReferenceTo - Extension: Fixed issue, where GetValueType and GetValue for SerializedProperty would throw exceptions, if field is private
27 lines
750 B
C#
27 lines
750 B
C#
#if UNITY_2019_3_OR_NEWER
|
|
using System;
|
|
|
|
namespace Module.Inspector
|
|
{
|
|
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
|
|
public sealed class SerializeReferenceToAttribute : DrawerPropertyAttribute
|
|
{
|
|
public readonly bool useType;
|
|
public readonly Type type;
|
|
public readonly bool useFullname;
|
|
|
|
public SerializeReferenceToAttribute(bool useFullname = true)
|
|
{
|
|
useType = false;
|
|
this.useFullname = useFullname;
|
|
}
|
|
|
|
public SerializeReferenceToAttribute(Type type, bool useFullname = true)
|
|
{
|
|
this.useFullname = useFullname;
|
|
this.type = type;
|
|
useType = true;
|
|
}
|
|
}
|
|
}
|
|
#endif |