1.9.0: Added support for attributes for drawing handles in the scene

This commit is contained in:
Anders Ejlersen 2024-02-11 22:02:10 +01:00
parent 81906d49dd
commit 5ce34bde70
48 changed files with 1354 additions and 8 deletions

14
Runtime/Enums/EAxis.cs Normal file
View file

@ -0,0 +1,14 @@
using System;
namespace Module.Inspector
{
[Flags]
public enum EAxis
{
None = 0,
X = 1,
Y = 2,
Z = 4,
All = X | Y | Z
}
}

View file

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 6cea1a74f79c4b4e98b10fe9b98a0cfe
timeCreated: 1669408493

View file

@ -0,0 +1,12 @@
using System;
namespace Module.Inspector
{
[Flags]
public enum ELabelType
{
None = 0,
Field = 1,
Value = 2
}
}

View file

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 00491187b70e400eb9bd403b49428b09
timeCreated: 1669499298

View file

@ -6,6 +6,7 @@
Drawer,
ValueModifier,
AccessModifier,
HandleDrawer,
Validate
}
}

View file

@ -0,0 +1,7 @@
namespace Module.Inspector
{
public abstract class HandleDrawerPropertyAttribute : AbstractPropertyAttribute
{
public override EPropertyType Type => EPropertyType.HandleDrawer;
}
}

View file

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: f9cdb8b0deb04fde8fa9b56e03a6f8c8
timeCreated: 1669408378

View file

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 6f0c558105634558964c91d5d8e3c979
timeCreated: 1669408405

View file

@ -0,0 +1,22 @@
using System;
using UnityEngine;
namespace Module.Inspector
{
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public sealed class BoxHandleAttribute : HandleDrawerPropertyAttribute
{
public readonly string fieldPosition;
public readonly string fieldRotation;
public readonly Space space;
public BoxHandleAttribute(string fieldPosition = null,
string fieldRotation = null,
Space space = Space.World)
{
this.fieldPosition = fieldPosition;
this.fieldRotation = fieldRotation;
this.space = space;
}
}
}

View file

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: b2966619dc0e480480c69602eb4d25f4
timeCreated: 1669475646

View file

@ -0,0 +1,22 @@
using System;
using UnityEngine;
namespace Module.Inspector
{
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public sealed class CircleHandleAttribute : HandleDrawerPropertyAttribute
{
public readonly string fieldPosition;
public readonly string fieldRotation;
public readonly Space space;
public CircleHandleAttribute(string fieldPosition = null,
string fieldRotation = null,
Space space = Space.World)
{
this.fieldPosition = fieldPosition;
this.fieldRotation = fieldRotation;
this.space = space;
}
}
}

View file

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: ec1137ba9e1344398415c1874809f64b
timeCreated: 1669475438

View file

@ -0,0 +1,22 @@
using System;
using UnityEngine;
namespace Module.Inspector
{
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public sealed class LabelHandleAttribute : HandleDrawerPropertyAttribute
{
public readonly ELabelType type;
public readonly string fieldPosition;
public readonly Space space;
public LabelHandleAttribute(ELabelType type = ELabelType.Value,
string fieldPosition = null,
Space space = Space.World)
{
this.type = type;
this.fieldPosition = fieldPosition;
this.space = space;
}
}
}

View file

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: b04dcda9e8db4bfcab1d02ca1a7904f4
timeCreated: 1669475765

View file

@ -0,0 +1,18 @@
using System;
using UnityEngine;
namespace Module.Inspector
{
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public sealed class PositionHandleAttribute : HandleDrawerPropertyAttribute
{
public readonly Space space;
public readonly EAxis axiis;
public PositionHandleAttribute(Space space, EAxis axiis)
{
this.space = space;
this.axiis = axiis;
}
}
}

View file

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 6ee82f8e6bfe42cd96c84a910b716d7a
timeCreated: 1669408436

View file

@ -0,0 +1,22 @@
using System;
using UnityEngine;
namespace Module.Inspector
{
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public sealed class RectangleHandleAttribute : HandleDrawerPropertyAttribute
{
public readonly string fieldPosition;
public readonly string fieldRotation;
public readonly Space space;
public RectangleHandleAttribute(string fieldPosition = null,
string fieldRotation = null,
Space space = Space.World)
{
this.fieldPosition = fieldPosition;
this.fieldRotation = fieldRotation;
this.space = space;
}
}
}

View file

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: c0b65d01ae7944ababe1c42a9497192c
timeCreated: 1669475700

View file

@ -0,0 +1,18 @@
using System;
using UnityEngine;
namespace Module.Inspector
{
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public sealed class RotationHandleAttribute : HandleDrawerPropertyAttribute
{
public readonly string fieldPosition;
public readonly Space space;
public RotationHandleAttribute(string fieldPosition = null, Space space = Space.World)
{
this.fieldPosition = fieldPosition;
this.space = space;
}
}
}

View file

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 0a51649ba7d643b59166944db5f2dc95
timeCreated: 1669475570

View file

@ -0,0 +1,22 @@
using System;
using UnityEngine;
namespace Module.Inspector
{
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public sealed class SphereHandleAttribute : HandleDrawerPropertyAttribute
{
public readonly string fieldPosition;
public readonly string fieldRotation;
public readonly Space space;
public SphereHandleAttribute(string fieldPosition = null,
string fieldRotation = null,
Space space = Space.World)
{
this.fieldPosition = fieldPosition;
this.fieldRotation = fieldRotation;
this.space = space;
}
}
}

View file

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 4ec43235833844159723030f304ac03b
timeCreated: 1669475530