1.9.0: Added support for attributes for drawing handles in the scene
This commit is contained in:
parent
81906d49dd
commit
5ce34bde70
48 changed files with 1354 additions and 8 deletions
22
Runtime/HandleDrawers/BoxHandleAttribute.cs
Normal file
22
Runtime/HandleDrawers/BoxHandleAttribute.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Runtime/HandleDrawers/BoxHandleAttribute.cs.meta
Normal file
3
Runtime/HandleDrawers/BoxHandleAttribute.cs.meta
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: b2966619dc0e480480c69602eb4d25f4
|
||||
timeCreated: 1669475646
|
||||
22
Runtime/HandleDrawers/CircleHandleAttribute.cs
Normal file
22
Runtime/HandleDrawers/CircleHandleAttribute.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Runtime/HandleDrawers/CircleHandleAttribute.cs.meta
Normal file
3
Runtime/HandleDrawers/CircleHandleAttribute.cs.meta
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ec1137ba9e1344398415c1874809f64b
|
||||
timeCreated: 1669475438
|
||||
22
Runtime/HandleDrawers/LabelHandleAttribute.cs
Normal file
22
Runtime/HandleDrawers/LabelHandleAttribute.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Runtime/HandleDrawers/LabelHandleAttribute.cs.meta
Normal file
3
Runtime/HandleDrawers/LabelHandleAttribute.cs.meta
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: b04dcda9e8db4bfcab1d02ca1a7904f4
|
||||
timeCreated: 1669475765
|
||||
18
Runtime/HandleDrawers/PositionHandleAttribute.cs
Normal file
18
Runtime/HandleDrawers/PositionHandleAttribute.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Runtime/HandleDrawers/PositionHandleAttribute.cs.meta
Normal file
3
Runtime/HandleDrawers/PositionHandleAttribute.cs.meta
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6ee82f8e6bfe42cd96c84a910b716d7a
|
||||
timeCreated: 1669408436
|
||||
22
Runtime/HandleDrawers/RectangleHandleAttribute.cs
Normal file
22
Runtime/HandleDrawers/RectangleHandleAttribute.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Runtime/HandleDrawers/RectangleHandleAttribute.cs.meta
Normal file
3
Runtime/HandleDrawers/RectangleHandleAttribute.cs.meta
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c0b65d01ae7944ababe1c42a9497192c
|
||||
timeCreated: 1669475700
|
||||
18
Runtime/HandleDrawers/RotationHandleAttribute.cs
Normal file
18
Runtime/HandleDrawers/RotationHandleAttribute.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Runtime/HandleDrawers/RotationHandleAttribute.cs.meta
Normal file
3
Runtime/HandleDrawers/RotationHandleAttribute.cs.meta
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 0a51649ba7d643b59166944db5f2dc95
|
||||
timeCreated: 1669475570
|
||||
22
Runtime/HandleDrawers/SphereHandleAttribute.cs
Normal file
22
Runtime/HandleDrawers/SphereHandleAttribute.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Runtime/HandleDrawers/SphereHandleAttribute.cs.meta
Normal file
3
Runtime/HandleDrawers/SphereHandleAttribute.cs.meta
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 4ec43235833844159723030f304ac03b
|
||||
timeCreated: 1669475530
|
||||
Loading…
Add table
Add a link
Reference in a new issue