1.5.0: Added IntToLayerMask, marked QuaternionToEuler as obsolete as of 2021 and fixed a couple of bugs
- 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
This commit is contained in:
parent
ee7326c33a
commit
7d99d62e11
14 changed files with 114 additions and 17 deletions
14
Runtime/Drawers/IntToLayerMaskAttribute.cs
Normal file
14
Runtime/Drawers/IntToLayerMaskAttribute.cs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
using System;
|
||||
using UnityEngine.Scripting;
|
||||
|
||||
namespace Module.Inspector
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
|
||||
public sealed class IntToLayerMaskAttribute : DrawerPropertyAttribute
|
||||
{
|
||||
[Preserve]
|
||||
public IntToLayerMaskAttribute()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Runtime/Drawers/IntToLayerMaskAttribute.cs.meta
Normal file
3
Runtime/Drawers/IntToLayerMaskAttribute.cs.meta
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 02a846340b4b4fc584555df887f68f9a
|
||||
timeCreated: 1656194556
|
||||
|
|
@ -3,6 +3,9 @@ using UnityEngine.Scripting;
|
|||
|
||||
namespace Module.Inspector
|
||||
{
|
||||
#if UNITY_2021_1_OR_NEWER
|
||||
[Obsolete]
|
||||
#endif
|
||||
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
|
||||
public sealed class QuaternionToEulerAttribute : DrawerPropertyAttribute
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4,18 +4,21 @@ using System;
|
|||
namespace Module.Inspector
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
|
||||
public sealed class SerializableReferenceToAttribute : DrawerPropertyAttribute
|
||||
public sealed class SerializeReferenceToAttribute : DrawerPropertyAttribute
|
||||
{
|
||||
public readonly bool useType;
|
||||
public readonly Type type;
|
||||
public readonly bool useFullname;
|
||||
|
||||
public SerializableReferenceToAttribute()
|
||||
public SerializeReferenceToAttribute(bool useFullname = true)
|
||||
{
|
||||
useType = false;
|
||||
this.useFullname = useFullname;
|
||||
}
|
||||
|
||||
public SerializableReferenceToAttribute(Type type)
|
||||
public SerializeReferenceToAttribute(Type type, bool useFullname = true)
|
||||
{
|
||||
this.useFullname = useFullname;
|
||||
this.type = type;
|
||||
useType = true;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue